From f4cb57007662a4ec3c2de3c027900223e0299bdd Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 8 Dec 2007 02:14:00 +0100 Subject: Suspend: Clean up Kconfig (V2) This cleans up the suspend Kconfig and removes the need to declare centrally which architectures support suspend. All architectures that currently support suspend are modified accordingly. Signed-off-by: Johannes Berg Acked-by: Russell King Acked-by: Paul Mackerras Acked-by: Ralf Baechle Acked-by: Paul Mundt Cc: Pavel Machek Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- arch/arm/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 77201d3f747..a00d8b97c30 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1035,6 +1035,9 @@ menu "Power management options" source "kernel/power/Kconfig" +config ARCH_SUSPEND_POSSIBLE + def_bool y + endmenu source "net/Kconfig" -- cgit v1.2.3 From c697eecebc6cfc0b393afea3c4ff1a5041526ad1 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 8 Jan 2008 00:04:17 +0100 Subject: Suspend: Introduce begin() and end() callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On ACPI systems the target state set by acpi_pm_set_target() is reset by acpi_pm_finish(), but that need not be called if the suspend fails.  All platforms that use the .set_target() global suspend callback are affected by analogous issues. For this reason, we need an additional global suspend callback that will reset the target state regardless of whether or not the suspend is successful.  Also, it is reasonable to rename the .set_target() callback, since it will be used for a different purpose on ACPI systems (due to ACPI 1.0x code ordering requirements). Introduce the global suspend callback .end() to be executed at the end of the suspend sequence and rename the .set_target() global suspend callback to .begin(). Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- arch/arm/mach-at91/pm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 4b120cc3613..a67defd5043 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -52,7 +52,7 @@ static suspend_state_t target_state; /* * Called after processes are frozen, but before we shutdown devices. */ -static int at91_pm_set_target(suspend_state_t state) +static int at91_pm_begin(suspend_state_t state) { target_state = state; return 0; @@ -202,11 +202,20 @@ error: return 0; } +/* + * Called right prior to thawing processes. + */ +static void at91_pm_end(void) +{ + target_state = PM_SUSPEND_ON; +} + static struct platform_suspend_ops at91_pm_ops ={ - .valid = at91_pm_valid_state, - .set_target = at91_pm_set_target, - .enter = at91_pm_enter, + .valid = at91_pm_valid_state, + .begin = at91_pm_begin, + .enter = at91_pm_enter, + .end = at91_pm_end, }; static int __init at91_pm_init(void) -- cgit v1.2.3