Subject: [PATCH] [acpi thermal] Add support for polling frequency - Add tzp module parameter - Add ->t_poll_freq to struct acpi_thermal - Implement thermal_get_poll_freq() - Call on device init Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/thermal/device.c | 11 +++++++++++ drivers/acpi/drivers/thermal/driver.c | 13 +++++++++++++ drivers/acpi/drivers/thermal/thermal.h | 2 ++ 3 files changed, 26 insertions(+), 0 deletions(-) applies-to: 692ce896c89f0a32e3f8254d2837e0613d97766d abdaad09eb96cbfad61bd2b2aff296162e3e01e7 diff --git a/drivers/acpi/drivers/thermal/device.c b/drivers/acpi/drivers/thermal/device.c index c95ac24..603c4af 100644 --- a/drivers/acpi/drivers/thermal/device.c +++ b/drivers/acpi/drivers/thermal/device.c @@ -188,3 +188,14 @@ int thermal_set_cooling_mode(struct acpi dbg("Cooling mode set to [%s]", mode ? "passive" : "active"); return 0; } + +int thermal_get_poll_freq(struct acpi_thermal * at) +{ + int ret; + + ret = get_int(at, "_TZP", &at->t_poll_freq); + if (!ret) + dbg("polling frequency is %lu dS", + at->t_poll_freq); + return ret; +} diff --git a/drivers/acpi/drivers/thermal/driver.c b/drivers/acpi/drivers/thermal/driver.c index 50bc500..d5d57ef 100644 --- a/drivers/acpi/drivers/thermal/driver.c +++ b/drivers/acpi/drivers/thermal/driver.c @@ -14,6 +14,11 @@ #include "thermal.h" +static int tzp; +module_param(tzp, int, 0); +MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); + + static int cooling_mode_init(struct acpi_thermal * at) { int ret; @@ -76,6 +81,14 @@ static int thermal_init(struct acpi_ther cooling_mode_init(at); + /* + * Set default polling frequency + */ + if (tzp) + at->t_poll_freq = tzp; + else + thermal_get_poll_freq(at); + return 0; } diff --git a/drivers/acpi/drivers/thermal/thermal.h b/drivers/acpi/drivers/thermal/thermal.h index 2ef4b5f..60f02e3 100644 --- a/drivers/acpi/drivers/thermal/thermal.h +++ b/drivers/acpi/drivers/thermal/thermal.h @@ -62,10 +62,12 @@ struct acpi_thermal { struct thermal_trips t_trips; u32 t_cooling_mode; + unsigned long t_poll_freq; }; extern int thermal_get_temp(struct acpi_thermal *); extern int thermal_get_trips(struct acpi_thermal * at); +extern int thermal_get_poll_freq(struct acpi_thermal *); extern int thermal_set_cooling_mode(struct acpi_thermal *, int); --- 0.99.9.GIT