linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND v2 0/2] Introduces bypass charge type property
@ 2022-02-10 15:41 Ricardo Rivera-Matos
  2022-02-10 15:41 ` [RESEND v2 1/2] power: supply: Introduces bypass charging property Ricardo Rivera-Matos
  2022-02-10 15:41 ` [RESEND v2 2/2] power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS Ricardo Rivera-Matos
  0 siblings, 2 replies; 7+ messages in thread
From: Ricardo Rivera-Matos @ 2022-02-10 15:41 UTC (permalink / raw)
  To: sre, linux-pm, linux-kernel, patches; +Cc: Ricardo Rivera-Matos

Hello,

This patch series introduces a new POWER_SUPPLY_CHARGE_TYPE for bypass charging
operation.

In fast charging ICs, the bypass operation is used to bypass the charging path
around the charging IC's integrated power converter to its load. This allows
for "smart" wall adaptors (such as USB PPS standard power adaptors) to handle
the power conversion and heat dissipation externally.

Best Regards,
Ricardo

Ricardo Rivera-Matos (2):
  power: supply: Introduces bypass charging property
  power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS

 drivers/power/supply/bq25980_charger.c    | 2 +-
 drivers/power/supply/power_supply_sysfs.c | 1 +
 include/linux/power_supply.h              | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RESEND v2 1/2] power: supply: Introduces bypass charging property
  2022-02-10 15:41 [RESEND v2 0/2] Introduces bypass charge type property Ricardo Rivera-Matos
@ 2022-02-10 15:41 ` Ricardo Rivera-Matos
  2022-02-11 20:43   ` Sebastian Reichel
  2022-02-10 15:41 ` [RESEND v2 2/2] power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS Ricardo Rivera-Matos
  1 sibling, 1 reply; 7+ messages in thread
From: Ricardo Rivera-Matos @ 2022-02-10 15:41 UTC (permalink / raw)
  To: sre, linux-pm, linux-kernel, patches; +Cc: Ricardo Rivera-Matos

Adds a POWER_SUPPLY_CHARGE_TYPE_BYPASS option to the POWER_SUPPLY_PROP_CHARGE_TYPE
property to facilitate bypass charging operation.

In bypass charging operation, the charger bypasses the charging path around the
integrated converter allowing for a "smart" wall adaptor to perform the power
conversion externally.

This operational mode is critical for the USB PPS standard of power adaptors and is
becoming a common feature in modern charging ICs such as:

- BQ25980
- BQ25975
- BQ25960
- LN8000
- LN8410

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
---
 drivers/power/supply/power_supply_sysfs.c | 1 +
 include/linux/power_supply.h              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 6ac88fbee3cb..52c909bae457 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -89,6 +89,7 @@ static const char * const POWER_SUPPLY_CHARGE_TYPE_TEXT[] = {
 	[POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE]	= "Adaptive",
 	[POWER_SUPPLY_CHARGE_TYPE_CUSTOM]	= "Custom",
 	[POWER_SUPPLY_CHARGE_TYPE_LONGLIFE]	= "Long Life",
+	[POWER_SUPPLY_CHARGE_TYPE_BYPASS]	= "Bypass",
 };
 
 static const char * const POWER_SUPPLY_HEALTH_TEXT[] = {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 86b4d5c4dab9..164779bc7e8f 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -49,6 +49,7 @@ enum {
 	POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE,	/* dynamically adjusted speed */
 	POWER_SUPPLY_CHARGE_TYPE_CUSTOM,	/* use CHARGE_CONTROL_* props */
 	POWER_SUPPLY_CHARGE_TYPE_LONGLIFE,	/* slow speed, longer life */
+	POWER_SUPPLY_CHARGE_TYPE_BYPASS,	/* bypassing the charger */
 };
 
 enum {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RESEND v2 2/2] power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS
  2022-02-10 15:41 [RESEND v2 0/2] Introduces bypass charge type property Ricardo Rivera-Matos
  2022-02-10 15:41 ` [RESEND v2 1/2] power: supply: Introduces bypass charging property Ricardo Rivera-Matos
