public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Thermal monitor on PM660
@ 2026-02-10  2:18 Richard Acayan
  2026-02-10  2:18 ` [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 Richard Acayan
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Richard Acayan @ 2026-02-10  2:18 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm
  Cc: Richard Acayan

This series adds the ADC thermal monitor on PM660. It also fixes the
scaling between voltage and temperature for the HC variant.

Richard Acayan (3):
  dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660
  thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC
  arm64: dts: qcom: pm660: add thermal monitor

 .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml        |  1 +
 arch/arm64/boot/dts/qcom/pm660.dtsi                    | 10 ++++++++++
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c               |  2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

-- 
2.53.0


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

* [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660
  2026-02-10  2:18 [PATCH 0/3] Thermal monitor on PM660 Richard Acayan
@ 2026-02-10  2:18 ` Richard Acayan
  2026-02-10  9:56   ` Konrad Dybcio
  2026-02-11  6:44   ` Krzysztof Kozlowski
  2026-02-10  2:18 ` [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC Richard Acayan
  2026-02-10  2:18 ` [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor Richard Acayan
  2 siblings, 2 replies; 14+ messages in thread
From: Richard Acayan @ 2026-02-10  2:18 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm
  Cc: Richard Acayan

While newer PMICs are compatible with PMIC5 drivers, the PM8998 and
PM660 are both PMIC4. The PM8998 is allowed to use the PMIC4 thermal
monitor. Allow it for PM660 as well.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
---
 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
index 65c80e3b4500..d2fce7f669b2 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -221,6 +221,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - qcom,pm660
               - qcom,pm8998
     then:
       patternProperties:
-- 
2.53.0


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

* [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC
  2026-02-10  2:18 [PATCH 0/3] Thermal monitor on PM660 Richard Acayan
  2026-02-10  2:18 ` [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 Richard Acayan
@ 2026-02-10  2:18 ` Richard Acayan
  2026-02-10  9:58   ` Konrad Dybcio
  2026-02-11  2:09   ` Dmitry Baryshkov
  2026-02-10  2:18 ` [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor Richard Acayan
  2 siblings, 2 replies; 14+ messages in thread
From: Richard Acayan @ 2026-02-10  2:18 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm
  Cc: Richard Acayan

When support was added for the HC variant, the full_scale_code_volt
value was copied from the tm5 variant. From the downstream kernel, the
scaling value is 0x70e4 on PMI632 (tm5 variant), but it is 0x4000 on
PM660 and PM8998 (HC variant). Correct the ADC code to voltage
scaling factor for the HC variant.

Fixes: f6c83676c6097 ("thermal/drivers/qcom/spmi-adc-tm5: Add support for HC variant")
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
index d7f2e6ca92c2..6ccd02fe0e4c 100644
--- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
+++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
@@ -909,7 +909,7 @@ static const struct adc_tm5_data adc_tm5_data_pmic = {
 };
 
 static const struct adc_tm5_data adc_tm_hc_data_pmic = {
-	.full_scale_code_volt = 0x70e4,
+	.full_scale_code_volt = 0x4000,
 	.decimation = (unsigned int []) { 256, 512, 1024 },
 	.hw_settle = (unsigned int []) { 0, 100, 200, 300, 400, 500, 600, 700,
 					 1000, 2000, 4000, 6000, 8000, 10000 },
-- 
2.53.0


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

* [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-10  2:18 [PATCH 0/3] Thermal monitor on PM660 Richard Acayan
  2026-02-10  2:18 ` [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 Richard Acayan
  2026-02-10  2:18 ` [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC Richard Acayan
@ 2026-02-10  2:18 ` Richard Acayan
  2026-02-10  9:59   ` Konrad Dybcio
  2 siblings, 1 reply; 14+ messages in thread
From: Richard Acayan @ 2026-02-10  2:18 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm
  Cc: Richard Acayan

The thermal monitor is used to monitor arbitrary ADC-based thermal
sensors. It is suitable for use in thermal zones. Add support for it in
PM660.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
---
 arch/arm64/boot/dts/qcom/pm660.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
index 156b2ddff0dc..7cedf6980b34 100644
--- a/arch/arm64/boot/dts/qcom/pm660.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
@@ -197,6 +197,16 @@ channel@85 {
 			};
 		};
 
+		pm660_adc_tm: adc-tm@3400 {
+			compatible = "qcom,spmi-adc-tm-hc";
+			reg = <0x3400>;
+			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
+			#thermal-sensor-cells = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		pm660_rradc: adc@4500 {
 			compatible = "qcom,pm660-rradc";
 			reg = <0x4500>;
-- 
2.53.0


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

* Re: [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660
  2026-02-10  2:18 ` [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 Richard Acayan
@ 2026-02-10  9:56   ` Konrad Dybcio
  2026-02-11  6:44   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2026-02-10  9:56 UTC (permalink / raw)
  To: Richard Acayan, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio, Amit Kucheria,
	Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Stephen Boyd, Dmitry Baryshkov, linux-arm-msm,
	devicetree, linux-pm

On 2/10/26 3:18 AM, Richard Acayan wrote:
> While newer PMICs are compatible with PMIC5 drivers, the PM8998 and
> PM660 are both PMIC4. The PM8998 is allowed to use the PMIC4 thermal
> monitor. Allow it for PM660 as well.
> 
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC
  2026-02-10  2:18 ` [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC Richard Acayan
@ 2026-02-10  9:58   ` Konrad Dybcio
  2026-02-11  2:09   ` Dmitry Baryshkov
  1 sibling, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2026-02-10  9:58 UTC (permalink / raw)
  To: Richard Acayan, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio, Amit Kucheria,
	Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Stephen Boyd, Dmitry Baryshkov, linux-arm-msm,
	devicetree, linux-pm

On 2/10/26 3:18 AM, Richard Acayan wrote:
> When support was added for the HC variant, the full_scale_code_volt
> value was copied from the tm5 variant. From the downstream kernel, the
> scaling value is 0x70e4 on PMI632 (tm5 variant), but it is 0x4000 on
> PM660 and PM8998 (HC variant). Correct the ADC code to voltage
> scaling factor for the HC variant.
> 
> Fixes: f6c83676c6097 ("thermal/drivers/qcom/spmi-adc-tm5: Add support for HC variant")
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---

nice catch!

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-10  2:18 ` [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor Richard Acayan
@ 2026-02-10  9:59   ` Konrad Dybcio
  2026-02-11  0:29     ` Richard Acayan
  2026-03-03  2:25     ` Richard Acayan
  0 siblings, 2 replies; 14+ messages in thread
From: Konrad Dybcio @ 2026-02-10  9:59 UTC (permalink / raw)
  To: Richard Acayan, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bjorn Andersson, Konrad Dybcio, Amit Kucheria,
	Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Stephen Boyd, Dmitry Baryshkov, linux-arm-msm,
	devicetree, linux-pm

On 2/10/26 3:18 AM, Richard Acayan wrote:
> The thermal monitor is used to monitor arbitrary ADC-based thermal
> sensors. It is suitable for use in thermal zones. Add support for it in
> PM660.
> 
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---
>  arch/arm64/boot/dts/qcom/pm660.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
> index 156b2ddff0dc..7cedf6980b34 100644
> --- a/arch/arm64/boot/dts/qcom/pm660.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
> @@ -197,6 +197,16 @@ channel@85 {
>  			};
>  		};
>  
> +		pm660_adc_tm: adc-tm@3400 {
> +			compatible = "qcom,spmi-adc-tm-hc";
> +			reg = <0x3400>;
> +			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
> +			#thermal-sensor-cells = <1>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			status = "disabled";

Can we enable it by default?

Konrad

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

* Re: [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-10  9:59   ` Konrad Dybcio
@ 2026-02-11  0:29     ` Richard Acayan
  2026-02-12 12:15       ` Konrad Dybcio
  2026-03-03  2:25     ` Richard Acayan
  1 sibling, 1 reply; 14+ messages in thread
From: Richard Acayan @ 2026-02-11  0:29 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On Tue, Feb 10, 2026 at 10:59:20AM +0100, Konrad Dybcio wrote:
> On 2/10/26 3:18 AM, Richard Acayan wrote:
(snip)
> > +		pm660_adc_tm: adc-tm@3400 {
> > +			compatible = "qcom,spmi-adc-tm-hc";
> > +			reg = <0x3400>;
> > +			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
> > +			#thermal-sensor-cells = <1>;
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +			status = "disabled";
> 
> Can we enable it by default?

No, the thermal monitor fails to probe if it doesn't have any channels:

	[   17.728926] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: error -EINVAL: get dt data failed
	[   17.728945] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: probe with driver qcom-spmi-adc-tm5 failed with error -22

Triggered by https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/thermal/qcom/qcom-spmi-adc-tm5.c?h=next-20260209#n945

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

* Re: [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC
  2026-02-10  2:18 ` [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC Richard Acayan
  2026-02-10  9:58   ` Konrad Dybcio
@ 2026-02-11  2:09   ` Dmitry Baryshkov
  1 sibling, 0 replies; 14+ messages in thread
From: Dmitry Baryshkov @ 2026-02-11  2:09 UTC (permalink / raw)
  To: Richard Acayan
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On Mon, Feb 09, 2026 at 09:18:18PM -0500, Richard Acayan wrote:
> When support was added for the HC variant, the full_scale_code_volt
> value was copied from the tm5 variant. From the downstream kernel, the
> scaling value is 0x70e4 on PMI632 (tm5 variant), but it is 0x4000 on
> PM660 and PM8998 (HC variant). Correct the ADC code to voltage
> scaling factor for the HC variant.
> 
> Fixes: f6c83676c6097 ("thermal/drivers/qcom/spmi-adc-tm5: Add support for HC variant")
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---
>  drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

> 
-- 
With best wishes
Dmitry

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

* Re: [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660
  2026-02-10  2:18 ` [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 Richard Acayan
  2026-02-10  9:56   ` Konrad Dybcio
@ 2026-02-11  6:44   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-11  6:44 UTC (permalink / raw)
  To: Richard Acayan
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On Mon, Feb 09, 2026 at 09:18:17PM -0500, Richard Acayan wrote:
> While newer PMICs are compatible with PMIC5 drivers, the PM8998 and
> PM660 are both PMIC4. The PM8998 is allowed to use the PMIC4 thermal
> monitor. Allow it for PM660 as well.
> 
> Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> ---
>  Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof


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

* Re: [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-11  0:29     ` Richard Acayan
@ 2026-02-12 12:15       ` Konrad Dybcio
  2026-02-12 18:27         ` Richard Acayan
  0 siblings, 1 reply; 14+ messages in thread
From: Konrad Dybcio @ 2026-02-12 12:15 UTC (permalink / raw)
  To: Richard Acayan
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On 2/11/26 1:29 AM, Richard Acayan wrote:
> On Tue, Feb 10, 2026 at 10:59:20AM +0100, Konrad Dybcio wrote:
>> On 2/10/26 3:18 AM, Richard Acayan wrote:
> (snip)
>>> +		pm660_adc_tm: adc-tm@3400 {
>>> +			compatible = "qcom,spmi-adc-tm-hc";
>>> +			reg = <0x3400>;
>>> +			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
>>> +			#thermal-sensor-cells = <1>;
>>> +			#address-cells = <1>;
>>> +			#size-cells = <0>;
>>> +			status = "disabled";
>>
>> Can we enable it by default?
> 
> No, the thermal monitor fails to probe if it doesn't have any channels:
> 
> 	[   17.728926] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: error -EINVAL: get dt data failed
> 	[   17.728945] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: probe with driver qcom-spmi-adc-tm5 failed with error -22
> 
> Triggered by https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/thermal/qcom/qcom-spmi-adc-tm5.c?h=next-20260209#n945

You can define the following ones in the common dt:

REF_GND
1.25VREF
VREF_VADC
VPH_PWR
VCOIN
DIE_TEMP
ANA_IN

as they're (almost or) always going to be present

Konrad


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

* Re: [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-12 12:15       ` Konrad Dybcio
@ 2026-02-12 18:27         ` Richard Acayan
  2026-02-16 11:58           ` Konrad Dybcio
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Acayan @ 2026-02-12 18:27 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On Thu, Feb 12, 2026 at 01:15:04PM +0100, Konrad Dybcio wrote:
> On 2/11/26 1:29 AM, Richard Acayan wrote:
> > On Tue, Feb 10, 2026 at 10:59:20AM +0100, Konrad Dybcio wrote:
> >> On 2/10/26 3:18 AM, Richard Acayan wrote:
> > (snip)
> >>> +		pm660_adc_tm: adc-tm@3400 {
> >>> +			compatible = "qcom,spmi-adc-tm-hc";
> >>> +			reg = <0x3400>;
> >>> +			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
> >>> +			#thermal-sensor-cells = <1>;
> >>> +			#address-cells = <1>;
> >>> +			#size-cells = <0>;
> >>> +			status = "disabled";
> >>
> >> Can we enable it by default?
> > 
> > No, the thermal monitor fails to probe if it doesn't have any channels:
> > 
> > 	[   17.728926] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: error -EINVAL: get dt data failed
> > 	[   17.728945] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: probe with driver qcom-spmi-adc-tm5 failed with error -22
> > 
> > Triggered by https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/thermal/qcom/qcom-spmi-adc-tm5.c?h=next-20260209#n945
> 
> You can define the following ones in the common dt:
> 
> REF_GND

Is there any (likely passive, if any) cooling device that should be
activated when this goes above or below a certain reading?

> 1.25VREF
> VREF_VADC
> VPH_PWR
> VCOIN
> DIE_TEMP

Maybe this temperature can be included, but I don't see any other
PMIC devicetree that has this channel ready-to-go.

> ANA_IN

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

* Re: [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-12 18:27         ` Richard Acayan
@ 2026-02-16 11:58           ` Konrad Dybcio
  0 siblings, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2026-02-16 11:58 UTC (permalink / raw)
  To: Richard Acayan
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On 2/12/26 7:27 PM, Richard Acayan wrote:
> On Thu, Feb 12, 2026 at 01:15:04PM +0100, Konrad Dybcio wrote:
>> On 2/11/26 1:29 AM, Richard Acayan wrote:
>>> On Tue, Feb 10, 2026 at 10:59:20AM +0100, Konrad Dybcio wrote:
>>>> On 2/10/26 3:18 AM, Richard Acayan wrote:
>>> (snip)
>>>>> +		pm660_adc_tm: adc-tm@3400 {
>>>>> +			compatible = "qcom,spmi-adc-tm-hc";
>>>>> +			reg = <0x3400>;
>>>>> +			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
>>>>> +			#thermal-sensor-cells = <1>;
>>>>> +			#address-cells = <1>;
>>>>> +			#size-cells = <0>;
>>>>> +			status = "disabled";
>>>>
>>>> Can we enable it by default?
>>>
>>> No, the thermal monitor fails to probe if it doesn't have any channels:
>>>
>>> 	[   17.728926] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: error -EINVAL: get dt data failed
>>> 	[   17.728945] qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: probe with driver qcom-spmi-adc-tm5 failed with error -22
>>>
>>> Triggered by https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/thermal/qcom/qcom-spmi-adc-tm5.c?h=next-20260209#n945
>>
>> You can define the following ones in the common dt:
>>
>> REF_GND
> 
> Is there any (likely passive, if any) cooling device that should be
> activated when this goes above or below a certain reading?

I don't think so

> 
>> 1.25VREF
>> VREF_VADC
>> VPH_PWR
>> VCOIN
>> DIE_TEMP
> 
> Maybe this temperature can be included, but I don't see any other
> PMIC devicetree that has this channel ready-to-go.

This channel is internally connected and handled by temp_alarm, I think
describing it via the ADC just lets one peek into the raw values

Konrad

> 
>> ANA_IN

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

* Re: [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor
  2026-02-10  9:59   ` Konrad Dybcio
  2026-02-11  0:29     ` Richard Acayan
@ 2026-03-03  2:25     ` Richard Acayan
  1 sibling, 0 replies; 14+ messages in thread
From: Richard Acayan @ 2026-03-03  2:25 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Amit Kucheria, Thara Gopinath,
	Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Stephen Boyd, Dmitry Baryshkov, linux-arm-msm, devicetree,
	linux-pm

On Tue, Feb 10, 2026 at 10:59:20AM +0100, Konrad Dybcio wrote:
> On 2/10/26 3:18 AM, Richard Acayan wrote:
> > The thermal monitor is used to monitor arbitrary ADC-based thermal
> > sensors. It is suitable for use in thermal zones. Add support for it in
> > PM660.
> > 
> > Signed-off-by: Richard Acayan <mailingradian@gmail.com>
> > ---
> >  arch/arm64/boot/dts/qcom/pm660.dtsi | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
> > index 156b2ddff0dc..7cedf6980b34 100644
> > --- a/arch/arm64/boot/dts/qcom/pm660.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
> > @@ -197,6 +197,16 @@ channel@85 {
> >  			};
> >  		};
> >  
> > +		pm660_adc_tm: adc-tm@3400 {
> > +			compatible = "qcom,spmi-adc-tm-hc";
> > +			reg = <0x3400>;
> > +			interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
> > +			#thermal-sensor-cells = <1>;
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +			status = "disabled";
> 
> Can we enable it by default?

This is for the ADC thermal monitor, and not the ADC itself. I don't see
the need to allocate channels just so this can be enabled by default,
since the thermal monitor's purpose is mostly to send interrupts when
the ADC values go above or below a certain threshold.

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

end of thread, other threads:[~2026-03-03  2:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10  2:18 [PATCH 0/3] Thermal monitor on PM660 Richard Acayan
2026-02-10  2:18 ` [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 Richard Acayan
2026-02-10  9:56   ` Konrad Dybcio
2026-02-11  6:44   ` Krzysztof Kozlowski
2026-02-10  2:18 ` [PATCH 2/3] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling for HC Richard Acayan
2026-02-10  9:58   ` Konrad Dybcio
2026-02-11  2:09   ` Dmitry Baryshkov
2026-02-10  2:18 ` [PATCH 3/3] arm64: dts: qcom: pm660: add thermal monitor Richard Acayan
2026-02-10  9:59   ` Konrad Dybcio
2026-02-11  0:29     ` Richard Acayan
2026-02-12 12:15       ` Konrad Dybcio
2026-02-12 18:27         ` Richard Acayan
2026-02-16 11:58           ` Konrad Dybcio
2026-03-03  2:25     ` Richard Acayan

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