X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Facpi%2Fevent.c;h=5479dc0eeeecdfe6401d0d81fd435af69ac67e42;hb=9ee85241fdaab358dff1d8647f20a478cfa512a1;hp=5c95863f8fa9f324c0b98d88cd40f96eb16f9ead;hpb=ba5e1223422368fd2f4dbb0745f5fbb5fe9a65f1;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 5c95863..5479dc0 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c @@ -109,6 +109,34 @@ static const struct file_operations acpi_system_event_ops = { }; #endif /* CONFIG_ACPI_PROC_EVENT */ +/* ACPI notifier chain */ +BLOCKING_NOTIFIER_HEAD(acpi_chain_head); + +int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data) +{ + struct acpi_bus_event event; + + strcpy(event.device_class, dev->pnp.device_class); + strcpy(event.bus_id, dev->pnp.bus_id); + event.type = type; + event.data = data; + return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event) + == NOTIFY_BAD) ? -EINVAL : 0; +} +EXPORT_SYMBOL(acpi_notifier_call_chain); + +int register_acpi_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&acpi_chain_head, nb); +} +EXPORT_SYMBOL(register_acpi_notifier); + +int unregister_acpi_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&acpi_chain_head, nb); +} +EXPORT_SYMBOL(unregister_acpi_notifier); + #ifdef CONFIG_NET static unsigned int acpi_event_seqnum; struct acpi_genl_event {