diff options
| author | 2026-08-25 07:09:00 -0500 | |
|---|---|---|
| committer | 2026-09-10 00:43:06 +0200 | |
| commit | 4fc88ba435dadbc05990951e3f3fbd8ccd2df140 (patch) | |
| tree | d4bb24d8181c0cff628b0557d75e6054af3fc137 /scripts/Makefile.thinlto | |
| parent | power: supply: bq2515x: Propagate charge-enable read errors (diff) | |
power: supply: cros_charge-control: adopt EC charge state on probe
The driver previously always forced AUTO with no charge limits at
probe, which discarded sustainer thresholds and modes set by firmware
or firmware setup before the kernel loaded.
For command versions that support GET (v2+), read the EC state into
the driver cache instead. Valid sustainer limits are adopted as AUTO
with those thresholds: while the sustainer is active the EC may report
IDLE or DISCHARGE as a transient hold/discharge step, which must not
be exposed as inhibit-charge or force-discharge. Sustainer off
(-1/-1) still maps to Linux "no limit" (0/100); other invalid limit
pairs are remapped the same way with a warning and pushed back to
the EC so the cache stays in sync.
If GET fails, fall back to the previous defaults and SET them on the
EC. Command version 1 still cannot report state and keeps forcing a
well-known configuration.
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260825120929.13168-2-matt.devillier@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
