From: Chris Morgan <macroalpha82@gmail.com>
To: linux-sunxi@lists.linux.dev
Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
quentin.schulz@free-electrons.com, mripard@kernel.org,
tgamblin@baylibre.com, aidanmacdonald.0x0@gmail.com,
u.kleine-koenig@pengutronix.de, lee@kernel.org,
samuel@sholland.org, jernej.skrabec@gmail.com, sre@kernel.org,
wens@csie.org, conor+dt@kernel.org, krzk+dt@kernel.org,
robh@kernel.org, lars@metafoo.de, jic23@kernel.org,
jonathan.cameron@huawei.com,
Chris Morgan <macromorgan@hotmail.com>,
Chen-Yu Tsai <wens@kernel.org>
Subject: [PATCH V4 02/15] power: supply: axp20x_battery: Remove design from min and max voltage
Date: Wed, 21 Aug 2024 16:54:43 -0500 [thread overview]
Message-ID: <20240821215456.962564-3-macroalpha82@gmail.com> (raw)
In-Reply-To: <20240821215456.962564-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
The POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN and
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN values should be immutable
properties of the battery, but for this driver they are writable values
and used as the minimum and maximum values for charging. Remove the
DESIGN designation from these values.
Fixes: 46c202b5f25f ("power: supply: add battery driver for AXP20X and AXP22X PMICs")
Suggested-by: Chen-Yu Tsai <wens@kernel.org>
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
drivers/power/supply/axp20x_battery.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
index 6ac5c80cfda2..7520b599eb3d 100644
--- a/drivers/power/supply/axp20x_battery.c
+++ b/drivers/power/supply/axp20x_battery.c
@@ -303,11 +303,11 @@ static int axp20x_battery_get_prop(struct power_supply *psy,
val->intval = reg & AXP209_FG_PERCENT;
break;
- case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
+ case POWER_SUPPLY_PROP_VOLTAGE_MAX:
return axp20x_batt->data->get_max_voltage(axp20x_batt,
&val->intval);
- case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
+ case POWER_SUPPLY_PROP_VOLTAGE_MIN:
ret = regmap_read(axp20x_batt->regmap, AXP20X_V_OFF, ®);
if (ret)
return ret;
@@ -455,10 +455,10 @@ static int axp20x_battery_set_prop(struct power_supply *psy,
struct axp20x_batt_ps *axp20x_batt = power_supply_get_drvdata(psy);
switch (psp) {
- case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
+ case POWER_SUPPLY_PROP_VOLTAGE_MIN:
return axp20x_set_voltage_min_design(axp20x_batt, val->intval);
- case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
+ case POWER_SUPPLY_PROP_VOLTAGE_MAX:
return axp20x_batt->data->set_max_voltage(axp20x_batt, val->intval);
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
@@ -493,8 +493,8 @@ static enum power_supply_property axp20x_battery_props[] = {
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_HEALTH,
- POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
- POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
+ POWER_SUPPLY_PROP_VOLTAGE_MAX,
+ POWER_SUPPLY_PROP_VOLTAGE_MIN,
POWER_SUPPLY_PROP_CAPACITY,
};
@@ -502,8 +502,8 @@ static int axp20x_battery_prop_writeable(struct power_supply *psy,
enum power_supply_property psp)
{
return psp == POWER_SUPPLY_PROP_STATUS ||
- psp == POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN ||
- psp == POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN ||
+ psp == POWER_SUPPLY_PROP_VOLTAGE_MIN ||
+ psp == POWER_SUPPLY_PROP_VOLTAGE_MAX ||
psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT ||
psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX;
}
--
2.34.1
next prev parent reply other threads:[~2024-08-21 21:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 21:54 [PATCH V4 00/15] Add Battery and USB Supply for AXP717 Chris Morgan
2024-08-21 21:54 ` [PATCH V4 01/15] iio: adc: axp20x_adc: Add adc_en1 and adc_en2 to axp_data Chris Morgan
2024-08-21 21:54 ` Chris Morgan [this message]
2024-08-21 21:54 ` [PATCH V4 03/15] power: supply: axp20x_battery: Make iio and battery config per device Chris Morgan
2024-08-21 21:54 ` [PATCH V4 04/15] power: supply: axp20x_usb_power: Make VBUS and IIO " Chris Morgan
2024-08-21 21:54 ` [PATCH V4 05/15] dt-bindings: power: supply: axp20x: Add input-current-limit-microamp Chris Morgan
2024-08-22 7:04 ` Krzysztof Kozlowski
2024-08-21 21:54 ` [PATCH V4 06/15] power: supply: axp20x_usb_power: add input-current-limit-microamp Chris Morgan
2024-08-21 21:54 ` [PATCH V4 07/15] dt-bindings: power: supply: axp20x-battery: Add monitored-battery Chris Morgan
2024-08-21 21:54 ` [PATCH V4 08/15] dt-bindings: iio: adc: Add AXP717 compatible Chris Morgan
2024-08-21 21:54 ` [PATCH V4 09/15] dt-bindings: power: supply: axp20x: " Chris Morgan
2024-08-21 21:54 ` [PATCH V4 10/15] " Chris Morgan
2024-08-21 21:54 ` [PATCH V4 11/15] mfd: axp20x: Add ADC, BAT, and USB cells for AXP717 Chris Morgan
2024-08-22 13:54 ` (subset) " Lee Jones
2024-08-26 11:03 ` Jonathan Cameron
2024-08-27 16:29 ` Sebastian Reichel
2024-08-29 12:15 ` Lee Jones
2024-08-29 12:17 ` Lee Jones
2024-08-21 21:54 ` [PATCH V4 12/15] iio: adc: axp20x_adc: add support for AXP717 ADC Chris Morgan
2024-08-21 21:54 ` [PATCH V4 13/15] power: supply: axp20x_usb_power: Add support for AXP717 Chris Morgan
2024-08-21 21:54 ` [PATCH V4 14/15] power: supply: axp20x_battery: add " Chris Morgan
2024-08-27 16:24 ` Sebastian Reichel
2024-08-30 1:11 ` Chris Morgan
2024-09-03 22:26 ` Sebastian Reichel
2024-08-21 21:54 ` [PATCH V4 15/15] arm64: dts: allwinner: h700: Add charger for Anbernic RG35XX Chris Morgan
2024-08-27 16:25 ` (subset) [PATCH V4 00/15] Add Battery and USB Supply for AXP717 Sebastian Reichel
2024-08-29 12:17 ` Lee Jones
2024-08-30 8:34 ` [GIT PULL] Immutable branch between MFD, IIO and Power due for the v6.12 merge window Lee Jones
2024-09-03 21:57 ` (subset) [PATCH V4 00/15] Add Battery and USB Supply for AXP717 Sebastian Reichel
2024-09-04 14:56 ` Chen-Yu Tsai
2024-09-07 13:30 ` Jonathan Cameron
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=20240821215456.962564-3-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=aidanmacdonald.0x0@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=jic23@kernel.org \
--cc=jonathan.cameron@huawei.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=macromorgan@hotmail.com \
--cc=mripard@kernel.org \
--cc=quentin.schulz@free-electrons.com \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=sre@kernel.org \
--cc=tgamblin@baylibre.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wens@csie.org \
--cc=wens@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;
as well as URLs for NNTP newsgroup(s).