i2c: img-scb: verify support for requested bit rate
authorSifan Naeem <sifan.naeem@imgtec.com>
Thu, 10 Sep 2015 14:50:07 +0000 (15:50 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 10 Oct 2015 07:40:11 +0000 (08:40 +0100)
commit58b0497dad1abbe389af83e3d7706be584cf3ba2
tree7c9b3c41a85f01e1107edb7fbe6c36374b0086ed
parent1ed6faedfc9741cca2d97b25ab73902ba7177093
i2c: img-scb: verify support for requested bit rate

The requested bit rate can be outside the range supported by the driver.
The maximum bit rate this driver supports at the moment is 400Khz.

If the requested bit rate is larger than the maximum supported by the
driver, set the bitrate to the maximum supported before bitrate_khz is
calculated.

Maximum speed supported by the driver can be increased to 1Mhz by
adding support for "fast plus mode" in the future.

Fixes: commit 27bce457d588 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver")
Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: James Hartley <james.hartley@imgtec.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-img-scb.c