[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <fdd9ec41a66113264c3b233658a72e00159f65d5.1585838679.git.mirq-linux@rere.qmqm.pl>
Date: Thu, 02 Apr 2020 16:58:35 +0200
From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
To: Sebastian Reichel <sre@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: [PATCH 12/14] power: supply: bq25890: show VSYS as output voltage
VSYS is the voltage that is provided to the rest of the system. Show
measurement OUTPUT_VOLTAGE and supplement it with VSYSMIN setting.
Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
---
drivers/power/supply/bq25890_charger.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index d23274d13263..6c277f2dbae2 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -524,7 +524,7 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
val->intval = 2600000 + ret * 100000;
break;
- case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+ case POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_NOW:
ret = bq25890_field_read(bq, F_SYSV); /* read measured value */
if (ret < 0)
return ret;
@@ -533,6 +533,10 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
val->intval = 2304000 + ret * 20000;
break;
+ case POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MIN:
+ val->intval = bq25890_find_val(bq->init_data.sysvmin, TBL_SYSVMIN);
+ break;
+
case POWER_SUPPLY_PROP_CURRENT_NOW:
ret = bq25890_field_read(bq, F_ICHGR); /* read measured value */
if (ret < 0)
@@ -724,7 +728,8 @@ static const enum power_supply_property bq25890_power_supply_props[] = {
POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW,
- POWER_SUPPLY_PROP_VOLTAGE_NOW,
+ POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_NOW,
+ POWER_SUPPLY_PROP_OUTPUT_VOLTAGE_MIN,
POWER_SUPPLY_PROP_CURRENT_NOW,
};
--
2.20.1
Powered by blists - more mailing lists