diff options
| -rw-r--r-- | Documentation/thermal/sysfs-api.txt | 16 | ||||
| -rw-r--r-- | drivers/thermal/thermal_core.c | 4 | ||||
| -rw-r--r-- | include/linux/thermal.h | 11 |
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 | ||
| 194 | Thermal cooling device sys I/F, created once it's registered: | 196 | Thermal 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 | ||
| 364 | slope | ||
| 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 | |||
| 371 | offset | ||
| 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); | |||
| 944 | create_s32_tzp_attr(k_i); | 944 | create_s32_tzp_attr(k_i); |
| 945 | create_s32_tzp_attr(k_d); | 945 | create_s32_tzp_attr(k_d); |
| 946 | create_s32_tzp_attr(integral_cutoff); | 946 | create_s32_tzp_attr(integral_cutoff); |
| 947 | create_s32_tzp_attr(slope); | ||
| 948 | create_s32_tzp_attr(offset); | ||
| 947 | #undef create_s32_tzp_attr | 949 | #undef create_s32_tzp_attr |
| 948 | 950 | ||
| 949 | static struct device_attribute *dev_tzp_attrs[] = { | 951 | static 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 | ||
| 958 | static int create_tzp_attrs(struct device *dev) | 962 | static 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 | ||
| 307 | struct thermal_genl_event { | 318 | struct thermal_genl_event { |
