arm: tegra: cardhu: registering ALS based on board sku
Sachin Nikam [Wed, 14 Mar 2012 07:29:00 +0000 (12:29 +0530)]
If board_info.sku is 0xb11 this board has ltr558 ALS on it
else isl29028 sensor.

Bug 901133

Change-Id: Id0fb5b59b55393e52147e7f9d8d114651a5e0561
Signed-off-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/89977
Reviewed-by: Automatic_Commit_Validation_User

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

index 1344731..0f7d2f9 100644 (file)
@@ -845,21 +845,17 @@ 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)
 {
@@ -914,15 +910,12 @@ 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
+       if (board_info.sku == BOARD_SKU_B11)
+               i2c_register_board_info(2, cardhu_i2c2_ltr_board_info,
+                       ARRAY_SIZE(cardhu_i2c2_ltr_board_info));
+       else
+               i2c_register_board_info(2, cardhu_i2c2_isl_board_info,
+                       ARRAY_SIZE(cardhu_i2c2_isl_board_info));
 
        err = cardhu_nct1008_init();
        if (err)
index bf76cc9..ba2a0d0 100644 (file)
@@ -42,6 +42,8 @@
 #define BOARD_PMU_PM299   0x0263
 
 /* SKU Information */
+#define BOARD_SKU_B11  0xb11
+
 #define SKU_DCDC_TPS62361_SUPPORT      0x1
 #define SKU_SLT_ULPI_SUPPORT           0x2
 #define SKU_T30S_SUPPORT               0x4