]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Separate i2c_board_info for n800 and n810
authorRiku Voipio <riku.voipio@iki.fi>
Tue, 22 Jul 2008 09:29:31 +0000 (12:29 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 4 Aug 2008 14:42:39 +0000 (17:42 +0300)
n800 and n810 have different peripherals on the second i2c bus
(tea5761 on n800 and lm8323 on n810). Split the i2c_board_info to
common and hw specific to avoid probing nonexistent devices.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-n800.c

index ae85c2c60534820856c8bb0e019be29f2375470b..868e13970b90f78347ff0abd3420b76cbc40b432 100644 (file)
@@ -642,30 +642,31 @@ static struct i2c_board_info __initdata n800_i2c_board_info_1[] = {
 
 extern struct tcm825x_platform_data n800_tcm825x_platform_data;
 
-static struct i2c_board_info __initdata_or_module n800_i2c_board_info_2[] = {
-#if defined (CONFIG_VIDEO_TCM825X) || defined (CONFIG_VIDEO_TCM825X_MODULE)
+static struct i2c_board_info __initdata_or_module n8x0_i2c_board_info_2[] = {
        {
                I2C_BOARD_INFO(TCM825X_NAME, TCM825X_I2C_ADDR),
                .platform_data = &n800_tcm825x_platform_data,
        },
-#endif
-#if defined(CONFIG_RADIO_TEA5761) || defined(CONFIG_RADIO_TEA5761_MODULE)
        {
-               I2C_BOARD_INFO("tea5761", 0x10),
+               I2C_BOARD_INFO("tsl2563", 0x29),
        },
-#endif
-#ifdef CONFIG_MACH_NOKIA_N810
        {
-               I2C_BOARD_INFO("lm8323", 0x45),
-               .irq            = OMAP_GPIO_IRQ(109),
-               .platform_data  = &lm8323_pdata,
+               I2C_BOARD_INFO("lp5521", 0x32),
        },
-#endif
+};
+
+
+static struct i2c_board_info __initdata_or_module n800_i2c_board_info_2[] = {
        {
-               I2C_BOARD_INFO("tsl2563", 0x29),
+               I2C_BOARD_INFO("tea5761", 0x10),
        },
+};
+
+static struct i2c_board_info __initdata_or_module n810_i2c_board_info_2[] = {
        {
-               I2C_BOARD_INFO("lp5521", 0x32),
+               I2C_BOARD_INFO("lm8323", 0x45),
+               .irq            = OMAP_GPIO_IRQ(109),
+               .platform_data  = &lm8323_pdata,
        },
 };
 
@@ -690,8 +691,15 @@ void __init nokia_n800_common_init(void)
        omap_serial_init();
        omap_register_i2c_bus(1, 400, n800_i2c_board_info_1,
                              ARRAY_SIZE(n800_i2c_board_info_1));
-       omap_register_i2c_bus(2, 400, n800_i2c_board_info_2,
+       omap_register_i2c_bus(2, 400, n8x0_i2c_board_info_2,
                              ARRAY_SIZE(n800_i2c_board_info_2));
+       if (machine_is_nokia_n800())
+               i2c_register_board_info(2, n800_i2c_board_info_2,
+                       ARRAY_SIZE(n800_i2c_board_info_2));
+       if (machine_is_nokia_n810())
+               i2c_register_board_info(2, n810_i2c_board_info_2,
+                       ARRAY_SIZE(n810_i2c_board_info_2));
+               
        mipid_dev_init();
        blizzard_dev_init();
 }