[v2,08/11] power: bq25890: implement PRECHARGE_CURRENT property
diff mbox series

Message ID f6827f3c9a9666ac15e227220ef9efabf67e0caa.1588517058.git.mirq-linux@rere.qmqm.pl
State Superseded
Headers show
Series
  • power: supply: bq25890: fix and extend
Related show

Commit Message

Michał Mirosław May 3, 2020, 3:21 p.m. UTC
Report configured precharge current.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/power/supply/bq25890_charger.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sebastian Reichel May 3, 2020, 9:15 p.m. UTC | #1
Hi,

On Sun, May 03, 2020 at 05:21:13PM +0200, Michał Mirosław wrote:
> Report configured precharge current.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

>  drivers/power/supply/bq25890_charger.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index ad0901fdceb6..b48685009048 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -497,6 +497,10 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
>  		val->intval = bq25890_find_val(bq->init_data.vreg, TBL_VREG);
>  		break;
>  
> +	case POWER_SUPPLY_PROP_PRECHARGE_CURRENT:
> +		val->intval = bq25890_find_val(bq->init_data.iprechg, TBL_ITERM);
> +		break;
> +
>  	case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT:
>  		val->intval = bq25890_find_val(bq->init_data.iterm, TBL_ITERM);
>  		break;
> @@ -689,6 +693,7 @@ static const enum power_supply_property bq25890_power_supply_props[] = {
>  	POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
>  	POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
>  	POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
> +	POWER_SUPPLY_PROP_PRECHARGE_CURRENT,
>  	POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
>  	POWER_SUPPLY_PROP_VOLTAGE_NOW,
>  };
> -- 
> 2.20.1
>

Patch
diff mbox series

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index ad0901fdceb6..b48685009048 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -497,6 +497,10 @@  static int bq25890_power_supply_get_property(struct power_supply *psy,
 		val->intval = bq25890_find_val(bq->init_data.vreg, TBL_VREG);
 		break;
 
+	case POWER_SUPPLY_PROP_PRECHARGE_CURRENT:
+		val->intval = bq25890_find_val(bq->init_data.iprechg, TBL_ITERM);
+		break;
+
 	case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT:
 		val->intval = bq25890_find_val(bq->init_data.iterm, TBL_ITERM);
 		break;
@@ -689,6 +693,7 @@  static const enum power_supply_property bq25890_power_supply_props[] = {
 	POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
 	POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
 	POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
+	POWER_SUPPLY_PROP_PRECHARGE_CURRENT,
 	POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
 	POWER_SUPPLY_PROP_VOLTAGE_NOW,
 };