* [PATCH v3] arm64: dts: qcom: sm7125-samsung: add fuel gauge
@ 2026-12-04 8:21 Erikas Bitovtas
2026-12-04 8:33 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Erikas Bitovtas @ 2026-12-04 8:21 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
Samsung Galaxy A52 and A72 use Silicon Mitus SM5714 interface PMIC,
which includes a fuel gauge as one of its features. Enable GPI DMA and
I2C controllers, add battery bindings and enable the interface PMIC fuel
gauge.
Signed-off-by: Erikas Bitovtas <erikas99876@gmail.com>
---
Samsung Galaxy A52 and A72 use Silicon Mitus SM5714 interface PMIC which
includes a fuel gauge to measure battery state of charge. Add device
tree bindings for their lithium-ion 4,500 and 5,000 mAh batteries
respectfully, enable GPI DMA and I2C controllers and enable the SM5714
fuel gauge.
Tested on Samsung Galaxy A72. The driver reports the same SoC and energy
as on Android.
This patch depends on a currently unmerged series for SC7180 GPI DMA:
https://lore.kernel.org/all/20261112-sc7180-gpi-dma-v1-0-2a8eceb49563@gmail.com/
---
Changes in v3:
- Removed voltage-min/max properties for now. Need further
investigation (sashiko).
- Corrected trickle-charge-current-microamp to use
charge-term-current-microamp instead (sashiko).
- Link to v2: https://patch.msgid.link/20261202-sm7125-samsung-fuelgauge-v2-1-4a8f2977d50f@gmail.com
Changes in v2:
- Included additional properties for batteries. The values were taken
from vendor code (https://github.com/LineageOS/android_kernel_samsung_sm7125/blob/lineage-24.0/arch/arm64/boot/dts/samsung/drivers/)
as follows:
- battery,low_temp_topoff -> trickle-charge-current-microamp
- fuelgauge,sw_v_empty_voltage -> voltage-min-design-microvolt
- battery,full_condition_vcell -> voltage-max-design-microvolt
- battery,recharge_condition_vcell -> re-charge-voltage-microvolt
- battery,max_charging_current -> constant-charge-current-max-microamp
- Link to v1: https://patch.msgid.link/20261123-sm7125-samsung-fuelgauge-v1-1-edcdef00a6ef@gmail.com
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: devicetree@vger.kernel.org
---
arch/arm64/boot/dts/qcom/sm7125-samsung-a52q.dts | 6 ++++
arch/arm64/boot/dts/qcom/sm7125-samsung-a72q.dts | 6 ++++
.../arm64/boot/dts/qcom/sm7125-samsung-common.dtsi | 39 ++++++++++++++++++++++
3 files changed, 51 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm7125-samsung-a52q.dts b/arch/arm64/boot/dts/qcom/sm7125-samsung-a52q.dts
index ecba5be8164e..092dedcbc5ef 100644
--- a/arch/arm64/boot/dts/qcom/sm7125-samsung-a52q.dts
+++ b/arch/arm64/boot/dts/qcom/sm7125-samsung-a52q.dts
@@ -15,6 +15,12 @@ / {
qcom,board-id = <0x22 0x6>;
};
+&battery {
+ charge-full-design-microamp-hours = <4500000>;
+ charge-term-current-microamp = <225000>;
+ constant-charge-current-max-microamp = <2800000>;
+};
+
&rmtfs_mem {
reg = <0x0 0xf4f00000 0x0 0x202000>;
};
diff --git a/arch/arm64/boot/dts/qcom/sm7125-samsung-a72q.dts b/arch/arm64/boot/dts/qcom/sm7125-samsung-a72q.dts
index f18d03de1585..64527ea0a4c3 100644
--- a/arch/arm64/boot/dts/qcom/sm7125-samsung-a72q.dts
+++ b/arch/arm64/boot/dts/qcom/sm7125-samsung-a72q.dts
@@ -15,6 +15,12 @@ / {
qcom,board-id = <0x22 0x5>;
};
+&battery {
+ charge-full-design-microamp-hours = <5000000>;
+ charge-term-current-microamp = <250000>;
+ constant-charge-current-max-microamp = <2700000>;
+};
+
&rmtfs_mem {
reg = <0x0 0xf3700000 0x0 0x202000>;
};
diff --git a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
index 59ef4921f31e..d1abb5eff1b3 100644
--- a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
@@ -22,6 +22,12 @@ / {
qcom,msm-id = <QCOM_ID_SM7125 0x0>;
+ battery: battery {
+ compatible = "simple-battery";
+ device-chemistry = "lithium-ion";
+ re-charge-voltage-microvolt = <4310000>;
+ };
+
chosen {
#address-cells = <2>;
#size-cells = <2>;
@@ -379,6 +385,25 @@ &dispcc {
status = "disabled";
};
+&gpi_dma0 {
+ status = "okay";
+};
+
+&gpi_dma1 {
+ status = "okay";
+};
+
+&i2c4 {
+ status = "okay";
+
+ fuel-gauge@71 {
+ compatible = "siliconmitus,sm5714-fuel-gauge";
+ reg = <0x71>;
+
+ monitored-battery = <&battery>;
+ };
+};
+
&pm6150l_gpios {
key_vol_up_default: key-vol-up-default-state {
pins = "gpio8";
@@ -421,6 +446,20 @@ &qfprom {
vcc-supply = <&vreg_l11a_1p8>;
};
+/* External pull-up */
+&qup_i2c4_default {
+ drive-strength = <2>;
+ bias-disable;
+};
+
+&qupv3_id_0 {
+ status = "okay";
+};
+
+&qupv3_id_1 {
+ status = "okay";
+};
+
&sdhc_2 {
vmmc-supply = <&vreg_l9c_2p95>;
vqmmc-supply = <&vreg_l6c_3p0>;
---
base-commit: 8f34aca9d0ee8201cd45a58b51a476d3a40916b0
change-id: 20261121-sm7125-samsung-fuelgauge-a57c6a0c916c
prerequisite-change-id: 20261111-sc7180-gpi-dma-a77963d9e1cc:v1
prerequisite-patch-id: 70dc64e33232cae6744eeb11e8f53e099eb49c1f
prerequisite-patch-id: 1ba00e1d0ffd80fa49f64e8b627ab07ce9478e74
Best regards,
--
Erikas Bitovtas <erikas99876@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] arm64: dts: qcom: sm7125-samsung: add fuel gauge
2026-12-04 8:21 [PATCH v3] arm64: dts: qcom: sm7125-samsung: add fuel gauge Erikas Bitovtas
@ 2026-12-04 8:33 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-04 8:33 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:
- [Low] arm64: dts: qcom: sm7125-samsung: unused gpi_dma1 and qupv3_id_1
enabled
--
commit ebee6ca2992e8f82a8e0bf30c5df3d165e9a0154
Author: Erikas Bitovtas <erikas99876@gmail.com>
arm64: dts: qcom: sm7125-samsung: add fuel gauge
This commit adds simple-battery nodes and enables the Silicon Mitus SM5714
fuel gauge along with GPI DMA and QUPv3 I2C controllers for Samsung 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..d1abb5eff1b3a 100644
> --- a/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm7125-samsung-common.dtsi
[ ... ]
> @@ -379,6 +385,25 @@ &dispcc {
> status = "disabled";
> };
>
> +&gpi_dma0 {
> + status = "okay";
> +};
> +
> +&gpi_dma1 {
> + status = "okay";
> +};
> +
> +&i2c4 {
> + status = "okay";
[ ... ]
> @@ -421,6 +446,20 @@ &qfprom {
> vcc-supply = <&vreg_l11a_1p8>;
> };
>
> +/* External pull-up */
> +&qup_i2c4_default {
> + drive-strength = <2>;
> + bias-disable;
> +};
> +
> +&qupv3_id_0 {
> + status = "okay";
> +};
> +
> +&qupv3_id_1 {
> + status = "okay";
> +};
[Severity: Low]
Should gpi_dma1 and qupv3_id_1 stay disabled until a peripheral under them
is enabled?
In sc7180.dtsi, i2c4 is a child of qupv3_id_0 and references only gpi_dma0,
while every child serial engine under qupv3_id_1 remains disabled. Enabling
both unused controllers probes them and registers unused DMA channels with
the default dma-channel-mask.
In addition, tlmm reserves GPIOs 59-62 (spi6 under qupv3_id_1) for a
TrustZone-owned fingerprint sensor, so enabling gpi_dma1 without an active
consumer or verified dma-channel-mask is premature.
The commit message also refers to enabling I2C controllers in the plural
when only i2c4 is enabled.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-sm7125-samsung-fuelgauge-v3-1-af0083219ffd@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 8:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 8:21 [PATCH v3] arm64: dts: qcom: sm7125-samsung: add fuel gauge Erikas Bitovtas
2026-12-04 8:33 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox