Subject: [PATCH] [acpi thermal] Get list of thermal devices on device init - Implement thermal_get_devices() - Call when device is initialized on binding - Add ->t_have_devices and ->t_devices to struct acpi_thermal Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/thermal/device.c | 6 ++++++ drivers/acpi/drivers/thermal/driver.c | 7 +++++++ drivers/acpi/drivers/thermal/thermal.h | 4 ++++ 3 files changed, 17 insertions(+), 0 deletions(-) applies-to: f26a8c63b0062ffbf2a5f9e7e7639177e251a9f2 e719c9110bdb2fdebe633892d3c557494e0801ea diff --git a/drivers/acpi/drivers/thermal/device.c b/drivers/acpi/drivers/thermal/device.c index 603c4af..191de64 100644 --- a/drivers/acpi/drivers/thermal/device.c +++ b/drivers/acpi/drivers/thermal/device.c @@ -199,3 +199,9 @@ int thermal_get_poll_freq(struct acpi_th at->t_poll_freq); return ret; } + +int thermal_get_devices(struct acpi_thermal * at) +{ + return get_devices(at, "_TZD", &at->t_devices); +} + diff --git a/drivers/acpi/drivers/thermal/driver.c b/drivers/acpi/drivers/thermal/driver.c index d5d57ef..11b7e73 100644 --- a/drivers/acpi/drivers/thermal/driver.c +++ b/drivers/acpi/drivers/thermal/driver.c @@ -89,6 +89,13 @@ static int thermal_init(struct acpi_ther else thermal_get_poll_freq(at); + /* + * Get devices in this thermal zone + */ + ret = thermal_get_devices(at); + if (!ret) + at->t_have_devices = 1; + return 0; } diff --git a/drivers/acpi/drivers/thermal/thermal.h b/drivers/acpi/drivers/thermal/thermal.h index 60f02e3..c363041 100644 --- a/drivers/acpi/drivers/thermal/thermal.h +++ b/drivers/acpi/drivers/thermal/thermal.h @@ -63,11 +63,15 @@ struct acpi_thermal { struct thermal_trips t_trips; u32 t_cooling_mode; unsigned long t_poll_freq; + + u32 t_have_devices; + struct acpi_handle_list t_devices; }; 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_get_devices(struct acpi_thermal * at); extern int thermal_set_cooling_mode(struct acpi_thermal *, int); --- 0.99.9.GIT