aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-07-01 15:07:33 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-01 15:29:44 -0400
commit2391dae3e36c19fe668c71eac2eb8344dbaaf46d (patch)
treeae8c1fa53fe67e3ccbb8c5097f6b5bda27b26959 /arch
parentcbcdd772ff43de58cc0d9de76ae9d05e2dd98bc0 (diff)
PM: introduce set_target method in pm_ops
Commit 52ade9b3b97fd3bea42842a056fe0786c28d0555 changed the suspend code ordering to execute pm_ops->prepare() after the device model per-device .suspend() calls in order to fix some ACPI-related issues. Unfortunately, it broke the at91 platform which assumed that pm_ops->prepare() would be called before suspending devices. at91 used pm_ops->prepare() to get notified of the target system sleep state, so that it could use this information while suspending devices. However, with the current suspend code ordering pm_ops->prepare() is called too late for this purpose. Thus, at91 needs an additional method in 'struct pm_ops' that will be used for notifying the platform of the target system sleep state. Moreover, in the future such a method will also be needed by ACPI. This patch adds the .set_target() method to 'struct pm_ops' and makes the suspend code call it, if implemented, before executing the device model per-device .suspend() calls. It also modifies the at91 code to use pm_ops->set_target() instead of pm_ops->prepare(). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Pavel Machek <pavel@ucw.cz> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Len Brown <lenb@kernel.org> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-at91/pm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 47ff676aca5f..ddf9184d561d 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -53,7 +53,7 @@ static suspend_state_t target_state;
53/* 53/*
54 * Called after processes are frozen, but before we shutdown devices. 54 * Called after processes are frozen, but before we shutdown devices.
55 */ 55 */
56static int at91_pm_prepare(suspend_state_t state) 56static int at91_pm_set_target(suspend_state_t state)
57{ 57{
58 target_state = state; 58 target_state = state;
59 return 0; 59 return 0;
@@ -201,7 +201,7 @@ error:
201 201
202static struct pm_ops at91_pm_ops ={ 202static struct pm_ops at91_pm_ops ={
203 .valid = at91_pm_valid_state, 203 .valid = at91_pm_valid_state,
204 .prepare = at91_pm_prepare, 204 .set_target = at91_pm_set_target,
205 .enter = at91_pm_enter, 205 .enter = at91_pm_enter,
206}; 206};
207 207