]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: prepare base for power tree support from DT for Loki
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 4 Apr 2014 15:54:29 +0000 (21:24 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Sat, 5 Apr 2014 11:48:22 +0000 (04:48 -0700)
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

arch/arm/mach-tegra/board-loki-power.c

index 798207414553afad0be445ed5f2a31d0e1765ae1..e279c0dfb25192394c233e88c9379ca18da5ab64 100644 (file)
@@ -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;