Devicetree
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sm7125-samsung: add thermistors
@ 2026-12-04 12:28 Erikas Bitovtas
  2026-12-04 12:44 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Erikas Bitovtas @ 2026-12-04 12:28 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, ~postmarketos/upstreaming, phone-devel,
	Erikas Bitovtas

Add board thermistors from pm6150 and their respective thermal zones to
Samsung Galaxy A52 and A72.

Signed-off-by: Erikas Bitovtas <erikas99876@gmail.com>
---
Add PM6150 ADC thermistors used in Samsung Galaxy A52 and A72. The
conn_therm and chg_skin_therm labeled thermistors are used by the fuel
gauge to determine the temperature of the battery.
---
 .../arm64/boot/dts/qcom/sm7125-samsung-common.dtsi | 124 +++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
index 59ef4921f31e..be8ab2fd8602 100644
--- a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
@@ -149,6 +149,64 @@ rmtfs_mem: memory {
 		};
 	};
 
+	thermal-zones {
+		xo-thermal {
+			polling-delay-passive = <0>;
+
+			thermal-sensors = <&pm6150_adc_tm 0>;
+
+			trips {
+				trip-point0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		chg-skin-thermal {
+			polling-delay-passive = <0>;
+
+			thermal-sensors = <&pm6150_adc_tm 1>;
+
+			trips {
+				trip-point0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		conn-thermal {
+			polling-delay-passive = <0>;
+
+			thermal-sensors = <&pm6150_adc_tm 2>;
+
+			trips {
+				trip-point0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		sdm-skin-thermal {
+			polling-delay-passive = <0>;
+
+			thermal-sensors = <&pm6150_adc_tm 3>;
+
+			trips {
+				trip-point0 {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+	};
+
 	vibrator {
 		compatible = "gpio-vibrator";
 		enable-gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>;
@@ -379,6 +437,72 @@ &dispcc {
 	status = "disabled";
 };
 
+&pm6150_adc {
+	channel@4c {
+		reg = <ADC5_XO_THERM_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+		label = "xo_therm";
+	};
+
+	channel@4d {
+		reg = <ADC5_AMUX_THM1_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+		label = "chg_skin_therm";
+	};
+
+	channel@4f {
+		reg = <ADC5_AMUX_THM3_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+		label = "conn_therm";
+	};
+
+	channel@53 {
+		reg = <ADC5_GPIO2_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time = <200>;
+		qcom,pre-scaling = <1 1>;
+		label = "sdm_skin_therm";
+	};
+};
+
+&pm6150_adc_tm {
+	status = "okay";
+
+	xo-therm@0 {
+		reg = <0>;
+		io-channels = <&pm6150_adc ADC5_XO_THERM_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
+
+	chg-skin-therm@1 {
+		reg = <1>;
+		io-channels = <&pm6150_adc ADC5_AMUX_THM1_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
+
+	conn-therm@2 {
+		reg = <2>;
+		io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
+
+	sdm-skin-therm@3 {
+		reg = <3>;
+		io-channels = <&pm6150_adc ADC5_GPIO2_100K_PU>;
+		qcom,ratiometric;
+		qcom,hw-settle-time-us = <200>;
+	};
+};
+
 &pm6150l_gpios {
 	key_vol_up_default: key-vol-up-default-state {
 		pins = "gpio8";

---
base-commit: 0b5bb03d26a268f2606e3f574b277a1105136328
change-id: 20261204-sm7125-samsung-thermistors-3548e6b83e0a

Best regards,
--  
Erikas Bitovtas <erikas99876@gmail.com>


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

* Re: [PATCH] arm64: dts: qcom: sm7125-samsung: add thermistors
  2026-12-04 12:28 [PATCH] arm64: dts: qcom: sm7125-samsung: add thermistors Erikas Bitovtas
@ 2026-12-04 12:44 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-04 12:44 UTC (permalink / raw)
  To: Erikas Bitovtas; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: qcom: missing high-impedance pinctrl for
  ADC5_GPIO2_100K_PU
--

commit 81475f753ef96794d320afe13c002f6726fe87e1
Author: Erikas Bitovtas <erikas99876@gmail.com>

arm64: dts: qcom: sm7125-samsung: add thermistors

This commit adds PM6150 ADC thermistor channels, ADC thermal monitor nodes,
and thermal zones to the SM7125 Samsung common device tree for the Galaxy
A52 and A72.

> diff --git a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
> index 59ef4921f31e9..be8ab2fd8602e 100644
> --- a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi

[ ... ]

> @@ -379,6 +437,72 @@ &dispcc {
>  	status = "disabled";
>  };
>
> +&pm6150_adc {

[ ... ]

> +	channel@53 {
> +		reg = <ADC5_GPIO2_100K_PU>;
> +		qcom,ratiometric;
> +		qcom,hw-settle-time = <200>;
> +		qcom,pre-scaling = <1 1>;
> +		label = "sdm_skin_therm";
> +	};
> +};

[Severity: Medium]
Does pm6150_adc need a bias-high-impedance pinctrl state for
ADC5_GPIO2_100K_PU?

Unlike the dedicated AMUX thermistor inputs, ADC5_GPIO2_100K_PU routes a
PM6150 GPIO pin into the ADC analog mux.  In pinctrl-spmi-gpio.c,
pmic_gpio_populate() never clears PMIC_GPIO_REG_EN_CTL; the digital pad is
only disabled when pmic_gpio_config_set() applies bias-high-impedance.

Without a bias-high-impedance state in pm6150_gpios bound via pinctrl-0
and pinctrl-names = "default" on pm6150_adc, Linux neither disables the
digital pad nor claims the pin in pinctrl.  If the pin is enabled in
hardware or claimed elsewhere, it can corrupt sdm-skin-thermal readings.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-sm7125-samsung-thermistors-v1-1-df7032c1aed2@gmail.com?part=1

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

end of thread, other threads:[~2026-12-04 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 12:28 [PATCH] arm64: dts: qcom: sm7125-samsung: add thermistors Erikas Bitovtas
2026-12-04 12:44 ` sashiko-bot

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