From: Chris Morgan <macroalpha82@gmail.com>
To: linux-rockchip@lists.infradead.org
Cc: mfd@lists.linux.dev, linux-pm@vger.kernel.org,
maccraft123mc@gmail.com, heiko@sntech.de, lee@kernel.org,
sre@kernel.org, Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH V4 7/7] power: supply: rk817-charger: Clear full charge cal on resume
Date: Wed, 11 Nov 2026 14:56:27 -0600 [thread overview]
Message-ID: <20261111205627.56652-8-macroalpha82@gmail.com> (raw)
In-Reply-To: <20261111205627.56652-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
After suspending, the coulumb counter may be off by a bit. Set the
cal_soc bit to 0 so that the gauge may be recalibrated again on a
full charge.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Lee Jones <lee@kernel.org>
---
drivers/power/supply/rk817_charger.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c
index 9a8d14691f9a..fa140d437b04 100644
--- a/drivers/power/supply/rk817_charger.c
+++ b/drivers/power/supply/rk817_charger.c
@@ -1398,6 +1398,9 @@ static int __maybe_unused rk817_resume(struct device *dev)
struct rk817_charger *charger = dev_get_drvdata(dev);
+ /* try to recalibrate capacity if we hit full charge. */
+ charger->soc_cal = 0;
+
/* force an immediate update */
mod_delayed_work(system_percpu_wq, &charger->work, 0);
--
2.53.0
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
prev parent reply other threads:[~2026-11-11 20:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 20:56 [PATCH V4 0/7] Fix Incorrect State of Charge for RK817 Chris Morgan
2026-11-11 20:56 ` [PATCH V4 1/7] power: supply: rk817-charger: correct spelling of coulomb Chris Morgan
2026-11-11 20:56 ` [PATCH V4 2/7] power: supply: rk817-charger: Fix NVRAM SoC value Chris Morgan
2026-11-11 20:56 ` [PATCH V4 3/7] power: supply: rk817-charger: simplify re-initializing coulomb counter Chris Morgan
2026-11-11 20:56 ` [PATCH V4 4/7] power: supply: rk817-charger: Resolve boot state of charge from " Chris Morgan
2026-11-11 20:56 ` [PATCH V4 5/7] power: supply: rk817-charger: Expose boot voltage and OCV values Chris Morgan
2026-11-11 20:56 ` [PATCH V4 6/7] power: supply: rk817-charger: Clear SYS_CAN_SD reg by default Chris Morgan
2026-11-11 20:56 ` Chris Morgan [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=20261111205627.56652-8-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=heiko@sntech.de \
--cc=lee@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maccraft123mc@gmail.com \
--cc=macromorgan@hotmail.com \
--cc=mfd@lists.linux.dev \
--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