[U-Boot] [PATCH v3 01/10] dm: i2c: Add a uclass for I2C
Masahiro YAMADA
yamada.m at jp.panasonic.com
Wed Dec 3 17:02:43 CET 2014
Hi Simon,
2014-12-04 0:13 GMT+09:00 Simon Glass <sjg at chromium.org>:
>> If each driver does not have .set_bus_speed handler,
>> we cannot change the bus speed
>> because changing the bus speed involves some hardware
>> register(s) setting.
>>
>> We should not change i2c->speed_hz without changing the
>> actual speed.
>>
>> I think the code should be:
>>
>>
>> if (ops->set_bus_speed) {
>> ret = ops->set_bus_speed(bus, speed);
>> if (ret)
>> return ret;
>> i2c->speed_hz = speed;
>> }
>>
>>
>
> I'll add a comment. The idea is that the driver can check the speed
> and give an error here rather than on the next xfer(). Also if it
> wants to change the clocks here then it can do so. But otherwise it is
> OK to deal with the speed change on the next xfer.
>
OK. Makes sense.
--
Best Regards
Masahiro Yamada
More information about the U-Boot
mailing list