diff options
Diffstat (limited to 'drivers/acpi/sleep.c')
| -rw-r--r-- | drivers/acpi/sleep.c | 103 | 
1 files changed, 67 insertions, 36 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 2fcc67d34b11..24213033fbae 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -177,6 +177,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {  	},  	{  	.callback = init_nvs_nosave, +	.ident = "Sony Vaio VGN-FW41E_H", +	.matches = { +		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), +		DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW41E_H"), +		}, +	}, +	{ +	.callback = init_nvs_nosave,  	.ident = "Sony Vaio VGN-FW21E",  	.matches = {  		DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), @@ -386,6 +394,8 @@ static void acpi_pm_finish(void)  	acpi_target_sleep_state = ACPI_STATE_S0; +	acpi_resume_power_resources(); +  	/* If we were woken with the fixed power button, provide a small  	 * hint to userspace in the form of a wakeup event on the fixed power  	 * button device (if it can be found). @@ -577,7 +587,27 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = {  	.end = acpi_pm_end,  	.recover = acpi_pm_finish,  }; -#endif /* CONFIG_SUSPEND */ + +static void acpi_sleep_suspend_setup(void) +{ +	int i; + +	for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) { +		acpi_status status; +		u8 type_a, type_b; + +		status = acpi_get_sleep_type_data(i, &type_a, &type_b); +		if (ACPI_SUCCESS(status)) { +			sleep_states[i] = 1; +		} +	} + +	suspend_set_ops(old_suspend_ordering ? +		&acpi_suspend_ops_old : &acpi_suspend_ops); +} +#else /* !CONFIG_SUSPEND */ +static inline void acpi_sleep_suspend_setup(void) {} +#endif /* !CONFIG_SUSPEND */  #ifdef CONFIG_HIBERNATION  static unsigned long s4_hardware_signature; @@ -698,7 +728,29 @@ static const struct platform_hibernation_ops acpi_hibernation_ops_old = {  	.restore_cleanup = acpi_pm_thaw,  	.recover = acpi_pm_finish,  }; -#endif /* CONFIG_HIBERNATION */ + +static void acpi_sleep_hibernate_setup(void) +{ +	acpi_status status; +	u8 type_a, type_b; + +	status = acpi_get_sleep_type_data(ACPI_STATE_S4, &type_a, &type_b); +	if (ACPI_FAILURE(status)) +		return; + +	hibernation_set_ops(old_suspend_ordering ? +			&acpi_hibernation_ops_old : &acpi_hibernation_ops); +	sleep_states[ACPI_STATE_S4] = 1; +	if (nosigcheck) +		return; + +	acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs); +	if (facs) +		s4_hardware_signature = facs->hardware_signature; +} +#else /* !CONFIG_HIBERNATION */ +static inline void acpi_sleep_hibernate_setup(void) {} +#endif /* !CONFIG_HIBERNATION */  int acpi_suspend(u32 acpi_state)  { @@ -734,9 +786,9 @@ int __init acpi_sleep_init(void)  {  	acpi_status status;  	u8 type_a, type_b; -#ifdef CONFIG_SUSPEND -	int i = 0; -#endif +	char supported[ACPI_S_STATE_COUNT * 3 + 1]; +	char *pos = supported; +	int i;  	if (acpi_disabled)  		return 0; @@ -744,45 +796,24 @@ int __init acpi_sleep_init(void)  	acpi_sleep_dmi_check();  	sleep_states[ACPI_STATE_S0] = 1; -	printk(KERN_INFO PREFIX "(supports S0"); - -#ifdef CONFIG_SUSPEND -	for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) { -		status = acpi_get_sleep_type_data(i, &type_a, &type_b); -		if (ACPI_SUCCESS(status)) { -			sleep_states[i] = 1; -			printk(KERN_CONT " S%d", i); -		} -	} -	suspend_set_ops(old_suspend_ordering ? -		&acpi_suspend_ops_old : &acpi_suspend_ops); -#endif +	acpi_sleep_suspend_setup(); +	acpi_sleep_hibernate_setup(); -#ifdef CONFIG_HIBERNATION -	status = acpi_get_sleep_type_data(ACPI_STATE_S4, &type_a, &type_b); -	if (ACPI_SUCCESS(status)) { -		hibernation_set_ops(old_suspend_ordering ? -			&acpi_hibernation_ops_old : &acpi_hibernation_ops); -		sleep_states[ACPI_STATE_S4] = 1; -		printk(KERN_CONT " S4"); -		if (!nosigcheck) { -			acpi_get_table(ACPI_SIG_FACS, 1, -				(struct acpi_table_header **)&facs); -			if (facs) -				s4_hardware_signature = -					facs->hardware_signature; -		} -	} -#endif  	status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);  	if (ACPI_SUCCESS(status)) {  		sleep_states[ACPI_STATE_S5] = 1; -		printk(KERN_CONT " S5");  		pm_power_off_prepare = acpi_power_off_prepare;  		pm_power_off = acpi_power_off;  	} -	printk(KERN_CONT ")\n"); + +	supported[0] = 0; +	for (i = 0; i < ACPI_S_STATE_COUNT; i++) { +		if (sleep_states[i]) +			pos += sprintf(pos, " S%d", i); +	} +	pr_info(PREFIX "(supports%s)\n", supported); +  	/*  	 * Register the tts_notifier to reboot notifier list so that the _TTS  	 * object can also be evaluated when the system enters S5.  |