mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
@ 2026-09-07 16:03 Shujath Mohd
  2026-09-08  7:19 ` Abel Vesa
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Shujath Mohd @ 2026-09-07 16:03 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: devicetree, linux-kernel, andersson, konradybcio, robh, krzk+dt,
	conor+dt, Shujath Mohd

Add simple-battery nodes describing the design capacity and voltage
limits of the Xperia TAMA batteries.

The Xperia XZ2, XZ2 Compact, and XZ3 use 3.4 V as the drained
battery voltage and 4.245 V as the fully charged voltage.

Signed-off-by: Shujath Mohd <shujath@outlook.in>
---
 arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts | 7 +++++++
 .../boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts     | 7 +++++++
 .../arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts | 7 +++++++
 3 files changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts
index 6e65909ab582..16e676ac9630 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts
@@ -10,6 +10,13 @@
 / {
 	model = "Sony Xperia XZ2";
 	compatible = "sony,akari-row", "qcom,sdm845";
+
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <3180000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4245000>;
+	};
 };
 
 &panel {
diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
index 82e59e453354..3bf9db963299 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
@@ -26,6 +26,13 @@ ts_vddio_supply: ts-vddio-regulator {
 		enable-active-high;
 		regulator-boot-on;
 	};
+
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <3330000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4245000>;
+	};
 };
 
 &ibb {
diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts
index dc15ab1a2716..013987184b39 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts
@@ -10,6 +10,13 @@
 / {
 	model = "Sony Xperia XZ2 Compact";
 	compatible = "sony,apollo-row", "qcom,sdm845";
+
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <2870000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4245000>;
+	};
 };
 
 &panel {
-- 
2.55.0


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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-07 16:03 [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties Shujath Mohd
@ 2026-09-08  7:19 ` Abel Vesa
  2026-09-08  7:56   ` Shujath Mohd
  2026-09-09  9:39 ` Konrad Dybcio
  2026-09-10  4:36 ` [PATCH v3] " Shujath Mohd
  2 siblings, 1 reply; 8+ messages in thread
From: Abel Vesa @ 2026-09-08  7:19 UTC (permalink / raw)
  To: Shujath Mohd
  Cc: linux-arm-msm, devicetree, linux-kernel, andersson, konradybcio,
	robh, krzk+dt, conor+dt

On 26-09-07 21:33:08, Shujath Mohd wrote:
> Add simple-battery nodes describing the design capacity and voltage
> limits of the Xperia TAMA batteries.
> 
> The Xperia XZ2, XZ2 Compact, and XZ3 use 3.4 V as the drained
> battery voltage and 4.245 V as the fully charged voltage.
> 
> Signed-off-by: Shujath Mohd <shujath@outlook.in>

So what changed since v1 ?

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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-08  7:19 ` Abel Vesa
@ 2026-09-08  7:56   ` Shujath Mohd
  2026-09-09  9:23     ` Konrad Dybcio
  0 siblings, 1 reply; 8+ messages in thread
From: Shujath Mohd @ 2026-09-08  7:56 UTC (permalink / raw)
  To: Abel Vesa
  Cc: linux-arm-msm, devicetree, linux-kernel, andersson, konradybcio,
	robh, krzk+dt, conor+dt

Just the commit message, nothing in files

On 8 September 2026 12:49:24 pm IST, Abel Vesa <abel.vesa@oss.qualcomm.com> wrote:
>On 26-09-07 21:33:08, Shujath Mohd wrote:
>> Add simple-battery nodes describing the design capacity and voltage
>> limits of the Xperia TAMA batteries.
>> 
>> The Xperia XZ2, XZ2 Compact, and XZ3 use 3.4 V as the drained
>> battery voltage and 4.245 V as the fully charged voltage.
>> 
>> Signed-off-by: Shujath Mohd <shujath@outlook.in>
>
>So what changed since v1 ?

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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-08  7:56   ` Shujath Mohd
@ 2026-09-09  9:23     ` Konrad Dybcio
  0 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-09-09  9:23 UTC (permalink / raw)
  To: Shujath Mohd, Abel Vesa
  Cc: linux-arm-msm, devicetree, linux-kernel, andersson, konradybcio,
	robh, krzk+dt, conor+dt

On 9/8/26 9:56 AM, Shujath Mohd wrote:
> Just the commit message, nothing in files
> 
> On 8 September 2026 12:49:24 pm IST, Abel Vesa <abel.vesa@oss.qualcomm.com> wrote:
>> On 26-09-07 21:33:08, Shujath Mohd wrote:
>>> Add simple-battery nodes describing the design capacity and voltage
>>> limits of the Xperia TAMA batteries.
>>>
>>> The Xperia XZ2, XZ2 Compact, and XZ3 use 3.4 V as the drained
>>> battery voltage and 4.245 V as the fully charged voltage.
>>>
>>> Signed-off-by: Shujath Mohd <shujath@outlook.in>
>>
>> So what changed since v1 ?


