power: supply: bq25890: show max charge current/voltage as configured
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Mon, 17 Dec 2018 19:28:16 +0000 (20:28 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 23 Jan 2019 21:29:45 +0000 (22:29 +0100)
Use firmware-provided limits for POWER_SUPPLY_*_MAX properties instead
of chip max values. This will reflect the battery limits as those are
the important ones.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq25890_charger.c

index 3f6fb49c956cc5ded343bda7d75361c4f5140964..66991e6f75d99ab8e98afd04fb9c63426866107b 100644 (file)
@@ -436,7 +436,7 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
                break;
 
        case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
-               val->intval = bq25890_tables[TBL_ICHG].rt.max;
+               val->intval = bq25890_find_val(bq->init_data.ichg, TBL_ICHG);
                break;
 
        case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
@@ -454,7 +454,7 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
                break;
 
        case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX:
-               val->intval = bq25890_tables[TBL_VREG].rt.max;
+               val->intval = bq25890_find_val(bq->init_data.vreg, TBL_VREG);
                break;
 
        case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: