ARM: TT: Reduce charger mode boot time
Hyongbin Kim [Thu, 12 Sep 2013 08:34:32 +0000 (17:34 +0900)]
In charger mode, sdhci2(External SD), sdhci0(Wifi) is not used.
Skip register to save boot time.

Bug 1367030

Change-Id: I297494976c8f0a50244638fc7c62916548c082e7
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/273600
(cherry picked from commit 5d675fa37bbf2f68a80314902f1b502c15b8166e)
Reviewed-on: http://git-master/r/300439
GVS: Gerrit_Virtual_Submit
Reviewed-by: Harry Hong <hhong@nvidia.com>

arch/arm/mach-tegra/board-tegratab-sdhci.c

index 79d4f05..06ea50d 100644 (file)
@@ -293,6 +293,12 @@ static int __init tegratab_wifi_prepower(void)
        if (!machine_is_tegratab())
                return 0;
 
+#ifdef CONFIG_ANDROID
+       /* In charger mode, don't power on wifi. */
+       if (get_androidboot_mode_charger())
+               return 0;
+#endif
+
        tegratab_wifi_power(1);
 
        return 0;
@@ -338,6 +344,13 @@ int __init tegratab_sdhci_init(void)
        && (!(tegra_sdhci_platform_data3.uhs_mask & MMC_UHS_MASK_DDR50)))
                tegra_sdhci_platform_data3.trim_delay = 0;
        platform_device_register(&tegra_sdhci_device3);
+
+#ifdef CONFIG_ANDROID
+       /* In charger mode, don't register wifi and external sd. */
+       if (get_androidboot_mode_charger())
+               return 0;
+#endif
+
        platform_device_register(&tegra_sdhci_device2);
        platform_device_register(&tegra_sdhci_device0);
        tegratab_wifi_init();