From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Matt DeVillier <matt.devillier@gmail.com>
Cc: "Sebastian Reichel" <sre@kernel.org>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Benson Leung" <bleung@chromium.org>,
"Guenter Roeck" <groeck@chromium.org>,
chrome-platform@lists.linux.dev, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] power: supply: cros_charge-control: adopt EC charge state on probe
Date: Mon, 31 Aug 2026 02:35:11 +0000 [thread overview]
Message-ID: <apToX3Paxb5sdClO@google.com> (raw)
In-Reply-To: <20260828142318.1881516-1-matt.devillier@gmail.com>
On Fri, Aug 28, 2026 at 09:23:15AM -0500, Matt DeVillier wrote:
> 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>
prev parent reply other threads:[~2026-08-31 2:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 15:57 [PATCH] power: supply: cros_charge-control: adopt EC charge state on probe Matt DeVillier
2026-08-25 10:04 ` Tzung-Bi Shih
2026-08-25 10:40 ` Thomas Weißschuh
2026-08-25 12:08 ` [PATCH v2] " Matt DeVillier
2026-08-25 12:09 ` Matt DeVillier
2026-08-25 16:51 ` Thomas Weißschuh
2026-08-26 1:58 ` Tzung-Bi Shih
2026-08-28 14:23 ` [PATCH v3] " Matt DeVillier
2026-08-31 2:35 ` Tzung-Bi Shih [this message]
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=apToX3Paxb5sdClO@google.com \
--to=tzungbi@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=matt.devillier@gmail.com \
--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