Commit b2a5631d authored by Andrey Panin's avatar Andrey Panin Committed by Linus Torvalds

[PATCH] port ACPI sleep workaround to new DMI probing

This patch moves Toshiba ACPI sleep workaround out of dmi_scan.c
Signed-off-by: default avatarAndrey Panin <pazke@donpac.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b622de31
...@@ -195,16 +195,6 @@ static __init int broken_toshiba_keyboard(struct dmi_blacklist *d) ...@@ -195,16 +195,6 @@ static __init int broken_toshiba_keyboard(struct dmi_blacklist *d)
return 0; return 0;
} }
/*
* Toshiba fails to preserve interrupts over S1
*/
static __init int init_ints_after_s1(struct dmi_blacklist *d)
{
printk(KERN_WARNING "Toshiba with broken S1 detected.\n");
dmi_broken |= BROKEN_INIT_AFTER_S1;
return 0;
}
#ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_ACPI_SLEEP
static __init int reset_videomode_after_s3(struct dmi_blacklist *d) static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
...@@ -326,10 +316,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ ...@@ -326,10 +316,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
NO_MATCH, NO_MATCH, NO_MATCH NO_MATCH, NO_MATCH, NO_MATCH
} }, } },
{ init_ints_after_s1, "Toshiba Satellite 4030cdt", { /* Reinitialization of 8259 is needed after S1 resume */
MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
NO_MATCH, NO_MATCH, NO_MATCH
} },
#ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_ACPI_SLEEP
{ reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /* Reset video mode after returning from ACPI S3 sleep */ { reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /* Reset video mode after returning from ACPI S3 sleep */
MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/dmi.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
...@@ -30,6 +31,8 @@ static u32 acpi_suspend_states[] = { ...@@ -30,6 +31,8 @@ static u32 acpi_suspend_states[] = {
[PM_SUSPEND_DISK] = ACPI_STATE_S4, [PM_SUSPEND_DISK] = ACPI_STATE_S4,
}; };
static int init_8259A_after_S1;
/** /**
* acpi_pm_prepare - Do preliminary suspend work. * acpi_pm_prepare - Do preliminary suspend work.
* @state: suspend state we're entering. * @state: suspend state we're entering.
...@@ -138,7 +141,7 @@ static int acpi_pm_finish(u32 state) ...@@ -138,7 +141,7 @@ static int acpi_pm_finish(u32 state)
/* reset firmware waking vector */ /* reset firmware waking vector */
acpi_set_firmware_waking_vector((acpi_physical_address) 0); acpi_set_firmware_waking_vector((acpi_physical_address) 0);
if (dmi_broken & BROKEN_INIT_AFTER_S1) { if (init_8259A_after_S1) {
printk("Broken toshiba laptop -> kicking interrupts\n"); printk("Broken toshiba laptop -> kicking interrupts\n");
init_8259A(0); init_8259A(0);
} }
...@@ -159,17 +162,39 @@ int acpi_suspend(u32 acpi_state) ...@@ -159,17 +162,39 @@ int acpi_suspend(u32 acpi_state)
return -EINVAL; return -EINVAL;
} }
static struct pm_ops acpi_pm_ops = { static struct pm_ops acpi_pm_ops = {
.prepare = acpi_pm_prepare, .prepare = acpi_pm_prepare,
.enter = acpi_pm_enter, .enter = acpi_pm_enter,
.finish = acpi_pm_finish, .finish = acpi_pm_finish,
}; };
/*
* Toshiba fails to preserve interrupts over S1, reinitialization
* of 8259 is needed after S1 resume.
*/
static int __init init_ints_after_s1(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 int __init acpi_sleep_init(void) static int __init acpi_sleep_init(void)
{ {
int i = 0; int i = 0;
dmi_check_system(acpisleep_dmi_table);
if (acpi_disabled) if (acpi_disabled)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment