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

Jan Weitzel j.weitzel at phytec.de
Tue Dec 9 22:49:28 PST 2014


"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 at phytec.de>
---
 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




More information about the barebox mailing list