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>,
Jacob Cook <jacobmcook1984@gmail.com>
Subject: [PATCH V3 5/7] power: supply: rk817-charger: Expose boot voltage and OCV values
Date: Mon, 9 Nov 2026 08:58:31 -0600 [thread overview]
Message-ID: <20261109145833.1363319-6-macroalpha82@gmail.com> (raw)
In-Reply-To: <20261109145833.1363319-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
Expose PWRON_VOL as POWER_SUPPLY_PROP_VOLTAGE_BOOT and the current
rested pair as POWER_SUPPLY_PROP_VOLTAGE_OCV. The OCV value will
return -ENODATA while the battery is not resting.
Co-developed-by: Jacob Cook <jacobmcook1984@gmail.com>
Signed-off-by: Jacob Cook <jacobmcook1984@gmail.com>
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Lee Jones <lee@kernel.org>
---
drivers/power/supply/rk817_charger.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c
index fe2c949ac5a5..ede89d84ab0e 100644
--- a/drivers/power/supply/rk817_charger.c
+++ b/drivers/power/supply/rk817_charger.c
@@ -565,6 +565,14 @@ static int rk817_bat_get_prop(struct power_supply *ps,
case POWER_SUPPLY_PROP_VOLTAGE_AVG:
val->intval = charger->volt_avg_uv;
break;
+ case POWER_SUPPLY_PROP_VOLTAGE_BOOT:
+ val->intval = charger->boot_voltage_uv;
+ break;
+ case POWER_SUPPLY_PROP_VOLTAGE_OCV:
+ if (!charger->relax_voltage_uv)
+ return -ENODATA;
+ val->intval = charger->relax_voltage_uv;
+ break;
case POWER_SUPPLY_PROP_CURRENT_AVG:
val->intval = charger->cur_avg_ua;
break;
@@ -703,6 +711,8 @@ static enum power_supply_property rk817_bat_props[] = {
POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
POWER_SUPPLY_PROP_VOLTAGE_AVG,
+ POWER_SUPPLY_PROP_VOLTAGE_BOOT,
+ POWER_SUPPLY_PROP_VOLTAGE_OCV,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_CURRENT_AVG,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
--
2.53.0
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-11-09 14:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 14:58 [PATCH V3 0/7] Fix Incorrect State of Charge for RK817 Chris Morgan
2026-11-09 14:58 ` [PATCH V3 1/7] power: supply: rk817-charger: correct spelling of coulomb Chris Morgan
2026-11-09 14:58 ` [PATCH V3 2/7] power: supply: rk817-charger: Fix NVRAM SoC value Chris Morgan
2026-11-09 14:58 ` [PATCH V3 3/7] power: supply: rk817-charger: simplify re-initializing coulomb counter Chris Morgan
2026-11-09 14:58 ` [PATCH V3 4/7] power: supply: rk817-charger: Resolve boot state of charge from " Chris Morgan
2026-11-09 14:58 ` Chris Morgan [this message]
2026-11-09 14:58 ` [PATCH V3 6/7] power: supply: rk817-charger: Clear SYS_CAN_SD reg by default Chris Morgan
2026-11-09 14:58 ` [PATCH V3 7/7] power: supply: rk817-charger: Clear full charge cal on resume Chris Morgan
2026-11-09 21:41 ` [PATCH V3 0/7] Fix Incorrect State of Charge for RK817 Chris Morgan
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=20261109145833.1363319-6-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=heiko@sntech.de \
--cc=jacobmcook1984@gmail.com \
--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