diff options
author | Punit Agrawal <punit.agrawal@arm.com> | 2015-03-03 10:43:04 +0000 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-07-07 09:20:20 -0700 |
commit | 88fe06724b6e88ffbaa2b95ace18f71b0a2ef541 (patch) | |
tree | e2a391ba6ab48b780f92a4c0515671bdfce9da0b /drivers/thermal | |
parent | ed1f8c57c5436dd3eb1eb2b32c0f854b5f32205b (diff) |
thermal: Default OF created trip points to writable
When registering a thermal zone from device tree, default the trip
points to writable. By default, only the root user can change these.
This allows the trip points to be tweaked after the system has
booted.
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
(cherry picked from commit 76af5495a5263a6d5b6d5de0f34d52de1dbf665e)
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/of-thermal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 705b21d01f1c..9e8c614103ef 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -866,6 +866,7 @@ int __init of_parse_thermal_zones(void) for_each_child_of_node(np, child) { struct thermal_zone_device *zone; struct thermal_zone_params *tzp; + int i, mask = 0; u32 prop; /* Check whether child is enabled or not */ @@ -896,8 +897,11 @@ int __init of_parse_thermal_zones(void) if (!of_property_read_u32(child, "sustainable-power", &prop)) tzp->sustainable_power = prop; + for (i = 0; i < tz->ntrips; i++) + mask |= 1 << i; + zone = thermal_zone_device_register(child->name, tz->ntrips, - 0, tz, + mask, tz, ops, tzp, tz->passive_delay, tz->polling_delay); |