aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/thermal.c13
-rw-r--r--include/linux/thermal.h1
2 files changed, 14 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)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 3ff680b44e81..16e6a8bdeb3c 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -41,6 +41,7 @@ struct thermal_zone_device_ops {
41 int (*set_mode) (struct thermal_zone_device *, const char *); 41 int (*set_mode) (struct thermal_zone_device *, const char *);
42 int (*get_trip_type) (struct thermal_zone_device *, int, char *); 42 int (*get_trip_type) (struct thermal_zone_device *, int, char *);
43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *); 43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *);
44 int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
44}; 45};
45 46
46struct thermal_cooling_device_ops { 47struct thermal_cooling_device_ops {