All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] power: supply: bq25630: scope the battery information
@ 2026-07-30  1:17 Linmao Li
  2026-07-30  1:17 ` [PATCH v3 1/2] power: supply: bq25630: Scope battery information to bq25630_setup() Linmao Li
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Linmao Li @ 2026-07-30  1:17 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Waqar Hameed, linux-pm, linux-kernel, Linmao Li

data->batinfo is only read by bq25630_setup(), but it is fetched in
bq25630_probe() and kept in the driver data for the lifetime of the
device.

Patch 1 moves the get/put pair into bq25630_setup() and drops the member.
Patch 2 then uses the new power_supply_desc::init callback so the charger
registers are programmed before the device is exposed to the system.

Patch 2 depends on commit c1eb5905fdce ("power: supply: Add registration
init callback"), which is in the power-supply tree but not in linux-next
yet. The series is therefore based on power-supply/for-next.

Changes in v3:
- Use dev_err() instead of dev_err_probe() for the battery info failure in
  bq25630_setup(). The function is currently only reached from probe(), but
  that should not be baked in as a policy, and the rest of the function
  already uses dev_err() (Waqar Hameed).
- Rebased onto current power-supply/for-next.

Note that v2 went out with a broken charset in the Content-Type header,
which made git am fail. That was a send-email misconfiguration on my side,
not a change in the patches themselves; it is fixed for this posting.
Thanks to Waqar Hameed for reporting it.

Changes in v2:
- Move the battery information get/put pair into bq25630_setup().
- Remove the now-unused batinfo member from the driver data.
- Use power_supply_desc::init to complete the hardware setup before the
  power supply is exposed.
- Split the changes into two patches.

Link to v2:
https://lore.kernel.org/linux-pm/20260728024558.3611522-1-lilinmao@kylinos.cn/
Link to v1:
https://lore.kernel.org/linux-pm/20260727093738.2611185-1-lilinmao@kylinos.cn/

Compile-tested on power-supply/for-next with CONFIG_CHARGER_BQ25630=m; both
patches build cleanly with W=1. Not tested on hardware.

Linmao Li (2):
  power: supply: bq25630: Scope battery information to bq25630_setup()
  power: supply: bq25630: Initialize hardware before exposing the power
    supply

 drivers/power/supply/bq25630_charger.c | 56 +++++++++++++-------------
 1 file changed, 29 insertions(+), 27 deletions(-)


base-commit: 5584ad5706e594c7648655171785aa4fffdd3db5
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-30 22:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30  1:17 [PATCH v3 0/2] power: supply: bq25630: scope the battery information Linmao Li
2026-07-30  1:17 ` [PATCH v3 1/2] power: supply: bq25630: Scope battery information to bq25630_setup() Linmao Li
2026-07-30 19:22   ` Waqar Hameed
2026-07-30  1:17 ` [PATCH v3 2/2] power: supply: bq25630: Initialize hardware before exposing the power supply Linmao Li
2026-07-30 19:21   ` Waqar Hameed
2026-07-30 22:04 ` [PATCH v3 0/2] power: supply: bq25630: scope the battery information Sebastian Reichel

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.