[PATCH] i2c: omap: fix fclk_rate for ti,omap4-i2c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"ti,am33xx" and "ti,omap4" use "ti,omap4-i2c" with different fclk_rate.
By now set it according to the used cpu compatible.

Signed-off-by: Jan Weitzel <j.weitzel@xxxxxxxxx>
---
 drivers/i2c/busses/i2c-omap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 094f591..d2254d4 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1015,6 +1015,13 @@ i2c_omap_probe(struct device_d *pdev)
 	i2c_omap->reg_shift = (i2c_data->flags >>
 					OMAP_I2C_FLAG_BUS_SHIFT__SHIFT) & 3;
 
+	if (!i2c_data->fclk_rate) {
+		if (of_machine_is_compatible("ti,am33xx"))
+			i2c_data->fclk_rate = am33xx_data.fclk_rate;
+		if (of_machine_is_compatible("ti,omap4"))
+			i2c_data->fclk_rate = omap4_data.fclk_rate;
+	}
+
 	if (pdev->platform_data != NULL) {
 		speed = *(u32 *)pdev->platform_data;
 	} else {
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux