projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8938202
)
thermal/drivers/mediatek/lvts_thermal: Register thermal zones as hwmon sensors
author
Chen-Yu Tsai
<wenst@chromium.org>
Tue, 13 Jun 2023 09:13:16 +0000
(17:13 +0800)
committer
Daniel Lezcano
<daniel.lezcano@linaro.org>
Mon, 26 Jun 2023 10:03:13 +0000
(12:03 +0200)
Register thermal zones as hwmon sensors to let userspace read
temperatures using standard hwmon interface.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link:
https://lore.kernel.org/r/20230613091317.1691247-1-wenst@chromium.org
drivers/thermal/mediatek/lvts_thermal.c
patch
|
blob
|
history
diff --git
a/drivers/thermal/mediatek/lvts_thermal.c
b/drivers/thermal/mediatek/lvts_thermal.c
index d0a3f95b7884ba87d5e8f992884f31fb1c03671c..1e11defe4f35d7d07edee7c2c683de788c4eb62c 100644
(file)
--- a/
drivers/thermal/mediatek/lvts_thermal.c
+++ b/
drivers/thermal/mediatek/lvts_thermal.c
@@
-19,6
+19,8
@@
#include <linux/thermal.h>
#include <dt-bindings/thermal/mediatek,lvts-thermal.h>
+#include "../thermal_hwmon.h"
+
#define LVTS_MONCTL0(__base) (__base + 0x0000)
#define LVTS_MONCTL1(__base) (__base + 0x0004)
#define LVTS_MONCTL2(__base) (__base + 0x0008)
@@
-996,6
+998,9
@@
static int lvts_ctrl_start(struct device *dev, struct lvts_ctrl *lvts_ctrl)
return PTR_ERR(tz);
}
+ if (devm_thermal_add_hwmon_sysfs(dev, tz))
+ dev_warn(dev, "zone %d: Failed to add hwmon sysfs attributes\n", dt_id);
+
/*
* The thermal zone pointer will be needed in the
* interrupt handler, we store it in the sensor