Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84157
b: refs/heads/master
c: 9ee8524
h: refs/heads/master
i:
  84155: a4660e6
v: v3
  • Loading branch information
Zhang Rui authored and Len Brown committed Feb 7, 2008
1 parent d4eee02 commit cf86903
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba5e1223422368fd2f4dbb0745f5fbb5fe9a65f1
refs/heads/master: 9ee85241fdaab358dff1d8647f20a478cfa512a1
28 changes: 28 additions & 0 deletions trunk/drivers/acpi/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ struct acpi_bus_event {

extern struct kobject *acpi_kobj;
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
extern int register_acpi_notifier(struct notifier_block *);
extern int unregister_acpi_notifier(struct notifier_block *);
/*
* External Functions
*/
Expand Down

0 comments on commit cf86903

Please sign in to comment.