[PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges

Rinat Muhamedgaliev posted 3 patches 2 weeks, 1 day ago
.../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(-)
[PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges
Posted by Rinat Muhamedgaliev 2 weeks, 1 day ago
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
Re: [PATCH v3 0/3] bq27xxx: support interchangeable OnePlus 6/6T fuel gauges
Posted by David Heidelberg 2 weeks, 1 day ago
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(-)
>