Devicetree
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Rinat Muhamedgaliev <rinat.muhamedgaliev@gmail.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	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: Tue, 8 Sep 2026 15:15:32 +0200	[thread overview]
Message-ID: <de1c8eb5-c965-405d-bc4e-551926a886d9@oss.qualcomm.com> (raw)
In-Reply-To: <CAGHQT46f3wexEQHpcp_aoa4MHpi6vrtAd8Pbmt0KANdn9rANLg@mail.gmail.com>

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

  reply	other threads:[~2026-09-08 13:15 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 [this message]
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

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=de1c8eb5-c965-405d-bc4e-551926a886d9@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox