linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] add some power supply properties about wireless/wired charging
@ 2020-07-21  5:59 Qiwu Huang
  2020-07-21  5:59 ` [PATCH v5 1/4] power: supply: core: add quick charge type property Qiwu Huang
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Qiwu Huang @ 2020-07-21  5:59 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

This patchset aims to provide power supply properties about wireless/wired charging.
"quick_charge_type" reports different types of quick charge based on the charging power;
"tx_adapter" shows" the type of wireless charging adapter;
"signal_strength" shows the coupling level between TX and RX;
"reverse_chg_mode" provides the interface of enabling/disabling wireless reverse charging.

Changes in v5
 - Add details in 0/X email

Changes in v4
 - Exclude the patch of "power: supply: supply battery soc with decimal form"
 - Fix some typo

Changes in v3
 - Add enumederated for quick charge type
 - Add enumederated for tx adapter type
 - Update the return type and description in ABI

Changes in v2
 - modify to capital letters for "power_supply_attrs"
 - Update the return type and description in ABI

Qiwu Huang (4):
  power: supply: core: add quick charge type property
  power: supply: core: add wireless charger adapter type property
  power: supply: core: add wireless signal strength property
  power: supply: core: property to control reverse charge

 Documentation/ABI/testing/sysfs-class-power | 71 +++++++++++++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  4 ++
 include/linux/power_supply.h                | 31 +++++++++
 3 files changed, 106 insertions(+)


-- 
2.27.0


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

* [PATCH v5 1/4] power: supply: core: add quick charge type property
  2020-07-21  5:59 [PATCH v5 0/4] add some power supply properties about wireless/wired charging Qiwu Huang
@ 2020-07-21  5:59 ` Qiwu Huang
  2020-07-21  8:18   ` Greg KH
  2020-07-21  5:59 ` [PATCH v5 2/4] power: supply: core: add wireless charger adapter " Qiwu Huang
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Qiwu Huang @ 2020-07-21  5:59 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

Reports the kind of quick charge type based on
different adapter power.

Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
---
 Documentation/ABI/testing/sysfs-class-power | 21 +++++++++++++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                | 10 ++++++++++
 3 files changed, 32 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 216d61a22f1e..dd3773dcf16a 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -708,3 +708,24 @@ Description:
 
 		Access: Read
 		Valid values: 1-31
+
+What:		/sys/class/power_supply/<supply_name>/quick_charge_type
+Date:		Jul 2020
+Contact:	Fei Jiang <jiangfei1@xiaomi.com>
+		Description:
+		Reports the kind of quick charge type based on different adapter power.
+		Different quick charge type represent different charging power.
+		QUICK_CHARGE_NORMAL : Charging Power <= 10W
+		QUICK_CHARGE_FAST : 10W < Charging Power <= 20W
+		QUICK_CHARGE_FLASH : 20W < Charging Power <= 30W
+		QUICK_CHARGE_TURBE : 30W < Charging Power <= 50W
+		QUICK_CHARGE_SUPER : Charging Power > 50W
+
+		Access: Read-Only
+		Valid values:
+			0: QUICK_CHARGE_NORMAL,
+			1: QUICK_CHARGE_FAST,
+			2: QUICK_CHARGE_FLASH,
+			3: QUICK_CHARGE_TURBE,
+			4: QUICK_CHARGE_SUPER.
+
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bc79560229b5..9554d7907373 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -206,6 +206,7 @@ static struct power_supply_attr power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(MODEL_NAME),
 	POWER_SUPPLY_ATTR(MANUFACTURER),
 	POWER_SUPPLY_ATTR(SERIAL_NUMBER),
+	POWER_SUPPLY_ATTR(QUICK_CHARGE_TYPE),
 };
 
 static struct attribute *
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index ac1345a48ad0..f35c661a2544 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -167,6 +167,7 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_MODEL_NAME,
 	POWER_SUPPLY_PROP_MANUFACTURER,
 	POWER_SUPPLY_PROP_SERIAL_NUMBER,
+	POWER_SUPPLY_PROP_QUICK_CHARGE_TYPE,
 };
 
 enum power_supply_type {
@@ -197,6 +198,15 @@ enum power_supply_usb_type {
 	POWER_SUPPLY_USB_TYPE_APPLE_BRICK_ID,	/* Apple Charging Method */
 };
 
+enum power_supply_quick_charge_type {
+	QUICK_CHARGE_NORMAL = 0,		/* Charging Power <= 10W */
+	QUICK_CHARGE_FAST,			/* 10W < Charging Power <= 20W */
+	QUICK_CHARGE_FLASH,			/* 20W < Charging Power <= 30W */
+	QUICK_CHARGE_TURBE,			/* 30W < Charging Power <= 50W */
+	QUICK_CHARGE_SUPER,			/* Charging Power > 50W */
+	QUICK_CHARGE_MAX,
+};
+
 enum power_supply_notifier_events {
 	PSY_EVENT_PROP_CHANGED,
 };
-- 
2.27.0


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

* [PATCH v5 2/4] power: supply: core: add wireless charger adapter type property
  2020-07-21  5:59 [PATCH v5 0/4] add some power supply properties about wireless/wired charging Qiwu Huang
  2020-07-21  5:59 ` [PATCH v5 1/4] power: supply: core: add quick charge type property Qiwu Huang
@ 2020-07-21  5:59 ` Qiwu Huang
  2020-07-21  8:19   ` Greg KH
  2020-07-21  5:59 ` [PATCH v5 3/4] power: supply: core: add wireless signal strength property Qiwu Huang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Qiwu Huang @ 2020-07-21  5:59 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

Reports what type of wireless adapter connection is
currently active for the supply.
for example it can show if ADAPTER_PD capable source is attached.

Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
---
 Documentation/ABI/testing/sysfs-class-power | 28 +++++++++++++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                | 19 ++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index dd3773dcf16a..03ab449fae8a 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -729,3 +729,31 @@ Contact:	Fei Jiang <jiangfei1@xiaomi.com>
 			3: QUICK_CHARGE_TURBE,
 			4: QUICK_CHARGE_SUPER.
 
+===== Wireless Charger Properties =====
+What:		/sys/class/power_supply/<supply_name>/tx_adapter
+Date:		Jul 2020
+Contact:	Fei Jiang <jiangfei1@xiaomi.com>
+Description:
+		Reports the type of wireless adapter connection is currently active for
+		the supply, for example it can show if ADAPTER_PD capable source
+		is attached. Expect common wireless adapter type, also increase by
+		some vendor private adapter type(ex. ADAPTER_PD_40W).
+
+		Access: Read-Only
+		Valid values:
+			0: ADAPTER_NONE,
+			1: ADAPTER_SDP,
+			2: ADAPTER_DCP,
+			3: ADAPTER_CDP,
+			4: ADAPTER_OCP,
+			5: ADAPTER_QC2,
+			6: ADAPTER_QC3,
+			7: ADAPTER_PD,
+			8: ADAPTER_AUTH_FAILED,
+			9: ADAPTER_PRIVATE_QC3,
+			10: ADAPTER_PRIVATE_PD,
+			11: ADAPTER_CAR_POWER,
+			12: ADAPTER_PRIVATE_PD_40W,
+			13: ADAPTER_VOICE_BOX,
+			14: ADAPTER_PRIVATE_PD_50W.
+
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 9554d7907373..f2458e21d02b 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -207,6 +207,7 @@ static struct power_supply_attr power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(MANUFACTURER),
 	POWER_SUPPLY_ATTR(SERIAL_NUMBER),
 	POWER_SUPPLY_ATTR(QUICK_CHARGE_TYPE),
+	POWER_SUPPLY_ATTR(TX_ADAPTER),
 };
 
 static struct attribute *
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index f35c661a2544..0bbdec1630a4 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -168,6 +168,7 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_MANUFACTURER,
 	POWER_SUPPLY_PROP_SERIAL_NUMBER,
 	POWER_SUPPLY_PROP_QUICK_CHARGE_TYPE,
