diff options
author | Jan Weitzel <j.weitzel@phytec.de> | 2014-12-11 10:47:59 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-01-06 14:46:51 +0100 |
commit | c5151cae1789252cef6efd0720225ded81ae4620 (patch) | |
tree | 98e2e8cfe6ade51d325b4ef558e843b5a36db7ec /drivers/i2c | |
parent | 013247989b4c9e4bea5d26f07c0bba968227d968 (diff) | |
download | barebox-c5151cae1789252cef6efd0720225ded81ae4620.tar.gz barebox-c5151cae1789252cef6efd0720225ded81ae4620.tar.xz |
i2c: omap: fix fclk_rate for ti,omap4-i2c
The compatible "ti,omap4-i2c" don't help to get fclk_rate. So set it acording to
cpu compatible: "ti,am33xx" and "ti,omap4"
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 094f5916cf..96c3c2bc87 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -271,11 +271,6 @@ static struct omap_i2c_driver_data am33xx_data = { .fclk_rate = 48000, }; -static struct omap_i2c_driver_data omap4_of_data = { - .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE, - .fclk_rate = 0, -}; - static inline void omap_i2c_write_reg(struct omap_i2c_struct *i2c_omap, int reg, u16 val) { @@ -1011,6 +1006,11 @@ i2c_omap_probe(struct device_d *pdev) if (r) return r; + if (of_machine_is_compatible("ti,am33xx")) + i2c_data = &am33xx_data; + if (of_machine_is_compatible("ti,omap4")) + i2c_data = &omap4_data; + i2c_omap->data = i2c_data; i2c_omap->reg_shift = (i2c_data->flags >> OMAP_I2C_FLAG_BUS_SHIFT__SHIFT) & 3; @@ -1140,7 +1140,6 @@ static __maybe_unused struct of_device_id omap_i2c_dt_ids[] = { .data = (unsigned long)&omap3_data, }, { .compatible = "ti,omap4-i2c", - .data = (unsigned long)&omap4_of_data, }, { /* sentinel */ } |