diff mbox series

[1/7] power: supply: bq25890: Document POWER_SUPPLY_PROP_CURRENT_NOW

Message ID 20221010210310.165461-1-marex@denx.de (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series [1/7] power: supply: bq25890: Document POWER_SUPPLY_PROP_CURRENT_NOW | expand

Commit Message

Marek Vasut Oct. 10, 2022, 9:03 p.m. UTC
Document that POWER_SUPPLY_PROP_CURRENT_NOW really does refer to ADC-sampled
immediate battery charge current I_BAT , since the meaning is not clear with
all the currents which might be measured by charger chips.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
To: linux-pm@vger.kernel.org
---
 drivers/power/supply/bq25890_charger.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Hans de Goede Oct. 12, 2022, 7:28 p.m. UTC | #1
Hi,

On 10/10/22 23:03, Marek Vasut wrote:
> Document that POWER_SUPPLY_PROP_CURRENT_NOW really does refer to ADC-sampled
> immediate battery charge current I_BAT , since the meaning is not clear with
> all the currents which might be measured by charger chips.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

> ---
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> To: linux-pm@vger.kernel.org
> ---
>  drivers/power/supply/bq25890_charger.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index 6020b58c641d2..1298d5720aa4b 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -588,7 +588,14 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
>  		val->intval = 2304000 + ret * 20000;
>  		break;
>  
> -	case POWER_SUPPLY_PROP_CURRENT_NOW:
> +	case POWER_SUPPLY_PROP_CURRENT_NOW:	/* I_BAT now */
> +		/*
> +		 * This is ADC-sampled immediate charge current supplied
> +		 * from charger to battery. The property name is confusing,
> +		 * for clarification refer to:
> +		 * Documentation/ABI/testing/sysfs-class-power
> +		 * /sys/class/power_supply/<supply_name>/current_now
> +		 */
>  		ret = bq25890_field_read(bq, F_ICHGR); /* read measured value */
>  		if (ret < 0)
>  			return ret;
diff mbox series

Patch

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index 6020b58c641d2..1298d5720aa4b 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -588,7 +588,14 @@  static int bq25890_power_supply_get_property(struct power_supply *psy,
 		val->intval = 2304000 + ret * 20000;
 		break;
 
-	case POWER_SUPPLY_PROP_CURRENT_NOW:
+	case POWER_SUPPLY_PROP_CURRENT_NOW:	/* I_BAT now */
+		/*
+		 * This is ADC-sampled immediate charge current supplied
+		 * from charger to battery. The property name is confusing,
+		 * for clarification refer to:
+		 * Documentation/ABI/testing/sysfs-class-power
+		 * /sys/class/power_supply/<supply_name>/current_now
+		 */
 		ret = bq25890_field_read(bq, F_ICHGR); /* read measured value */
 		if (ret < 0)
 			return ret;