ARM: Tegra: Power: use new api to get cpu regulator max_curr
Diwakar Tundlam [Thu, 20 Oct 2011 23:43:56 +0000 (16:43 -0700)]
used when the chip SKU is T33/T33S (cardhu case) or AP33 (enterprise case) to
initialize edp with a higher cpu regulator max_curr value.

bug 888679

Change-Id: Icb50b33b1fc9b1248886e040f4b9b927feee4242
(cherry picked from commit ea572ebf71bbced17f2df2313f03e032949fac68)
Reviewed-on: http://git-master/r/64210
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Lokesh Pathak <lpathak@nvidia.com>

Rebase-Id: R248e17bf5ab3541dac91815b3cabd0d1dfab8a13

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

index 023efa5..3c7fd3f 100644 (file)
@@ -1129,9 +1129,15 @@ void __init cardhu_tsensor_init(void)
 
 int __init cardhu_edp_init(void)
 {
-       /* Temporary initalization, needs to be set to the actual
-          regulator current */
-       tegra_init_cpu_edp_limits(5000);
+       unsigned int regulator_mA;
+
+       regulator_mA = get_maximum_cpu_current_supported();
+       if (!regulator_mA) {
+               regulator_mA = 5000; /* regular T30/s */
+       }
+       pr_info("%s: CPU regulator %d mA\n", __func__, regulator_mA);
+
+       tegra_init_cpu_edp_limits(regulator_mA);
        return 0;
 }
 #endif
index c233e28..15c236c 100644 (file)
@@ -542,7 +542,15 @@ int __init enterprise_suspend_init(void)
 
 int __init enterprise_edp_init(void)
 {
-       tegra_init_cpu_edp_limits(2500); /* 2.5A regulator */
+       unsigned int regulator_mA;
+
+       regulator_mA = get_maximum_cpu_current_supported();
+       if (!regulator_mA) {
+               regulator_mA = 2500; /* regular AP30 */
+       }
+       pr_info("%s: CPU regulator %d mA\n", __func__, regulator_mA);
+
+       tegra_init_cpu_edp_limits(regulator_mA);
        return 0;
 }
 #endif