diff mbox series

[thermal:,thermal/next] thermal/drivers/qcom/spmi-adc-tm5: Register thermal zones as hwmon sensors

Message ID 165902290396.15455.5533342393994258286.tip-bot2@tip-bot2
State New
Headers show
Series [thermal:,thermal/next] thermal/drivers/qcom/spmi-adc-tm5: Register thermal zones as hwmon sensors | expand

Commit Message

thermal-bot for Lad Prabhakar July 28, 2022, 3:41 p.m. UTC
The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     ee35f721477a96cd7a5ee8b0d24507ff4e67fa65
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//ee35f721477a96cd7a5ee8b0d24507ff4e67fa65
Author:        Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
AuthorDate:    Tue, 19 Jul 2022 08:49:40 +03:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 28 Jul 2022 17:29:51 +02:00

thermal/drivers/qcom/spmi-adc-tm5: 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-2-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
index d9c9c97..073943c 100644
--- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
+++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
@@ -20,6 +20,8 @@ 
 #include <linux/thermal.h>
 #include <asm-generic/unaligned.h>
 
+#include "../thermal_hwmon.h"
+
 /*
  * Thermal monitoring block consists of 8 (ADC_TM5_NUM_CHANNELS) channels. Each
  * channel is programmed to use one of ADC channels for voltage comparison.
@@ -687,6 +689,9 @@  static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm)
 			return PTR_ERR(tzd);
 		}
 		adc_tm->channels[i].tzd = tzd;
+		if (devm_thermal_add_hwmon_sysfs(tzd))
+			dev_warn(adc_tm->dev,
+				 "Failed to add hwmon sysfs attributes\n");
 	}
 
 	return 0;