@ 2022-02-10 15:41 ` Ricardo Rivera-Matos
  1 sibling, 0 replies; 7+ messages in thread
From: Ricardo Rivera-Matos @ 2022-02-10 15:41 UTC (permalink / raw)
  To: sre, linux-pm, linux-kernel, patches; +Cc: Ricardo Rivera-Matos

This patch remaps the bypass operation from POWER_SUPPLY_CHARGE_TYPE_FAST
to POWER_SUPPLY_CHARGE_TYPE_BYPASS.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
---
 drivers/power/supply/bq25980_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq25980_charger.c b/drivers/power/supply/bq25980_charger.c
index 9daa6d14db4d..9339f5649282 100644
--- a/drivers/power/supply/bq25980_charger.c
+++ b/drivers/power/supply/bq25980_charger.c
@@ -764,7 +764,7 @@ static int bq25980_get_charger_property(struct power_supply *psy,
 		if (!state.ce)
 			val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE;
 		else if (state.bypass)
-			val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST;
+			val->intval = POWER_SUPPLY_CHARGE_TYPE_BYPASS;
 		else if (!state.bypass)
 			val->intval = POWER_SUPPLY_CHARGE_TYPE_STANDARD;
 		break;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RESEND v2 1/2] power: supply: Introduces bypass charging property
  2022-02-10 15:41 ` [RESEND v2 1/2] power: supply: Introduces bypass charging property Ricardo Rivera-Matos
@ 2022-02-11 20:43   ` Sebastian Reichel
  2022-02-11 21:46     ` Rivera-Matos, Ricardo
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Reichel @ 2022-02-11 20:43 UTC (permalink / raw)
  To: Ricardo Rivera-Matos; +Cc: linux-pm, linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 2448 bytes --]

Hi,

On Thu, Feb 10, 2022 at 09:41:07AM -0600, Ricardo Rivera-Matos wrote:
> Adds a POWER_SUPPLY_CHARGE_TYPE_BYPASS option to the POWER_SUPPLY_PROP_CHARGE_TYPE
> property to facilitate bypass charging operation.
> 
> In bypass charging operation, the charger bypasses the charging path around the
> integrated converter allowing for a "smart" wall adaptor to perform the power
> conversion externally.
> 
> This operational mode is critical for the USB PPS standard of power adaptors and is
> becoming a common feature in modern charging ICs such as:
> 
> - BQ25980
> - BQ25975
> - BQ25960
> - LN8000
> - LN8410
> 
> Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
> ---

Sorry for the wait. This needs to update the sysfs ABI documentation:

Documentation/ABI/testing/sysfs-class-power

I think your patch description is a good explanation for that file.
Also I obviously missed to point this out for the "Long Life" charge
type, so please also add a sentence for that so that the property
is properly documented.

(Otherwise the patchset looks fine to me)

Thanks,

-- Sebastian

