arm: tegra: cardhu: Registering BQ27510 Fuel gauge for E1291
Laxman Dewangan [Fri, 25 Mar 2011 09:20:15 +0000 (14:20 +0530)]
Registering fuel gauge BQ27510 device for E1291 based system only.

bug 806646

Original-Change-Id: I445e997d8f8a4cb0cb7239b5fffceb29417bc144
Reviewed-on: http://git-master/r/24275
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ramachandrudu Kandhala <rkandhala@nvidia.com>
Original-Change-Id: I5c94b1776d59353ff2ae99c1567400cec439c0d7

Rebase-Id: R816296734a6f0f127f4ab6eb41cc85a8c4f9ee43

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

index 2c4531a..f7ede6d 100644 (file)
@@ -287,10 +287,13 @@ static struct nct1008_platform_data cardhu_nct1008_pdata = {
        .alarm_fn = NULL,
 };
 
-static struct i2c_board_info cardhu_i2c4_board_info[] = {
+static struct i2c_board_info cardhu_i2c4_bq27510_board_info[] = {
        {
                I2C_BOARD_INFO("bq27510", 0x55),
        },
+};
+
+static struct i2c_board_info cardhu_i2c4_board_info[] = {
        {
                I2C_BOARD_INFO("nct1008", 0x4C),
                .platform_data = &cardhu_nct1008_pdata,
@@ -449,6 +452,8 @@ static struct i2c_board_info cardhu_i2c2_isl_board_info[] = {
 int __init cardhu_sensors_init(void)
 {
        int err;
+       struct board_info board_info;
+       tegra_get_board_info(&board_info);
 
        cardhu_camera_init();
        cam_tca6416_init();
@@ -469,6 +474,10 @@ int __init cardhu_sensors_init(void)
        i2c_register_board_info(4, cardhu_i2c4_board_info,
                ARRAY_SIZE(cardhu_i2c4_board_info));
 
+       if (board_info.board_id == BOARD_E1291)
+               i2c_register_board_info(4, cardhu_i2c4_bq27510_board_info,
+                       ARRAY_SIZE(cardhu_i2c4_bq27510_board_info));
+
        i2c_register_board_info(2, cardhu_i2c2_isl_board_info,
                ARRAY_SIZE(cardhu_i2c2_isl_board_info));