Commit 6d278131 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

ACPI: allow drivers to request both device and system notify events

System notify events (0x00-0x7f) are common across all device types
and should be handled in Linux/ACPI, not in drivers.  However, some
BIOSes use system notify events in device-specific ways that require
the driver to be involved.

This patch adds a ACPI_DRIVER_ALL_NOTIFY_EVENTS driver flag.  When a
driver sets this flag and supplies a .notify method, Linux/ACPI calls
the .notify method for ALL notify events on the device, not just the
device-specific (0x80-0xff) events.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 07a2039b
...@@ -549,6 +549,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) ...@@ -549,6 +549,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
{ {
int result = 0; int result = 0;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_driver *driver;
blocking_notifier_call_chain(&acpi_bus_notify_list, blocking_notifier_call_chain(&acpi_bus_notify_list,
type, (void *)handle); type, (void *)handle);
...@@ -629,7 +630,10 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) ...@@ -629,7 +630,10 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
break; break;
} }
return; driver = device->driver;
if (driver && driver->ops.notify &&
(driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
driver->ops.notify(device, type);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
......
...@@ -114,10 +114,13 @@ struct acpi_device_ops { ...@@ -114,10 +114,13 @@ struct acpi_device_ops {
acpi_op_notify notify; acpi_op_notify notify;
}; };
#define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */
struct acpi_driver { struct acpi_driver {
char name[80]; char name[80];
char class[80]; char class[80];
const struct acpi_device_id *ids; /* Supported Hardware IDs */ const struct acpi_device_id *ids; /* Supported Hardware IDs */
unsigned int flags;
struct acpi_device_ops ops; struct acpi_device_ops ops;
struct device_driver drv; struct device_driver drv;
struct module *owner; struct module *owner;
......
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