From: Prachoday Sutar <prachodaysutar7@gmail.com>
To: sre@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, pali@kernel.org, afd@ti.com
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Prachoday Sutar <prachodaysutar7@gmail.com>
Subject: [PATCH v3 0/2] Add TI BQ27Z558 fuel gauge support
Date: Sun, 6 Dec 2026 13:54:59 +0530 [thread overview]
Message-ID: <20261206082501.10506-1-prachodaysutar7@gmail.com> (raw)
The TI BQ27Z558 is a single-cell fuel gauge documented in the same
Technical Reference Manual as the BQ27Z561-R2 (SLUUC54) and is register
compatible with the BQ27Z561.
Patch 1 makes the bq27xxx I2C driver take the chip type from the OF
match data via i2c_get_match_data() and use client->name for the
battery name. Until now, probe always looked up the client name in the
I2C ID table, so a device bound through a fallback compatible got a
NULL ID and crashed.
Patch 2 adds "ti,bq27z558" to the binding with "ti,bq27z561" as the
fallback. With patch 1 applied no BQ27Z558-specific driver change is
needed, and the battery is still named after the exact chip
("bq27z558-N").
Testing:
- Build-tested on x86_64 with W=1, with and without CONFIG_OF.
- dt_binding_check for bq27xxx.yaml and checkpatch --strict are clean.
- Hardware: Kneron KL630-based board with a BQ27Z558, running a vendor
Linux 4.9 kernel with BQ27Z561 support backported and "bq27z558"
added to the driver's I2C ID and OF match tables, with only
"ti,bq27z558" in the DT. Voltage, current, capacity, status and
temperature read correctly. This shows that the BQ27Z558 works with
the BQ27Z561 register map; it did not exercise this series or the
fallback compatible.
Changes in v3:
- Keep "ti,bq27z561" as the fallback compatible (Sebastian).
- New patch 1: add the chip type as .data to all OF match entries and
use i2c_get_match_data() and client->name instead of
i2c_client_get_device_id() (suggested by Andrew).
- Drop the v2 patch adding a "bq27z558" I2C device ID; it is no longer
needed after patch 1.
- Drop the separate "Add BQ27Z558 support" driver patch planned in the
v2 discussion, for the same reason.
- Put the driver change first, so the fallback binding never exists
without a driver that can handle it.
- Correct the testing description. The v1 and v2 cover letters wrongly
said the fallback compatible was tested.
Changes in v2:
- Add a patch with a "bq27z558" I2C device ID. Binding via the fallback
compatible alone left i2c_client_get_device_id() returning NULL in
probe (reported by the Sashiko AI review).
- Binding patch: drop the claim that no driver changes are needed.
Link to v2: https://lore.kernel.org/r/20261126201959.28743-1-prachodaysutar7@gmail.com
Link to v1: https://lore.kernel.org/r/20261126191906.25708-1-prachodaysutar7@gmail.com
Prachoday Sutar (2):
power: supply: bq27xxx: Use i2c_get_match_data()
dt-bindings: power: supply: bq27xxx: Add BQ27Z558
.../bindings/power/supply/bq27xxx.yaml | 72 +++++++++---------
drivers/power/supply/bq27xxx_battery_i2c.c | 76 ++++++++++---------
2 files changed, 78 insertions(+), 70 deletions(-)
base-commit: 7778cfebeb93187a47251df6ad3fbbb5709e6786
--
2.25.1
next reply other threads:[~2026-12-06 8:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 8:24 Prachoday Sutar [this message]
2026-12-06 8:25 ` [PATCH v3 1/2] power: supply: bq27xxx: Use i2c_get_match_data() Prachoday Sutar
2026-12-06 8:25 ` [PATCH v3 2/2] dt-bindings: power: supply: bq27xxx: Add BQ27Z558 Prachoday Sutar
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=20261206082501.10506-1-prachodaysutar7@gmail.com \
--to=prachodaysutar7@gmail.com \
--cc=afd@ti.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pali@kernel.org \
--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®