arm: tegra: kai: registering LTR558 ALS on I2C
Sachin Nikam [Wed, 7 Mar 2012 06:59:55 +0000 (11:59 +0530)]
Registering LTR558 Ambient light and Proximity sensor on I2C bus.

Bug 901133

Change-Id: I34b996813a409229a1baa25a069f0ba4758b154e
Signed-off-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/88228
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

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

index 46893ba..1344731 100644 (file)
@@ -845,12 +845,21 @@ static void mpuirq_init(void)
                ARRAY_SIZE(inv_mpu_i2c2_board_info));
 }
 
-
+#ifdef CONFIG_SENSORS_ISL29028
 static struct i2c_board_info cardhu_i2c2_isl_board_info[] = {
        {
                I2C_BOARD_INFO("isl29028", 0x44),
        }
 };
+#endif
+
+#ifdef CONFIG_SENSORS_LTR558
+static struct i2c_board_info cardhu_i2c2_ltr_board_info[] = {
+       {
+               I2C_BOARD_INFO("LTR_558ALS", 0x23),
+       }
+};
+#endif
 
 int __init cardhu_sensors_init(void)
 {
@@ -905,8 +914,15 @@ int __init cardhu_sensors_init(void)
                i2c_register_board_info(4, cardhu_i2c4_bq27510_board_info,
                        ARRAY_SIZE(cardhu_i2c4_bq27510_board_info));
 
+#ifdef CONFIG_SENSORS_ISL29028
        i2c_register_board_info(2, cardhu_i2c2_isl_board_info,
                ARRAY_SIZE(cardhu_i2c2_isl_board_info));
+#endif
+
+#ifdef CONFIG_SENSORS_LTR558
+       i2c_register_board_info(2, cardhu_i2c2_ltr_board_info,
+               ARRAY_SIZE(cardhu_i2c2_ltr_board_info));
+#endif
 
        err = cardhu_nct1008_init();
        if (err)