diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-03-30 13:48:13 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-05 02:25:07 -0400 |
commit | 46ec8598fde74ba59703575c22a6fb0b6b151bb6 (patch) | |
tree | 21936a8b188c58e69e2bd5d951df28e6e05930fa /include/acpi/acpi_bus.h | |
parent | 478c6a43fcbc6c11609f8cee7c7b57223907754f (diff) |
ACPI: support acpi_device_ops .notify methods
This patch adds support for ACPI device driver .notify() methods. If
such a method is present, Linux/ACPI installs a handler for device
notifications (but not for system notifications such as Bus Check,
Device Check, etc). When a device notification occurs, Linux/ACPI
passes it on to the driver's .notify() method.
In most cases, this removes the need for drivers to install their own
handlers for device-specific notifications.
For fixed hardware devices like some power and sleep buttons, there's
no notification value because there's no control method to execute a
Notify opcode. When a fixed hardware device generates an event, we
handle it the same as a regular device notification, except we send
a ACPI_FIXED_HARDWARE_EVENT value. This is outside the normal 0x0-0xff
range used by Notify opcodes.
Several drivers install their own handlers for system Bus Check and
Device Check notifications so they can support hot-plug. This patch
doesn't affect that usage.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi/acpi_bus.h')
-rw-r--r-- | include/acpi/acpi_bus.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 08ec60c8366a..a2228511d4be 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -95,6 +95,7 @@ typedef int (*acpi_op_suspend) (struct acpi_device * device, | |||
95 | typedef int (*acpi_op_resume) (struct acpi_device * device); | 95 | typedef int (*acpi_op_resume) (struct acpi_device * device); |
96 | typedef int (*acpi_op_bind) (struct acpi_device * device); | 96 | typedef int (*acpi_op_bind) (struct acpi_device * device); |
97 | typedef int (*acpi_op_unbind) (struct acpi_device * device); | 97 | typedef int (*acpi_op_unbind) (struct acpi_device * device); |
98 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); | ||
98 | 99 | ||
99 | struct acpi_bus_ops { | 100 | struct acpi_bus_ops { |
100 | u32 acpi_op_add:1; | 101 | u32 acpi_op_add:1; |
@@ -110,6 +111,7 @@ struct acpi_device_ops { | |||
110 | acpi_op_resume resume; | 111 | acpi_op_resume resume; |
111 | acpi_op_bind bind; | 112 | acpi_op_bind bind; |
112 | acpi_op_unbind unbind; | 113 | acpi_op_unbind unbind; |
114 | acpi_op_notify notify; | ||
113 | }; | 115 | }; |
114 | 116 | ||
115 | struct acpi_driver { | 117 | struct acpi_driver { |