ARM: mach-tegra: tegra11_emc: Set max emc rate to boot emc rate
Hyongbin Kim [Thu, 20 Jun 2013 01:41:19 +0000 (10:41 +0900)]
Set emc max clock to boot clock for reducing charger-mode-kernel
boot current.
Then we can set lower charger-mode-kernel boot threshold voltage.

Bug 1309060

Change-Id: I26519bf970d6521ad51fc2501b633d89e0eb4337
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/240422
(cherry picked from commit acd75476da525169f85e10146bf2a4e9722bb510)
Reviewed-on: http://git-master/r/299749
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

arch/arm/mach-tegra/tegra11_emc.c

index 1a6fd95..2b345d6 100644 (file)
@@ -1441,7 +1441,14 @@ static int init_emc_table(const struct tegra11_emc_table *table, int table_size)
 
                if (table_rate == boot_rate)
                        emc_stats.last_sel = i;
-
+#ifdef CONFIG_ANDROID
+               if (get_androidboot_mode_charger() &&
+                  (table_rate == boot_rate)) {
+                       /* EMC max rate = bootloader emc rate */
+                       max_entry = true;
+                       break;
+               }
+#endif
                if (emc_max_dvfs_sel) {
                        /* EMC max rate = max table entry above boot pll_m */
                        if (table_rate >= max_rate) {