mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
thermal/drivers/tsens: register thermal zones as hwmon sensors
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>
This commit is contained in:
parent
62db1e8e97
commit
8556e19d49
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user