arm: tegra: entrprise: Enable battery charging for special SKU
Laxman Dewangan [Fri, 26 Aug 2011 09:03:42 +0000 (14:03 +0530)]
Enable battery charging with special SKU.
The board ID have the sku field and bit 0 of the sku
should be 1 for enabling battery charging.

bug 868483

Original-Change-Id: I028bcbfbc042184a7feecb66bfbf35d6c70cd355
Reviewed-on: http://git-master/r/49416
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>

Rebase-Id: Rbe63dbafc5fb6c2a29fb4c12bb3496a6e9d68d87

arch/arm/mach-tegra/board-enterprise-power.c
arch/arm/mach-tegra/board-enterprise.h

index 9c4dfa8..b36bcce 100644 (file)
@@ -459,6 +459,7 @@ int __init enterprise_regulator_init(void)
 {
        void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
        u32 pmc_ctrl;
+       struct board_info board_info;
 
        /* configure the power management controller to trigger PMU
         * interrupts when low */
@@ -466,6 +467,15 @@ int __init enterprise_regulator_init(void)
        pmc_ctrl = readl(pmc + PMC_CTRL);
        writel(pmc_ctrl | PMC_CTRL_INTR_LOW, pmc + PMC_CTRL);
 
+       tegra_get_board_info(&board_info);
+
+       /* Disable battery charging for board whose sku does not
+          have battery support */
+       if (!(board_info.sku & SKU_BATTERY_SUPPORT)) {
+               bcharger_pdata.num_consumer_supplies = 0;
+               bcharger_pdata.consumer_supplies = NULL;
+       }
+
        i2c_register_board_info(4, enterprise_regulators, 1);
        enterprise_gpio_switch_regulator_init();
        pm_power_off = enterprise_power_off;
index 76e11f4..a0f09ca 100644 (file)
@@ -78,5 +78,7 @@ void __init enterprise_tsensor_init(void);
 #define CAM_FLASH_MAX_FLASH_AMP        7
 
 #define BOARD_1205             (0x0C05)
+#define BOARD_E1197            (0x0B61)
 #define ENTERPRISE_FAB_A01     (0x01)
+#define SKU_BATTERY_SUPPORT    0x1
 #endif