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 <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2024-04-04 17:03:33 +01:00
committed by Dom Cobley
parent b2b66990fc
commit dc7510a448

View File

@@ -228,6 +228,9 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
dev->hs_hcnt, dev->hs_lcnt);
}
if (!dev->sda_hold_time)
dev->sda_hold_time = lcnt / 2;
ret = i2c_dw_set_sda_hold(dev);
if (ret)
return ret;