arm: tegra: cardhu: Registering mpu3050 for E1291 only
Laxman Dewangan [Wed, 13 Apr 2011 08:38:48 +0000 (13:38 +0530)]
Registering the mpu sensor MPU3050 for the E1291 based
cardhu system only.

Original-Change-Id: I614d5496bad34e465d58163e9590d41fefab822e
Reviewed-on: http://git-master/r/27608
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ramachandrudu Kandhala <rkandhala@nvidia.com>
Reviewed-by: Robert R Collins <rcollins@nvidia.com>
Original-Change-Id: I32bb6997dd504c4c070ba27a5e223f4a325d1f96

Rebase-Id: Rb30429965bb8edf799905a39ca843def5b4cf724

arch/arm/mach-tegra/board-cardhu-sensors.c

index e21df9d..e85e4ca 100644 (file)
@@ -779,11 +779,19 @@ static struct i2c_board_info __initdata mpu3050_i2c0_boardinfo[] = {
 
 static void cardhu_mpuirq_init(void)
 {
+       struct board_info board_info;
+       tegra_get_board_info(&board_info);
+       if (board_info.board_id != BOARD_E1291)
+               return;
+
        pr_info("*** MPU START *** cardhu_mpuirq_init...\n");
        tegra_gpio_enable(TEGRA_GPIO_PX1);
        gpio_request(TEGRA_GPIO_PX1, SENSOR_MPU_NAME);
        gpio_direction_input(TEGRA_GPIO_PX1);
        pr_info("*** MPU END *** cardhu_mpuirq_init...\n");
+
+       i2c_register_board_info(2, mpu3050_i2c0_boardinfo,
+               ARRAY_SIZE(mpu3050_i2c0_boardinfo));
 }
 #endif
 
@@ -869,12 +877,6 @@ int __init cardhu_sensors_init(void)
 #ifdef CONFIG_MPU_SENSORS_MPU3050
        cardhu_mpuirq_init();
 #endif
-
-#ifdef CONFIG_MPU_SENSORS_MPU3050
-       i2c_register_board_info(2, mpu3050_i2c0_boardinfo,
-               ARRAY_SIZE(mpu3050_i2c0_boardinfo));
-#endif
-
        return 0;
 }