i2c: core: Parse SDA hold time from firmware

There are two drivers already using the SDA hold time setting.
It might be more in the future, thus, make I2C core to parse the setting
for us if provided by firmware.

Signed-off-by: Andy Shevchenko <[email protected]>
Tested-by: Alexandre Belloni <[email protected]>
Reviewed-by: Alexandre Belloni <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
Andy Shevchenko 2018-07-25 17:39:25 +03:00 • committed by Wolfram Sang
commit 4717be73c2
2 changed files with 4 additions and 0 deletions

View file

@ -1576,6 +1576,8 @@ void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_de
ret = device_property_read_u32(dev, "i2c-sda-falling-time-ns", &t->sda_fall_ns);
if (ret && use_defaults)
t->sda_fall_ns = t->scl_fall_ns;
device_property_read_u32(dev, "i2c-sda-hold-time-ns", &t->sda_hold_ns);
}
EXPORT_SYMBOL_GPL(i2c_parse_fw_timings);