Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal: of: Enable thermal_zoneX when sensor is correctly added

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

Tested-by: Javi Merino <javi.merino@arm.com>
Reported-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by

Lukasz Majewski and committed by
Eduardo Valentin
528012c1 b97f880c

+3
+3
drivers/thermal/of-thermal.c
··· 497 497 if (sensor_specs.np == sensor_np && id == sensor_id) { 498 498 tzd = thermal_zone_of_add_sensor(child, sensor_np, 499 499 data, ops); 500 + if (!IS_ERR(tzd)) 501 + tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED); 502 + 500 503 of_node_put(sensor_specs.np); 501 504 of_node_put(child); 502 505 goto exit;