Subject: [PATCH] [acpi thermal] Add event interface Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/thermal/event.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) applies-to: 5edfc94eaa9e64da9430eb257b50e18ee8e5a9ef a575aafbda51795d7350045280e7d41cdbbf7962 diff --git a/drivers/acpi/drivers/thermal/event.c b/drivers/acpi/drivers/thermal/event.c index 06e2e32..e79ce0b 100644 --- a/drivers/acpi/drivers/thermal/event.c +++ b/drivers/acpi/drivers/thermal/event.c @@ -13,4 +13,31 @@ #include "thermal.h" -acpi_device_event_none(thermal); +#define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 +#define ACPI_THERMAL_NOTIFY_THRESHOLDS 0x81 +#define ACPI_THERMAL_NOTIFY_DEVICES 0x82 + + +static int thermal_notify(struct acpi_dev * ad, u32 event, int * data) +{ + struct acpi_thermal * at = dev_get_drvdata(&ad->dev); + + if (event == ACPI_THERMAL_NOTIFY_TEMPERATURE) { + thermal_check(at); + } else if (event == ACPI_THERMAL_NOTIFY_THRESHOLDS) { + thermal_get_trips(at); + thermal_check(at); + } else { /* ACPI_THERMAL_NOTIFY_DEVICES */ + if (at->t_have_devices) + thermal_get_devices(at); + } + *data = 0; + return 0; +} + +declare_acpi_events(thermal, + acpi_event_raise(ACPI_THERMAL_NOTIFY_TEMPERATURE), + acpi_event_raise(ACPI_THERMAL_NOTIFY_THRESHOLDS), + acpi_event_raise(ACPI_THERMAL_NOTIFY_DEVICES)); + +acpi_device_event(thermal); --- 0.99.9.GIT