ARM: tegra: whistler: Power down/up core rail
Prashant Gaikwad [Thu, 21 Apr 2011 04:13:48 +0000 (09:13 +0530)]
program pwren signal of max8907c regulator to power down/up core rail on
deep sleep enter/exit deep sleep mode.

core_timer and core_off_timer changed as per K32.

separate_req set to false as whistler pmu has combined power requests.

Bug 817378

Original-Change-Id: Ia95a61360079f919a039572cf8fd4597db9efd50
Reviewed-on: http://git-master/r/28435
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: R51bd290332e65f90d7e3013389d1456a99809051

arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/pm.h

index 6b47631..c7d1f36 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/cpu_pm.h>
 #include <linux/clk/tegra.h>
+#include <linux/export.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -618,8 +619,29 @@ static int tegra_suspend_enter(suspend_state_t state)
        return 0;
 }
 
+/*
+ * Function pointers to optional board specific function
+ */
+void (*tegra_deep_sleep)(int);
+EXPORT_SYMBOL(tegra_deep_sleep);
+
+static int tegra_suspend_prepare(void)
+{
+       if ((current_suspend_mode == TEGRA_SUSPEND_LP0) && tegra_deep_sleep)
+               tegra_deep_sleep(1);
+       return 0;
+}
+
+static void tegra_suspend_finish(void)
+{
+       if ((current_suspend_mode == TEGRA_SUSPEND_LP0) && tegra_deep_sleep)
+               tegra_deep_sleep(0);
+}
+
 static const struct platform_suspend_ops tegra_suspend_ops = {
        .valid          = suspend_valid_only_mem,
+       .prepare        = tegra_suspend_prepare,
+       .finish         = tegra_suspend_finish,
        .prepare_late   = tegra_suspend_prepare_late,
        .wake           = tegra_suspend_wake,
        .enter          = tegra_suspend_enter,
index e855b9d..76113b6 100644 (file)
@@ -49,4 +49,9 @@ void tegra_idle_lp2(void);
 
 u64 tegra_rtc_read_ms(void);
 
+/*
+ * Callbacks for platform drivers to implement.
+ */
+extern void (*tegra_deep_sleep)(int);
+
 #endif /* _MACH_TEGRA_SUSPEND_H_ */