+	POWER_SUPPLY_PROP_TX_ADAPTER,
 };
 
 enum power_supply_type {
@@ -207,6 +208,24 @@ enum power_supply_quick_charge_type {
 	QUICK_CHARGE_MAX,
 };
 
+enum power_supply_tx_adapter_type {
+	ADAPTER_NONE = 0,			/* Nothing Attached */
+	ADAPTER_SDP,				/* Standard Downstream Port */
+	ADAPTER_CDP,				/* Charging Downstream Port */
+	ADAPTER_DCP,				/* Dedicated Charging Port */
+	ADAPTER_OCP,				/* Other Charging Port */
+	ADAPTER_QC2,				/* Qualcomm Charge 2.0 */
+	ADAPTER_QC3,				/* Qualcomm Charge 3.0 */
+	ADAPTER_PD,				/* Power Delivery Port */
+	ADAPTER_AUTH_FAILED,			/* Authenticated Failed Adapter */
+	ADAPTER_PRIVATE_QC3,			/* Qualcomm Charge 3.0 with Private Protocol */
+	ADAPTER_PRIVATE_PD,			/* PD Adapter with Private Protocol */
+	ADAPTER_CAR_POWER,			/* Wireless Car Charger */
+	ADAPTER_PRIVATE_PD_40W,			/* 40W PD Adapter with Private Protocol */
+	ADAPTER_VOICE_BOX,			/* Voice Box which Support Wireless Charger */
+	ADAPTER_PRIVATE_PD_50W,			/* 50W PD Adapter with Private Protocol */
+};
+
 enum power_supply_notifier_events {
 	PSY_EVENT_PROP_CHANGED,
 };
-- 
2.27.0


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

* [PATCH v5 3/4] power: supply: core: add wireless signal strength property
  2020-07-21  5:59 [PATCH v5 0/4] add some power supply properties about wireless/wired charging Qiwu Huang
  2020-07-21  5:59 ` [PATCH v5 1/4] power: supply: core: add quick charge type property Qiwu Huang
  2020-07-21  5:59 ` [PATCH v5 2/4] power: supply: core: add wireless charger adapter " Qiwu Huang
@ 2020-07-21  5:59 ` Qiwu Huang
  2020-07-21  8:20   ` Greg KH
  2020-07-21  5:59 ` [PATCH v5 4/4] power: supply: core: property to control reverse charge Qiwu Huang
  2020-07-21  8:21 ` [PATCH v5 0/4] add some power supply properties about wireless/wired charging Greg KH
  4 siblings, 1 reply; 15+ messages in thread
From: Qiwu Huang @ 2020-07-21  5:59 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

reports wireless signal strength.
The value show degree of coupling between tx and rx.

Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
---
 Documentation/ABI/testing/sysfs-class-power | 10 ++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                |  1 +
 3 files changed, 12 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 03ab449fae8a..75ec7de2fe78 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -757,3 +757,13 @@ Description:
 			13: ADAPTER_VOICE_BOX,
 			14: ADAPTER_PRIVATE_PD_50W.
 
+What:		/sys/class/power_supply/<supply_name>/signal_strength
+Date:		Jul 2020
+Contact:	Fei Jiang <jiangfei1@xiaomi.com>
+Description:
+		In PING phase, RX transmits a signal strength packet as the first
+		communication packet to instruct the base to keep power signal on.
+		The value reports wireless signal strength and show degree of coupling.
+
+		Access: Read-Only
+		Valid values: 0 - 100
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index f2458e21d02b..e420a453095e 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -208,6 +208,7 @@ static struct power_supply_attr power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(SERIAL_NUMBER),
 	POWER_SUPPLY_ATTR(QUICK_CHARGE_TYPE),
 	POWER_SUPPLY_ATTR(TX_ADAPTER),
+	POWER_SUPPLY_ATTR(SIGNAL_STRENGTH),
 };
 
 static struct attribute *
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 0bbdec1630a4..346c6c9c0737 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -169,6 +169,7 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_SERIAL_NUMBER,
 	POWER_SUPPLY_PROP_QUICK_CHARGE_TYPE,
 	POWER_SUPPLY_PROP_TX_ADAPTER,
