aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep/main.c')
-rw-r--r--drivers/acpi/sleep/main.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index c3b0cd88d09f..0f2caea2fc83 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -62,8 +62,6 @@ static u32 acpi_suspend_states[] = {
62 [PM_SUSPEND_MAX] = ACPI_STATE_S5 62 [PM_SUSPEND_MAX] = ACPI_STATE_S5
63}; 63};
64 64
65static int init_8259A_after_S1;
66
67/** 65/**
68 * acpi_suspend_begin - Set the target system sleep state to the state 66 * acpi_suspend_begin - Set the target system sleep state to the state
69 * associated with given @pm_state, if supported. 67 * associated with given @pm_state, if supported.
@@ -186,13 +184,6 @@ static void acpi_suspend_finish(void)
186 acpi_set_firmware_waking_vector((acpi_physical_address) 0); 184 acpi_set_firmware_waking_vector((acpi_physical_address) 0);
187 185
188 acpi_target_sleep_state = ACPI_STATE_S0; 186 acpi_target_sleep_state = ACPI_STATE_S0;
189
190#ifdef CONFIG_X86
191 if (init_8259A_after_S1) {
192 printk("Broken toshiba laptop -> kicking interrupts\n");
193 init_8259A(0);
194 }
195#endif
196} 187}
197 188
198/** 189/**
@@ -232,26 +223,6 @@ static struct platform_suspend_ops acpi_suspend_ops = {
232 .finish = acpi_suspend_finish, 223 .finish = acpi_suspend_finish,
233 .end = acpi_suspend_end, 224 .end = acpi_suspend_end,
234}; 225};
235
236/*
237 * Toshiba fails to preserve interrupts over S1, reinitialization
238 * of 8259 is needed after S1 resume.
239 */
240static int __init init_ints_after_s1(const struct dmi_system_id *d)
241{
242 printk(KERN_WARNING "%s with broken S1 detected.\n", d->ident);
243 init_8259A_after_S1 = 1;
244 return 0;
245}
246
247static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
248 {
249 .callback = init_ints_after_s1,
250 .ident = "Toshiba Satellite 4030cdt",
251 .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),},
252 },
253 {},
254};
255#endif /* CONFIG_SUSPEND */ 226#endif /* CONFIG_SUSPEND */
256 227
257#ifdef CONFIG_HIBERNATION 228#ifdef CONFIG_HIBERNATION
@@ -369,8 +340,8 @@ int acpi_suspend(u32 acpi_state)
369/** 340/**
370 * acpi_pm_device_sleep_state - return preferred power state of ACPI device 341 * acpi_pm_device_sleep_state - return preferred power state of ACPI device
371 * in the system sleep state given by %acpi_target_sleep_state 342 * in the system sleep state given by %acpi_target_sleep_state
372 * @dev: device to examine 343 * @dev: device to examine; its driver model wakeup flags control
373 * @wake: if set, the device should be able to wake up the system 344 * whether it should be able to wake up the system
374 * @d_min_p: used to store the upper limit of allowed states range 345 * @d_min_p: used to store the upper limit of allowed states range
375 * Return value: preferred power state of the device on success, -ENODEV on 346 * Return value: preferred power state of the device on success, -ENODEV on
376 * failure (ie. if there's no 'struct acpi_device' for @dev) 347 * failure (ie. if there's no 'struct acpi_device' for @dev)
@@ -388,7 +359,7 @@ int acpi_suspend(u32 acpi_state)
388 * via @wake. 359 * via @wake.
389 */ 360 */
390 361
391int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) 362int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
392{ 363{
393 acpi_handle handle = DEVICE_ACPI_HANDLE(dev); 364 acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
394 struct acpi_device *adev; 365 struct acpi_device *adev;
@@ -427,7 +398,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
427 * can wake the system. _S0W may be valid, too. 398 * can wake the system. _S0W may be valid, too.
428 */ 399 */
429 if (acpi_target_sleep_state == ACPI_STATE_S0 || 400 if (acpi_target_sleep_state == ACPI_STATE_S0 ||
430 (wake && adev->wakeup.state.enabled && 401 (device_may_wakeup(dev) && adev->wakeup.state.enabled &&
431 adev->wakeup.sleep_state <= acpi_target_sleep_state)) { 402 adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
432 acpi_status status; 403 acpi_status status;
433 404
@@ -473,8 +444,6 @@ int __init acpi_sleep_init(void)
473 u8 type_a, type_b; 444 u8 type_a, type_b;
474#ifdef CONFIG_SUSPEND 445#ifdef CONFIG_SUSPEND
475 int i = 0; 446 int i = 0;
476
477 dmi_check_system(acpisleep_dmi_table);
478#endif 447#endif
479 448
480 if (acpi_disabled) 449 if (acpi_disabled)