Skip to contentSkip to conversation

arm64: dts: qcom: Add PMIC thermal support for Shikra platforms

PATCH Superseded Jishnu Prakash 5 participants 12 messages Jul 15 – Jul 21

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover arm64: dts: qcom: Add PMIC thermal support for Shikra platforms

This series adds the following:
- VADC and temp-alarm devices for PM4125 and temp-alarm device for PM8005 which are used for thermal mitigation on Shikra CQ2390M SoM platform
- ADC thermistor channels and thermal configurations for same on Shikra CQ2390M SoM
- ADC thermistor channels and their thermal configurations on Shikra IQ2390S SoM

---
Changes in v4:
- Collected Reviewed-by tags.
- Updated the pm8005-thermal trips to hot and critical.
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Dropping the polling-delay = <0> property from all thermal-zones as suggested by Konrad.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Move thermal zones to their respective PMIC files (PM4125, PM8005) as suggested by Dmitry Baryshkov
- Rename generic-adc-thermal bridge nodes to therm-bridge suffix (msm-therm-bridge, pa-therm-bridge, quiet-therm-bridge) as suggested by Dmitry Baryshkov
- Update commit messages accordingly
- Link to v1: https://patch.msgid.link/[email protected]

To: Bjorn Andersson <[email protected]>
To: Konrad Dybcio <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Jishnu Prakash (4):
arm64: dts: qcom: pm4125: Add VADC and temp alarm nodes
arm64: dts: qcom: pm8005: Add temp alarm node
arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform
arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform

 arch/arm64/boot/dts/qcom/pm4125.dtsi         | 104 +++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/pm8005.dtsi         |  35 ++++++++
 arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi | 120 +++++++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi | 113 +++++++++++++++++++++++++
 4 files changed, 372 insertions(+)

---
base-commit: cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5
change-id: 20260613-shikra_adc_support-0079650eb76c

Best regards,

Signature · 1 line
Jishnu Prakash <[email protected]>
#1 lore raw

PATCH v4 1/4 arm64: dts: qcom: pm4125: Add VADC and temp alarm nodes

Add VADC node with some channels under it, for voltage and temperature readings. Add temperature alarm node, used for PMIC thermal mitigation.

---
 arch/arm64/boot/dts/qcom/pm4125.dtsi | 104 +++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
