Skip to content

Commit 84010d5

Browse files
pelwellpopcornmix
authored andcommitted
i2c: designware: Make the SDA hold time half LCNT
In the absence of a value in Device Tree, set the SDA hold time to half the SCL low time. Signed-off-by: Phil Elwell <[email protected]>
1 parent 582f1f4 commit 84010d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/i2c/busses/i2c-designware-master.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
228228
dev->hs_hcnt, dev->hs_lcnt);
229229
}
230230

231+
if (!dev->sda_hold_time)
232+
dev->sda_hold_time = lcnt / 2;
233+
231234
ret = i2c_dw_set_sda_hold(dev);
232235
if (ret)
233236
return ret;

0 commit comments

Comments
 (0)