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