+	POWER_SUPPLY_PROP_SIGNAL_STRENGTH,
 };
 
 enum power_supply_type {
-- 
2.27.0


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

* [PATCH v5 4/4] power: supply: core: property to control reverse charge
  2020-07-21  5:59 [PATCH v5 0/4] add some power supply properties about wireless/wired charging Qiwu Huang
                   ` (2 preceding siblings ...)
  2020-07-21  5:59 ` [PATCH v5 3/4] power: supply: core: add wireless signal strength property Qiwu Huang
@ 2020-07-21  5:59 ` Qiwu Huang
  2020-07-21  8:21   ` Greg KH
  2020-07-21  8:21 ` [PATCH v5 0/4] add some power supply properties about wireless/wired charging Greg KH
  4 siblings, 1 reply; 15+ messages in thread
From: Qiwu Huang @ 2020-07-21  5:59 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

Interface to control wireless reverse charge.
Supply reverse charge function when enabled.

Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
---
 Documentation/ABI/testing/sysfs-class-power | 12 ++++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                |  1 +
 3 files changed, 14 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 75ec7de2fe78..54647d6995d3 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -767,3 +767,15 @@ Description:
 
 		Access: Read-Only
 		Valid values: 0 - 100
+
+What:		/sys/class/power_supply/<supply_name>/reverse_chg_mode
+Date:		Jul 2020
+Contact:	Fei Jiang <jiangfei1@xiaomi.com>
+Description:
+		Some phones support wireless reverse charge function which charge other phones.
+		The property supply interface to control wireless reverse charge.
+		If enabled, start TX mode and detect RX. Disabled when timeout or manual setting.
+
+		Valid values:
+		- 1: enabled
+		- 0: disabled
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index e420a453095e..81916b6b6ccf 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -209,6 +209,7 @@ static struct power_supply_attr power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(QUICK_CHARGE_TYPE),
 	POWER_SUPPLY_ATTR(TX_ADAPTER),
 	POWER_SUPPLY_ATTR(SIGNAL_STRENGTH),
+	POWER_SUPPLY_ATTR(REVERSE_CHG_MODE),
 };
 
 static struct attribute *
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 346c6c9c0737..a87ae1fff8d1 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -170,6 +170,7 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_QUICK_CHARGE_TYPE,
 	POWER_SUPPLY_PROP_TX_ADAPTER,
 	POWER_SUPPLY_PROP_SIGNAL_STRENGTH,
+	POWER_SUPPLY_PROP_REVERSE_CHG_MODE,
 };
 
 enum power_supply_type {
-- 
2.27.0


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

* Re: [PATCH v5 1/4] power: supply: core: add quick charge type property
  2020-07-21  5:59 ` [PATCH v5 1/4] power: supply: core: add quick charge type property Qiwu Huang
@ 2020-07-21  8:18   ` Greg KH
  0 siblings, 0 replies; 15+ messages in thread
From: Greg KH @ 2020-07-21  8:18 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 01:59:34PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> Reports the kind of quick charge type based on
> different adapter power.
> 
> Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH v5 2/4] power: supply: core: add wireless charger adapter type property
  2020-07-21  5:59 ` [PATCH v5 2/4] power: supply: core: add wireless charger adapter " Qiwu Huang
@ 2020-07-21  8:19   ` Greg KH
  0 siblings, 0 replies; 15+ messages in thread
From: Greg KH @ 2020-07-21  8:19 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 01:59:35PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> Reports what type of wireless adapter connection is
> currently active for the supply.
> for example it can show if ADAPTER_PD capable source is attached.
> 
> Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH v5 3/4] power: supply: core: add wireless signal strength property
  2020-07-21  5:59 ` [PATCH v5 3/4] power: supply: core: add wireless signal strength property Qiwu Huang
@ 2020-07-21  8:20   ` Greg KH
  2020-07-21 10:21     ` ivan
  0 siblings, 1 reply; 15+ messages in thread
From: Greg KH @ 2020-07-21  8:20 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 01:59:36PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> reports wireless signal strength.
> The value show degree of coupling between tx and rx.
> 
> Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> ---
>  Documentation/ABI/testing/sysfs-class-power | 10 ++++++++++
>  drivers/power/supply/power_supply_sysfs.c   |  1 +
>  include/linux/power_supply.h                |  1 +
>  3 files changed, 12 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 03ab449fae8a..75ec7de2fe78 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -757,3 +757,13 @@ Description:
>  			13: ADAPTER_VOICE_BOX,
>  			14: ADAPTER_PRIVATE_PD_50W.
>  
> +What:		/sys/class/power_supply/<supply_name>/signal_strength
> +Date:		Jul 2020
> +Contact:	Fei Jiang <jiangfei1@xiaomi.com>
> +Description:
> +		In PING phase, RX transmits a signal strength packet as the first

What does "PING phase" mean?

Other than that, seems sane to me, thanks for the changes.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH v5 4/4] power: supply: core: property to control reverse charge
  2020-07-21  5:59 ` [PATCH v5 4/4] power: supply: core: property to control reverse charge Qiwu Huang
@ 2020-07-21  8:21   ` Greg KH
  2020-07-21 10:40     ` ivan
  0 siblings, 1 reply; 15+ messages in thread
From: Greg KH @ 2020-07-21  8:21 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 01:59:37PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> Interface to control wireless reverse charge.
> Supply reverse charge function when enabled.
> 
> Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> ---
>  Documentation/ABI/testing/sysfs-class-power | 12 ++++++++++++
>  drivers/power/supply/power_supply_sysfs.c   |  1 +
>  include/linux/power_supply.h                |  1 +
>  3 files changed, 14 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 75ec7de2fe78..54647d6995d3 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -767,3 +767,15 @@ Description:
>  
>  		Access: Read-Only
>  		Valid values: 0 - 100
> +
> +What:		/sys/class/power_supply/<supply_name>/reverse_chg_mode
> +Date:		Jul 2020
> +Contact:	Fei Jiang <jiangfei1@xiaomi.com>
> +Description:
> +		Some phones support wireless reverse charge function which charge other phones.

Replace "phones" with "devices"?

And shouldn't these lines be wrapped properly at 72 colums or so?

> +		The property supply interface to control wireless reverse charge.

I can't understand this sentance.

> +		If enabled, start TX mode and detect RX. Disabled when timeout or manual setting.

Can this be set, or is it just something to be read?

thanks,

greg k-h

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

* Re: [PATCH v5 0/4] add some power supply properties about wireless/wired charging
  2020-07-21  5:59 [PATCH v5 0/4] add some power supply properties about wireless/wired charging Qiwu Huang
                   ` (3 preceding siblings ...)
  2020-07-21  5:59 ` [PATCH v5 4/4] power: supply: core: property to control reverse charge Qiwu Huang
@ 2020-07-21  8:21 ` Greg KH
  4 siblings, 0 replies; 15+ messages in thread
