aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/event.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-01-25 01:48:06 -0500
committerLen Brown <len.brown@intel.com>2008-02-07 03:22:57 -0500
commit9ee85241fdaab358dff1d8647f20a478cfa512a1 (patch)
tree8ecac98ed4d4683d5d9db0bf69e1a4a1532cf2ec /drivers/acpi/event.c
parentba5e1223422368fd2f4dbb0745f5fbb5fe9a65f1 (diff)
ACPI: create notifier chain to get hotkey events to graphics driver
Kernel mode graphics drivers need this ACPI notifier chaine so that they can get notified upon hotkey events. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/event.c')
-rw-r--r--drivers/acpi/event.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 5c95863f8fa9..5479dc0eeeec 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -109,6 +109,34 @@ static const struct file_operations acpi_system_event_ops = {
109}; 109};
110#endif /* CONFIG_ACPI_PROC_EVENT */ 110#endif /* CONFIG_ACPI_PROC_EVENT */
111 111
112/* ACPI notifier chain */
113BLOCKING_NOTIFIER_HEAD(acpi_chain_head);
114
115int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data)
116{
117 struct acpi_bus_event event;
118
119 strcpy(event.device_class, dev->pnp.device_class);
120 strcpy(event.bus_id, dev->pnp.bus_id);
121 event.type = type;
122 event.data = data;
123 return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event)
124 == NOTIFY_BAD) ? -EINVAL : 0;
125}
126EXPORT_SYMBOL(acpi_notifier_call_chain);
127
128int register_acpi_notifier(struct notifier_block *nb)
129{
130 return blocking_notifier_chain_register(&acpi_chain_head, nb);
131}
132EXPORT_SYMBOL(register_acpi_notifier);
133
134int unregister_acpi_notifier(struct notifier_block *nb)
135{
136 return blocking_notifier_chain_unregister(&acpi_chain_head, nb);
137}
138EXPORT_SYMBOL(unregister_acpi_notifier);
139
112#ifdef CONFIG_NET 140#ifdef CONFIG_NET
113static unsigned int acpi_event_seqnum; 141static unsigned int acpi_event_seqnum;
114struct acpi_genl_event { 142struct acpi_genl_event {