aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c13
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,
1012 return -EINVAL; 1012 return -EINVAL;
1013} 1013}
1014 1014
1015static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
1016 unsigned long *temperature) {
1017 struct acpi_thermal *tz = thermal->devdata;
1018
1019 if (tz->trips.critical.flags.valid) {
1020 *temperature = KELVIN_TO_MILLICELSIUS(
1021 tz->trips.critical.temperature);
1022 return 0;
1023 } else
1024 return -EINVAL;
1025}
1026
1015typedef int (*cb)(struct thermal_zone_device *, int, 1027typedef int (*cb)(struct thermal_zone_device *, int,
1016 struct thermal_cooling_device *); 1028 struct thermal_cooling_device *);
1017static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal, 1029static 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 = {
1103 .set_mode = thermal_set_mode, 1115 .set_mode = thermal_set_mode,
1104 .get_trip_type = thermal_get_trip_type, 1116 .get_trip_type = thermal_get_trip_type,
1105 .get_trip_temp = thermal_get_trip_temp, 1117 .get_trip_temp = thermal_get_trip_temp,
1118 .get_crit_temp = thermal_get_crit_temp,
1106}; 1119};
1107 1120
1108static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) 1121static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)