From: Greg KH @ 2020-07-21  8:21 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 01:59:33PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> This patchset aims to provide power supply properties about wireless/wired charging.
> "quick_charge_type" reports different types of quick charge based on the charging power;
> "tx_adapter" shows" the type of wireless charging adapter;
> "signal_strength" shows the coupling level between TX and RX;
> "reverse_chg_mode" provides the interface of enabling/disabling wireless reverse charging.
> 
> Changes in v5
>  - Add details in 0/X email

Thanks for all of the changes, looks much better.

I've reviewed the individual patches.

thanks,

greg k-h

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

* Re: [PATCH v5 3/4] power: supply: core: add wireless signal strength property
  2020-07-21  8:20   ` Greg KH
@ 2020-07-21 10:21     ` ivan
  2020-07-21 10:32       ` Greg KH
  0 siblings, 1 reply; 15+ messages in thread
From: ivan @ 2020-07-21 10:21 UTC (permalink / raw)
  To: Greg KH; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 4:19 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jul 21, 2020 at 01:59:36PM +0800, Qiwu Huang wrote:
> > From: Qiwu Huang <huangqiwu@xiaomi.com>
> >
> > reports wireless signal strength.
> > The value show degree of coupling between tx and rx.
> >
> > Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> > ---
> >  Documentation/ABI/testing/sysfs-class-power | 10 ++++++++++
> >  drivers/power/supply/power_supply_sysfs.c   |  1 +
> >  include/linux/power_supply.h                |  1 +
> >  3 files changed, 12 insertions(+)
> >
> > diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> > index 03ab449fae8a..75ec7de2fe78 100644
> > --- a/Documentation/ABI/testing/sysfs-class-power
> > +++ b/Documentation/ABI/testing/sysfs-class-power
> > @@ -757,3 +757,13 @@ Description:
> >                       13: ADAPTER_VOICE_BOX,
> >                       14: ADAPTER_PRIVATE_PD_50W.
> >
> > +What:                /sys/class/power_supply/<supply_name>/signal_strength
> > +Date:                Jul 2020
> > +Contact:     Fei Jiang <jiangfei1@xiaomi.com>
> > +Description:
> > +             In PING phase, RX transmits a signal strength packet as the first
>
> What does "PING phase" mean?

The Qi Wireless Power Transfer System is published by the Wireless
Power Consortium.
The ping phase is the necessary stage for matching transmitter and
receiver. In this phase,
the Power Transmitter executes a Digital Ping, and listens for a
response. If the
Power Transmitter discovers a Power Receiver, the Power Transmitter
may extend the Digital Ping,
i.e. maintain the Power Signal at the level of the Digital Ping. This
causes the system to proceed to the
identification & configuration phase. If the Power Transmitter does
not extend the Digital Ping, the
system shall revert to the selection phase.

>
> Other than that, seems sane to me, thanks for the changes.
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>



-- 
Thanks

Qiwu

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

* Re: [PATCH v5 3/4] power: supply: core: add wireless signal strength property
  2020-07-21 10:21     ` ivan
