projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62db1e8
)
thermal/drivers/tsens: register thermal zones as hwmon sensors
author
Dmitry Baryshkov
<dmitry.baryshkov@linaro.org>
Sat, 29 Jan 2022 18:07:50 +0000
(21:07 +0300)
committer
Daniel Lezcano
<daniel.lezcano@linaro.org>
Tue, 8 Mar 2022 20:26:08 +0000
(21:26 +0100)
Register thermal zones as hwmon sensors to let userspace read
CPU temperatures using standard hwmon interface.
Acked-by: Amit Kucheria <amitk@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link:
https://lore.kernel.org/r/20220129180750.1882310-1-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/qcom/tsens.c
patch
|
blob
|
history
diff --git
a/drivers/thermal/qcom/tsens.c
b/drivers/thermal/qcom/tsens.c
index 99a8d9f3e03ca9546411baf9d550197ed820bdb3..154d3cb19c88db0522f3e477ded0fea4011d1087 100644
(file)
--- a/
drivers/thermal/qcom/tsens.c
+++ b/
drivers/thermal/qcom/tsens.c
@@
-18,6
+18,7
@@
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/thermal.h>
+#include "../thermal_hwmon.h"
#include "tsens.h"
/**
@@
-1060,6
+1061,10
@@
static int tsens_register(struct tsens_priv *priv)
priv->sensor[i].tzd = tzd;
if (priv->ops->enable)
priv->ops->enable(priv, i);
+
+ if (devm_thermal_add_hwmon_sysfs(tzd))
+ dev_warn(priv->dev,
+ "Failed to add hwmon sysfs attributes\n");
}
/* VER_0 require to set MIN and MAX THRESH