Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors
@ 2022-07-19  5:49 Dmitry Baryshkov
  2022-07-19  5:49 ` [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: " Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2022-07-19  5:49 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Amit Kucheria,
	Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui
  Cc: linux-arm-msm, linux-pm

Register thermal zones as hwmon sensors to let userspace read
temperatures using standard hwmon interface.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 5 +++++
 1 file changed, 5 insertions(+)

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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: register thermal zones as hwmon sensors
  2022-07-19  5:49 [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors Dmitry Baryshkov
@ 2022-07-19  5:49 ` Dmitry Baryshkov
  2022-07-19  6:01   ` Bhupesh Sharma
  2022-07-19  5:59 ` [PATCH 1/2] thermal/drivers/qcom/temp-alarm: " Bhupesh Sharma
  2022-07-20 10:24 ` Daniel Lezcano
  2 siblings, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2022-07-19  5:49 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Amit Kucheria,
	Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui
  Cc: linux-arm-msm, linux-pm

Register thermal zones as hwmon sensors to let userspace read
temperatures using standard hwmon interface.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
index d9c9c975f931..073943cbcc2b 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;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors
  2022-07-19  5:49 [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors Dmitry Baryshkov
  2022-07-19  5:49 ` [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: " Dmitry Baryshkov
@ 2022-07-19  5:59 ` Bhupesh Sharma
  2022-07-20 10:24 ` Daniel Lezcano
  2 siblings, 0 replies; 5+ messages in thread
From: Bhupesh Sharma @ 2022-07-19  5:59 UTC (permalink / raw)
  To: Dmitry Baryshkov, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Amit Kucheria, Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano,
	Zhang Rui
  Cc: linux-arm-msm, linux-pm


On 7/19/22 11:19 AM, Dmitry Baryshkov wrote:
> Register thermal zones as hwmon sensors to let userspace read
> temperatures using standard hwmon interface.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> 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)

LGTM, so:

Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: register thermal zones as hwmon sensors
  2022-07-19  5:49 ` [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: " Dmitry Baryshkov
@ 2022-07-19  6:01   ` Bhupesh Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Bhupesh Sharma @ 2022-07-19  6:01 UTC (permalink / raw)
  To: Dmitry Baryshkov, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Amit Kucheria, Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano,
	Zhang Rui
  Cc: linux-arm-msm, linux-pm


On 7/19/22 11:19 AM, Dmitry Baryshkov wrote:
> Register thermal zones as hwmon sensors to let userspace read
> temperatures using standard hwmon interface.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> index d9c9c975f931..073943cbcc2b 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;

LGTM, so:

Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors
  2022-07-19  5:49 [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors Dmitry Baryshkov
  2022-07-19  5:49 ` [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: " Dmitry Baryshkov
  2022-07-19  5:59 ` [PATCH 1/2] thermal/drivers/qcom/temp-alarm: " Bhupesh Sharma
@ 2022-07-20 10:24 ` Daniel Lezcano
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2022-07-20 10:24 UTC (permalink / raw)
  To: Dmitry Baryshkov, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Amit Kucheria, Thara Gopinath, Rafael J. Wysocki, Zhang Rui
  Cc: linux-arm-msm, linux-pm

On 19/07/2022 07:49, Dmitry Baryshkov wrote:
> Register thermal zones as hwmon sensors to let userspace read
> temperatures using standard hwmon interface.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Both applied, thx

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-20 10:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19  5:49 [PATCH 1/2] thermal/drivers/qcom/temp-alarm: register thermal zones as hwmon sensors Dmitry Baryshkov
2022-07-19  5:49 ` [PATCH 2/2] thermal/drivers/qcom/spmi-adc-tm5: " Dmitry Baryshkov
2022-07-19  6:01   ` Bhupesh Sharma
2022-07-19  5:59 ` [PATCH 1/2] thermal/drivers/qcom/temp-alarm: " Bhupesh Sharma
2022-07-20 10:24 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox