From: Dzmitry Sankouski <dsankouski@gmail.com>
To: Chanwoo Choi <cw00.choi@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Lee Jones <lee@kernel.org>, Sebastian Reichel <sre@kernel.org>,
Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Dzmitry Sankouski <dsankouski@gmail.com>
Subject: [PATCH 9/9] power: supply: max77976_charger: fix constant current reporting
Date: Sat, 30 Aug 2025 23:45:22 +0300 [thread overview]
Message-ID: <20250830-max77705_77976_charger_improvement-v1-9-e976db3fd432@gmail.com> (raw)
In-Reply-To: <20250830-max77705_77976_charger_improvement-v1-0-e976db3fd432@gmail.com>
CHARGE_CONTROL_LIMIT is a wrong property to report charge current limit,
because `CHARGE_*` attributes represents capacity, not current. The
correct attribute to report and set charge current limit is
CONSTANT_CHARGE_CURRENT.
Rename CHARGE_CONTROL_LIMIT to CONSTANT_CHARGE_CURRENT.
Fixes: 715ecbc10d6a ("power: supply: max77976: add Maxim MAX77976 charger driver")
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
drivers/power/supply/max77976_charger.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/power/supply/max77976_charger.c b/drivers/power/supply/max77976_charger.c
index e6fe68cebc32..3d6ff4005533 100644
--- a/drivers/power/supply/max77976_charger.c
+++ b/drivers/power/supply/max77976_charger.c
@@ -292,10 +292,10 @@ static int max77976_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_ONLINE:
err = max77976_get_online(chg, &val->intval);
break;
- case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX:
+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
val->intval = MAX77976_CHG_CC_MAX;
break;
- case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT:
+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
err = max77976_get_integer(chg, CHG_CC,
MAX77976_CHG_CC_MIN,
MAX77976_CHG_CC_MAX,
@@ -330,7 +330,7 @@ static int max77976_set_property(struct power_supply *psy,
int err = 0;
switch (psp) {
- case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT:
+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
err = max77976_set_integer(chg, CHG_CC,
MAX77976_CHG_CC_MIN,
MAX77976_CHG_CC_MAX,
@@ -355,7 +355,7 @@ static int max77976_property_is_writeable(struct power_supply *psy,
enum power_supply_property psp)
{
switch (psp) {
- case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT:
+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
return true;
default:
@@ -368,8 +368,8 @@ static enum power_supply_property max77976_psy_props[] = {
POWER_SUPPLY_PROP_CHARGE_TYPE,
POWER_SUPPLY_PROP_HEALTH,
POWER_SUPPLY_PROP_ONLINE,
- POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
- POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
--
2.39.5
prev parent reply other threads:[~2025-08-30 20:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 20:45 [PATCH 0/9] power: supply: fixes and improvements for max77(705,976) chargers Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 1/9] power: supply: max77705_charger: move active discharge setting to mfd parent Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 2/9] power: supply: max77705_charger: refactoring: rename charger to chg Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 3/9] power: supply: max77705_charger: use regfields for config registers Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 4/9] power: supply: max77705_charger: return error when config fails Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 5/9] power: supply: max77705_charger: add writable properties Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 6/9] power: supply: max77705_charger: rework interrupts Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 7/9] power: supply: max77705_charger: use REGMAP_IRQ_REG_LINE macro Dzmitry Sankouski
2025-08-30 20:45 ` [PATCH 8/9] power: supply: max77705_charger: implement aicl feature Dzmitry Sankouski
2025-08-30 20:45 ` Dzmitry Sankouski [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=20250830-max77705_77976_charger_improvement-v1-9-e976db3fd432@gmail.com \
--to=dsankouski@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=krzk@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=sebastian.reichel@collabora.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