diff options
author | Zhang, Rui <rui.zhang@intel.com> | 2008-04-10 16:13:10 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 02:45:49 -0400 |
commit | 9ec732ff80b7e8a9096666f78ae584d3b393bc84 (patch) | |
tree | fae3a8b26c555521ac26992b8c3d897b07921cd5 /drivers | |
parent | 63c4ec905d63834a97ec7dbbf0a2ec89ef5872be (diff) | |
download | blackbird-op-linux-9ec732ff80b7e8a9096666f78ae584d3b393bc84.tar.gz blackbird-op-linux-9ec732ff80b7e8a9096666f78ae584d3b393bc84.zip |
thermal: add new get_crit_temp callback
Add a new callback so that the generic thermal can get
the critical trip point info of a thermal zone,
which is needed for building the tempX_crit hwmon sysfs attribute.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/thermal.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 766bd25d3376..ec707ed1a70f 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1012,6 +1012,18 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal, return -EINVAL; } +static int thermal_get_crit_temp(struct thermal_zone_device *thermal, + unsigned long *temperature) { + struct acpi_thermal *tz = thermal->devdata; + + if (tz->trips.critical.flags.valid) { + *temperature = KELVIN_TO_MILLICELSIUS( + tz->trips.critical.temperature); + return 0; + } else + return -EINVAL; +} + typedef int (*cb)(struct thermal_zone_device *, int, struct thermal_cooling_device *); static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal, @@ -1103,6 +1115,7 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = { .set_mode = thermal_set_mode, .get_trip_type = thermal_get_trip_type, .get_trip_temp = thermal_get_trip_temp, + .get_crit_temp = thermal_get_crit_temp, }; static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) |