diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2022-07-19 08:49:39 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2022-07-28 18:29:50 +0300 |
commit | fb55b0129787ec98eace23ddccd429188d318574 (patch) | |
tree | 3fd4dfcb87045b22d8266490c3b7cbe918cb04b5 /drivers | |
parent | 8cf18eea46e24a337c5a095edeed42ca03e97811 (diff) | |
download | linux-fb55b0129787ec98eace23ddccd429188d318574.tar.xz |
thermal/drivers/qcom/temp-alarm: Register thermal zones as hwmon sensors
Register thermal zones as hwmon sensors to let userspace read
temperatures using standard hwmon interface.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Link: https://lore.kernel.org/r/20220719054940.755907-1-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c index 7419e196dbb0..770f82cc9bca 100644 --- a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c +++ b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c @@ -16,6 +16,7 @@ #include <linux/thermal.h> #include "../thermal_core.h" +#include "../thermal_hwmon.h" #define QPNP_TM_REG_DIG_MAJOR 0x01 #define QPNP_TM_REG_TYPE 0x04 @@ -458,6 +459,10 @@ static int qpnp_tm_probe(struct platform_device *pdev) return ret; } + if (devm_thermal_add_hwmon_sysfs(chip->tz_dev)) + dev_warn(&pdev->dev, + "Failed to add hwmon sysfs attributes\n"); + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, qpnp_tm_isr, IRQF_ONESHOT, node->name, chip); if (ret < 0) |