aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/event.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2007-08-22 13:24:31 -0400
committerLen Brown <len.brown@intel.com>2007-08-23 14:27:23 -0400
commit962ce8ca0604af0c3c5609f7613d4ec5fcfac623 (patch)
tree8a9fcb67251129a382e202759389d2b72de4b621 /drivers/acpi/event.c
parentb377fd3982ad957c796758a90e2988401a884241 (diff)
ACPI: don't duplicate input events on netlink
The previous events patch added a netlink event for every user of the legacy /proc/acpi/event interface. However, some users of /proc/acpi/event are really input events, and they already report their events via the input layer. Introduce a new interface, acpi_bus_generate_netlink_event(), which is explicitly called by devices that want to repoprt events via netlink. This allows the input-like events to opt-out of generating netlink events. In summary: events that are sent via netlink: ac/battery/sbs thermal processor thinkpad_acpi dock/bay events that are sent via input layer: button video hotkey thinkpad_acpi hotkey asus_acpi/asus-laptop hotkey sonypi/sonylaptop 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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 95637a4ff782..b7b143288c22 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -147,7 +147,8 @@ static struct genl_multicast_group acpi_event_mcgrp = {
147 .name = ACPI_GENL_MCAST_GROUP_NAME, 147 .name = ACPI_GENL_MCAST_GROUP_NAME,
148}; 148};
149 149
150int acpi_bus_generate_genetlink_event(struct acpi_device *device, 150int acpi_bus_generate_netlink_event(const char *device_class,
151 const char *bus_id,
151 u8 type, int data) 152 u8 type, int data)
152{ 153{
153 struct sk_buff *skb; 154 struct sk_buff *skb;
@@ -191,8 +192,8 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device,
191 192
192 memset(event, 0, sizeof(struct acpi_genl_event)); 193 memset(event, 0, sizeof(struct acpi_genl_event));
193 194
194 strcpy(event->device_class, device->pnp.device_class); 195 strcpy(event->device_class, device_class);
195 strcpy(event->bus_id, device->dev.bus_id); 196 strcpy(event->bus_id, bus_id);
196 event->type = type; 197 event->type = type;
197 event->data = data; 198 event->data = data;
198 199
@@ -211,6 +212,8 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device,
211 return 0; 212 return 0;
212} 213}
213 214
215EXPORT_SYMBOL(acpi_bus_generate_netlink_event);
216
214static int acpi_event_genetlink_init(void) 217static int acpi_event_genetlink_init(void)
215{ 218{
216 int result; 219 int result;
@@ -228,12 +231,14 @@ static int acpi_event_genetlink_init(void)
228} 231}
229 232
230#else 233#else
231int acpi_bus_generate_genetlink_event(struct acpi_device *device, u8 type, 234int acpi_bus_generate_netlink_event(struct acpi_device *device, u8 type,
232 int data) 235 int data)
233{ 236{
234 return 0; 237 return 0;
235} 238}
236 239
240EXPORT_SYMBOL(acpi_generate_netlink_event);
241
237static int acpi_event_genetlink_init(void) 242static int acpi_event_genetlink_init(void)
238{ 243{
239 return -ENODEV; 244 return -ENODEV;