* [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
@ 2026-08-26 23:38 Rinat Muhamedgaliev
2026-08-27 21:43 ` Krzysztof Kozlowski
` (3 more replies)
0 siblings, 4 replies; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-08-26 23:38 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
devicetree, linux-kernel, Caleb Connolly, Frederic Laing,
Rinat Muhamedgaliev
The fuel gauge at I2C address 0x55 on OnePlus 6T (fajita) reports
DeviceType 0x0541, identifying it as a TI bq27541 rather than bq27411.
Binding it as bq27411 selects the wrong register map and produces
invalid voltage, state-of-charge, and temperature readings. Use the
bq27541 compatible and rename the shared label along with its fajita
and enchilada consumers.
Tested on OnePlus 6T (fajita): queried DeviceType directly over I2C,
built the DTB, booted it once with fastboot boot, then installed a
locally built postmarketOS kernel package. Before the change, readings
included about 65 V, over 10000% SOC, and -273.1 C. Afterward, the
bq27xxx driver bound as ti,bq27541 and reported 3.835 V, 42% SOC, and
33.3 C.
Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
Closes: https://gitlab.com/sdm845-mainline/linux/-/issues/36
Link: https://gitlab.com/sdm845-mainline/linux/-/merge_requests/148
Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 948a0dd18..0c6203fa8 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -790,8 +790,8 @@ &i2c10 {
status = "okay";
clock-frequency = <100000>;
- bq27441_fg: bq27441-battery@55 {
- compatible = "ti,bq27411";
+ bq27541_fg: bq27541-battery@55 {
+ compatible = "ti,bq27541";
status = "okay";
reg = <0x55>;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
index 5f01115e2..21ebd3f67 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
@@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
};
};
-&bq27441_fg {
+&bq27541_fg {
monitored-battery = <&battery>;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
index 7ffcad24d..d640b38b5 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
@@ -67,7 +67,7 @@ tfa9894_codec: tfa9894@34 {
};
-&bq27441_fg {
+&bq27541_fg {
monitored-battery = <&battery>;
};
--
2.55.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
2026-08-26 23:38 [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible Rinat Muhamedgaliev
@ 2026-08-27 21:43 ` Krzysztof Kozlowski
2026-08-28 10:05 ` Konrad Dybcio
` (2 subsequent siblings)
3 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Kozlowski @ 2026-08-27 21:43 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
devicetree, linux-kernel, Caleb Connolly, Frederic Laing
On 27/08/2026 01:38, Rinat Muhamedgaliev wrote:
> The fuel gauge at I2C address 0x55 on OnePlus 6T (fajita) reports
> DeviceType 0x0541, identifying it as a TI bq27541 rather than bq27411.
>
> Binding it as bq27411 selects the wrong register map and produces
> invalid voltage, state-of-charge, and temperature readings. Use the
> bq27541 compatible and rename the shared label along with its fajita
> and enchilada consumers.
>
> Tested on OnePlus 6T (fajita): queried DeviceType directly over I2C,
> built the DTB, booted it once with fastboot boot, then installed a
> locally built postmarketOS kernel package. Before the change, readings
> included about 65 V, over 10000% SOC, and -273.1 C. Afterward, the
> bq27xxx driver bound as ti,bq27541 and reported 3.835 V, 42% SOC, and
> 33.3 C.
>
> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
> Closes: https://gitlab.com/sdm845-mainline/linux/-/issues/36
This is fine.
> Link: https://gitlab.com/sdm845-mainline/linux/-/merge_requests/148
But link seems irrelevant here. We do not reference downstream PRs in
upstream commits, because it should go the other way.
Please drop it.
> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
> ---
> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index 948a0dd18..0c6203fa8 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -790,8 +790,8 @@ &i2c10 {
> status = "okay";
> clock-frequency = <100000>;
>
> - bq27441_fg: bq27441-battery@55 {
> - compatible = "ti,bq27411";
> + bq27541_fg: bq27541-battery@55 {
If renaming it, then node name should be fuel-gauge@.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
2026-08-26 23:38 [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible Rinat Muhamedgaliev
2026-08-27 21:43 ` Krzysztof Kozlowski
@ 2026-08-28 10:05 ` Konrad Dybcio
2026-08-29 21:03 ` Rinat Muhamedgaliev
2026-08-29 20:52 ` [PATCH v2] " Rinat Muhamedgaliev
2026-09-07 8:38 ` [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible David Heidelberg
3 siblings, 1 reply; 21+ messages in thread
From: Konrad Dybcio @ 2026-08-28 10:05 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
devicetree, linux-kernel, Caleb Connolly, Frederic Laing
On 8/27/26 1:38 AM, Rinat Muhamedgaliev wrote:
> The fuel gauge at I2C address 0x55 on OnePlus 6T (fajita) reports
> DeviceType 0x0541, identifying it as a TI bq27541 rather than bq27411.
>
> Binding it as bq27411 selects the wrong register map and produces
> invalid voltage, state-of-charge, and temperature readings. Use the
> bq27541 compatible and rename the shared label along with its fajita
> and enchilada consumers.
>
> Tested on OnePlus 6T (fajita): queried DeviceType directly over I2C,
> built the DTB, booted it once with fastboot boot, then installed a
> locally built postmarketOS kernel package. Before the change, readings
> included about 65 V, over 10000% SOC, and -273.1 C. Afterward, the
> bq27xxx driver bound as ti,bq27541 and reported 3.835 V, 42% SOC, and
> 33.3 C.
>
> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
> Closes: https://gitlab.com/sdm845-mainline/linux/-/issues/36
> Link: https://gitlab.com/sdm845-mainline/linux/-/merge_requests/148
If I'm reading that thread right, this IC is on the battery itself (?)
and it seems to differ across different units / suppliers, would that
be a good interpretation?
Konrad
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
2026-08-26 23:38 [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible Rinat Muhamedgaliev
2026-08-27 21:43 ` Krzysztof Kozlowski
2026-08-28 10:05 ` Konrad Dybcio
@ 2026-08-29 20:52 ` Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges Rinat Muhamedgaliev
2026-09-07 8:38 ` [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible David Heidelberg
3 siblings, 1 reply; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-08-29 20:52 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
devicetree, linux-kernel, Caleb Connolly, Frederic Laing,
Rinat Muhamedgaliev
The fuel gauge at I2C address 0x55 on OnePlus 6T (fajita) reports DeviceType 0x0541, identifying it as a TI bq27541 rather than bq27411.
Binding it as bq27411 selects the wrong register map and produces invalid voltage, state-of-charge, and temperature readings. Use the bq27541 compatible and rename the shared label along with its fajita and enchilada consumers.
Tested on OnePlus 6T (fajita): queried DeviceType directly over I2C, built the DTB, booted it once with fastboot boot, then installed a locally built postmarketOS kernel package. Before the change, readings included about 65 V, over 10000% SOC, and -273.1 C. Afterward, the bq27xxx driver bound as ti,bq27541 and reported 3.835 V, 42% SOC, and 33.3 C.
Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
Closes: https://gitlab.com/sdm845-mainline/linux/-/issues/36
Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 948a0dd18d13..f3459226bf7b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -790,8 +790,8 @@ &i2c10 {
status = "okay";
clock-frequency = <100000>;
- bq27441_fg: bq27441-battery@55 {
- compatible = "ti,bq27411";
+ bq27541_fg: fuel-gauge@55 {
+ compatible = "ti,bq27541";
status = "okay";
reg = <0x55>;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
index 5f01115e2322..21ebd3f67155 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
@@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
};
};
-&bq27441_fg {
+&bq27541_fg {
monitored-battery = <&battery>;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
index 7ffcad24d505..d640b38b53f4 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
@@ -67,7 +67,7 @@ tfa9894_codec: tfa9894@34 {
};
-&bq27441_fg {
+&bq27541_fg {
monitored-battery = <&battery>;
};
--
2.55.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
2026-08-28 10:05 ` Konrad Dybcio
@ 2026-08-29 21:03 ` Rinat Muhamedgaliev
2026-09-08 13:15 ` Konrad Dybcio
0 siblings, 1 reply; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-08-29 21:03 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-msm, devicetree, linux-kernel,
Caleb Connolly, Frederic Laing
On 29/08/2026, Konrad Dybcio wrote:
> If I'm reading that thread right, this IC is on the battery itself (?)
> and it seems to differ across different units / suppliers, would that
> be a good interpretation?
That matches what I found while looking into this. Both the bq27411-G1
and bq27541-G1 datasheets describe them as pack-side fuel gauges meant
for integration into the battery pack itself, alongside the protection
IC, rather than being placed on the phone's mainboard. So it's
plausible that different battery packs (different suppliers or
production batches) could carry a different chip variant, and DT
can't detect that at boot time - the bq27xxx driver picks its register
map purely from the compatible string, with no runtime DeviceType
probing.
I want to be upfront: I only tested this on my own OnePlus 6T
(fajita), by reading DeviceType directly over I2C on that one unit. I
haven't verified whether other fajita/enchilada units report the same
value, so I can't rule out that some devices out there actually do
have a bq27411 and would regress with this patch.
I'm not sure what the right way to handle this is and would appreciate
guidance. A few options I can think of, roughly in order of effort:
- Ask other sdm845-mainline users to report their DeviceType (a quick
i2cget on 0x55) to get a sense of how common each variant is.
- Leave the fix as-is for now, since it's still strictly correct for
the tested unit and the previous binding was wrong for it, but note
the pack-side/per-battery caveat explicitly in the commit message.
- Longer term, add DeviceType autodetection to bq27xxx_battery.c
itself so the driver picks the right register map at probe time
instead of relying on a static DT compatible - though that's a
separate, larger change to the driver, not this DT patch.
Happy to go whichever direction you and the other reviewers think is
right; just didn't want to claim more certainty than I actually have.
Rinat
пт, 28 авг. 2026 г. в 13:05, Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>:
>
> On 8/27/26 1:38 AM, Rinat Muhamedgaliev wrote:
> > The fuel gauge at I2C address 0x55 on OnePlus 6T (fajita) reports
> > DeviceType 0x0541, identifying it as a TI bq27541 rather than bq27411.
> >
> > Binding it as bq27411 selects the wrong register map and produces
> > invalid voltage, state-of-charge, and temperature readings. Use the
> > bq27541 compatible and rename the shared label along with its fajita
> > and enchilada consumers.
> >
> > Tested on OnePlus 6T (fajita): queried DeviceType directly over I2C,
> > built the DTB, booted it once with fastboot boot, then installed a
> > locally built postmarketOS kernel package. Before the change, readings
> > included about 65 V, over 10000% SOC, and -273.1 C. Afterward, the
> > bq27xxx driver bound as ti,bq27541 and reported 3.835 V, 42% SOC, and
> > 33.3 C.
> >
> > Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
> > Closes: https://gitlab.com/sdm845-mainline/linux/-/issues/36
> > Link: https://gitlab.com/sdm845-mainline/linux/-/merge_requests/148
>
> If I'm reading that thread right, this IC is on the battery itself (?)
> and it seems to differ across different units / suppliers, would that
> be a good interpretation?
>
> Konrad
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
2026-08-26 23:38 [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible Rinat Muhamedgaliev
` (2 preceding siblings ...)
2026-08-29 20:52 ` [PATCH v2] " Rinat Muhamedgaliev
@ 2026-09-07 8:38 ` David Heidelberg
3 siblings, 0 replies; 21+ messages in thread
From: David Heidelberg @ 2026-09-07 8:38 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-arm-msm,
devicetree, linux-kernel, Caleb Connolly, Frederic Laing
On 27/08/2026 01:38, Rinat Muhamedgaliev wrote:
> The fuel gauge at I2C address 0x55 on OnePlus 6T (fajita) reports
> DeviceType 0x0541, identifying it as a TI bq27541 rather than bq27411.
>
> Binding it as bq27411 selects the wrong register map and produces
> invalid voltage, state-of-charge, and temperature readings. Use the
> bq27541 compatible and rename the shared label along with its fajita
> and enchilada consumers.
>
> Tested on OnePlus 6T (fajita): queried DeviceType directly over I2C,
> built the DTB, booted it once with fastboot boot, then installed a
> locally built postmarketOS kernel package. Before the change, readings
> included about 65 V, over 10000% SOC, and -273.1 C. Afterward, the
> bq27xxx driver bound as ti,bq27541 and reported 3.835 V, 42% SOC, and
> 33.3 C.
>
> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
> Closes: https://gitlab.com/sdm845-mainline/linux/-/issues/36
> Link: https://gitlab.com/sdm845-mainline/linux/-/merge_requests/148
> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
> ---
> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index 948a0dd18..0c6203fa8 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -790,8 +790,8 @@ &i2c10 {
> status = "okay";
> clock-frequency = <100000>;
>
> - bq27441_fg: bq27441-battery@55 {
> - compatible = "ti,bq27411";
> + bq27541_fg: bq27541-battery@55 {
> + compatible = "ti,bq27541";
Original OP6/6T has bq27411, replacements (or later series) bq27541.
This change is no-go as is, would be great thou to have auto-detection and use
something such as:
compatible = "ti,bq27xxx";
and adding logic to detect chip id (and maybe also non-sense values)?
We could also multiply device-trees (fajita + enchilada) x2 (bq27411 + bq27541)
and let u-boot decide, but it seems a bit overkill for a battery chip from the
same generation and vendor.
Thanks
David
> status = "okay";
> reg = <0x55>;
> };
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> index 5f01115e2..21ebd3f67 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> @@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
> };
> };
>
> -&bq27441_fg {
> +&bq27541_fg {
> monitored-battery = <&battery>;
> };
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
> index 7ffcad24d..d640b38b5 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
> @@ -67,7 +67,7 @@ tfa9894_codec: tfa9894@34 {
>
> };
>
> -&bq27441_fg {
> +&bq27541_fg {
> monitored-battery = <&battery>;
> };
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
2026-08-29 21:03 ` Rinat Muhamedgaliev
@ 2026-09-08 13:15 ` Konrad Dybcio
0 siblings, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2026-09-08 13:15 UTC (permalink / raw)
To: Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-arm-msm, devicetree, linux-kernel,
Caleb Connolly, Frederic Laing
On 8/29/26 11:03 PM, Rinat Muhamedgaliev wrote:
> On 29/08/2026, Konrad Dybcio wrote:
>> If I'm reading that thread right, this IC is on the battery itself (?)
>> and it seems to differ across different units / suppliers, would that
>> be a good interpretation?
>
> That matches what I found while looking into this. Both the bq27411-G1
> and bq27541-G1 datasheets describe them as pack-side fuel gauges meant
> for integration into the battery pack itself, alongside the protection
> IC, rather than being placed on the phone's mainboard. So it's
> plausible that different battery packs (different suppliers or
> production batches) could carry a different chip variant, and DT
> can't detect that at boot time - the bq27xxx driver picks its register
> map purely from the compatible string, with no runtime DeviceType
> probing.
>
> I want to be upfront: I only tested this on my own OnePlus 6T
> (fajita), by reading DeviceType directly over I2C on that one unit. I
> haven't verified whether other fajita/enchilada units report the same
> value, so I can't rule out that some devices out there actually do
> have a bq27411 and would regress with this patch.
>
> I'm not sure what the right way to handle this is and would appreciate
> guidance. A few options I can think of, roughly in order of effort:
>
> - Ask other sdm845-mainline users to report their DeviceType (a quick
> i2cget on 0x55) to get a sense of how common each variant is.
> - Leave the fix as-is for now, since it's still strictly correct for
> the tested unit and the previous binding was wrong for it, but note
> the pack-side/per-battery caveat explicitly in the commit message.
> - Longer term, add DeviceType autodetection to bq27xxx_battery.c
> itself so the driver picks the right register map at probe time
> instead of relying on a static DT compatible - though that's a
> separate, larger change to the driver, not this DT patch.
>
> Happy to go whichever direction you and the other reviewers think is
> right; just didn't want to claim more certainty than I actually have.
If the driver can do autodetection, then that's a good idea
Otherwise, since based on David's reply there's strong reasons to
believe both variants are out in the wild, no autodetection would
suggest we need 2 DT variants (I'm really a fan of the other option)
Konrad
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges
2026-08-29 20:52 ` [PATCH v2] " Rinat Muhamedgaliev
@ 2026-09-09 23:47 ` Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible Rinat Muhamedgaliev
` (3 more replies)
0 siblings, 4 replies; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-09-09 23:47 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel
Cc: David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel, Rinat Muhamedgaliev
OnePlus 6 and OnePlus 6T battery packs may contain either a TI bq27411
or bq27541 fuel gauge. The DTS compatible used until now selects only
the bq27411 register map, while v2 proposed selecting bq27541 for every
device. Neither static choice supports both original and replacement
battery packs.
Add a generic ti,bq27xxx compatible and have the I2C driver issue the
DeviceType control command at probe time. It selects bq27411 for
DeviceType 0x0421 and bq27541 for 0x0541.
Tested on OnePlus 6T (fajita) with DeviceType 0x0541. After installing
the kernel and rebooting, the fuel gauge reported 4.360 V, 100% state
of charge, 27.8 C, and Full status.
Changes in v3:
- Replace the static bq27541 DTS change from v2 with runtime detection
for both bq27411 and bq27541.
- Add the generic compatible to the binding and I2C driver.
- Split the change into binding, driver, and DTS patches.
Rinat Muhamedgaliev (3):
dt-bindings: power: supply: bq27xxx: add generic compatible
power: supply: bq27xxx: autodetect bq27411 and bq27541
arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
.../bindings/power/supply/bq27xxx.yaml | 1 +
.../boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 +-
.../dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
.../boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
drivers/power/supply/bq27xxx_battery_i2c.c | 39 +++++++++++++++++++
5 files changed, 44 insertions(+), 4 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible
2026-09-09 23:47 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges Rinat Muhamedgaliev
@ 2026-09-09 23:47 ` Rinat Muhamedgaliev
2026-09-11 8:20 ` Krzysztof Kozlowski
2026-09-09 23:47 ` [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541 Rinat Muhamedgaliev
` (2 subsequent siblings)
3 siblings, 1 reply; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-09-09 23:47 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel
Cc: David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel, Rinat Muhamedgaliev
Add a generic compatible for I2C fuel gauges whose device type is
determined at probe time.
Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
---
Documentation/devicetree/bindings/power/supply/bq27xxx.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
index bc05400..f2e0170 100644
--- a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
+++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
@@ -21,6 +21,7 @@ properties:
enum:
- ti,bq27200
- ti,bq27210
+ - ti,bq27xxx
- ti,bq27500 # deprecated, use revision specific property below
- ti,bq27510 # deprecated, use revision specific property below
- ti,bq27520 # deprecated, use revision specific property below
--
2.55.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541
2026-09-09 23:47 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible Rinat Muhamedgaliev
@ 2026-09-09 23:47 ` Rinat Muhamedgaliev
2026-09-10 0:09 ` David Heidelberg
2026-09-10 7:42 ` Konrad Dybcio
2026-09-09 23:47 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible Rinat Muhamedgaliev
2026-09-10 0:08 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges David Heidelberg
3 siblings, 2 replies; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-09-09 23:47 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel
Cc: David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel, Rinat Muhamedgaliev
Some replaceable battery packs used by OnePlus 6 and OnePlus 6T
phones contain a bq27411, while others contain a bq27541. These
devices require different register maps.
Add support for the generic ti,bq27xxx compatible. At probe time,
issue the DeviceType control command and select the bq27411 or bq27541
register map from the returned value.
Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
---
drivers/power/supply/bq27xxx_battery_i2c.c | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/drivers/power/supply/bq27xxx_battery_i2c.c b/drivers/power/supply/bq27xxx_battery_i2c.c
index 868e95f..718f8e8 100644
--- a/drivers/power/supply/bq27xxx_battery_i2c.c
+++ b/drivers/power/supply/bq27xxx_battery_i2c.c
@@ -16,6 +16,11 @@
static DEFINE_IDA(battery_id);
+#define BQ27XXX_REG_CTRL 0x00
+#define BQ27XXX_DEVICE_TYPE 0x0001
+#define BQ27411_DEVICE_TYPE 0x0421
+#define BQ27541_DEVICE_TYPE 0x0541
+
static irqreturn_t bq27xxx_battery_irq_handler_thread(int irq, void *data)
{
struct bq27xxx_device_info *di = data;
@@ -153,6 +158,32 @@ static void bq27xxx_battery_i2c_devm_ida_free(void *data)
ida_free(&battery_id, num);
}
+static int bq27xxx_battery_i2c_detect_chip(struct bq27xxx_device_info *di)
+{
+ int ret;
+
+ ret = di->bus.write(di, BQ27XXX_REG_CTRL, BQ27XXX_DEVICE_TYPE,
+ false);
+ if (ret < 0)
+ return ret;
+
+ ret = di->bus.read(di, BQ27XXX_REG_CTRL, false);
+ if (ret < 0)
+ return ret;
+
+ switch (ret) {
+ case BQ27411_DEVICE_TYPE:
+ di->chip = BQ27411;
+ return 0;
+ case BQ27541_DEVICE_TYPE:
+ di->chip = BQ27541;
+ return 0;
+ default:
+ dev_err(di->dev, "unsupported device type 0x%04x\n", ret);
+ return -ENODEV;
+ }
+}
+
static int bq27xxx_battery_i2c_probe(struct i2c_client *client)
{
const struct i2c_device_id *id = i2c_client_get_device_id(client);
@@ -188,6 +219,12 @@ static int bq27xxx_battery_i2c_probe(struct i2c_client *client)
di->bus.read_bulk = bq27xxx_battery_i2c_bulk_read;
di->bus.write_bulk = bq27xxx_battery_i2c_bulk_write;
+ if (!di->chip) {
+ ret = bq27xxx_battery_i2c_detect_chip(di);
+ if (ret)
+ return ret;
+ }
+
ret = bq27xxx_battery_setup(di);
if (ret)
return ret;
@@ -225,6 +262,7 @@ static void bq27xxx_battery_i2c_remove(struct i2c_client *client)
}
static const struct i2c_device_id bq27xxx_i2c_id_table[] = {
+ { "bq27xxx", 0 },
{ "bq27200", BQ27000 },
{ "bq27210", BQ27010 },
{ "bq27500", BQ2750X },
@@ -262,6 +300,7 @@ MODULE_DEVICE_TABLE(i2c, bq27xxx_i2c_id_table);
#ifdef CONFIG_OF
static const struct of_device_id bq27xxx_battery_i2c_of_match_table[] = {
+ { .compatible = "ti,bq27xxx" },
{ .compatible = "ti,bq27200" },
{ .compatible = "ti,bq27210" },
{ .compatible = "ti,bq27500" },
--
2.55.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-09 23:47 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541 Rinat Muhamedgaliev
@ 2026-09-09 23:47 ` Rinat Muhamedgaliev
2026-09-10 0:12 ` David Heidelberg
2026-09-11 8:21 ` Krzysztof Kozlowski
2026-09-10 0:08 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges David Heidelberg
3 siblings, 2 replies; 21+ messages in thread
From: Rinat Muhamedgaliev @ 2026-09-09 23:47 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel
Cc: David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel, Rinat Muhamedgaliev
OnePlus 6 and OnePlus 6T battery packs may contain either a TI
bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
so the driver can select the register map from DeviceType at probe
time.
Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
after booting the new kernel, the battery reported 4.360 V, 100% state
of charge, 27.8 C, and Full status.
Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 948a0dd..8c5cd94 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -790,8 +790,8 @@ &i2c10 {
status = "okay";
clock-frequency = <100000>;
- bq27441_fg: bq27441-battery@55 {
- compatible = "ti,bq27411";
+ bq27xxx_fg: fuel-gauge@55 {
+ compatible = "ti,bq27xxx";
status = "okay";
reg = <0x55>;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
index 5f01115..cf40842 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
@@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
};
};
-&bq27441_fg {
+&bq27xxx_fg {
monitored-battery = <&battery>;
};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
index 7ffcad2..9436027 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
@@ -67,7 +67,7 @@ tfa9894_codec: tfa9894@34 {
};
-&bq27441_fg {
+&bq27xxx_fg {
monitored-battery = <&battery>;
};
--
2.55.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges
2026-09-09 23:47 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges Rinat Muhamedgaliev
` (2 preceding siblings ...)
2026-09-09 23:47 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible Rinat Muhamedgaliev
@ 2026-09-10 0:08 ` David Heidelberg
3 siblings, 0 replies; 21+ messages in thread
From: David Heidelberg @ 2026-09-10 0:08 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio,
Sebastian Reichel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Pali Rohár,
Andrew F . Davis, linux-arm-msm, devicetree, linux-pm,
linux-kernel
On 10/09/2026 01:47, Rinat Muhamedgaliev wrote:
> OnePlus 6 and OnePlus 6T battery packs may contain either a TI bq27411
> or bq27541 fuel gauge. The DTS compatible used until now selects only
> the bq27411 register map, while v2 proposed selecting bq27541 for every
> device. Neither static choice supports both original and replacement
> battery packs.
>
> Add a generic ti,bq27xxx compatible and have the I2C driver issue the
> DeviceType control command at probe time. It selects bq27411 for
> DeviceType 0x0421 and bq27541 for 0x0541.
>
> Tested on OnePlus 6T (fajita) with DeviceType 0x0541. After installing
> the kernel and rebooting, the fuel gauge reported 4.360 V, 100% state
> of charge, 27.8 C, and Full status.
>
> Changes in v3:
> - Replace the static bq27541 DTS change from v2 with runtime detection
> for both bq27411 and bq27541.
> - Add the generic compatible to the binding and I2C driver.
> - Split the change into binding, driver, and DTS patches.
Hello Rinat!
Happy to see this series.
Did you managed to get someone with the original bq27411 to test it?
Eventually we hang at on https://matrix.to/#/#sdm845:ixit.cz
Thanks
David
>
> Rinat Muhamedgaliev (3):
> dt-bindings: power: supply: bq27xxx: add generic compatible
> power: supply: bq27xxx: autodetect bq27411 and bq27541
> arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
>
> .../bindings/power/supply/bq27xxx.yaml | 1 +
> .../boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 +-
> .../dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
> .../boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
> drivers/power/supply/bq27xxx_battery_i2c.c | 39 +++++++++++++++++++
> 5 files changed, 44 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541
2026-09-09 23:47 ` [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541 Rinat Muhamedgaliev
@ 2026-09-10 0:09 ` David Heidelberg
2026-09-10 7:42 ` Konrad Dybcio
1 sibling, 0 replies; 21+ messages in thread
From: David Heidelberg @ 2026-09-10 0:09 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio,
Sebastian Reichel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Pali Rohár,
Andrew F . Davis, linux-arm-msm, devicetree, linux-pm,
linux-kernel
On 10/09/2026 01:47, Rinat Muhamedgaliev wrote:
> Some replaceable battery packs used by OnePlus 6 and OnePlus 6T
> phones contain a bq27411, while others contain a bq27541. These
> devices require different register maps.
>
> Add support for the generic ti,bq27xxx compatible. At probe time,
> issue the DeviceType control command and select the bq27411 or bq27541
> register map from the returned value.
>
> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
> ---
> drivers/power/supply/bq27xxx_battery_i2c.c | 39 ++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/drivers/power/supply/bq27xxx_battery_i2c.c b/drivers/power/supply/bq27xxx_battery_i2c.c
> index 868e95f..718f8e8 100644
> --- a/drivers/power/supply/bq27xxx_battery_i2c.c
> +++ b/drivers/power/supply/bq27xxx_battery_i2c.c
> @@ -16,6 +16,11 @@
>
> static DEFINE_IDA(battery_id);
>
> +#define BQ27XXX_REG_CTRL 0x00
> +#define BQ27XXX_DEVICE_TYPE 0x0001
> +#define BQ27411_DEVICE_TYPE 0x0421
> +#define BQ27541_DEVICE_TYPE 0x0541
> +
> static irqreturn_t bq27xxx_battery_irq_handler_thread(int irq, void *data)
> {
> struct bq27xxx_device_info *di = data;
> @@ -153,6 +158,32 @@ static void bq27xxx_battery_i2c_devm_ida_free(void *data)
> ida_free(&battery_id, num);
> }
>
> +static int bq27xxx_battery_i2c_detect_chip(struct bq27xxx_device_info *di)
> +{
> + int ret;
> +
> + ret = di->bus.write(di, BQ27XXX_REG_CTRL, BQ27XXX_DEVICE_TYPE,
> + false);
> + if (ret < 0)
> + return ret;
> +
> + ret = di->bus.read(di, BQ27XXX_REG_CTRL, false);
> + if (ret < 0)
> + return ret;
> +
> + switch (ret) {
> + case BQ27411_DEVICE_TYPE:
> + di->chip = BQ27411;
> + return 0;
> + case BQ27541_DEVICE_TYPE:
> + di->chip = BQ27541;
> + return 0;
> + default:
> + dev_err(di->dev, "unsupported device type 0x%04x\n", ret);
> + return -ENODEV;
> + }
> +}
> +
> static int bq27xxx_battery_i2c_probe(struct i2c_client *client)
> {
> const struct i2c_device_id *id = i2c_client_get_device_id(client);
> @@ -188,6 +219,12 @@ static int bq27xxx_battery_i2c_probe(struct i2c_client *client)
> di->bus.read_bulk = bq27xxx_battery_i2c_bulk_read;
> di->bus.write_bulk = bq27xxx_battery_i2c_bulk_write;
>
> + if (!di->chip) {
> + ret = bq27xxx_battery_i2c_detect_chip(di);
> + if (ret)
> + return ret;
> + }
> +
> ret = bq27xxx_battery_setup(di);
> if (ret)
> return ret;
> @@ -225,6 +262,7 @@ static void bq27xxx_battery_i2c_remove(struct i2c_client *client)
> }
>
> static const struct i2c_device_id bq27xxx_i2c_id_table[] = {
> + { "bq27xxx", 0 },
> { "bq27200", BQ27000 },
> { "bq27210", BQ27010 },
> { "bq27500", BQ2750X },
> @@ -262,6 +300,7 @@ MODULE_DEVICE_TABLE(i2c, bq27xxx_i2c_id_table);
>
> #ifdef CONFIG_OF
> static const struct of_device_id bq27xxx_battery_i2c_of_match_table[] = {
> + { .compatible = "ti,bq27xxx" },
Maybe some comment suggesting to use this compatible when autodetection is needed?
David
> { .compatible = "ti,bq27200" },
> { .compatible = "ti,bq27210" },
> { .compatible = "ti,bq27500" },
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-09 23:47 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible Rinat Muhamedgaliev
@ 2026-09-10 0:12 ` David Heidelberg
2026-09-11 8:21 ` Krzysztof Kozlowski
1 sibling, 0 replies; 21+ messages in thread
From: David Heidelberg @ 2026-09-10 0:12 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio,
Sebastian Reichel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Pali Rohár,
Andrew F . Davis, linux-arm-msm, devicetree, linux-pm,
linux-kernel
On 10/09/2026 01:47, Rinat Muhamedgaliev wrote:
> OnePlus 6 and OnePlus 6T battery packs may contain either a TI
> bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
> so the driver can select the register map from DeviceType at probe
> time.
>
> Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
> after booting the new kernel, the battery reported 4.360 V, 100% state
> of charge, 27.8 C, and Full status.
>
> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
>
> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
> ---
> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index 948a0dd..8c5cd94 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -790,8 +790,8 @@ &i2c10 {
> status = "okay";
> clock-frequency = <100000>;
>
> - bq27441_fg: bq27441-battery@55 {
> - compatible = "ti,bq27411";
> + bq27xxx_fg: fuel-gauge@55 {
> + compatible = "ti,bq27xxx";
For new driver this would make definitely sense, but since we need backwards
compatibility (someone use new device-tree, but the old driver) you want to do
compatible = "ti,bq27xxx", "ti,bq27411";
here. The 27xxx will get evaluated first, if not available fallback to existing
driver.
> status = "okay";
> reg = <0x55>;
> };
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> index 5f01115..cf40842 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> @@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
> };
> };
>
> -&bq27441_fg {
> +&bq27xxx_fg {
> monitored-battery = <&battery>;
> };
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
> index 7ffcad2..9436027 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
> @@ -67,7 +67,7 @@ tfa9894_codec: tfa9894@34 {
>
> };
>
> -&bq27441_fg {
> +&bq27xxx_fg {
> monitored-battery = <&battery>;
> };
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541
2026-09-09 23:47 ` [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541 Rinat Muhamedgaliev
2026-09-10 0:09 ` David Heidelberg
@ 2026-09-10 7:42 ` Konrad Dybcio
1 sibling, 0 replies; 21+ messages in thread
From: Konrad Dybcio @ 2026-09-10 7:42 UTC (permalink / raw)
To: Rinat Muhamedgaliev, Bjorn Andersson, Konrad Dybcio,
Sebastian Reichel
Cc: David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel
On 9/10/26 1:47 AM, Rinat Muhamedgaliev wrote:
> Some replaceable battery packs used by OnePlus 6 and OnePlus 6T
> phones contain a bq27411, while others contain a bq27541. These
> devices require different register maps.
>
> Add support for the generic ti,bq27xxx compatible. At probe time,
> issue the DeviceType control command and select the bq27411 or bq27541
> register map from the returned value.
>
> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
> ---
[...]
First off, please don't send new revisions as a reply to the
previous one, this creates very messy thread structures and confuses
tooling. You may use the b4 tool for easy management:
https://b4.docs.kernel.org/en/latest/
> static const struct i2c_device_id bq27xxx_i2c_id_table[] = {
> + { "bq27xxx", 0 },
> { "bq27200", BQ27000 },
> { "bq27210", BQ27010 },
> { "bq27500", BQ2750X },
> @@ -262,6 +300,7 @@ MODULE_DEVICE_TABLE(i2c, bq27xxx_i2c_id_table);
>
> #ifdef CONFIG_OF
> static const struct of_device_id bq27xxx_battery_i2c_of_match_table[] = {
> + { .compatible = "ti,bq27xxx" },
I don't think we need a new compatible here, especially given wildcard
compatibles are very much not going to be accepted by the dt folks.
I think it's fine to add a chip_id readback mechanism that would be in
place regardless of the compatible and would say something to the lines
of: "detected another chip, proceeding based on chip_id"
Konrad
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible
2026-09-09 23:47 ` [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible Rinat Muhamedgaliev
@ 2026-09-11 8:20 ` Krzysztof Kozlowski
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-11 8:20 UTC (permalink / raw)
To: Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel,
David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel
On Thu, Sep 10, 2026 at 02:47:42AM +0300, Rinat Muhamedgaliev wrote:
> Add a generic compatible for I2C fuel gauges whose device type is
> determined at probe time.
Generic compatibles are not allowed. Existing ones should be used.
Do not attach (thread) your patchsets to some other threads (unrelated
or older versions). This buries them deep in the mailbox and might
interfere with applying entire sets. See also:
https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-09 23:47 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible Rinat Muhamedgaliev
2026-09-10 0:12 ` David Heidelberg
@ 2026-09-11 8:21 ` Krzysztof Kozlowski
2026-09-11 13:37 ` Andrew Davis
1 sibling, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-11 8:21 UTC (permalink / raw)
To: Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel,
David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, Andrew F . Davis, linux-arm-msm, devicetree,
linux-pm, linux-kernel
On Thu, Sep 10, 2026 at 02:47:44AM +0300, Rinat Muhamedgaliev wrote:
> OnePlus 6 and OnePlus 6T battery packs may contain either a TI
> bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
> so the driver can select the register map from DeviceType at probe
> time.
>
> Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
> after booting the new kernel, the battery reported 4.360 V, 100% state
> of charge, 27.8 C, and Full status.
>
> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
What is the bug here? Your commit msg should be specific about it.
>
> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
> ---
> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index 948a0dd..8c5cd94 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -790,8 +790,8 @@ &i2c10 {
> status = "okay";
> clock-frequency = <100000>;
>
> - bq27441_fg: bq27441-battery@55 {
> - compatible = "ti,bq27411";
> + bq27xxx_fg: fuel-gauge@55 {
> + compatible = "ti,bq27xxx";
And this is just breaking all users without any explanation.
> status = "okay";
> reg = <0x55>;
> };
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> index 5f01115..cf40842 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
> @@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
> };
> };
>
> -&bq27441_fg {
> +&bq27xxx_fg {
No, irrelevant to the supposed bug here.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-11 8:21 ` Krzysztof Kozlowski
@ 2026-09-11 13:37 ` Andrew Davis
2026-09-11 18:41 ` David Heidelberg
` (2 more replies)
0 siblings, 3 replies; 21+ messages in thread
From: Andrew Davis @ 2026-09-11 13:37 UTC (permalink / raw)
To: Krzysztof Kozlowski, Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel,
David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, linux-arm-msm, devicetree, linux-pm,
linux-kernel
On 9/11/26 3:21 AM, Krzysztof Kozlowski wrote:
> On Thu, Sep 10, 2026 at 02:47:44AM +0300, Rinat Muhamedgaliev wrote:
>> OnePlus 6 and OnePlus 6T battery packs may contain either a TI
>> bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
>> so the driver can select the register map from DeviceType at probe
>> time.
>>
>> Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
>> after booting the new kernel, the battery reported 4.360 V, 100% state
>> of charge, 27.8 C, and Full status.
>>
>> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
>
> What is the bug here? Your commit msg should be specific about it.
>
Commit msg seems pretty clear about the bug (to me at least), the DT
says the fuel gauge is a BQ27411 but that isn't the case, some shipped
with a BQ27541 fuel gauge.
(I do agree though this shouldn't have a fixes tag as back-porting this
without also back-porting the driver-side change would break users)
Since these fuel gauges often live on the battery pack and not the
device itself, folks changing their batteries might end up with
different fuel gauges, so having some detection method is going to
be helpful.
Rinat,
I'm not familiar with the bootflow on these devices, but is this something
you could detect in the bootloader and fixup the DT before it is passed
to kernel? That way the kernel gets a DT with the correct and specific
compatible to start with?
Andrew
>>
>> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
>> ---
>> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
>> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
>> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>> index 948a0dd..8c5cd94 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>> @@ -790,8 +790,8 @@ &i2c10 {
>> status = "okay";
>> clock-frequency = <100000>;
>>
>> - bq27441_fg: bq27441-battery@55 {
>> - compatible = "ti,bq27411";
>> + bq27xxx_fg: fuel-gauge@55 {
>> + compatible = "ti,bq27xxx";
>
> And this is just breaking all users without any explanation.
>
>
>
>> status = "okay";
>> reg = <0x55>;
>> };
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>> index 5f01115..cf40842 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>> @@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
>> };
>> };
>>
>> -&bq27441_fg {
>> +&bq27xxx_fg {
>
> No, irrelevant to the supposed bug here.
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-11 13:37 ` Andrew Davis
@ 2026-09-11 18:41 ` David Heidelberg
2026-09-11 20:00 ` David Heidelberg
2026-09-12 7:47 ` Krzysztof Kozlowski
2 siblings, 0 replies; 21+ messages in thread
From: David Heidelberg @ 2026-09-11 18:41 UTC (permalink / raw)
To: Andrew Davis, Krzysztof Kozlowski, Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Pali Rohár, linux-arm-msm,
devicetree, linux-pm, linux-kernel
On 11/09/2026 15:37, Andrew Davis wrote:
> On 9/11/26 3:21 AM, Krzysztof Kozlowski wrote:
>> On Thu, Sep 10, 2026 at 02:47:44AM +0300, Rinat Muhamedgaliev wrote:
>>> OnePlus 6 and OnePlus 6T battery packs may contain either a TI
>>> bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
>>> so the driver can select the register map from DeviceType at probe
>>> time.
>>>
>>> Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
>>> after booting the new kernel, the battery reported 4.360 V, 100% state
>>> of charge, 27.8 C, and Full status.
>>>
>>> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
>>
>> What is the bug here? Your commit msg should be specific about it.
>>
>
> Commit msg seems pretty clear about the bug (to me at least), the DT
> says the fuel gauge is a BQ27411 but that isn't the case, some shipped
> with a BQ27541 fuel gauge.
>
> (I do agree though this shouldn't have a fixes tag as back-porting this
> without also back-porting the driver-side change would break users)
>
> Since these fuel gauges often live on the battery pack and not the
> device itself, folks changing their batteries might end up with
> different fuel gauges, so having some detection method is going to
> be helpful.
>
> Rinat,
>
> I'm not familiar with the bootflow on these devices, but is this something
> you could detect in the bootloader and fixup the DT before it is passed
> to kernel? That way the kernel gets a DT with the correct and specific
> compatible to start with?
>
> Andrew
>
>>>
>>> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
>>> ---
>>> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
>>> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
>>> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/
>>> arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> index 948a0dd..8c5cd94 100644
>>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> @@ -790,8 +790,8 @@ &i2c10 {
>>> status = "okay";
>>> clock-frequency = <100000>;
>>> - bq27441_fg: bq27441-battery@55 {
>>> - compatible = "ti,bq27411";
>>> + bq27xxx_fg: fuel-gauge@55 {
>>> + compatible = "ti,bq27xxx";
>>
>> And this is just breaking all users without any explanation.
>>
>>
>>
>>> status = "okay";
>>> reg = <0x55>;
>>> };
>>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/
>>> arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>>> index 5f01115..cf40842 100644
>>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>>> @@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
>>> };
>>> };
>>> -&bq27441_fg {
>>> +&bq27xxx_fg {
>>
>> No, irrelevant to the supposed bug here.
>>
>> Best regards,
>> Krzysztof
>>
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-11 13:37 ` Andrew Davis
2026-09-11 18:41 ` David Heidelberg
@ 2026-09-11 20:00 ` David Heidelberg
2026-09-12 7:47 ` Krzysztof Kozlowski
2 siblings, 0 replies; 21+ messages in thread
From: David Heidelberg @ 2026-09-11 20:00 UTC (permalink / raw)
To: Andrew Davis, Krzysztof Kozlowski, Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Pali Rohár, linux-arm-msm,
devicetree, linux-pm, linux-kernel
On 11/09/2026 15:37, Andrew Davis wrote:
> On 9/11/26 3:21 AM, Krzysztof Kozlowski wrote:
>> On Thu, Sep 10, 2026 at 02:47:44AM +0300, Rinat Muhamedgaliev wrote:
>>> OnePlus 6 and OnePlus 6T battery packs may contain either a TI
>>> bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
>>> so the driver can select the register map from DeviceType at probe
>>> time.
>>>
>>> Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
>>> after booting the new kernel, the battery reported 4.360 V, 100% state
>>> of charge, 27.8 C, and Full status.
>>>
>>> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
>>
>> What is the bug here? Your commit msg should be specific about it.
>>
>
> Commit msg seems pretty clear about the bug (to me at least), the DT
> says the fuel gauge is a BQ27411 but that isn't the case, some shipped
> with a BQ27541 fuel gauge.
>
> (I do agree though this shouldn't have a fixes tag as back-porting this
> without also back-porting the driver-side change would break users)
>
> Since these fuel gauges often live on the battery pack and not the
> device itself, folks changing their batteries might end up with
> different fuel gauges, so having some detection method is going to
> be helpful.
>
> Rinat,
>
> I'm not familiar with the bootflow on these devices, but is this something
> you could detect in the bootloader and fixup the DT before it is passed
> to kernel? That way the kernel gets a DT with the correct and specific
> compatible to start with?
Hello Andrew:
There are two possible bootflows:
a) from fastboot (we can't do anything)
b) from intermediate u-boot (we could do this)
While your suggestion seems to be the most correct, I'm not sure the
"complexity" here outweighs the pros of simply reporting
deb_warn your phones has different charging chip
and switching the behavior to the "replacement part" here.
In the future we'll need to add u-boot logic because of camera focus, where the
focus in some phones is on different i2c addr + from different vendor, where we
cannot do it so simply as here.
What do you think?
David>
> Andrew
>
>>>
>>> Signed-off-by: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
>>> ---
>>> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 4 ++--
>>> arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 2 +-
>>> arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/
>>> arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> index 948a0dd..8c5cd94 100644
>>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> @@ -790,8 +790,8 @@ &i2c10 {
>>> status = "okay";
>>> clock-frequency = <100000>;
>>> - bq27441_fg: bq27441-battery@55 {
>>> - compatible = "ti,bq27411";
>>> + bq27xxx_fg: fuel-gauge@55 {
>>> + compatible = "ti,bq27xxx";
>>
>> And this is just breaking all users without any explanation.
>>
>>
>>
>>> status = "okay";
>>> reg = <0x55>;
>>> };
>>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/
>>> arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>>> index 5f01115..cf40842 100644
>>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
>>> @@ -44,7 +44,7 @@ main_cam_ois: main-cam-ois-regulator {
>>> };
>>> };
>>> -&bq27441_fg {
>>> +&bq27xxx_fg {
>>
>> No, irrelevant to the supposed bug here.
>>
>> Best regards,
>> Krzysztof
>>
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
2026-09-11 13:37 ` Andrew Davis
2026-09-11 18:41 ` David Heidelberg
2026-09-11 20:00 ` David Heidelberg
@ 2026-09-12 7:47 ` Krzysztof Kozlowski
2 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-12 7:47 UTC (permalink / raw)
To: Andrew Davis, Rinat Muhamedgaliev
Cc: Bjorn Andersson, Konrad Dybcio, Sebastian Reichel,
David Heidelberg, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pali Rohár, linux-arm-msm, devicetree, linux-pm,
linux-kernel
On 11/09/2026 15:37, Andrew Davis wrote:
> On 9/11/26 3:21 AM, Krzysztof Kozlowski wrote:
>> On Thu, Sep 10, 2026 at 02:47:44AM +0300, Rinat Muhamedgaliev wrote:
>>> OnePlus 6 and OnePlus 6T battery packs may contain either a TI
>>> bq27411 or bq27541 fuel gauge. Use the generic ti,bq27xxx compatible
>>> so the driver can select the register map from DeviceType at probe
>>> time.
>>>
>>> Tested on OnePlus 6T (fajita) with a bq27541 (DeviceType 0x0541):
>>> after booting the new kernel, the battery reported 4.360 V, 100% state
>>> of charge, 27.8 C, and Full status.
>>>
>>> Fixes: 12dfb002ca01 ("arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge")
>>
>> What is the bug here? Your commit msg should be specific about it.
>>
>
> Commit msg seems pretty clear about the bug (to me at least), the DT
> says the fuel gauge is a BQ27411 but that isn't the case, some shipped
> with a BQ27541 fuel gauge.
>
> (I do agree though this shouldn't have a fixes tag as back-porting this
> without also back-porting the driver-side change would break users)
But different model is not a bug by itself. If devices are compatible
how would it be a bug? if everything is working fine with different
model how would that be a bug?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2026-09-12 7:47 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-26 23:38 [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible Rinat Muhamedgaliev
2026-08-27 21:43 ` Krzysztof Kozlowski
2026-08-28 10:05 ` Konrad Dybcio
2026-08-29 21:03 ` Rinat Muhamedgaliev
2026-09-08 13:15 ` Konrad Dybcio
2026-08-29 20:52 ` [PATCH v2] " Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges Rinat Muhamedgaliev
2026-09-09 23:47 ` [PATCH v3 1/3] dt-bindings: power: supply: bq27xxx: add generic compatible Rinat Muhamedgaliev
2026-09-11 8:20 ` Krzysztof Kozlowski
2026-09-09 23:47 ` [PATCH v3 2/3] power: supply: bq27xxx: autodetect bq27411 and bq27541 Rinat Muhamedgaliev
2026-09-10 0:09 ` David Heidelberg
2026-09-10 7:42 ` Konrad Dybcio
2026-09-09 23:47 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible Rinat Muhamedgaliev
2026-09-10 0:12 ` David Heidelberg
2026-09-11 8:21 ` Krzysztof Kozlowski
2026-09-11 13:37 ` Andrew Davis
2026-09-11 18:41 ` David Heidelberg
2026-09-11 20:00 ` David Heidelberg
2026-09-12 7:47 ` Krzysztof Kozlowski
2026-09-10 0:08 ` [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges David Heidelberg
2026-09-07 8:38 ` [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible David Heidelberg
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.