All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: qcom: Add PMIC thermal support for Agatti QRB2210-RB1 platform
@ 2026-10-29 13:47 Raj Aryan
  2026-10-29 14:02 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Raj Aryan @ 2026-10-29 13:47 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Abel Vesa
  Cc: linux-arm-msm, devicetree, linux-kernel, Raj Aryan

Add ADC channels for msm, quiet and xo thermistors along with
their ADC thermal bridge nodes and thermal zones for PMIC
thermal mitigation.

Signed-off-by: Raj Aryan <raj.aryan@oss.qualcomm.com>
---
Changes in v2:
- Moved XO channel into pmic DTSI file. 
- Gave meaningful name to thermal zones.
- Updated the prerequisite/dependency.
- Link to v1: https://lore.kernel.org/r/20260824-pm4125-adc-thermal-v1-1-3b67ef2eccb2@oss.qualcomm.com
---
 arch/arm64/boot/dts/qcom/pm4125.dtsi     |  8 +++
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 83 ++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm4125.dtsi b/arch/arm64/boot/dts/qcom/pm4125.dtsi
index 77de9db8c119..bcf777e465b8 100644
--- a/arch/arm64/boot/dts/qcom/pm4125.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm4125.dtsi
@@ -156,6 +156,14 @@ channel@4b {
 				qcom,pre-scaling = <1 1>;
 			};
 
+			channel@4c {
+				reg = <ADC5_XO_THERM_100K_PU>;
+				label = "xo_therm";
+				qcom,ratiometric;
+				qcom,hw-settle-time = <200>;
+				qcom,pre-scaling = <1 1>;
+			};
+
 			channel@83 {
 				reg = <ADC5_VPH_PWR>;
 				label = "vph_pwr";
diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
index bf6fb12ad990..17bc2b984c75 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
@@ -7,6 +7,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
 #include "agatti.dtsi"
 #include "pm4125.dtsi"
 
@@ -33,6 +34,68 @@ clk40m: can-clk {
 		};
 	};
 
+	msm_therm_bridge: msm-therm-bridge {
+		compatible = "generic-adc-thermal";
+		io-channels = <&pm4125_adc ADC5_AMUX_THM3_100K_PU>;
+		io-channel-names = "sensor-channel";
+		#thermal-sensor-cells = <0>;
+	};
+
+	quiet_therm_bridge: quiet-therm-bridge {
+		compatible = "generic-adc-thermal";
+		io-channels = <&pm4125_adc ADC5_AMUX_THM2_100K_PU>;
+		io-channel-names = "sensor-channel";
+		#thermal-sensor-cells = <0>;
+	};
+
+	xo_therm_bridge: xo-therm-bridge {
+		compatible = "generic-adc-thermal";
+		io-channels = <&pm4125_adc ADC5_XO_THERM_100K_PU>;
+		io-channel-names = "sensor-channel";
+		#thermal-sensor-cells = <0>;
+	};
+
+	thermal-zones {
+		msm-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&msm_therm_bridge>;
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		quiet-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&quiet_therm_bridge>;
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		xo-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&xo_therm_bridge>;
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+	};
+
 	gpio-keys {
 		compatible = "gpio-keys";
 		label = "gpio-keys";
@@ -333,6 +396,26 @@ vreg_l7p: ldo7 {
 	};
 };
 
