]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/sleep/main.c
ACPI PM: Remove obsolete Toshiba workaround
[linux-2.6-omap-h63xx.git] / drivers / acpi / sleep / main.c
index 71183eea7906fe05424a0500676d31107d119c4e..0f2caea2fc838a540a97cff2584792164220a559 100644 (file)
@@ -51,7 +51,7 @@ static int acpi_sleep_prepare(u32 acpi_state)
 }
 
 #ifdef CONFIG_SUSPEND
-static struct platform_suspend_ops acpi_pm_ops;
+static struct platform_suspend_ops acpi_suspend_ops;
 
 extern void do_suspend_lowlevel(void);
 
@@ -62,14 +62,12 @@ static u32 acpi_suspend_states[] = {
        [PM_SUSPEND_MAX] = ACPI_STATE_S5
 };
 
-static int init_8259A_after_S1;
-
 /**
- *     acpi_pm_begin - Set the target system sleep state to the state
+ *     acpi_suspend_begin - Set the target system sleep state to the state
  *             associated with given @pm_state, if supported.
  */
 
-static int acpi_pm_begin(suspend_state_t pm_state)
+static int acpi_suspend_begin(suspend_state_t pm_state)
 {
        u32 acpi_state = acpi_suspend_states[pm_state];
        int error = 0;
@@ -85,13 +83,13 @@ static int acpi_pm_begin(suspend_state_t pm_state)
 }
 
 /**
- *     acpi_pm_prepare - Do preliminary suspend work.
+ *     acpi_suspend_prepare - Do preliminary suspend work.
  *
  *     If necessary, set the firmware waking vector and do arch-specific
  *     nastiness to get the wakeup code to the waking vector.
  */
 
-static int acpi_pm_prepare(void)
+static int acpi_suspend_prepare(void)
 {
        int error = acpi_sleep_prepare(acpi_target_sleep_state);
 
@@ -104,7 +102,7 @@ static int acpi_pm_prepare(void)
 }
 
 /**
- *     acpi_pm_enter - Actually enter a sleep state.
+ *     acpi_suspend_enter - Actually enter a sleep state.
  *     @pm_state: ignored
  *
  *     Flush caches and go to sleep. For STR we have to call arch-specific
@@ -112,7 +110,7 @@ static int acpi_pm_prepare(void)
  *     It's unfortunate, but it works. Please fix if you're feeling frisky.
  */
 
-static int acpi_pm_enter(suspend_state_t pm_state)
+static int acpi_suspend_enter(suspend_state_t pm_state)
 {
        acpi_status status = AE_OK;
        unsigned long flags = 0;
@@ -169,13 +167,13 @@ static int acpi_pm_enter(suspend_state_t pm_state)
 }
 
 /**
- *     acpi_pm_finish - Instruct the platform to leave a sleep state.
+ *     acpi_suspend_finish - Instruct the platform to leave a sleep state.
  *
  *     This is called after we wake back up (or if entering the sleep state
  *     failed). 
  */
 
-static void acpi_pm_finish(void)
+static void acpi_suspend_finish(void)
 {
        u32 acpi_state = acpi_target_sleep_state;
 
@@ -186,29 +184,22 @@ static void acpi_pm_finish(void)
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
 
        acpi_target_sleep_state = ACPI_STATE_S0;
-
-#ifdef CONFIG_X86
-       if (init_8259A_after_S1) {
-               printk("Broken toshiba laptop -> kicking interrupts\n");
-               init_8259A(0);
-       }
-#endif
 }
 
 /**
- *     acpi_pm_end - Finish up suspend sequence.
+ *     acpi_suspend_end - Finish up suspend sequence.
  */
 
-static void acpi_pm_end(void)
+static void acpi_suspend_end(void)
 {
        /*
-        * This is necessary in case acpi_pm_finish() is not called during a
+        * This is necessary in case acpi_suspend_finish() is not called during a
         * failing transition to a sleep state.
         */
        acpi_target_sleep_state = ACPI_STATE_S0;
 }
 
-static int acpi_pm_state_valid(suspend_state_t pm_state)
+static int acpi_suspend_state_valid(suspend_state_t pm_state)
 {
        u32 acpi_state;
 
@@ -224,33 +215,13 @@ static int acpi_pm_state_valid(suspend_state_t pm_state)
        }
 }
 
-static struct platform_suspend_ops acpi_pm_ops = {
-       .valid = acpi_pm_state_valid,
-       .begin = acpi_pm_begin,
-       .prepare = acpi_pm_prepare,
-       .enter = acpi_pm_enter,
-       .finish = acpi_pm_finish,
-       .end = acpi_pm_end,
-};
-
-/*
- * Toshiba fails to preserve interrupts over S1, reinitialization
- * of 8259 is needed after S1 resume.
- */
-static int __init init_ints_after_s1(const struct dmi_system_id *d)
-{
-       printk(KERN_WARNING "%s with broken S1 detected.\n", d->ident);
-       init_8259A_after_S1 = 1;
-       return 0;
-}
-
-static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
-       {
-        .callback = init_ints_after_s1,
-        .ident = "Toshiba Satellite 4030cdt",
-        .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),},
-        },
-       {},
+static struct platform_suspend_ops acpi_suspend_ops = {
+       .valid = acpi_suspend_state_valid,
+       .begin = acpi_suspend_begin,
+       .prepare = acpi_suspend_prepare,
+       .enter = acpi_suspend_enter,
+       .finish = acpi_suspend_finish,
+       .end = acpi_suspend_end,
 };
 #endif /* CONFIG_SUSPEND */
 
@@ -369,8 +340,8 @@ int acpi_suspend(u32 acpi_state)
 /**
  *     acpi_pm_device_sleep_state - return preferred power state of ACPI device
  *             in the system sleep state given by %acpi_target_sleep_state
- *     @dev: device to examine
- *     @wake: if set, the device should be able to wake up the system
+ *     @dev: device to examine; its driver model wakeup flags control
+ *             whether it should be able to wake up the system
  *     @d_min_p: used to store the upper limit of allowed states range
  *     Return value: preferred power state of the device on success, -ENODEV on
  *             failure (ie. if there's no 'struct acpi_device' for @dev)
@@ -388,7 +359,7 @@ int acpi_suspend(u32 acpi_state)
  *     via @wake.
  */
 
-int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
+int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
 {
        acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
        struct acpi_device *adev;
@@ -427,7 +398,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
         * can wake the system.  _S0W may be valid, too.
         */
        if (acpi_target_sleep_state == ACPI_STATE_S0 ||
-           (wake && adev->wakeup.state.enabled &&
+           (device_may_wakeup(dev) && adev->wakeup.state.enabled &&
             adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
                acpi_status status;
 
@@ -473,8 +444,6 @@ int __init acpi_sleep_init(void)
        u8 type_a, type_b;
 #ifdef CONFIG_SUSPEND
        int i = 0;
-
-       dmi_check_system(acpisleep_dmi_table);
 #endif
 
        if (acpi_disabled)
@@ -492,7 +461,7 @@ int __init acpi_sleep_init(void)
                }
        }
 
-       suspend_set_ops(&acpi_pm_ops);
+       suspend_set_ops(&acpi_suspend_ops);
 #endif
 
 #ifdef CONFIG_HIBERNATION