Skip to content

Commit db7720e

Browse files
TroyMitchell911Wolfram Sang
authored andcommitted
i2c: spacemit: check SDA instead of SCL after bus reset
After calling spacemit_i2c_conditionally_reset_bus(), the controller should ensure that the SDA line is release before proceeding. Previously, the driver checked the SCL line instead, which does not guarantee that the bus is truly idle. This patch changes the check to verify SDA. This ensures proper bus recovery and avoids potential communication errors after a conditional reset. Fixes: 5ea5584 ("i2c: spacemit: add support for SpacemiT K1 SoC") Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent 11f4068 commit db7720e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/i2c/busses/i2c-k1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ static void spacemit_i2c_conditionally_reset_bus(struct spacemit_i2c_dev *i2c)
172172
spacemit_i2c_reset(i2c);
173173
usleep_range(10, 20);
174174

175-
/* check scl status again */
175+
/* check sda again here */
176176
status = readl(i2c->base + SPACEMIT_IBMR);
177-
if (!(status & SPACEMIT_BMR_SCL))
177+
if (!(status & SPACEMIT_BMR_SDA))
178178
dev_warn_ratelimited(i2c->dev, "unit reset failed\n");
179179
}
180180

0 commit comments

Comments
 (0)