From 962ce8ca0604af0c3c5609f7613d4ec5fcfac623 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Thu, 23 Aug 2007 01:24:31 +0800 Subject: 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 Signed-off-by: Len Brown --- drivers/acpi/thermal.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/acpi/thermal.c') diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 1e06159..291758c 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -487,6 +487,10 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) KELVIN_TO_CELSIUS(tz->temperature)); acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled); + acpi_bus_generate_netlink_event(tz->device->pnp.device_class, + tz->device->dev.bus_id, + ACPI_THERMAL_NOTIFY_CRITICAL, + tz->trips.critical.flags.enabled); orderly_poweroff(true); @@ -506,6 +510,10 @@ static int acpi_thermal_hot(struct acpi_thermal *tz) acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, tz->trips.hot.flags.enabled); + acpi_bus_generate_netlink_event(tz->device->pnp.device_class, + tz->device->dev.bus_id, + ACPI_THERMAL_NOTIFY_HOT, + tz->trips.hot.flags.enabled); /* TBD: Call user-mode "sleep(S4)" function */ @@ -1150,11 +1158,15 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data) acpi_thermal_get_trip_points(tz); acpi_thermal_check(tz); acpi_bus_generate_event(device, event, 0); + acpi_bus_generate_netlink_event(device->pnp.device_class, + device->dev.bus_id, event, 0); break; case ACPI_THERMAL_NOTIFY_DEVICES: if (tz->flags.devices) acpi_thermal_get_devices(tz); acpi_bus_generate_event(device, event, 0); + acpi_bus_generate_netlink_event(device->pnp.device_class, + device->dev.bus_id, event, 0); break; default: ACPI_DEBUG_PRINT((ACPI_DB_INFO, -- cgit v1.1