arch/arm64/boot/dts/qcom/pm4125.dtsi +104 -0
index 3dc8d667d091..77de9db8c119 100644
@@ -8,6 +8,35 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
+/ {
+	thermal-zones {
+		pm4125-thermal {
+			polling-delay-passive = <100>;
+			thermal-sensors = <&pm4125_tz>;
+
+			trips {
+				pm4125_trip0: trip0 {
+					temperature = <105000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				pm4125_trip1: trip1 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "hot";
+				};
+
+				pm4125_trip2: trip2 {
+					temperature = <155000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pmic@0 {
 		compatible = "qcom,pm2250", "qcom,spmi-pmic";
@@ -65,6 +94,81 @@ pm4125_typec: typec@1500 {
 			status = "disabled";
 		};
 
+		pm4125_tz: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			io-channels = <&pm4125_adc ADC5_DIE_TEMP>;
+			io-channel-names = "thermal";
+			#thermal-sensor-cells = <0>;
+		};
+
+		pm4125_adc: adc@3100 {
+			compatible = "qcom,spmi-adc5";
+			reg = <0x3100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#io-channel-cells = <1>;
+			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+
+			/* Channel nodes */
+			channel@0 {
+				reg = <ADC5_REF_GND>;
+				label = "ref_gnd";
+				qcom,pre-scaling = <1 1>;
+			};
+
+			channel@1 {
+				reg = <ADC5_1P25VREF>;
+				label = "vref_1p25";
+				qcom,pre-scaling = <1 1>;
+			};
+
+			channel@6 {
+				reg = <ADC5_DIE_TEMP>;
+				label = "die_temp";
+				qcom,pre-scaling = <1 1>;
+			};
+
+			channel@7 {
+				reg = <ADC5_USB_IN_I>;
+				label = "usb_in_i_uv";
+				qcom,pre-scaling = <1 1>;
+			};
+
+			channel@8 {
+				reg = <ADC5_USB_IN_V_16>;
+				label = "usb_in_v_div_16";
+				qcom,pre-scaling = <1 16>;
+			};
+
+			channel@9 {
+				reg = <ADC5_CHG_TEMP>;
+				label = "chg_temp";
+				qcom,pre-scaling = <1 1>;
+			};
+
+			channel@4b {
+				reg = <ADC5_BAT_ID_100K_PU>;
+				label = "bat_id";
+				qcom,ratiometric;
+				qcom,hw-settle-time = <200>;
+				qcom,pre-scaling = <1 1>;
+			};
+
+			channel@83 {
+				reg = <ADC5_VPH_PWR>;
+				label = "vph_pwr";
+				qcom,pre-scaling = <1 3>;
+			};
+
+			channel@84 {
+				reg = <ADC5_VBAT_SNS>;
+				label = "vbat_sns";
+				qcom,pre-scaling = <1 3>;
+			};
+		};
+
 		rtc@6000 {
 			compatible = "qcom,pm8941-rtc";
 			reg = <0x6000>, <0x6100>;
Signature · 1 line
2.43.0
#2 lore raw

PATCH v4 2/4 arm64: dts: qcom: pm8005: Add temp alarm node

In reply to Jishnu Prakash

Add temperature alarm node along with thermal zone used for PMIC thermal mitigation.

---
 arch/arm64/boot/dts/qcom/pm8005.dtsi | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/qcom/pm8005.dtsi +35 -0
index 0f0ab2da8305..ce31a8545020 100644
@@ -4,6 +4,34 @@
 #include <dt-bindings/spmi/spmi.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
+/ {
+	thermal-zones {
+		pm8005-thermal {
+			thermal-sensors = <&pm8005_tz>;
+
+			trips {
+				pm8005_trip0: trip0 {
+					temperature = <105000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				pm8005_trip1: trip1 {
+					temperature = <125000>;
+					hysteresis = <0>;
+					type = "hot";
+				};
+
+				pm8005_trip2: trip2 {
+					temperature = <145000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pm8005_lsid0: pmic@4 {
 		compatible = "qcom,pm8005", "qcom,spmi-pmic";
@@ -11,6 +39,13 @@ pm8005_lsid0: pmic@4 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm8005_tz: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};
+
 		pm8005_gpios: gpio@c000 {
 			compatible = "qcom,pm8005-gpio", "qcom,spmi-gpio";
 			reg = <0xc000>;
Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH v4 2/4] arm64: dts: qcom: pm8005: Add temp alarm node

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The critical thermal trip exceeds the hardware maximum limit for a PMIC temp-alarm without an ADC…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The critical thermal trip exceeds the hardware maximum limit for a PMIC temp-alarm without an ADC, causing sudden hardware shutdown and boot warnings. --

--- Patch [2]: [PATCH v4 2/4] arm64: dts: qcom: pm8005: Add temp alarm node --- commit 6fe65cc601cbda83fdc5adbaeaef49d876e5ddff
Author: Jishnu Prakash <[email protected]>

arm64: dts: qcom: pm8005: Add temp alarm node

Add temperature alarm node along with thermal zone used for PMIC thermal mitigation.

Quoted 14 lines
arch/arm64/boot/dts/qcom/pm8005.dtsi +6 -0
index 0f0ab2da83055..ce31a85450200 100644
@@ -4,6 +4,34 @@
 #include <dt-bindings/spmi/spmi.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
+/ {
+	thermal-zones {
+		pm8005-thermal {
+			thermal-sensors = <&pm8005_tz>;
+
+			trips {

[ ... ]

arch/arm64/boot/dts/qcom/pm8005.dtsi line 29

Quoted 5 lines
arch/arm64/boot/dts/qcom/pm8005.dtsi +5 -0
+				pm8005_trip2: trip2 {
+					temperature = <145000>;
+					hysteresis = <0>;
+					type = "critical";
+				};

[Severity: High]
Does this critical trip temperature exceed the hardware maximum limit?

The critical thermal trip is set to 145°C, but the temp alarm node below lacks an io-channels property to specify an ADC.

Without an ADC, the qcom,spmi-temp-alarm driver will clamp the critical trip to the hardware maximum (140°C) and leave the hardware auto-shutdown enabled. This can cause an abrupt power cut at 140°C, bypassing the OS's graceful shutdown procedure that was intended to happen at 145°C, and will also print a warning on every boot.

Quoted 18 lines
arch/arm64/boot/dts/qcom/pm8005.dtsi +11 -0
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pm8005_lsid0: pmic@4 {
 		compatible = "qcom,pm8005", "qcom,spmi-pmic";
@@ -11,6 +39,13 @@ pm8005_lsid0: pmic@4 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm8005_tz: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#4 lore raw

Re: [PATCH v4 2/4] arm64: dts: qcom: pm8005: Add temp alarm node

Quoted 39 lines · On Wed, Jul 15, 2026 at 07:53:21AM +0000, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The critical thermal trip exceeds the hardware maximum limit for a PMIC temp-alarm without an ADC, causing sudden hardware shutdown and boot warnings. --

--- Patch [2]: [PATCH v4 2/4] arm64: dts: qcom: pm8005: Add temp alarm node --- commit 6fe65cc601cbda83fdc5adbaeaef49d876e5ddff
Author: Jishnu Prakash <[email protected]>

arm64: dts: qcom: pm8005: Add temp alarm node

Add temperature alarm node along with thermal zone used for PMIC thermal mitigation.

Quoted 14 lines
arch/arm64/boot/dts/qcom/pm8005.dtsi +6 -0
index 0f0ab2da83055..ce31a85450200 100644
@@ -4,6 +4,34 @@
 #include <dt-bindings/spmi/spmi.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
+/ {
+	thermal-zones {
+		pm8005-thermal {
+			thermal-sensors = <&pm8005_tz>;
+
+			trips {

[ ... ]

arch/arm64/boot/dts/qcom/pm8005.dtsi line 29

Quoted 5 lines
arch/arm64/boot/dts/qcom/pm8005.dtsi +5 -0
+				pm8005_trip2: trip2 {
+					temperature = <145000>;
+					hysteresis = <0>;
+					type = "critical";
+				};

[Severity: High]
Does this critical trip temperature exceed the hardware maximum limit?

Quoted 8 lines

The critical thermal trip is set to 145°C, but the temp alarm node below lacks an io-channels property to specify an ADC.

Without an ADC, the qcom,spmi-temp-alarm driver will clamp the critical trip to the hardware maximum (140°C) and leave the hardware auto-shutdown enabled. This can cause an abrupt power cut at 140°C, bypassing the OS's graceful shutdown procedure that was intended to happen at 145°C, and will also print a warning on every boot.

Thanks for the review. As per IPCAT (TEMP_ALARM_SHUTDOWN_CTL1), the hardware max for pm8005 is 145°C, so the critical trip does not exceed the HW limit.

regards
Rakesh kota

Quoted 24 lines
Quoted 19 lines
arch/arm64/boot/dts/qcom/pm8005.dtsi +11 -0
+			};
+		};
+	};
+};
+
 &spmi_bus {
 	pm8005_lsid0: pmic@4 {
 		compatible = "qcom,pm8005", "qcom,spmi-pmic";
@@ -11,6 +39,13 @@ pm8005_lsid0: pmic@4 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm8005_tz: temp-alarm@2400 {
+			compatible = "qcom,spmi-temp-alarm";
+			reg = <0x2400>;
+			interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			#thermal-sensor-cells = <0>;
+		};

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#6 lore raw

PATCH v4 3/4 arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform

In reply to Jishnu Prakash

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

---
 arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi | 120 +++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +120 -0
index dc3861489f64..139d0ad0b1ab 100644
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 #include "shikra.dtsi"
@@ -27,9 +28,128 @@ key-volume-up {
 			linux,can-disable;
 		};
 	};
+
+	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>;
+	};
+
+	pa_therm_bridge: pa-therm-bridge {
+		compatible = "generic-adc-thermal";
+		io-channels = <&pm4125_adc ADC5_AMUX_THM1_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>;
+	};
+
+	thermal-zones {
+		sys-1-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&pa_therm_bridge>;
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		sys-2-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&quiet_therm_bridge>;
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		sys-3-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&msm_therm_bridge>;
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+	};
+};
+
+&pm4125_adc {
+	pinctrl-0 = <&pm4125_adc_gpio5_default>, <&pm4125_adc_gpio6_default>;
+	pinctrl-names = "default";
+
+	channel@4d {
+		reg = <ADC5_AMUX_THM1_100K_PU>;
+		label = "pa_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	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>;
+	};
+
+	channel@54 {
+		reg = <ADC5_GPIO3_100K_PU>;
+		label = "chgr_skin";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@55 {
+		reg = <ADC5_GPIO4_100K_PU>;
+		label = "gnss_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
 };
 
 &pm4125_gpios {
+	pm4125_adc_gpio5_default: pm4125-adc-gpio5-state {
+		pins = "gpio5";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+
+	pm4125_adc_gpio6_default: pm4125-adc-gpio6-state {
+		pins = "gpio6";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+
 	vol_up_n: vol-up-n-state {
 		pins = "gpio9";
 		function = PMIC_GPIO_FUNC_NORMAL;
Signature · 1 line
2.43.0
#7 lore raw

Re: [PATCH v4 3/4] arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Missing `polling-delay` in thermal zones using `generic-adc-thermal` renders thermal mitigation…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Missing polling-delay in thermal zones using generic-adc-thermal renders thermal mitigation non-functional.
- [Medium] Mismatch between ADC channel definitions and pinctrl configurations causes bogus sensor readings. --

--- Patch [3]: [PATCH v4 3/4] arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform --- commit 0bee643f0fa64e35671928d7a4baae1362c3d049
Author: Jishnu Prakash <[email protected]>

arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform

This commit adds ADC channels for pa, quiet, and msm thermistors along with their ADC thermal bridge nodes. It also configures thermal zones for PMIC thermal mitigation on the Shikra CQ2390M SoM platform.

Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +0 -0
index dc3861489f64d..139d0ad0b1ab2 100644

[ ... ]

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi key-volume-up { · line 56

Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +4 -0
+	thermal-zones {
+		sys-1-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&pa_therm_bridge>;

[Severity: High]
Does this thermal zone require a polling-delay property to function correctly?

The generic-adc-thermal driver relies entirely on software polling by the thermal core since it doesn't support hardware temperature interrupts. Because the trips defined below are only "hot" and not for passive cooling, passive cooling is never engaged.

Without a polling-delay property, the core defaults to 0 and might never schedule the delayed work to read the ADC, effectively disabling thermal mitigation.

Quoted 9 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +9 -0
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};

[ ... ]

Quoted 7 lines

+&pm4125_adc {

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +6 -0
+	pinctrl-0 = <&pm4125_adc_gpio5_default>, <&pm4125_adc_gpio6_default>;
+	pinctrl-names = "default";
+
+	channel@4d {
+		reg = <ADC5_AMUX_THM1_100K_PU>;
+		label = "pa_therm";

[ ... ]

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi key-volume-up { · line 133

Quoted 11 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +11 -0
+	channel@54 {
+		reg = <ADC5_GPIO3_100K_PU>;
+		label = "chgr_skin";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@55 {
+		reg = <ADC5_GPIO4_100K_PU>;
+		label = "gnss_therm";

[Severity: Medium]
Is there a mismatch between the pinctrl configuration and the ADC channels being added here?

The pinctrl property for the ADC node configures gpio5 and gpio6 for ADC use, but these new channels are mapped to ADC5_GPIO3 and ADC5_GPIO4.

Will these channels read from unconfigured pins and produce incorrect temperature readings?

Quoted 5 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +4 -0
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#8 lore raw

Re: [PATCH v4 3/4] arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform

Quoted 30 lines · On 7/15/2026 1:25 PM, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Missing polling-delay in thermal zones using generic-adc-thermal renders thermal mitigation non-functional.
- [Medium] Mismatch between ADC channel definitions and pinctrl configurations causes bogus sensor readings. --

--- Patch [3]: [PATCH v4 3/4] arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform --- commit 0bee643f0fa64e35671928d7a4baae1362c3d049
Author: Jishnu Prakash <[email protected]>

arm64: dts: qcom: Add PMIC thermal support for Shikra CQ2390M SoM platform

This commit adds ADC channels for pa, quiet, and msm thermistors along with their ADC thermal bridge nodes. It also configures thermal zones for PMIC thermal mitigation on the Shikra CQ2390M SoM platform.

Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +0 -0
index dc3861489f64d..139d0ad0b1ab2 100644

[ ... ]

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi key-volume-up { · line 56

Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +4 -0
+	thermal-zones {
+		sys-1-thermal {
+			polling-delay-passive = <2000>;
+			thermal-sensors = <&pa_therm_bridge>;

[Severity: High]
Does this thermal zone require a polling-delay property to function correctly?

Quoted 8 lines

The generic-adc-thermal driver relies entirely on software polling by the thermal core since it doesn't support hardware temperature interrupts. Because the trips defined below are only "hot" and not for passive cooling, passive cooling is never engaged.

Without a polling-delay property, the core defaults to 0 and might never schedule the delayed work to read the ADC, effectively disabling thermal mitigation.

When we enable the cooling-map for this zone, we will add polling-delay as well.

Quoted 51 lines
Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +9 -0
+
+			trips {
+				active-config0 {
+					temperature = <80000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};

[ ... ]

Quoted 7 lines

+&pm4125_adc {

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +6 -0
+	pinctrl-0 = <&pm4125_adc_gpio5_default>, <&pm4125_adc_gpio6_default>;
+	pinctrl-names = "default";
+
+	channel@4d {
+		reg = <ADC5_AMUX_THM1_100K_PU>;
+		label = "pa_therm";

[ ... ]

arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi key-volume-up { · line 133

Quoted 11 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +11 -0
+	channel@54 {
+		reg = <ADC5_GPIO3_100K_PU>;
+		label = "chgr_skin";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@55 {
+		reg = <ADC5_GPIO4_100K_PU>;
+		label = "gnss_therm";

[Severity: Medium]
Is there a mismatch between the pinctrl configuration and the ADC channels being added here?

The pinctrl property for the ADC node configures gpio5 and gpio6 for ADC use, but these new channels are mapped to ADC5_GPIO3 and ADC5_GPIO4.

Will these channels read from unconfigured pins and produce incorrect temperature readings?

Quoted 5 lines
arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi +4 -0
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
  };
#9 lore raw

PATCH v4 4/4 arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform

In reply to Jishnu Prakash

Add ADC channels for system thermistors, used for thermal mitigation. Add ADC_TM nodes for pa/quiet/msm thermistors and also thermal zones for them.

---
 arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi | 113 +++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +113 -0
index 73945bf42112..9ab0b44b00be 100644
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 #include "shikra.dtsi"
@@ -26,9 +27,121 @@ key-volume-up {
 			linux,can-disable;
 		};
 	};
+
+	thermal-zones {
+		sys-1-thermal {
+			thermal-sensors = <&pm8150_adc_tm 0>;
+
+			trips {
+				active-config0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		sys-2-thermal {
+			thermal-sensors = <&pm8150_adc_tm 1>;
+
+			trips {
+				active-config0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		sys-3-thermal {
+			thermal-sensors = <&pm8150_adc_tm 2>;
+
+			trips {
+				active-config0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+	};
+};
+
+&pm8150_adc {
+	pinctrl-0 = <&pm8150_adc_gpio2_default>, <&pm8150_adc_gpio3_default>;
+	pinctrl-names = "default";
+
+	channel@4d {
+		reg = <ADC5_AMUX_THM1_100K_PU>;
+		label = "msm_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@4e {
+		reg = <ADC5_AMUX_THM2_100K_PU>;
+		label = "quiet_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@52 {
+		reg = <ADC5_GPIO1_100K_PU>;
+		label = "gnss_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+
+	channel@55 {
+		reg = <ADC5_GPIO4_100K_PU>;
+		label = "pa_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+};
+
+&pm8150_adc_tm {
+	status = "okay";
+
+	pa-therm@0 {
+		reg = <0>;
+		io-channels = <&pm8150_adc ADC5_GPIO4_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
+
+	quiet-therm@1 {
+		reg = <1>;
+		io-channels = <&pm8150_adc ADC5_AMUX_THM2_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
+
+	msm-therm@2 {
+		reg = <2>;
+		io-channels = <&pm8150_adc ADC5_AMUX_THM1_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
 };
 
 &pm8150_gpios {
+	pm8150_adc_gpio2_default: pm8150-adc-gpio2-state {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+
+	pm8150_adc_gpio3_default: pm8150-adc-gpio3-state {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+
 	vol_up_n: vol-up-n-state {
 		pins = "gpio6";
 		function = PMIC_GPIO_FUNC_NORMAL;
Signature · 1 line
2.43.0
#10 lore raw

Re: [PATCH v4 4/4] arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Mismatched PMIC ADC channels and pinctrl configurations for thermistors. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Mismatched PMIC ADC channels and pinctrl configurations for thermistors. --

--- Patch [4]: [PATCH v4 4/4] arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform --- commit 5e80ce0d3c9c4dc567c3d3d335a508d11f309e50
Author: Jishnu Prakash <[email protected]>

arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform

This commit adds ADC channels for system thermistors used for thermal mitigation. It includes ADC_TM nodes for PA, quiet, and MSM thermistors, along with corresponding thermal zones.

Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +0 -0
index 73945bf42112d..9ab0b44b00bed 100644

[ ... ]

Quoted 4 lines

+&pm8150_adc {

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +3 -0
+	pinctrl-0 = <&pm8150_adc_gpio2_default>, <&pm8150_adc_gpio3_default>;
+	pinctrl-names = "default";
+

[ ... ]

Quoted 6 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +6 -0
+	channel@52 {
+		reg = <ADC5_GPIO1_100K_PU>;
+		label = "gnss_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi key-volume-up { · line 105

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +10 -0
+	};
+
+	channel@55 {
+		reg = <ADC5_GPIO4_100K_PU>;
+		label = "pa_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+};

[Severity: High]
Is there a mismatch between the pinctrl configurations and the ADC channels being used?

The pinctrl-0 property specifies configurations for gpio2 and gpio3, but the ADC channels instruct the hardware to read from ADC5_GPIO1 and ADC5_GPIO4.

Could this result in the gnss_therm and pa_therm thermal zones reading garbage data since they point to unconfigured PMIC GPIOs?

If the unconfigured pins float to a voltage that translates to a temperature above the 125°C trip point, it might cause spurious system shutdowns or unnecessary throttling.

[ ... ]

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi key-volume-up { · line 144

Quoted 13 lines

&pm8150_gpios {

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +12 -0
+	pm8150_adc_gpio2_default: pm8150-adc-gpio2-state {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+
+	pm8150_adc_gpio3_default: pm8150-adc-gpio3-state {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+

[Severity: High]
Because these configurations explicitly target gpio2 and gpio3 instead of the pins actually used by the ADC, does forcing them into high-impedance mode risk breaking or interfering with whatever hardware is actually connected to them?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#11 lore raw

Re: [PATCH v4 4/4] arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform

Quoted 52 lines · On Wed, Jul 15, 2026 at 07:58:39AM +0000, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Mismatched PMIC ADC channels and pinctrl configurations for thermistors. --

--- Patch [4]: [PATCH v4 4/4] arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform --- commit 5e80ce0d3c9c4dc567c3d3d335a508d11f309e50
Author: Jishnu Prakash <[email protected]>

arm64: dts: qcom: Add PMIC thermal support for Shikra IQ2390S SoM platform

This commit adds ADC channels for system thermistors used for thermal mitigation. It includes ADC_TM nodes for PA, quiet, and MSM thermistors, along with corresponding thermal zones.

Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +0 -0
index 73945bf42112d..9ab0b44b00bed 100644

[ ... ]

Quoted 4 lines

+&pm8150_adc {

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +3 -0
+	pinctrl-0 = <&pm8150_adc_gpio2_default>, <&pm8150_adc_gpio3_default>;
+	pinctrl-names = "default";
+

[ ... ]

Quoted 6 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +6 -0
+	channel@52 {
+		reg = <ADC5_GPIO1_100K_PU>;
+		label = "gnss_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi key-volume-up { · line 105

Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +10 -0
+	};
+
+	channel@55 {
+		reg = <ADC5_GPIO4_100K_PU>;
+		label = "pa_therm";
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+	};
+};

[Severity: High]
Is there a mismatch between the pinctrl configurations and the ADC channels being used?

The pinctrl-0 property specifies configurations for gpio2 and gpio3, but the ADC channels instruct the hardware to read from ADC5_GPIO1 and ADC5_GPIO4.

Quoted 7 lines

Could this result in the gnss_therm and pa_therm thermal zones reading garbage data since they point to unconfigured PMIC GPIOs?

If the unconfigured pins float to a voltage that translates to a temperature above the 125°C trip point, it might cause spurious system shutdowns or unnecessary throttling.

The pinctrl state names (gpio2, gpio3) are symbolic labels only and vary between PMICs — they carry no functional meaning to the hardware or driver. The ADC channel selection is determined solely by the reg value (ADC5_GPIO1_100K_PU, ADC5_GPIO4_100K_PU), which directly encodes the AMUX channel the hardware reads from. There is no mismatch — no garbage data or spurious shutdowns are expected.

Quoted 13 lines

[ ... ]

Quoted 11 lines

&pm8150_gpios {

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +10 -0
+	pm8150_adc_gpio2_default: pm8150-adc-gpio2-state {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
+	};
+
+	pm8150_adc_gpio3_default: pm8150-adc-gpio3-state {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		bias-high-impedance;
Quoted 9 lines

arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi

Quoted 2 lines
arch/arm64/boot/dts/qcom/shikra-iqs-som.dtsi +2 -0
+	};
+

[Severity: High]
Because these configurations explicitly target gpio2 and gpio3 instead of the pins actually used by the ADC, does forcing them into high-impedance mode risk breaking or interfering with whatever hardware is actually connected to them?

The pinctrl state names are symbolic labels only and vary between PMICs — the ADC channel is determined solely by the reg value (ADC5_GPIO3_100K_PU, ADC5_GPIO4_100K_PU). No mismatch here.

regards
Rakesh Kota

Quoted 2 lines
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4