@ 2020-07-21 10:32       ` Greg KH
  2020-07-21 10:34         ` ivan
  0 siblings, 1 reply; 15+ messages in thread
From: Greg KH @ 2020-07-21 10:32 UTC (permalink / raw)
  To: ivan; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 06:21:20PM +0800, ivan wrote:
> On Tue, Jul 21, 2020 at 4:19 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Jul 21, 2020 at 01:59:36PM +0800, Qiwu Huang wrote:
> > > From: Qiwu Huang <huangqiwu@xiaomi.com>
> > >
> > > reports wireless signal strength.
> > > The value show degree of coupling between tx and rx.
> > >
> > > Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> > > ---
> > >  Documentation/ABI/testing/sysfs-class-power | 10 ++++++++++
> > >  drivers/power/supply/power_supply_sysfs.c   |  1 +
> > >  include/linux/power_supply.h                |  1 +
> > >  3 files changed, 12 insertions(+)
> > >
> > > diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> > > index 03ab449fae8a..75ec7de2fe78 100644
> > > --- a/Documentation/ABI/testing/sysfs-class-power
> > > +++ b/Documentation/ABI/testing/sysfs-class-power
> > > @@ -757,3 +757,13 @@ Description:
> > >                       13: ADAPTER_VOICE_BOX,
> > >                       14: ADAPTER_PRIVATE_PD_50W.
> > >
> > > +What:                /sys/class/power_supply/<supply_name>/signal_strength
> > > +Date:                Jul 2020
> > > +Contact:     Fei Jiang <jiangfei1@xiaomi.com>
> > > +Description:
> > > +             In PING phase, RX transmits a signal strength packet as the first
> >
> > What does "PING phase" mean?
> 
> The Qi Wireless Power Transfer System is published by the Wireless
> Power Consortium.
> The ping phase is the necessary stage for matching transmitter and
> receiver. In this phase,
> the Power Transmitter executes a Digital Ping, and listens for a
> response. If the
> Power Transmitter discovers a Power Receiver, the Power Transmitter
> may extend the Digital Ping,
> i.e. maintain the Power Signal at the level of the Digital Ping. This
> causes the system to proceed to the
> identification & configuration phase. If the Power Transmitter does
> not extend the Digital Ping, the
> system shall revert to the selection phase.

