diff mbox

[2/2] thermal: of: Enable thermal_zoneX when sensor is correctly added

Message ID 1421667844-13627-3-git-send-email-l.majewski@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lukasz Majewski Jan. 19, 2015, 11:44 a.m. UTC
Up till now the thermal_zone mode was by default "disabled". With this
patch the default behavior was changed to "enable".

One can read the mode at:
/sys/class/thermal/thermal_zone0/mode

Reported-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
---
 drivers/thermal/of-thermal.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Javi Merino Jan. 20, 2015, 6:26 p.m. UTC | #1
On Mon, Jan 19, 2015 at 11:44:04AM +0000, Lukasz Majewski wrote:
> Up till now the thermal_zone mode was by default "disabled". With this
> patch the default behavior was changed to "enable".
> 
> One can read the mode at:
> /sys/class/thermal/thermal_zone0/mode
> 
> Reported-by: Abhilash Kesavan <a.kesavan@samsung.com>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>

We are facing the same issue with Juno.  When registering thermal
zones from device tree they were coming up disabled.  I've tested it
on my Juno board and it fixes it.

Tested-by: Javi Merino <javi.merino@arm.com>

> ---
>  drivers/thermal/of-thermal.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index d717f3d..668fb1b 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -497,6 +497,9 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
>  		if (sensor_specs.np == sensor_np && id == sensor_id) {
>  			tzd = thermal_zone_of_add_sensor(child, sensor_np,
>  							 data, ops);
> +			if (!IS_ERR(tzd))
> +				tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED);
> +
>  			of_node_put(sensor_specs.np);
>  			of_node_put(child);
>  			goto exit;
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index d717f3d..668fb1b 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -497,6 +497,9 @@  thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
 		if (sensor_specs.np == sensor_np && id == sensor_id) {
 			tzd = thermal_zone_of_add_sensor(child, sensor_np,
 							 data, ops);
+			if (!IS_ERR(tzd))
+				tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED);
+
 			of_node_put(sensor_specs.np);
 			of_node_put(child);
 			goto exit;