aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorStefan Schaeckeler <schaecsn@gmx.net>2019-12-11 22:17:02 -0800
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-01-27 10:24:32 +0100
commitd27970b82a0f552f70e76fab154855b3192aac23 (patch)
tree40e9192e6b457bc5bee095c89d77a09fdbe96ed1 /drivers/thermal
parentthermal: armada: Clear reset in armadaxp_init (diff)
downloadlinux-dev-d27970b82a0f552f70e76fab154855b3192aac23.tar.xz
linux-dev-d27970b82a0f552f70e76fab154855b3192aac23.zip
thermal: rockchip: Enable hwmon
By default, of-based thermal drivers do not enable hwmon. Explicitly enable hwmon for both, the soc and gpu temperature sensor. Signed-off-by: Stefan Schaeckeler <schaecsn@gmx.net> Tested-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20191212061702.BFE2D6E85603@corona.crabdance.com
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/rockchip_thermal.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 9ed8085bb792..7c1a8bccdcba 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -58,6 +58,8 @@ enum adc_sort_mode {
ADC_INCREMENT,
};
+#include "thermal_hwmon.h"
+
/**
* The max sensors is two in rockchip SoCs.
* Two sensors: CPU and GPU sensor.
@@ -1331,8 +1333,15 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
thermal->chip->control(thermal->regs, true);
- for (i = 0; i < thermal->chip->chn_num; i++)
+ for (i = 0; i < thermal->chip->chn_num; i++) {
rockchip_thermal_toggle_sensor(&thermal->sensors[i], true);
+ thermal->sensors[i].tzd->tzp->no_hwmon = false;
+ error = thermal_add_hwmon_sysfs(thermal->sensors[i].tzd);
+ if (error)
+ dev_warn(&pdev->dev,
+ "failed to register sensor %d with hwmon: %d\n",
+ i, error);
+ }
platform_set_drvdata(pdev, thermal);
@@ -1354,6 +1363,7 @@ static int rockchip_thermal_remove(struct platform_device *pdev)
for (i = 0; i < thermal->chip->chn_num; i++) {
struct rockchip_thermal_sensor *sensor = &thermal->sensors[i];
+ thermal_remove_hwmon_sysfs(sensor->tzd);
rockchip_thermal_toggle_sensor(sensor, false);
}