omap4 i2c: add support for i2c bus 4
authorKoen Kooi <koen@dominion.thruhere.net>
Wed, 8 Aug 2012 00:57:35 +0000 (00:57 +0000)
committerHeiko Schocher <hs@denx.de>
Thu, 6 Sep 2012 04:01:09 +0000 (06:01 +0200)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
arch/arm/include/asm/arch-omap4/cpu.h
arch/arm/include/asm/arch-omap4/i2c.h
drivers/i2c/omap24xx_i2c.c

index a8c4c60c8c9b8883dcb1823b68d30b5d53ba8aba..3a0bfbf0c612a052296756aecceb4af72ac4b956 100644 (file)
@@ -138,6 +138,7 @@ struct watchdog {
 #define I2C_BASE1              (OMAP44XX_L4_PER_BASE + 0x70000)
 #define I2C_BASE2              (OMAP44XX_L4_PER_BASE + 0x72000)
 #define I2C_BASE3              (OMAP44XX_L4_PER_BASE + 0x60000)
+#define I2C_BASE4              (OMAP44XX_L4_PER_BASE + 0x350000)
 
 /* MUSB base */
 #define MUSB_BASE              (OMAP44XX_L4_CORE_BASE + 0xAB000)
index a91b4c2f31bb194be74e576b84df3b85e91aaa1c..02ee2f88a1b29578ecb1bfe47cb9f3c93fe7be0b 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef _OMAP4_I2C_H_
 #define _OMAP4_I2C_H_
 
-#define I2C_BUS_MAX    3
+#define I2C_BUS_MAX    4
 #define I2C_DEFAULT_BASE       I2C_BASE1
 
 struct i2c {
index 978507ba29870c9845e752fa59cc14705c3abd24..094305fdf932111b406a5546f707c5d28e4e89aa 100644 (file)
@@ -442,6 +442,14 @@ int i2c_set_bus_num(unsigned int bus)
                return -1;
        }
 
+#if I2C_BUS_MAX == 4
+       if (bus == 3)
+               i2c_base = (struct i2c *)I2C_BASE4;
+       else
+       if (bus == 2)
+               i2c_base = (struct i2c *)I2C_BASE3;
+       else
+#endif
 #if I2C_BUS_MAX == 3
        if (bus == 2)
                i2c_base = (struct i2c *)I2C_BASE3;