diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-04-30 11:35:37 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-06-18 00:13:14 -0400 |
commit | 6d2781310036a8d3fa2b590a6f83a298010fd64a (patch) | |
tree | b10f1e9b275aed0a666786421f636f6fae5cb661 /drivers | |
parent | 07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff) |
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: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/bus.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index ae862f1798dc..cdfecc0a2ac6 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -549,6 +549,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | |||
549 | { | 549 | { |
550 | int result = 0; | 550 | int result = 0; |
551 | struct acpi_device *device = NULL; | 551 | struct acpi_device *device = NULL; |
552 | struct acpi_driver *driver; | ||
552 | 553 | ||
553 | blocking_notifier_call_chain(&acpi_bus_notify_list, | 554 | blocking_notifier_call_chain(&acpi_bus_notify_list, |
554 | type, (void *)handle); | 555 | type, (void *)handle); |
@@ -629,7 +630,10 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | |||
629 | break; | 630 | break; |
630 | } | 631 | } |
631 | 632 | ||
632 | return; | 633 | driver = device->driver; |
634 | if (driver && driver->ops.notify && | ||
635 | (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) | ||
636 | driver->ops.notify(device, type); | ||
633 | } | 637 | } |
634 | 638 | ||
635 | /* -------------------------------------------------------------------------- | 639 | /* -------------------------------------------------------------------------- |