i2c: mxs: Add support for I2C 1 on i.MX28
authorMarek Vasut <marex@denx.de>
Sun, 19 Oct 2014 22:23:43 +0000 (00:23 +0200)
committerHeiko Schocher <hs@denx.de>
Wed, 29 Oct 2014 07:56:07 +0000 (08:56 +0100)
Add support for I2C bus 1 on the i.MX28.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
drivers/i2c/mxs_i2c.c

index d3cb7274f3086d2e82a4ca9a9fb32de0bd75ee9a..87e05c71254920802b41aba409601277a192de94 100644 (file)
 
 static struct mxs_i2c_regs *mxs_i2c_get_base(struct i2c_adapter *adap)
 {
-       return (struct mxs_i2c_regs *)MXS_I2C0_BASE;
+       if (adap->hwadapnr == 0)
+               return (struct mxs_i2c_regs *)MXS_I2C0_BASE;
+       else
+               return (struct mxs_i2c_regs *)MXS_I2C1_BASE;
 }
 
 static unsigned int mxs_i2c_get_bus_speed(struct i2c_adapter *adap)
@@ -311,3 +314,7 @@ U_BOOT_I2C_ADAP_COMPLETE(mxs0, mxs_i2c_init, mxs_i2c_probe,
                         mxs_i2c_if_read, mxs_i2c_if_write,
                         mxs_i2c_set_bus_speed,
                         CONFIG_SYS_I2C_SPEED, 0, 0)
+U_BOOT_I2C_ADAP_COMPLETE(mxs1, mxs_i2c_init, mxs_i2c_probe,
+                        mxs_i2c_if_read, mxs_i2c_if_write,
+                        mxs_i2c_set_bus_speed,
+                        CONFIG_SYS_I2C_SPEED, 0, 1)