diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-04-04 21:24:29 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-04-05 04:48:22 -0700 |
commit | f04f1e7034651bf43d71765303c95a9bebc19b3f (patch) | |
tree | 51c8ad142c306e611c1ed6b32ae113e923aab786 /arch/arm/mach-tegra/board-loki-power.c | |
parent | 9907770f5fb6ffd2189b3dccbb0905e37419dc95 (diff) |
ARM: tegra: prepare base for power tree support from DT for Loki
Prepare the loki board power regulator initialisation such that
to register PMIC and fixed regulators from board files only if
PMIC and fixed regulators are not registered from the DT.
bug 1440861
Change-Id: Ia0be6b4e70efdc3b66b97ac5cf4ce8200d031e4f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/392403
Diffstat (limited to 'arch/arm/mach-tegra/board-loki-power.c')
-rw-r--r-- | arch/arm/mach-tegra/board-loki-power.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/board-loki-power.c b/arch/arm/mach-tegra/board-loki-power.c index 798207414553..e279c0dfb251 100644 --- a/arch/arm/mach-tegra/board-loki-power.c +++ b/arch/arm/mach-tegra/board-loki-power.c @@ -774,6 +774,7 @@ int __init loki_regulator_init(void) { int i; struct board_info bi; + struct device_node *np; tegra_pmc_pmu_interrupt_polarity(true); @@ -806,9 +807,6 @@ int __init loki_regulator_init(void) } } - - i2c_register_board_info(4, palma_device, - ARRAY_SIZE(palma_device)); if (bi.board_id == BOARD_P2530 && bi.fab >= 0xa1) { pmic_platform.reg_data[PALMAS_REG_SMPS7] = PALMAS_REG_PDATA(smps7_a01); @@ -824,6 +822,16 @@ int __init loki_regulator_init(void) PALMAS_REG_INIT_DATA(ldo5_a01); } + + np = of_find_compatible_node(NULL, NULL, "ti,palmas"); + if (np) { + pr_info("Palmas registration from DT power tree\n"); + } else { + pr_info("Palmas registration from board power tree\n"); + i2c_register_board_info(4, palma_device, + ARRAY_SIZE(palma_device)); + } + platform_device_register(&power_supply_extcon_device); loki_cl_dvfs_init(); @@ -834,12 +842,19 @@ static int __init loki_fixed_regulator_init(void) { struct board_info pmu_board_info; struct board_info bi; + struct device_node *np; if ((!of_machine_is_compatible("nvidia,loki")) && (!of_machine_is_compatible("nvidia,t132loki"))) return 0; + np = of_find_compatible_node(NULL, "fixed-regulators", "simple-bus"); + if (np) { + pr_info("Fixed Regulator is from the DT\n"); + return 0; + } + tegra_get_board_info(&bi); tegra_get_pmu_board_info(&pmu_board_info); @@ -853,8 +868,8 @@ static int __init loki_fixed_regulator_init(void) return 0; } - subsys_initcall_sync(loki_fixed_regulator_init); + int __init loki_edp_init(void) { unsigned int regulator_mA; |