Thanks for the description, so perhaps turning this response into the
text in the description would be good?

thanks,

greg k-h

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

* Re: [PATCH v5 3/4] power: supply: core: add wireless signal strength property
  2020-07-21 10:32       ` Greg KH
@ 2020-07-21 10:34         ` ivan
  0 siblings, 0 replies; 15+ messages in thread
From: ivan @ 2020-07-21 10:34 UTC (permalink / raw)
  To: Greg KH; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 6:32 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jul 21, 2020 at 06:21:20PM +0800, ivan wrote:
> > On Tue, Jul 21, 2020 at 4:19 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Tue, Jul 21, 2020 at 01:59:36PM +0800, Qiwu Huang wrote:
> > > > From: Qiwu Huang <huangqiwu@xiaomi.com>
> > > >
> > > > reports wireless signal strength.
> > > > The value show degree of coupling between tx and rx.
> > > >
> > > > Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> > > > ---
> > > >  Documentation/ABI/testing/sysfs-class-power | 10 ++++++++++
> > > >  drivers/power/supply/power_supply_sysfs.c   |  1 +
> > > >  include/linux/power_supply.h                |  1 +
> > > >  3 files changed, 12 insertions(+)
> > > >
> > > > diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> > > > index 03ab449fae8a..75ec7de2fe78 100644
> > > > --- a/Documentation/ABI/testing/sysfs-class-power
> > > > +++ b/Documentation/ABI/testing/sysfs-class-power
> > > > @@ -757,3 +757,13 @@ Description:
> > > >                       13: ADAPTER_VOICE_BOX,
> > > >                       14: ADAPTER_PRIVATE_PD_50W.
> > > >
> > > > +What:                /sys/class/power_supply/<supply_name>/signal_strength
> > > > +Date:                Jul 2020
> > > > +Contact:     Fei Jiang <jiangfei1@xiaomi.com>
> > > > +Description:
> > > > +             In PING phase, RX transmits a signal strength packet as the first
> > >
> > > What does "PING phase" mean?
> >
> > The Qi Wireless Power Transfer System is published by the Wireless
> > Power Consortium.
> > The ping phase is the necessary stage for matching transmitter and
> > receiver. In this phase,
> > the Power Transmitter executes a Digital Ping, and listens for a
> > response. If the
> > Power Transmitter discovers a Power Receiver, the Power Transmitter
> > may extend the Digital Ping,
> > i.e. maintain the Power Signal at the level of the Digital Ping. This
> > causes the system to proceed to the
> > identification & configuration phase. If the Power Transmitter does
> > not extend the Digital Ping, the
> > system shall revert to the selection phase.
>
> Thanks for the description, so perhaps turning this response into the
> text in the description would be good?

OK, I will

>
> thanks,
>
> greg k-h



-- 
Thanks

Qiwu

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

* Re: [PATCH v5 4/4] power: supply: core: property to control reverse charge
  2020-07-21  8:21   ` Greg KH
@ 2020-07-21 10:40     ` ivan
  0 siblings, 0 replies; 15+ messages in thread
From: ivan @ 2020-07-21 10:40 UTC (permalink / raw)
  To: Greg KH; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Tue, Jul 21, 2020 at 4:21 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jul 21, 2020 at 01:59:37PM +0800, Qiwu Huang wrote:
