linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: Default OF created trip points to writable
@ 2015-02-10 18:21 Punit Agrawal
  2015-02-16 15:14 ` Eduardo Valentin
  0 siblings, 1 reply; 10+ messages in thread
From: Punit Agrawal @ 2015-02-10 18:21 UTC (permalink / raw)
  To: edubezval; +Cc: rui.zhang, linux-pm, Punit Agrawal

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.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
---
Hi Eduardo,

We've been using this patch internally and haven't run into any
 issues. Without these changes there is no way to change trip points
 from a running system.

Comments welcome.

Cheers,
Punit

 drivers/thermal/of-thermal.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 668fb1b..b7ad5c0 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -865,6 +865,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;
 
 		/* Check whether child is enabled or not */
 		if (!of_device_is_available(child))
@@ -891,8 +892,11 @@ int __init of_parse_thermal_zones(void)
 		/* No hwmon because there might be hwmon drivers registering */
 		tzp->no_hwmon = true;
 
+		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);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-02-26 10:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-10 18:21 [PATCH] thermal: Default OF created trip points to writable Punit Agrawal
2015-02-16 15:14 ` Eduardo Valentin
2015-02-17 11:12   ` Punit Agrawal
2015-02-24 19:52     ` Eduardo Valentin
2015-02-25 12:25       ` Punit Agrawal
2015-02-25 18:47         ` Eduardo Valentin
2015-02-26 10:16           ` Punit Agrawal
2015-02-25 16:24       ` Srinivas Pandruvada
2015-02-25 18:52         ` Eduardo Valentin
2015-02-26  2:36           ` Srinivas Pandruvada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).