diff mbox series

[3/3] power: supply: bq25890: show max charge current/voltage as configured

Message ID e64e265aaac864e353289c076769aca96148b325.1545014442.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State Not Applicable, archived
Headers show
Series Fix and extend bq25890 charger driver | expand

Commit Message

Michał Mirosław Dec. 17, 2018, 2:52 a.m. UTC
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>
---
 drivers/power/supply/bq25890_charger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index a8b2d939cfcd..f998738fa239 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -432,7 +432,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:
@@ -450,7 +450,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: