From: Len Brown Date: Thu, 23 Oct 2008 03:28:46 +0000 (-0400) Subject: Merge branch 'suspend' into test X-Git-Tag: v2.6.28-rc1~26^2~12 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=acd41d36e5a813501da92156f325ce15ddcd58ff;p=linux-2.6-omap-h63xx.git Merge branch 'suspend' into test --- acd41d36e5a813501da92156f325ce15ddcd58ff diff --cc drivers/acpi/sleep/main.c index 4c21480b582,2a312702225..cc344d4252c --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@@ -23,8 -24,37 +24,38 @@@ #include "sleep.h" u8 sleep_states[ACPI_S_STATE_COUNT]; +static u32 acpi_target_sleep_state = ACPI_STATE_S0; + static void acpi_sleep_tts_switch(u32 acpi_state) + { + union acpi_object in_arg = { ACPI_TYPE_INTEGER }; + struct acpi_object_list arg_list = { 1, &in_arg }; + acpi_status status = AE_OK; + + in_arg.integer.value = acpi_state; + status = acpi_evaluate_object(NULL, "\\_TTS", &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + /* + * OS can't evaluate the _TTS object correctly. Some warning + * message will be printed. But it won't break anything. + */ + printk(KERN_NOTICE "Failure in evaluating _TTS object\n"); + } + } + + static int tts_notify_reboot(struct notifier_block *this, + unsigned long code, void *x) + { + acpi_sleep_tts_switch(ACPI_STATE_S5); + return NOTIFY_DONE; + } + + static struct notifier_block tts_notifier = { + .notifier_call = tts_notify_reboot, + .next = NULL, + .priority = 0, + }; + static int acpi_sleep_prepare(u32 acpi_state) { #ifdef CONFIG_ACPI_SLEEP @@@ -130,8 -162,9 +161,9 @@@ static void acpi_pm_end(void * failing transition to a sleep state. */ acpi_target_sleep_state = ACPI_STATE_S0; + acpi_sleep_tts_switch(acpi_target_sleep_state); } -#endif /* CONFIG_PM_SLEEP */ +#endif /* CONFIG_ACPI_SLEEP */ #ifdef CONFIG_SUSPEND extern void do_suspend_lowlevel(void);