For context, everyone is expected to provide a brief changelog between
revisions

There's a pretty in-depth piece of documentation regarding all the
(well, probably "most") such expectations:

https://docs.kernel.org/process/submitting-patches.html

And the b4 tool was created to take care of most of the annoying ones:

https://b4.docs.kernel.org/en/latest/ 

which everyone (contributors and maintainers alike) is encouraged to use

Konrad

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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-07 16:03 [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties Shujath Mohd
  2026-09-08  7:19 ` Abel Vesa
@ 2026-09-09  9:39 ` Konrad Dybcio
  2026-09-10  4:36 ` [PATCH v3] " Shujath Mohd
  2 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-09-09  9:39 UTC (permalink / raw)
  To: Shujath Mohd, linux-arm-msm
  Cc: devicetree, linux-kernel, andersson, konradybcio, robh, krzk+dt,
	conor+dt

On 9/7/26 6:03 PM, Shujath Mohd wrote:
> Add simple-battery nodes describing the design capacity and voltage
> limits of the Xperia TAMA batteries.
> 
> The Xperia XZ2, XZ2 Compact, and XZ3 use 3.4 V as the drained
> battery voltage and 4.245 V as the fully charged voltage.
> 
> Signed-off-by: Shujath Mohd <shujath@outlook.in>
> ---

In the downstream kernel, I see:

fg-gen3-batterydata-akari-byd-4250mv.dtsi
fg-gen3-batterydata-akari-byd-4300mv.dtsi
fg-gen3-batterydata-akari-byd-4340mv.dtsi
fg-gen3-batterydata-akari-byd-4380mv.dtsi

fg-gen3-batterydata-akari-tmm-4250mv.dtsi
fg-gen3-batterydata-akari-tmm-4300mv.dtsi
fg-gen3-batterydata-akari-tmm-4340mv.dtsi
fg-gen3-batterydata-akari-tmm-4380mv.dtsi

fg-gen3-batterydata-akatsuki-tmm-4250mv.dtsi
fg-gen3-batterydata-akatsuki-tmm-4300mv.dtsi
fg-gen3-batterydata-akatsuki-tmm-4340mv.dtsi
fg-gen3-batterydata-akatsuki-tmm-4380mv.dtsi

fg-gen3-batterydata-apollo-tmm-4250mv.dtsi
fg-gen3-batterydata-apollo-tmm-4300mv.dtsi
fg-gen3-batterydata-apollo-tmm-4340mv.dtsi
fg-gen3-batterydata-apollo-tmm-4380mv.dtsi

fg-gen3-batterydata-aurora-tmm-4250mv.dtsi
fg-gen3-batterydata-aurora-tmm-4300mv.dtsi
fg-gen3-batterydata-aurora-tmm-4340mv.dtsi
fg-gen3-batterydata-aurora-tmm-4380mv.dtsi

so XZ2 has 2 battery suppliers, while Premium/Compact and
XZ3 only have one. The -mv suffixes I deciphered to be tuned
settings for various aging levels.

The BYD vs TMM batteries on Akari have a different capacity,
and public spec sheets match neither :)

BYD says initial capacity = 3056000 uAh
TMM says initial capacity = 3217000 uAh

the spec sheet says 3180 mAh, so presumably the TMM one was
used in all models

The constant current charge threshold is set to 4370 on the
-4380mv bin and the DTs don't clearly specify a lower bound
(maybe in the qcom,fg-data blob?), but 3.4 sounds appropriate

Konrad

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

* [PATCH v3] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-07 16:03 [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties Shujath Mohd
  2026-09-08  7:19 ` Abel Vesa
  2026-09-09  9:39 ` Konrad Dybcio
@ 2026-09-10  4:36 ` Shujath Mohd
  2026-10-15 12:14   ` Konrad Dybcio
  2026-11-08 20:21   ` Bjorn Andersson
  2 siblings, 2 replies; 8+ messages in thread
From: Shujath Mohd @ 2026-09-10  4:36 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
	devicetree, linux-kernel, Shujath Mohd

Add simple-battery nodes describing the design capacity and voltage
limits of the Xperia TAMA batteries.

Use the TMM fuel-gauge profile values from the downstream kernel
(`somc,initial-capacity-uah` and `qcom,max-voltage-uv` on the 4250 mV
bins). Akari also shipped a BYD cell (3056000 uAh); a single
simple-battery node cannot express both, so prefer TMM as on the other
TAMA devices.

Voltage limits match the fresh 4250 mV profiles: 3.4 V drained and
4.245 V fully charged. Aging bins raise max voltage / CC-CV up to
4.380 V / 4370 mV and are not modelled here.

Signed-off-by: Shujath Mohd <shujath@outlook.in>
---
Changes in v3:
- Document TMM vs BYD dual-supplier situation in Akari
- Set charge-full design from downstream TMM initial capacities (akari 3217000, apollo 2899000, akatsuki 3325000 uAh)
- Explain voltage limits vs aging/CC-CV bins

Changes in v2:
- Retitle subject to include "tama" (commit message only) 

 arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts | 7 +++++++
 .../boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts     | 7 +++++++
 .../arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts | 7 +++++++
 3 files changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts
index 6e65909ab582..c76708ad537b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dts
@@ -10,6 +10,13 @@
 / {
 	model = "Sony Xperia XZ2";
 	compatible = "sony,akari-row", "qcom,sdm845";
+
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <3217000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4245000>;
+	};
 };
 
 &panel {
diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
index 82e59e453354..87279392f7eb 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
@@ -26,6 +26,13 @@ ts_vddio_supply: ts-vddio-regulator {
 		enable-active-high;
 		regulator-boot-on;
 	};
+
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <3325000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4245000>;
+	};
 };
 
 &ibb {
diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts
index dc15ab1a2716..08c0837d7e5e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dts
@@ -10,6 +10,13 @@
 / {
 	model = "Sony Xperia XZ2 Compact";
 	compatible = "sony,apollo-row", "qcom,sdm845";
+
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <2899000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4245000>;
+	};
 };
 
 &panel {
-- 
2.55.0


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

* Re: [PATCH v3] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-10  4:36 ` [PATCH v3] " Shujath Mohd
@ 2026-10-15 12:14   ` Konrad Dybcio
  2026-11-08 20:21   ` Bjorn Andersson
  1 sibling, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-10-15 12:14 UTC (permalink / raw)
  To: Shujath Mohd, Bjorn Andersson, Konrad Dybcio
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
	devicetree, linux-kernel

On 9/10/26 6:36 AM, Shujath Mohd wrote:
> Add simple-battery nodes describing the design capacity and voltage
> limits of the Xperia TAMA batteries.
> 
> Use the TMM fuel-gauge profile values from the downstream kernel
> (`somc,initial-capacity-uah` and `qcom,max-voltage-uv` on the 4250 mV
> bins). Akari also shipped a BYD cell (3056000 uAh); a single
> simple-battery node cannot express both, so prefer TMM as on the other
> TAMA devices.
> 
> Voltage limits match the fresh 4250 mV profiles: 3.4 V drained and
> 4.245 V fully charged. Aging bins raise max voltage / CC-CV up to
> 4.380 V / 4370 mV and are not modelled here.
> 
> Signed-off-by: Shujath Mohd <shujath@outlook.in>
> ---

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

Konrad

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

* Re: [PATCH v3] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
  2026-09-10  4:36 ` [PATCH v3] " Shujath Mohd
  2026-10-15 12:14   ` Konrad Dybcio
@ 2026-11-08 20:21   ` Bjorn Andersson
  1 sibling, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2026-11-08 20:21 UTC (permalink / raw)
  To: Konrad Dybcio, Shujath Mohd
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
	devicetree, linux-kernel


On Thu, 10 Sep 2026 10:06:48 +0530, Shujath Mohd wrote:
> Add simple-battery nodes describing the design capacity and voltage
> limits of the Xperia TAMA batteries.
> 
> Use the TMM fuel-gauge profile values from the downstream kernel
> (`somc,initial-capacity-uah` and `qcom,max-voltage-uv` on the 4250 mV
> bins). Akari also shipped a BYD cell (3056000 uAh); a single
> simple-battery node cannot express both, so prefer TMM as on the other
> TAMA devices.
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: qcom: sdm845-sony-tama: Add battery properties
      commit: 30c200691b175037067e599ed0d1f31418f4edb3

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2026-11-08 20:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 16:03 [PATCH v2] arm64: dts: qcom: sdm845-sony-tama: Add battery properties Shujath Mohd
2026-09-08  7:19 ` Abel Vesa
2026-09-08  7:56   ` Shujath Mohd
2026-09-09  9:23     ` Konrad Dybcio
2026-09-09  9:39 ` Konrad Dybcio
2026-09-10  4:36 ` [PATCH v3] " Shujath Mohd
2026-10-15 12:14   ` Konrad Dybcio
2026-11-08 20:21   ` Bjorn Andersson

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

all inboxes | Powered by JetHome®