]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
twl4030: board init updates
authorDavid Brownell <david-b@pacbell.net>
Sun, 21 Sep 2008 21:12:23 +0000 (14:12 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 23 Sep 2008 10:50:25 +0000 (13:50 +0300)
For boards with twl4030/tps65950 chips, update board setup code to
provide the appropriate board info.

This should evolve a bunch more over time; right now too much of this
data is globally defined (like IRQ and GPIO numbering).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-omap2evm.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-overo.c

index 4a48adf333495e6a31b00f794218b6fa88828fb7..3649a9402bcf1b0773ab4dc69fca30a8c1c986c7 100644 (file)
@@ -353,14 +353,25 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = {
        {OMAP_TAG_SERIAL_CONSOLE, &sdp2430_serial_console_config},
 };
 
+static struct twl4030_platform_data sdp2430_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_24XX_SYS_NIRQ,
+               .platform_data = &sdp2430_twldata,
+       },
+};
+
 static int __init omap2430_i2c_init(void)
 {
-       /*
-        * Registering bus 2 first to avoid twl4030 misbehaving as 2430SDP
-        * has twl4030 on bus 2
-        */
-       omap_register_i2c_bus(2, 2600, NULL, 0);
        omap_register_i2c_bus(1, 400, NULL, 0);
+       omap_register_i2c_bus(2, 2600, sdp2430_i2c_boardinfo,
+                       ARRAY_SIZE(sdp2430_i2c_boardinfo));
        return 0;
 }
 
index 0e520b0bd897daedf648c133878c1baca4d0b88d..4c60d7b4301fb62a804ae0875f0b4a1a1a0612a9 100644 (file)
@@ -309,9 +309,24 @@ static struct omap_board_config_kernel sdp3430_config[] __initdata = {
        { OMAP_TAG_LCD,         &sdp3430_lcd_config },
 };
 
+static struct twl4030_platform_data sdp3430_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_34XX_SYS_NIRQ,
+               .platform_data = &sdp3430_twldata,
+       },
+};
+
 static int __init omap3430_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, NULL, 0);
+       omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo,
+                       ARRAY_SIZE(sdp3430_i2c_boardinfo));
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
index 9263be9842910ddd304803bcb7c10ca0fe097b89..c07c71291237a757d3e5a8c4c3c7eb78ab8cf7bb 100644 (file)
@@ -183,9 +183,24 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {
        { OMAP_TAG_UART,        &ldp_uart_config },
 };
 
+static struct twl4030_platform_data ldp_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata ldp_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_34XX_SYS_NIRQ,
+               .platform_data = &ldp_twldata,
+       },
+};
+
 static int __init omap_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, NULL, 0);
+       omap_register_i2c_bus(1, 2600, ldp_i2c_boardinfo,
+                       ARRAY_SIZE(ldp_i2c_boardinfo));
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
index 6cf9db846f89d04ba91d83b46596c441aa74c608..6ce7740b62b87fe699fd7ce672c9a14b20a36cb5 100644 (file)
@@ -234,14 +234,25 @@ static struct omap_board_config_kernel omap2_evm_config[] __initdata = {
        { OMAP_TAG_LCD,         &omap2_evm_lcd_config },
 };
 
+static struct twl4030_platform_data omap2evm_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata omap2evm_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_24XX_SYS_NIRQ,
+               .platform_data = &omap2evm_twldata,
+       },
+};
+
 static int __init omap2_evm_i2c_init(void)
 {
-       /*
-        * Registering bus 2 first to avoid twl4030 misbehaving as OMAP2EVM
-        * has twl4030 on bus 2
-        */
-       omap_register_i2c_bus(2, 2600, NULL, 0);
        omap_register_i2c_bus(1, 400, NULL, 0);
+       omap_register_i2c_bus(2, 2600, omap2evm_i2c_boardinfo,
+                       ARRAY_SIZE(omap2evm_i2c_boardinfo));
        return 0;
 }
 
index 70562f25a4942f3e8bbdf5e86492a15ee52c096c..fa8f5f64e3e95d059b226fa98b7e5267d11363a5 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 
+#include <linux/i2c/twl4030.h>
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
@@ -108,9 +110,24 @@ static struct omap_uart_config omap3_beagle_uart_config __initdata = {
        .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+static struct twl4030_platform_data beagle_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_34XX_SYS_NIRQ,
+               .platform_data = &beagle_twldata,
+       },
+};
+
 static int __init omap3_beagle_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, NULL, 0);
+       omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
+                       ARRAY_SIZE(beagle_i2c_boardinfo));
 #ifdef CONFIG_I2C2_OMAP_BEAGLE
        omap_register_i2c_bus(2, 400, NULL, 0);
 #endif
index 92f70cec87fb449a3f8f15e5ae2424bb64f18739..e69ea4d7436cf583449082d8409814fe0b803c61 100644 (file)
@@ -20,6 +20,9 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/input.h>
+
+#include <linux/i2c/twl4030.h>
+
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 
@@ -27,8 +30,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <linux/io.h>
-#include <linux/delay.h>
 
 #include <mach/gpio.h>
 #include <mach/keypad.h>
@@ -88,9 +89,24 @@ static struct omap_uart_config omap3_evm_uart_config __initdata = {
        .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+static struct twl4030_platform_data omap3evm_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_34XX_SYS_NIRQ,
+               .platform_data = &omap3evm_twldata,
+       },
+};
+
 static int __init omap3_evm_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, NULL, 0);
+       omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo,
+                       ARRAY_SIZE(omap3evm_i2c_boardinfo));
        omap_register_i2c_bus(2, 400, NULL, 0);
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
index 396ec33d5c4b267209c4744abf485ec280f7ed5a..ccd3f2d4924022417269594429a8435f6b4b597a 100644 (file)
@@ -26,6 +26,9 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+
+#include <linux/i2c/twl4030.h>
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -143,9 +146,24 @@ static struct omap_uart_config overo_uart_config __initdata = {
        .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+static struct twl4030_platform_data overo_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+};
+
+static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_34XX_SYS_NIRQ,
+               .platform_data = &overo_twldata,
+       },
+};
+
 static int __init overo_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, NULL, 0);
+       omap_register_i2c_bus(1, 2600, overo_i2c_boardinfo,
+                       ARRAY_SIZE(overo_i2c_boardinfo));
        /* i2c2 pins are used for gpio */
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;