
3 Dec
2014
3 Dec
'14
5:02 p.m.
Hi Simon,
2014-12-04 0:13 GMT+09:00 Simon Glass sjg@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