From dbf1fe6ed62cceed42fc1b014ac1a2e9fb418fdf Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Mon, 26 Mar 2012 16:31:19 +0530 Subject: ARM: tegra: Cardhu: Support for E1198-A03 Adding support for E1198-A03 which have different regulators and the identification of regulators are done based on board sku id. Change-Id: Iee76d2bc493308da5346011232db32b933fd8625 Signed-off-by: Laxman Dewangan Reviewed-on: http://git-master/r/92284 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- arch/arm/mach-tegra/board-cardhu-power.c | 65 +++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-tegra/board-cardhu-power.c') diff --git a/arch/arm/mach-tegra/board-cardhu-power.c b/arch/arm/mach-tegra/board-cardhu-power.c index 7cd5aab8f194..7143b548b955 100644 --- a/arch/arm/mach-tegra/board-cardhu-power.c +++ b/arch/arm/mach-tegra/board-cardhu-power.c @@ -379,6 +379,7 @@ int __init cardhu_regulator_init(void) struct board_info pmu_board_info; void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); u32 pmc_ctrl; + bool ext_core_regulator = false; /* configure the power management controller to trigger PMU * interrupts when low */ @@ -404,9 +405,63 @@ int __init cardhu_regulator_init(void) pdata_ldo2_0.regulator.constraints.max_uV = 1200000; } + /* + * E1198 will have different core regulator decoding. + * A01/A02: Based on sku bit 0. + * A03: Based on bit 2 and bit 0 + * 2,0: 00 no core regulator, + * 01:TPS62365 + * 10:TPS62366 + * 11:TPS623850 + */ + if (board_info.board_id == BOARD_E1198) { + int vsels; + switch(board_info.fab) { + case BOARD_FAB_A00: + case BOARD_FAB_A01: + case BOARD_FAB_A02: + if (board_info.sku & SKU_DCDC_TPS62361_SUPPORT) + ext_core_regulator = true; + break; + + case BOARD_FAB_A03: + vsels = ((board_info.sku >> 1) & 0x2) | (board_info.sku & 1); + switch(vsels) { + case 1: + ext_core_regulator = true; + tps62361_pdata.vsel0_def_state = 1; + tps62361_pdata.vsel1_def_state = 1; + break; + case 2: + ext_core_regulator = true; + tps62361_pdata.vsel0_def_state = 0; + tps62361_pdata.vsel1_def_state = 0; + break; + case 3: + ext_core_regulator = true; + tps62361_pdata.vsel0_def_state = 1; + tps62361_pdata.vsel1_def_state = 0; + break; + } + break; + } + + pr_info("BoardId:SKU:Fab 0x%04x:0x%04x:0x%02x\n", + board_info.board_id, board_info.sku , board_info.fab); + pr_info("Core regulator %s\n", + (ext_core_regulator)? "true": "false"); + pr_info("VSEL 1:0 %d%d\n", + tps62361_pdata.vsel1_def_state, + tps62361_pdata.vsel0_def_state); + } + + if ((board_info.board_id == BOARD_E1291) && + (board_info.sku & SKU_DCDC_TPS62361_SUPPORT)) + ext_core_regulator = true; + if ((board_info.board_id == BOARD_E1198) || (board_info.board_id == BOARD_E1291)) { - if (board_info.sku & SKU_DCDC_TPS62361_SUPPORT) { + if (ext_core_regulator) { tps_platform.num_subdevs = ARRAY_SIZE(tps_devs_e1198_skubit0_1); tps_platform.subdevs = tps_devs_e1198_skubit0_1; @@ -422,6 +477,7 @@ int __init cardhu_regulator_init(void) if (pmu_board_info.sku & SKU_DCDC_TPS62361_SUPPORT) { tps_platform.num_subdevs = ARRAY_SIZE(tps_devs_e118x_skubit0_1); tps_platform.subdevs = tps_devs_e118x_skubit0_1; + ext_core_regulator = true; } else { tps_platform.num_subdevs = ARRAY_SIZE(tps_devs_e118x_skubit0_0); tps_platform.subdevs = tps_devs_e118x_skubit0_0; @@ -440,10 +496,9 @@ int __init cardhu_regulator_init(void) i2c_register_board_info(4, cardhu_regulators, 1); - /* Resgister the TPS6236x for all boards whose sku bit 0 is set. */ - if ((board_info.sku & SKU_DCDC_TPS62361_SUPPORT) || - (pmu_board_info.sku & SKU_DCDC_TPS62361_SUPPORT)) { - pr_info("Registering the device TPS62361\n"); + /* Register the external core regulator if it is require */ + if (ext_core_regulator) { + pr_info("Registering the core regulator\n"); i2c_register_board_info(4, tps62361_boardinfo, 1); } return 0; -- cgit v1.2.3