All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] power: supply: read-only CellWise CW2017 monitor for Redmi Go
@ 2026-10-29 17:53 Kupreenko Danila
  2026-10-29 17:53 ` [RFC PATCH 3/3] arm64: dts: qcom: tiare: describe CW2017 fuel gauge Kupreenko Danila
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kupreenko Danila @ 2026-10-29 17:53 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa, linux-pm, devicetree, linux-arm-msm,
	linux-kernel

Add a read-only power_supply driver for the CellWise CW2017 fuel gauge,
its Devicetree binding, and the Xiaomi Redmi Go (tiare) I2C node.

Unlike CW2015, CW2017 has a different register map and battery profile
protocol. The driver requires a gauge already initialized with a valid
battery profile; it reads voltage, integer SOC and temperature but never
writes CONFIG, changes the battery profile or resets the chip. Charging
status is unknown; presence is not inferred.

The CW2017 source is an independent implementation assisted by Codex
(GPT-6). Firefly was consulted later as a behavioral reference, not as
a source of copied code. AI assistance is disclosed in commit trailers.

Hardware testing on Xiaomi Redmi Go (tiare), postmarketOS, Linux
7.1.3-msm89x7 with a module built from the same RFC driver source (R5):
  - module auto-loaded and bound to I2C device 2-0063;
  - running srcversion matched the locally built R5 module;
  - capacity, voltage and temperature appeared in power_supply sysfs;
  - three consecutive measurements remained accessible;
  - udevadm monitor observed kernel power_supply change events, including
    changes in voltage and temperature, with roughly 30-second cadence.

Mainline 7.3 ARM64 build/MODPOST, targeted DT/schema validation, sparse
and host mock regressions with sanitizers passed. The mainline kernel
itself has NOT been booted on Redmi Go. Hardware PM/unbind, power cost,
calibration, temperature-source provenance and induced I2C error recovery
remain untested. The source operates as a monitor, not a safety controller.

Open review questions include policy for already-initialized gauges,
3-attempt probe retries, nominal 30-second polling and up to 300-second
backoff after failures, and event frequency with small voltage changes.

This is the first PUBLIC RFC; preceding revisions remained local.

Kupreenko Danila (3):
  dt-bindings: power: supply: add CellWise CW2017 fuel gauge
  power: supply: add read-only CW2017 battery monitor
  arm64: dts: qcom: tiare: describe CW2017 fuel gauge

 .../power/supply/cellwise,cw2017.yaml         |  52 +++
 MAINTAINERS                                   |   7 +
 .../boot/dts/qcom/msm8917-xiaomi-tiare.dts    |   9 +
 drivers/power/supply/Kconfig                  |  14 +
 drivers/power/supply/Makefile                 |   1 +
 drivers/power/supply/cw2017_battery.c         | 370 ++++++++++++++++++
 6 files changed, 453 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/cellwise,cw2017.yaml
 create mode 100644 drivers/power/supply/cw2017_battery.c

base-commit: c339f4010dea8b0d754f84ace70cd1b089878ef8
-- 
2.56.0

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

end of thread, other threads:[~2026-10-29 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 17:53 [RFC PATCH 0/3] power: supply: read-only CellWise CW2017 monitor for Redmi Go Kupreenko Danila
2026-10-29 17:53 ` [RFC PATCH 3/3] arm64: dts: qcom: tiare: describe CW2017 fuel gauge Kupreenko Danila
2026-10-29 18:11   ` sashiko-bot
2026-10-29 17:53 ` [RFC PATCH 1/3] dt-bindings: power: supply: add CellWise " Kupreenko Danila
2026-10-29 17:53 ` [RFC PATCH 2/3] power: supply: add read-only CW2017 battery monitor Kupreenko Danila
2026-10-29 18:06   ` sashiko-bot
2026-10-29 19:10     ` Kupreenko Danila

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.