Commit 0da7309c authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] handle GPE sharing between button and lid

http://bugzilla.kernel.org/show_bug.cgi?id=3518Signed-off-by: default avatarDavid Shaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 90b369e0
...@@ -397,6 +397,7 @@ acpi_system_write_wakeup_device ( ...@@ -397,6 +397,7 @@ acpi_system_write_wakeup_device (
char strbuf[5]; char strbuf[5];
char str[5] = ""; char str[5] = "";
int len = count; int len = count;
struct acpi_device *found_dev = NULL;
if (len > 4) len = 4; if (len > 4) len = 4;
...@@ -413,9 +414,25 @@ acpi_system_write_wakeup_device ( ...@@ -413,9 +414,25 @@ acpi_system_write_wakeup_device (
if (!strncmp(dev->pnp.bus_id, str, 4)) { if (!strncmp(dev->pnp.bus_id, str, 4)) {
dev->wakeup.state.enabled = dev->wakeup.state.enabled ? 0:1; dev->wakeup.state.enabled = dev->wakeup.state.enabled ? 0:1;
found_dev = dev;
break; break;
} }
} }
if (found_dev) {
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device * dev = container_of(node,
struct acpi_device, wakeup_list);
if ((dev != found_dev) &&
(dev->wakeup.gpe_number == found_dev->wakeup.gpe_number) &&
(dev->wakeup.gpe_device == found_dev->wakeup.gpe_device)) {
printk(KERN_WARNING "ACPI: '%s' and '%s' have the same GPE, "
"can't disable/enable one seperately\n",
dev->pnp.bus_id, found_dev->pnp.bus_id);
dev->wakeup.state.enabled = found_dev->wakeup.state.enabled;
}
}
}
spin_unlock(&acpi_device_lock); spin_unlock(&acpi_device_lock);
return count; return count;
} }
......
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