1
0
Fork 0

power-supply: add support for setting max current for USB1/USB2 separately

In order for the MAX77818 driver to be able to set the max current separately
for the two VBUS lines, a new property was added (POWER_SUPPLY_PROP_CURRENT_MAX2),
enabling POWER_SUPPLY_PROP_CURRENT_MAX to configure USB1 max current draw and
POWER_SUPPLY_PROP_CURRENT_MAX2 to configure USB2 max current respectively.
pull/10/head
Steinar Bakkemo 2020-04-16 14:19:55 +02:00
parent f23dba4f13
commit 8ab4975d96
2 changed files with 3 additions and 0 deletions

View File

@ -220,6 +220,7 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(voltage_ocv),
POWER_SUPPLY_ATTR(voltage_boot),
POWER_SUPPLY_ATTR(current_max),
POWER_SUPPLY_ATTR(current_max2),
POWER_SUPPLY_ATTR(current_now),
POWER_SUPPLY_ATTR(current_avg),
POWER_SUPPLY_ATTR(current_boot),

View File

@ -116,6 +116,7 @@ enum power_supply_property {
POWER_SUPPLY_PROP_VOLTAGE_OCV,
POWER_SUPPLY_PROP_VOLTAGE_BOOT,
POWER_SUPPLY_PROP_CURRENT_MAX,
POWER_SUPPLY_PROP_CURRENT_MAX2,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CURRENT_AVG,
POWER_SUPPLY_PROP_CURRENT_BOOT,
@ -412,6 +413,7 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
case POWER_SUPPLY_PROP_CURRENT_MAX:
case POWER_SUPPLY_PROP_CURRENT_MAX2:
case POWER_SUPPLY_PROP_CURRENT_NOW:
case POWER_SUPPLY_PROP_CURRENT_AVG:
case POWER_SUPPLY_PROP_CURRENT_BOOT: