aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-12-26 07:59:07 -0500
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>2018-01-08 12:38:57 -0500
commit81d56dd3d5854b22a4fa724bffd37a8cf673093d (patch)
tree4627568a469c3a0333afaaa868f1adec17800186
parent9563d054168c475b43bd5165dd952ea3187cac6a (diff)
power: supply: axp288_charger: Use the right property for the input current limit
Use the right property for the input current limit and make it writable. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-rw-r--r--drivers/power/supply/axp288_charger.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index fdca0a4a1c8e..8f4ac2d38b3f 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -378,6 +378,11 @@ static int axp288_charger_usb_set_property(struct power_supply *psy,
378 if (ret < 0) 378 if (ret < 0)
379 dev_warn(&info->pdev->dev, "set charge voltage failed\n"); 379 dev_warn(&info->pdev->dev, "set charge voltage failed\n");
380 break; 380 break;
381 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
382 ret = axp288_charger_set_vbus_inlmt(info, val->intval);
383 if (ret < 0)
384 dev_warn(&info->pdev->dev, "set input current limit failed\n");
385 break;
381 default: 386 default:
382 ret = -EINVAL; 387 ret = -EINVAL;
383 } 388 }
@@ -430,7 +435,7 @@ static int axp288_charger_usb_get_property(struct power_supply *psy,
430 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: 435 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
431 val->intval = info->max_cv * 1000; 436 val->intval = info->max_cv * 1000;
432 break; 437 break;
433 case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT: 438 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
434 ret = axp288_charger_get_vbus_inlmt(info); 439 ret = axp288_charger_get_vbus_inlmt(info);
435 if (ret < 0) 440 if (ret < 0)
436 return ret; 441 return ret;
@@ -451,6 +456,7 @@ static int axp288_charger_property_is_writeable(struct power_supply *psy,
451 switch (psp) { 456 switch (psp) {
452 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: 457 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
453 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: 458 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
459 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
454 ret = 1; 460 ret = 1;
455 break; 461 break;
456 default: 462 default:
@@ -469,7 +475,7 @@ static enum power_supply_property axp288_usb_props[] = {
469 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, 475 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
470 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, 476 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
471 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, 477 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
472 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT, 478 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
473}; 479};
474 480
475static const struct power_supply_desc axp288_charger_desc = { 481static const struct power_supply_desc axp288_charger_desc = {