mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Heidelberg <david@ixit.cz>
To: Andrew Davis <afd@ti.com>, Krzysztof Kozlowski <krzk@kernel.org>,
	Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
Cc: "Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Pali Rohár" <pali@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] arm64: dts: qcom: sdm845-oneplus: use generic fuel gauge compatible
Date: Fri, 11 Sep 2026 22:00:12 +0200	[thread overview]
Message-ID: <f5f6e231-ff11-45cf-af30-9db346ba5f97@ixit.cz> (raw)
In-Reply-To: <6c45cfd5-ac37-4f8e-bde3-0391512df982@ti.com>



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


  parent reply	other threads:[~2026-09-11 20:00 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 " 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 [this message]
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

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=f5f6e231-ff11-45cf-af30-9db346ba5f97@ixit.cz \
    --to=david@ixit.cz \
    --cc=afd@ti.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=rinat.muhamedgaliev@gmail.com \
    --cc=robh@kernel.org \
    --cc=sre@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 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®