diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-04-30 18:09:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 19:40:40 -0400 |
commit | e8c9c502690efd24b7055bf608e7a3c34216848b (patch) | |
tree | 1583f34ec9cac07ddfdcb24de66e49718b107436 /include/linux/pm.h | |
parent | 11d77d0c01b80e44c7aceb21928508dafce774f9 (diff) |
power management: implement pm_ops.valid for everybody
Almost all users of pm_ops only support mem sleep, don't check in .valid and
don't reject any others in .prepare so users can be confused if they check
/sys/power/state, especially when new states are added (these would then
result in s-t-r although they're supposed to be something different).
This patch implements a generic pm_valid_only_mem function that is then
exported for users and puts it to use in almost all existing pm_ops.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@lists.linux-foundation.org
Cc: Len Brown <lenb@kernel.org>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index c2a55f94c29a..6035209cf31e 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -128,6 +128,9 @@ typedef int __bitwise suspend_disk_method_t; | |||
128 | * always valid and never passed to this call. | 128 | * always valid and never passed to this call. |
129 | * If not assigned, all suspend states are advertised as valid | 129 | * If not assigned, all suspend states are advertised as valid |
130 | * in /sys/power/state (but can still be rejected by prepare or enter.) | 130 | * in /sys/power/state (but can still be rejected by prepare or enter.) |
131 | * Since new states can be added for other platforms, you should | ||
132 | * assign this callback. There is a %pm_valid_only_mem function | ||
133 | * available if you only implemented mem sleep. | ||
131 | * | 134 | * |
132 | * @prepare: Prepare the platform for the given suspend state. Can return a | 135 | * @prepare: Prepare the platform for the given suspend state. Can return a |
133 | * negative error code if necessary. | 136 | * negative error code if necessary. |
@@ -165,6 +168,7 @@ extern void pm_set_ops(struct pm_ops *pm_ops); | |||
165 | extern struct pm_ops *pm_ops; | 168 | extern struct pm_ops *pm_ops; |
166 | extern int pm_suspend(suspend_state_t state); | 169 | extern int pm_suspend(suspend_state_t state); |
167 | 170 | ||
171 | extern int pm_valid_only_mem(suspend_state_t state); | ||
168 | 172 | ||
169 | /** | 173 | /** |
170 | * arch_suspend_disable_irqs - disable IRQs for suspend | 174 | * arch_suspend_disable_irqs - disable IRQs for suspend |