>  drivers/power/supply/power_supply_sysfs.c | 1 +
>  include/linux/power_supply.h              | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index 6ac88fbee3cb..52c909bae457 100644
> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -89,6 +89,7 @@ static const char * const POWER_SUPPLY_CHARGE_TYPE_TEXT[] = {
>  	[POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE]	= "Adaptive",
>  	[POWER_SUPPLY_CHARGE_TYPE_CUSTOM]	= "Custom",
>  	[POWER_SUPPLY_CHARGE_TYPE_LONGLIFE]	= "Long Life",
> +	[POWER_SUPPLY_CHARGE_TYPE_BYPASS]	= "Bypass",
>  };
>  
>  static const char * const POWER_SUPPLY_HEALTH_TEXT[] = {
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 86b4d5c4dab9..164779bc7e8f 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -49,6 +49,7 @@ enum {
>  	POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE,	/* dynamically adjusted speed */
>  	POWER_SUPPLY_CHARGE_TYPE_CUSTOM,	/* use CHARGE_CONTROL_* props */
>  	POWER_SUPPLY_CHARGE_TYPE_LONGLIFE,	/* slow speed, longer life */
> +	POWER_SUPPLY_CHARGE_TYPE_BYPASS,	/* bypassing the charger */
>  };
>  
>  enum {
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND v2 1/2] power: supply: Introduces bypass charging property
  2022-02-11 20:43   ` Sebastian Reichel
@ 2022-02-11 21:46     ` Rivera-Matos, Ricardo
  2022-02-12  3:44       ` Sebastian Reichel
  0 siblings, 1 reply; 7+ messages in thread
From: Rivera-Matos, Ricardo @ 2022-02-11 21:46 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, linux-kernel, patches

Sebastian,

> On Feb 11, 2022, at 2:43 PM, Sebastian Reichel <sebastian.reichel@collabora.com> wrote:
> 
> Hi,
> 
> On Thu, Feb 10, 2022 at 09:41:07AM -0600, Ricardo Rivera-Matos wrote:
>> Adds a POWER_SUPPLY_CHARGE_TYPE_BYPASS option to the POWER_SUPPLY_PROP_CHARGE_TYPE
>> property to facilitate bypass charging operation.
>> 
>> In bypass charging operation, the charger bypasses the charging path around the
>> integrated converter allowing for a "smart" wall adaptor to perform the power
>> conversion externally.
>> 
>> This operational mode is critical for the USB PPS standard of power adaptors and is
>> becoming a common feature in modern charging ICs such as:
>> 
>> - BQ25980
>> - BQ25975
>> - BQ25960
>> - LN8000
>> - LN8410
>> 
>> Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
>> ---
> 
> Sorry for the wait. This needs to update the sysfs ABI documentation:
> 
> Documentation/ABI/testing/sysfs-class-power

Ack
> 
> I think your patch description is a good explanation for that file.
> Also I obviously missed to point this out for the "Long Life" charge
> type, so please also add a sentence for that so that the property
> is properly documented.

As I understand it “Long Life” means the charger reduces its charging rate in order to prolong the battery health.

Is this a fit explanation?
> 
> (Otherwise the patchset looks fine to me)
> 
> Thanks,
> 
> -- Sebastian

Best Regards,
Ricardo

<snip>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND v2 1/2] power: supply: Introduces bypass charging property
  2022-02-11 21:46     ` Rivera-Matos, Ricardo
@ 2022-02-12  3:44       ` Sebastian Reichel
  2022-02-21 17:50         ` Rivera-Matos, Ricardo
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Reichel @ 2022-02-12  3:44 UTC (permalink / raw)
  To: Rivera-Matos, Ricardo; +Cc: linux-pm, linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

Hi,

On Fri, Feb 11, 2022 at 03:46:52PM -0600, Rivera-Matos, Ricardo wrote:
> > I think your patch description is a good explanation for that file.
> > Also I obviously missed to point this out for the "Long Life" charge
> > type, so please also add a sentence for that so that the property
> > is properly documented.
> 
> As I understand it “Long Life” means the charger reduces its
> charging rate in order to prolong the battery health.
> 
> Is this a fit explanation?

Yes, thanks for taking care of it.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RESEND v2 1/2] power: supply: Introduces bypass charging property
  2022-02-12  3:44       ` Sebastian Reichel
@ 2022-02-21 17:50         ` Rivera-Matos, Ricardo
  0 siblings, 0 replies; 7+ messages in thread
From: Rivera-Matos, Ricardo @ 2022-02-21 17:50 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, linux-kernel, patches

Hello,

> On Feb 11, 2022, at 9:44 PM, Sebastian Reichel <sebastian.reichel@collabora.com> wrote:
> 
> Hi,
> 
> On Fri, Feb 11, 2022 at 03:46:52PM -0600, Rivera-Matos, Ricardo wrote:
>>> I think your patch description is a good explanation for that file.
>>> Also I obviously missed to point this out for the "Long Life" charge
>>> type, so please also add a sentence for that so that the property
>>> is properly documented.
>> 
>> As I understand it “Long Life” means the charger reduces its
>> charging rate in order to prolong the battery health.
>> 
>> Is this a fit explanation?
> 
> Yes, thanks for taking care of it.

Ack.
> 
> -- Sebastian

Ricardo


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-21 17:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 15:41 [RESEND v2 0/2] Introduces bypass charge type property Ricardo Rivera-Matos
2022-02-10 15:41 ` [RESEND v2 1/2] power: supply: Introduces bypass charging property Ricardo Rivera-Matos
2022-02-11 20:43   ` Sebastian Reichel
2022-02-11 21:46     ` Rivera-Matos, Ricardo
2022-02-12  3:44       ` Sebastian Reichel
2022-02-21 17:50         ` Rivera-Matos, Ricardo
2022-02-10 15:41 ` [RESEND v2 2/2] power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS Ricardo Rivera-Matos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).