+&pm4125_adc {
+	status = "okay";
+
+	channel@4e {
+		reg = <ADC5_AMUX_THM2_100K_PU>;
+		label = "quiet_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@4f {
+		reg = <ADC5_AMUX_THM3_100K_PU>;
+		label = "msm_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+};
+
 &i2c2_gpio {
 	clock-frequency = <400000>;
 	status = "okay";

---
base-commit: f1ac44c32cba88ad65dcecd4a279661d14e93651
change-id: 20260812-pm4125-adc-thermal-4c0f713737fa

Best regards,
-- 
Raj Aryan <raj.aryan@oss.qualcomm.com>


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

* Re: [PATCH v2] arm64: dts: qcom: Add PMIC thermal support for Agatti QRB2210-RB1 platform
  2026-10-29 13:47 [PATCH v2] arm64: dts: qcom: Add PMIC thermal support for Agatti QRB2210-RB1 platform Raj Aryan
@ 2026-10-29 14:02 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-29 14:02 UTC (permalink / raw)
  To: Raj Aryan; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] arm64: dts: qcom: missing polling-delay on qrb2210-rb1 ADC thermal zones
--

commit 38fb45777755ec6c570eb782acfb19540ef209d8
Author: Raj Aryan <raj.aryan@oss.qualcomm.com>

arm64: dts: qcom: Add PMIC thermal support for Agatti QRB2210-RB1 platform

This commit adds PM4125 ADC channels, generic-adc-thermal bridge nodes, and
thermal zones for the msm, quiet, and xo thermistors on the Agatti
QRB2210-RB1 platform.

> diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
> index bf6fb12ad9906..17bc2b984c75f 100644
> --- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
> +++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts

[ ... ]

> @@ -33,6 +34,68 @@ clk40m: can-clk {
>  		};
>  	};
>  
> +	msm_therm_bridge: msm-therm-bridge {
> +		compatible = "generic-adc-thermal";
> +		io-channels = <&pm4125_adc ADC5_AMUX_THM3_100K_PU>;
> +		io-channel-names = "sensor-channel";
> +		#thermal-sensor-cells = <0>;
> +	};
> +
> +	quiet_therm_bridge: quiet-therm-bridge {
> +		compatible = "generic-adc-thermal";
> +		io-channels = <&pm4125_adc ADC5_AMUX_THM2_100K_PU>;
> +		io-channel-names = "sensor-channel";
> +		#thermal-sensor-cells = <0>;
> +	};
> +
> +	xo_therm_bridge: xo-therm-bridge {
> +		compatible = "generic-adc-thermal";
> +		io-channels = <&pm4125_adc ADC5_XO_THERM_100K_PU>;
> +		io-channel-names = "sensor-channel";
> +		#thermal-sensor-cells = <0>;
> +	};
> +
> +	thermal-zones {
> +		msm-thermal {
> +			polling-delay-passive = <2000>;
> +			thermal-sensors = <&msm_therm_bridge>;
> +
> +			trips {
> +				active-config0 {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "hot";
> +				};
> +			};
> +		};
> +
> +		quiet-thermal {
> +			polling-delay-passive = <2000>;
> +			thermal-sensors = <&quiet_therm_bridge>;
> +
> +			trips {
> +				active-config0 {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "hot";
> +				};
> +			};
> +		};
> +
> +		xo-thermal {
> +			polling-delay-passive = <2000>;
> +			thermal-sensors = <&xo_therm_bridge>;
> +
> +			trips {
> +				active-config0 {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "hot";
> +				};
> +			};
> +		};
> +	};

[Severity: High]
Will the msm-thermal, quiet-thermal, and xo-thermal zones ever be polled at
runtime without a polling-delay property?

Each zone is bound to a generic-adc-thermal bridge node, and gadc_thermal_ops
in drivers/thermal/thermal-generic-adc.c only provides .get_temp without
.set_trips or interrupt-driven trip support:

drivers/thermal/thermal-generic-adc.c:
static const struct thermal_zone_device_ops gadc_thermal_ops = {
	.get_temp = gadc_thermal_get_temp,
};

When thermal_of_zone_register() calls thermal_of_monitor_init() in
drivers/thermal/thermal_of.c, omitting polling-delay sets *delay to 0
(leaving tz->polling_delay_jiffies = 0):

drivers/thermal/thermal_of.c:thermal_of_monitor_init() {
	...
	ret = of_property_read_u32(np, "polling-delay", delay);
	if (ret == -EINVAL) {
		*delay = 0;
	}
	...
}

In monitor_thermal_zone() in drivers/thermal/thermal_core.c, periodic polling
is only scheduled if tz->passive > 0 or tz->polling_delay_jiffies is
non-zero:

drivers/thermal/thermal_core.c:monitor_thermal_zone() {
	if (tz->passive > 0 && tz->passive_delay_jiffies)
		thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies);
	else if (tz->polling_delay_jiffies)
		thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies);
}

Because these three thermal zones only define trips with type = "hot" and no
passive trips, tz->passive remains 0 and polling-delay-passive is never
activated. As a result, after the initial registration check, tz->poll_queue
is never queued and the active-config0 hot trips at 80000 mC cannot be
detected.

Should these thermal zones define polling-delay (or set polling-delay-passive
to <0> and use polling-delay = <2000>) so the ADC channels are periodically
sampled?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261029-pm4125-adc-thermal-v2-1-8f405d9dac96@oss.qualcomm.com?part=1

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

end of thread, other threads:[~2026-10-29 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 13:47 [PATCH v2] arm64: dts: qcom: Add PMIC thermal support for Agatti QRB2210-RB1 platform Raj Aryan
2026-10-29 14:02 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.