aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/thermal/sysfs-api.txt16
-rw-r--r--drivers/thermal/thermal_core.c4
-rw-r--r--include/linux/thermal.h11
3 files changed, 31 insertions, 0 deletions
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 7d44d7f1a71b..c1f6864a8c5d 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -190,6 +190,8 @@ Thermal zone device sys I/F, created once it's registered:
190 |---k_i: PID's integral term in the power allocator gov 190 |---k_i: PID's integral term in the power allocator gov
191 |---k_d: PID's derivative term in the power allocator 191 |---k_d: PID's derivative term in the power allocator
192 |---integral_cutoff: Offset above which errors are accumulated 192 |---integral_cutoff: Offset above which errors are accumulated
193 |---slope: Slope constant applied as linear extrapolation
194 |---offset: Offset constant applied as linear extrapolation
193 195
194Thermal cooling device sys I/F, created once it's registered: 196Thermal cooling device sys I/F, created once it's registered:
195/sys/class/thermal/cooling_device[0-*]: 197/sys/class/thermal/cooling_device[0-*]:
@@ -359,6 +361,20 @@ integral_cutoff
359 Documentation/thermal/power_allocator.txt 361 Documentation/thermal/power_allocator.txt
360 RW, Optional 362 RW, Optional
361 363
364slope
365 The slope constant used in a linear extrapolation model
366 to determine a hotspot temperature based off the sensor's
367 raw readings. It is up to the device driver to determine
368 the usage of these values.
369 RW, Optional
370
371offset
372 The offset constant used in a linear extrapolation model
373 to determine a hotspot temperature based off the sensor's
374 raw readings. It is up to the device driver to determine
375 the usage of these values.
376 RW, Optional
377
362***************************** 378*****************************
363* Cooling device attributes * 379* Cooling device attributes *
364***************************** 380*****************************
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 962de1847cc0..04659bfb888b 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -944,6 +944,8 @@ create_s32_tzp_attr(k_pu);
944create_s32_tzp_attr(k_i); 944create_s32_tzp_attr(k_i);
945create_s32_tzp_attr(k_d); 945create_s32_tzp_attr(k_d);
946create_s32_tzp_attr(integral_cutoff); 946create_s32_tzp_attr(integral_cutoff);
947create_s32_tzp_attr(slope);
948create_s32_tzp_attr(offset);
947#undef create_s32_tzp_attr 949#undef create_s32_tzp_attr
948 950
949static struct device_attribute *dev_tzp_attrs[] = { 951static struct device_attribute *dev_tzp_attrs[] = {
@@ -953,6 +955,8 @@ static struct device_attribute *dev_tzp_attrs[] = {
953 &dev_attr_k_i, 955 &dev_attr_k_i,
954 &dev_attr_k_d, 956 &dev_attr_k_d,
955 &dev_attr_integral_cutoff, 957 &dev_attr_integral_cutoff,
958 &dev_attr_slope,
959 &dev_attr_offset,
956}; 960};
957 961
958static int create_tzp_attrs(struct device *dev) 962static int create_tzp_attrs(struct device *dev)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 6bbe11c97cea..037e9df2f610 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -302,6 +302,17 @@ struct thermal_zone_params {
302 302
303 /* threshold below which the error is no longer accumulated */ 303 /* threshold below which the error is no longer accumulated */
304 s32 integral_cutoff; 304 s32 integral_cutoff;
305
306 /*
307 * @slope: slope of a linear temperature adjustment curve.
308 * Used by thermal zone drivers.
309 */
310 int slope;
311 /*
312 * @offset: offset of a linear temperature adjustment curve.
313 * Used by thermal zone drivers (default 0).
314 */
315 int offset;
305}; 316};
306 317
307struct thermal_genl_event { 318struct thermal_genl_event {