diff options
author | Paul Walmsley <paul@pwsan.com> | 2012-02-02 04:30:50 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-03-05 19:01:19 -0500 |
commit | 1416408d31236dc2a80d269aa23ffa93aa01e833 (patch) | |
tree | fb77d8bad2e21597ed5d0b34fdd040044999e2c2 /arch/arm/mach-omap2/pm44xx.c | |
parent | b7c39a3f59ae55aa49ebf670e9329bc7da6d3c65 (diff) |
ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4
The platform_suspend_ops can be shared across OMAP2, 3, and 4, along
with all of the functions referenced in that structure. This patch
shares them. It also removes the suspend_state file-scoped variable
in the OMAP2 and 3 PM code; it does not appear to be actually needed
by anything.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
[khilman@ti.com: minor rework needed due to rebase/merge with conflicting changes]
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm44xx.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 84d52f729af4..91e0b1c9b76c 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -83,41 +83,6 @@ static int omap4_pm_suspend(void) | |||
83 | 83 | ||
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
86 | |||
87 | static int omap4_pm_enter(suspend_state_t suspend_state) | ||
88 | { | ||
89 | int ret = 0; | ||
90 | |||
91 | switch (suspend_state) { | ||
92 | case PM_SUSPEND_STANDBY: | ||
93 | case PM_SUSPEND_MEM: | ||
94 | ret = omap4_pm_suspend(); | ||
95 | break; | ||
96 | default: | ||
97 | ret = -EINVAL; | ||
98 | } | ||
99 | |||
100 | return ret; | ||
101 | } | ||
102 | |||
103 | static int omap4_pm_begin(suspend_state_t state) | ||
104 | { | ||
105 | disable_hlt(); | ||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | static void omap4_pm_end(void) | ||
110 | { | ||
111 | enable_hlt(); | ||
112 | return; | ||
113 | } | ||
114 | |||
115 | static const struct platform_suspend_ops omap_pm_ops = { | ||
116 | .begin = omap4_pm_begin, | ||
117 | .end = omap4_pm_end, | ||
118 | .enter = omap4_pm_enter, | ||
119 | .valid = suspend_valid_only_mem, | ||
120 | }; | ||
121 | #endif /* CONFIG_SUSPEND */ | 86 | #endif /* CONFIG_SUSPEND */ |
122 | 87 | ||
123 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | 88 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) |
@@ -234,8 +199,8 @@ static int __init omap4_pm_init(void) | |||
234 | (void) clkdm_for_each(omap_pm_clkdms_setup, NULL); | 199 | (void) clkdm_for_each(omap_pm_clkdms_setup, NULL); |
235 | 200 | ||
236 | #ifdef CONFIG_SUSPEND | 201 | #ifdef CONFIG_SUSPEND |
237 | suspend_set_ops(&omap_pm_ops); | 202 | omap_pm_suspend = omap4_pm_suspend; |
238 | #endif /* CONFIG_SUSPEND */ | 203 | #endif |
239 | 204 | ||
240 | /* Overwrite the default cpu_do_idle() */ | 205 | /* Overwrite the default cpu_do_idle() */ |
241 | arm_pm_idle = omap_default_idle; | 206 | arm_pm_idle = omap_default_idle; |