aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.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/thermal.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/thermal.c')
-rw-r--r--drivers/acpi/thermal.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1e06159fd9c4..291758c9a4d6 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -487,6 +487,10 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
487 KELVIN_TO_CELSIUS(tz->temperature)); 487 KELVIN_TO_CELSIUS(tz->temperature));
488 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 488 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
489 tz->trips.critical.flags.enabled); 489 tz->trips.critical.flags.enabled);
490 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
491 tz->device->dev.bus_id,
492 ACPI_THERMAL_NOTIFY_CRITICAL,
493 tz->trips.critical.flags.enabled);
490 494
491 orderly_poweroff(true); 495 orderly_poweroff(true);
492 496
@@ -506,6 +510,10 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
506 510
507 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT, 511 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_HOT,
508 tz->trips.hot.flags.enabled); 512 tz->trips.hot.flags.enabled);
513 acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
514 tz->device->dev.bus_id,
515 ACPI_THERMAL_NOTIFY_HOT,
516 tz->trips.hot.flags.enabled);
509 517
510 /* TBD: Call user-mode "sleep(S4)" function */ 518 /* TBD: Call user-mode "sleep(S4)" function */
511 519
@@ -1150,11 +1158,15 @@ static void acpi_thermal_notify(acpi_handle handle, u32 event, void *data)
1150 acpi_thermal_get_trip_points(tz); 1158 acpi_thermal_get_trip_points(tz);
1151 acpi_thermal_check(tz); 1159 acpi_thermal_check(tz);
1152 acpi_bus_generate_event(device, event, 0); 1160 acpi_bus_generate_event(device, event, 0);
1161 acpi_bus_generate_netlink_event(device->pnp.device_class,
1162 device->dev.bus_id, event, 0);
1153 break; 1163 break;
1154 case ACPI_THERMAL_NOTIFY_DEVICES: 1164 case ACPI_THERMAL_NOTIFY_DEVICES:
1155 if (tz->flags.devices) 1165 if (tz->flags.devices)
1156 acpi_thermal_get_devices(tz); 1166 acpi_thermal_get_devices(tz);
1157 acpi_bus_generate_event(device, event, 0); 1167 acpi_bus_generate_event(device, event, 0);
1168 acpi_bus_generate_netlink_event(device->pnp.device_class,
1169 device->dev.bus_id, event, 0);
1158 break; 1170 break;
1159 default: 1171 default:
1160 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1172 ACPI_DEBUG_PRINT((ACPI_DB_INFO,