> > From: Qiwu Huang <huangqiwu@xiaomi.com>
> >
> > Interface to control wireless reverse charge.
> > Supply reverse charge function when enabled.
> >
> > Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> > ---
> >  Documentation/ABI/testing/sysfs-class-power | 12 ++++++++++++
> >  drivers/power/supply/power_supply_sysfs.c   |  1 +
> >  include/linux/power_supply.h                |  1 +
> >  3 files changed, 14 insertions(+)
> >
> > diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> > index 75ec7de2fe78..54647d6995d3 100644
> > --- a/Documentation/ABI/testing/sysfs-class-power
> > +++ b/Documentation/ABI/testing/sysfs-class-power
> > @@ -767,3 +767,15 @@ Description:
> >
> >               Access: Read-Only
> >               Valid values: 0 - 100
> > +
> > +What:                /sys/class/power_supply/<supply_name>/reverse_chg_mode
> > +Date:                Jul 2020
> > +Contact:     Fei Jiang <jiangfei1@xiaomi.com>
> > +Description:
> > +             Some phones support wireless reverse charge function which charge other phones.
>
> Replace "phones" with "devices"?

 Yes,  devices better than phones

>
> And shouldn't these lines be wrapped properly at 72 colums or so?

Sorry, I will modify the format  to match this standard.


>
> > +             The property supply interface to control wireless reverse charge.
>
> I can't understand this sentance.

The property provider interface to enable/disable wireless reverse charge.

>
> > +             If enabled, start TX mode and detect RX. Disabled when timeout or manual setting.
>
> Can this be set, or is it just something to be read?

Sorry,I forgot the permission statement

Access: Read, Write




>
> thanks,
>
> greg k-h



--
Thanks

Qiwu

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

* [PATCH v5 0/4] add some power supply properties about wireless/wired charging
@ 2020-07-21 11:15 Qiwu Huang
  0 siblings, 0 replies; 15+ messages in thread
From: Qiwu Huang @ 2020-07-21 11:15 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

This patchset aims to provide power supply properties about wireless/wired charging.
"quick_charge_type" reports different types of quick charge based on the charging power;
"tx_adapter" shows" the type of wireless charging adapter;
"signal_strength" shows the coupling level between TX and RX;
"reverse_chg_mode" provides the interface of enabling/disabling wireless reverse charging.

Changes in v6
 - Replace "phones" with "devices" suggested by GregKH
 - Add permission statement for "reverse_chg_mode"
 - Update description for "reverse_chg_mode" in ABI suggested by GregKH
 - Update description for "PING phase" in ABI suggested by GregKH

Changes in v5
 - Add details in 0/X email

Changes in v4
 - Exclude the patch of "power: supply: supply battery soc with decimal form"
 - Fix some typo

Changes in v3
 - Add enumederated for quick charge type
 - Add enumederated for tx adapter type
 - Update the return type and description in ABI

Changes in v2
 - modify to capital letters for "power_supply_attrs"
 - Update the return type and description in ABI

Qiwu Huang (4):
  power: supply: core: add quick charge type property
  power: supply: core: add wireless charger adapter type property
  power: supply: core: add wireless signal strength property
  power: supply: core: property to control reverse charge

 Documentation/ABI/testing/sysfs-class-power | 85 +++++++++++++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  4 +
 include/linux/power_supply.h                | 31 ++++++++
 3 files changed, 120 insertions(+)

-- 
2.27.0


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

end of thread, other threads:[~2020-07-21 11:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21  5:59 [PATCH v5 0/4] add some power supply properties about wireless/wired charging Qiwu Huang
2020-07-21  5:59 ` [PATCH v5 1/4] power: supply: core: add quick charge type property Qiwu Huang
2020-07-21  8:18   ` Greg KH
2020-07-21  5:59 ` [PATCH v5 2/4] power: supply: core: add wireless charger adapter " Qiwu Huang
2020-07-21  8:19   ` Greg KH
2020-07-21  5:59 ` [PATCH v5 3/4] power: supply: core: add wireless signal strength property Qiwu Huang
2020-07-21  8:20   ` Greg KH
2020-07-21 10:21     ` ivan
2020-07-21 10:32       ` Greg KH
2020-07-21 10:34         ` ivan
2020-07-21  5:59 ` [PATCH v5 4/4] power: supply: core: property to control reverse charge Qiwu Huang
2020-07-21  8:21   ` Greg KH
2020-07-21 10:40     ` ivan
2020-07-21  8:21 ` [PATCH v5 0/4] add some power supply properties about wireless/wired charging Greg KH
2020-07-21 11:15 Qiwu Huang

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).