All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Heidelberg <david@ixit.cz>
To: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Caleb Connolly <caleb@connolly.tech>,
	Frederic Laing <dev@fredfunk.tech>
Subject: Re: [PATCH] arm64: dts: qcom: sdm845-oneplus: fix fuel gauge compatible
Date: Mon, 7 Sep 2026 10:38:34 +0200	[thread overview]
Message-ID: <06aa2b47-c5d0-4ef4-8d3b-9780dcc4bcf3@ixit.cz> (raw)
In-Reply-To: <20260826233818.124278-1-rinat.muhamedgaliev@gmail.com>

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>;
>   };
>   


      parent reply	other threads:[~2026-09-07  8:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` David Heidelberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06aa2b47-c5d0-4ef4-8d3b-9780dcc4bcf3@ixit.cz \
    --to=david@ixit.cz \
    --cc=andersson@kernel.org \
    --cc=caleb@connolly.tech \
    --cc=conor+dt@kernel.org \
    --cc=dev@fredfunk.tech \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rinat.muhamedgaliev@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.