lkml.org 
[lkml]   [2020]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@rere.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
\
 
 \ /
  Last update: 2020-04-02 16:59    [W:0.126 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site