Skip to contentSkip to conversation

ARM: tegra: pm: add platform suspend support

PATCH Superseded Joseph Lo 1 participant 1 message Mar 12, 2013

Subsystems (3)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Joseph Lo

author
#0 lore raw

PATCH v2 4/9 ARM: tegra: pm: add platform suspend support

Adding suspend to RAM support for Tegra platform. There are three suspend mode for Tegra. The difference were below.

* LP2: CPU voltage off
* LP1: CPU voltage off, DRAM in self-refresh
* LP0: CPU + Core voltage off, DRAM in self-refresh

After this patch, the LP2 suspend mode will be supported.

---
V2:
* add the PM_SLEEP protection for "tegra_init_suspend"
* remove "tegra_suspend_{enter/exit}_lp2"
* refactor the "tegra_pmc_pm_set" for non-used parameter
* replace "unsigned long" with "u32" for tegra_pmc_get_cpu_time

---
 arch/arm/mach-tegra/common.c |  1 +
 arch/arm/mach-tegra/pm.c     | 65 ++++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/pm.h     |  6 ++++
 arch/arm/mach-tegra/pmc.c    | 45 ++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/pmc.h    |  8 ++++++
 5 files changed, 125 insertions(+)
arch/arm/mach-tegra/common.c +1 -0
index bc7268a..fd67efa 100644
@@ -65,6 +65,7 @@ void __init tegra_dt_init_irq(void)
 	tegra_init_irq();
 	irqchip_init();
 	tegra_legacy_irq_syscore_init();
+	tegra_init_suspend();
 }
 #endif
 
arch/arm/mach-tegra/pm.c +65 -0

81 lines not on this page · raw message

arch/arm/mach-tegra/pm.h +6 -0
index 787335c..e7cbfeb 100644
@@ -32,4 +32,10 @@ bool tegra_set_cpu_in_lp2(int phy_cpu_id);
 void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time);
 extern void (*tegra_tear_down_cpu)(void);
 
+#ifdef CONFIG_PM_SLEEP
+void tegra_init_suspend(void);
+#else
+static inline void tegra_init_suspend(void) {}
+#endif
+
 #endif /* _MACH_TEGRA_PM_H_ */
arch/arm/mach-tegra/pmc.c +45 -0

58 lines not on this page · raw message

arch/arm/mach-tegra/pmc.h +8 -0
index 1c4b4de..feea9de 100644
@@ -26,6 +26,14 @@ enum tegra_suspend_mode {
 	TEGRA_MAX_SUSPEND_MODE,
 };
 
+#ifdef CONFIG_PM_SLEEP
+enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
+u32 tegra_pmc_get_cpu_good_time(void);
+u32 tegra_pmc_get_cpu_off_time(void);
+void tegra_pmc_pm_set(void);
+void tegra_pmc_suspend_init(void);
+#endif
+
 bool tegra_pmc_cpu_is_powered(int cpuid);
 int tegra_pmc_cpu_power_on(int cpuid);
 int tegra_pmc_cpu_remove_clamping(int cpuid);
Signature · 1 line
1.8.1.5