aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/acer-wmi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-09-05 18:56:57 +0200
committerIngo Molnar <mingo@elte.hu>2008-09-05 18:56:57 +0200
commit616ad8c44281c0c6711a72b560e01ec335ff27e0 (patch)
tree0a20453ffedb09db6fb41a0c2208ccc2c7751d3a /drivers/misc/acer-wmi.c
parent99809963c99e1ed868d9ebeb4a5e7ee1cbe0309f (diff)
parentb380b0d4f7dffcc235c0facefa537d4655619101 (diff)
Merge branch 'linus' into x86/defconfig
Diffstat (limited to 'drivers/misc/acer-wmi.c')
-rw-r--r--drivers/misc/acer-wmi.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index e7a3fe508df..d8b0d326e45 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -192,6 +192,9 @@ static struct quirk_entry *quirks;
static void set_quirks(void)
{
+ if (!interface)
+ return;
+
if (quirks->mailled)
interface->capability |= ACER_CAP_MAILLED;
@@ -803,11 +806,30 @@ static acpi_status get_u32(u32 *value, u32 cap)
static acpi_status set_u32(u32 value, u32 cap)
{
+ acpi_status status;
+
if (interface->capability & cap) {
switch (interface->type) {
case ACER_AMW0:
return AMW0_set_u32(value, cap, interface);
case ACER_AMW0_V2:
+ if (cap == ACER_CAP_MAILLED)
+ return AMW0_set_u32(value, cap, interface);
+
+ /*
+ * On some models, some WMID methods don't toggle
+ * properly. For those cases, we want to run the AMW0
+ * method afterwards to be certain we've really toggled
+ * the device state.
+ */
+ if (cap == ACER_CAP_WIRELESS ||
+ cap == ACER_CAP_BLUETOOTH) {
+ status = WMID_set_u32(value, cap, interface);
+ if (ACPI_FAILURE(status))
+ return status;
+
+ return AMW0_set_u32(value, cap, interface);
+ }
case ACER_WMID:
return WMID_set_u32(value, cap, interface);
default:
@@ -1167,7 +1189,7 @@ static int create_debugfs(void)
return 0;
error_debugfs:
- remove_debugfs();
+ remove_debugfs();
return -ENOMEM;
}
@@ -1218,6 +1240,8 @@ static int __init acer_wmi_init(void)
return -ENODEV;
}
+ set_quirks();
+
if (platform_driver_register(&acer_platform_driver)) {
printk(ACER_ERR "Unable to register platform driver.\n");
goto error_platform_register;
@@ -1248,6 +1272,7 @@ error_platform_register:
static void __exit acer_wmi_exit(void)
{
remove_sysfs(acer_platform_device);
+ remove_debugfs();
platform_device_del(acer_platform_device);
platform_driver_unregister(&acer_platform_driver);