Devicetree
 help / color / mirror / Atom feed
* [PATCH V5 0/3] Add Cellwise CW2217
@ 2026-11-27 19:23 Chris Morgan
  2026-11-27 19:23 ` [PATCH V5 1/3] dt-bindings: power: cw2015: add cw2215, cw2217, and cw2218 Chris Morgan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Morgan @ 2026-11-27 19:23 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, shawn.lin, linux-pm, heiko, conor+dt, krzk+dt, robh,
	sre, t.schramm, xsf, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

Add the Cellwise CW2217 battery gauge driver. This driver is based on
the sources used for Rockchip's Board Support package [1] but has
been updated to use the regmap API and devm helpers.

[1] https://github.com/rockchip-linux/kernel/blob/develop-6.12/drivers/power/supply/cw221x_battery.c

Changes Since V4:
 - Updated bindings to set 64 as the minItems and 80 as the maxItems
   for all battery profiles. 64 remains the min and max for the cw2015
   series and 80 remains the min and max for the others.
 - Renived the status okay line from the vita-pro device tree for the
   battery monitor since it is implied.

Changes Since V3:
 - Two more small fixes requested by Sashiko, one trivial fix for the
   to not always write CW2217_CONFIG_RESTART for the cw2217_active
   method and a small fix for the regmap writeable/volatile ranges.

Changes Since V2:
 - Fixed more bugs pointed out by Sashiko.
 - Corrected an integer overflow condition when measuring current.
 - Corrected logic for when we don't have a user specified battery
   profile.
 - Added power supply changed logic in the worker.
 - Updated the Kconfig text to note support for the cw2215 and cw2218.
 - Added a check to ensure polling interval cannot be below 250ms.

Changes Since V1:
 - Added a default value for the shunt resistor in the binding
   documentation, and updated the commit description to note that the
   min and max for the battery profile is now per-compatible string.
 - Fixed bugs pointed out by Sashiko bot, and corrected units for
   temp and shunt resistor values.
 - Corrected include pointed out by kernel test robot.
 - Noted in the commit message the patch is based on original work by
   Xu Shengfei at Rockchip. I did not list him as co-developed or
   signed-off since I did not have his permission (yet) to do so,
   but I have his authorship included in the file itself.

Chris Morgan (3):
  dt-bindings: power: cw2015: add cw2215, cw2217, and cw2218
  power: supply: cw2217: Add support for Cellwise cw2217
  arm64: dts: rockchip: Add Battery Gauge to Anbernic Vita-Pro

 .../bindings/power/supply/cw2015_battery.yaml |  41 +-
 .../rockchip/rk3576-anbernic-rg-vita-pro.dts  |  20 +-
 drivers/power/supply/Kconfig                  |  11 +
 drivers/power/supply/Makefile                 |   1 +
 drivers/power/supply/cw2217_battery.c         | 878 ++++++++++++++++++
 5 files changed, 945 insertions(+), 6 deletions(-)
 create mode 100644 drivers/power/supply/cw2217_battery.c

-- 
2.53.0


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

end of thread, other threads:[~2026-11-27 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 19:23 [PATCH V5 0/3] Add Cellwise CW2217 Chris Morgan
2026-11-27 19:23 ` [PATCH V5 1/3] dt-bindings: power: cw2015: add cw2215, cw2217, and cw2218 Chris Morgan
2026-11-27 19:23 ` [PATCH V5 2/3] power: supply: cw2217: Add support for Cellwise cw2217 Chris Morgan
2026-11-27 19:23 ` [PATCH V5 3/3] arm64: dts: rockchip: Add Battery Gauge to Anbernic Vita-Pro Chris Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox