aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorEduardo Valentin <edubezval@gmail.com>2015-05-11 19:34:23 -0700
committerKevin Hilman <khilman@linaro.org>2015-07-07 09:20:24 -0700
commit5b943ea4df2d865a0dd3d2ba9c03f68c436d87c6 (patch)
tree379aa3d0aff4bebd84988c633d84ac08b458e296 /drivers/thermal
parent9865d3221d3d9630116c4c9b30cf3276b2655109 (diff)
thermal: support slope and offset coefficients
It is common to have a linear extrapolation from the current sensor readings and the actual temperature value. This is specially the case when the sensor is in use to extrapolate hotspots. This patch adds slope and offset constants for single sensor linear extrapolation equation. Because the same sensor can be use in different locations, from board to board, these constants are added as part of thermal_zone_params. The constants are available through sysfs. It is up to the device driver to determine the usage of these values. Signed-off-by: Eduardo Valentin <edubezval@gmail.com> (cherry picked from commit 9d0be7f4810257a9b0fc78fff641f14409f14ab3) Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_core.c4
1 files changed, 4 insertions, 0 deletions
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);
create_s32_tzp_attr(k_i);
create_s32_tzp_attr(k_d);
create_s32_tzp_attr(integral_cutoff);
+create_s32_tzp_attr(slope);
+create_s32_tzp_attr(offset);
#undef create_s32_tzp_attr
static struct device_attribute *dev_tzp_attrs[] = {
@@ -953,6 +955,8 @@ static struct device_attribute *dev_tzp_attrs[] = {
&dev_attr_k_i,
&dev_attr_k_d,
&dev_attr_integral_cutoff,
+ &dev_attr_slope,
+ &dev_attr_offset,
};
static int create_tzp_attrs(struct device *dev)