Skip to content

Commit 6197880

Browse files
macromorgansre
authored andcommitted
power: supply: axp20x_battery: Remove design from min and max voltage
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: 46c202b ("power: supply: add battery driver for AXP20X and AXP22X PMICs") Suggested-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Chris Morgan <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent e764374 commit 6197880

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/power/supply/axp20x_battery.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ static int axp20x_battery_get_prop(struct power_supply *psy,
303303
val->intval = reg & AXP209_FG_PERCENT;
304304
break;
305305

306-
case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
306+
case POWER_SUPPLY_PROP_VOLTAGE_MAX:
307307
return axp20x_batt->data->get_max_voltage(axp20x_batt,
308308
&val->intval);
309309

310-
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
310+
case POWER_SUPPLY_PROP_VOLTAGE_MIN:
311311
ret = regmap_read(axp20x_batt->regmap, AXP20X_V_OFF, &reg);
312312
if (ret)
313313
return ret;
@@ -455,10 +455,10 @@ static int axp20x_battery_set_prop(struct power_supply *psy,
455455
struct axp20x_batt_ps *axp20x_batt = power_supply_get_drvdata(psy);
456456

457457
switch (psp) {
458-
case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
458+
case POWER_SUPPLY_PROP_VOLTAGE_MIN:
459459
return axp20x_set_voltage_min_design(axp20x_batt, val->intval);
460460

461-
case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
461+
case POWER_SUPPLY_PROP_VOLTAGE_MAX:
462462
return axp20x_batt->data->set_max_voltage(axp20x_batt, val->intval);
463463

464464
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
@@ -493,17 +493,17 @@ static enum power_supply_property axp20x_battery_props[] = {
493493
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
494494
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
495495
POWER_SUPPLY_PROP_HEALTH,
496-
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
497-
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
496+
POWER_SUPPLY_PROP_VOLTAGE_MAX,
497+
POWER_SUPPLY_PROP_VOLTAGE_MIN,
498498
POWER_SUPPLY_PROP_CAPACITY,
499499
};
500500

501501
static int axp20x_battery_prop_writeable(struct power_supply *psy,
502502
enum power_supply_property psp)
503503
{
504504
return psp == POWER_SUPPLY_PROP_STATUS ||
505-
psp == POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN ||
506-
psp == POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN ||
505+
psp == POWER_SUPPLY_PROP_VOLTAGE_MIN ||
506+
psp == POWER_SUPPLY_PROP_VOLTAGE_MAX ||
507507
psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT ||
508508
psp == POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX;
509509
}

0 commit comments

Comments
 (0)