linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] power: supply: core: add quick charge type property
@ 2020-07-10  8:48 Qiwu Huang
  2020-07-10  8:48 ` [PATCH 2/5] power: supply: core: add wireless charger adapter " Qiwu Huang
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Qiwu Huang @ 2020-07-10  8:48 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. UI will show different
animation effect for different quick charge type.

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 216d61a22f1e..0d9d6b46e239 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -708,3 +708,13 @@ 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.
+
+		Access: Read-Only
+		Valid values: "QUICK_CHARGE_NORMAL", "QUICK_CHARGE_FAST", "QUICK_CHARGE_FLASH",
+		"QUICK_CHARGE_TURBE", "QUICK_CHARGE_SUPER".
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bc79560229b5..f95574c41898 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..3fe7e9ef2f0f 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 {
-- 
2.26.0


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

* [PATCH 2/5] power: supply: core: add wireless charger adapter type property
  2020-07-10  8:48 [PATCH 1/5] power: supply: core: add quick charge type property Qiwu Huang
@ 2020-07-10  8:48 ` Qiwu Huang
  2020-07-10 10:00   ` Greg KH
  2020-07-10  8:48 ` [PATCH 3/5] power: supply: core: add wireless signal strength property Qiwu Huang
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Qiwu Huang @ 2020-07-10  8:48 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 forthe 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 | 13 +++++++++++++
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                |  1 +
 3 files changed, 15 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 0d9d6b46e239..2099cf194a89 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -718,3 +718,16 @@ Contact:	Fei Jiang <jiangfei1@xiaomi.com>
 		Access: Read-Only
 		Valid values: "QUICK_CHARGE_NORMAL", "QUICK_CHARGE_FAST", "QUICK_CHARGE_FLASH",
 		"QUICK_CHARGE_TURBE", "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 what type of wireless adapter connection is currently active for
+		the supply, for example it can show if ADAPTER_PD capable source
+		is attached.
+
+		Access: Read-Only
+		Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",
+		"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
\ No newline at end of file
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index f95574c41898..c864a14829ec 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 3fe7e9ef2f0f..2de9a4c93723 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 {
-- 
2.26.0


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

* [PATCH 3/5] power: supply: core: add wireless signal strength property
  2020-07-10  8:48 [PATCH 1/5] power: supply: core: add quick charge type property Qiwu Huang
  2020-07-10  8:48 ` [PATCH 2/5] power: supply: core: add wireless charger adapter " Qiwu Huang
@ 2020-07-10  8:48 ` Qiwu Huang
  2020-07-10 10:01   ` Greg KH
  2020-07-10  8:48 ` [PATCH 4/5] power: supply: core: property to control reverse charge Qiwu Huang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Qiwu Huang @ 2020-07-10  8:48 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 | 9 ++++++++-
 drivers/power/supply/power_supply_sysfs.c   | 1 +
 include/linux/power_supply.h                | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 2099cf194a89..1f42aa0c071e 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -730,4 +730,11 @@ Description:
 
 		Access: Read-Only
 		Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",
-		"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
\ No newline at end of file
+		"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
+
+What:		/sys/class/power_supply/<supply_name>/signal_strength
+Date:		Jul 2020
+Contact:	Fei Jiang <jiangfei1@xiaomi.com>
+Description:
+		Reports wireless signal strength.
+		The value show degree of coupling.
\ No newline at end of file
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index c864a14829ec..42fbe1b68255 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 2de9a4c93723..397fb8e96b03 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.26.0


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

* [PATCH 4/5] power: supply: core: property to control reverse charge
  2020-07-10  8:48 [PATCH 1/5] power: supply: core: add quick charge type property Qiwu Huang
  2020-07-10  8:48 ` [PATCH 2/5] power: supply: core: add wireless charger adapter " Qiwu Huang
  2020-07-10  8:48 ` [PATCH 3/5] power: supply: core: add wireless signal strength property Qiwu Huang
@ 2020-07-10  8:48 ` Qiwu Huang
  2020-07-10 10:01   ` Greg KH
  2020-07-10  8:48 ` [PATCH 5/5] power: supply: core: supply battery soc with decimal form Qiwu Huang
  2020-07-10  9:59 ` [PATCH 1/5] power: supply: core: add quick charge type property Greg KH
  4 siblings, 1 reply; 14+ messages in thread
From: Qiwu Huang @ 2020-07-10  8:48 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 | 13 ++++++++++++-
 drivers/power/supply/power_supply_sysfs.c   |  1 +
 include/linux/power_supply.h                |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 1f42aa0c071e..1f489a250c19 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -737,4 +737,15 @@ Date:		Jul 2020
 Contact:	Fei Jiang <jiangfei1@xiaomi.com>
 Description:
 		Reports wireless signal strength.
-		The value show degree of coupling.
\ No newline at end of file
+		The value show degree of coupling.
+What:		/sys/class/power_supply/<supply_name>/reverse_chg_mode
+Date:		Jul 2020
+Contact:	Fei Jiang <jiangfei1@xiaomi.com>
+Description:
+		The property supply interface to control wireless
+		reverse charge mode.
+
+		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 42fbe1b68255..4be762abba89 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 397fb8e96b03..319bf6456867 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.26.0


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

* [PATCH 5/5] power: supply: core: supply battery soc with decimal form
  2020-07-10  8:48 [PATCH 1/5] power: supply: core: add quick charge type property Qiwu Huang
                   ` (2 preceding siblings ...)
  2020-07-10  8:48 ` [PATCH 4/5] power: supply: core: property to control reverse charge Qiwu Huang
@ 2020-07-10  8:48 ` Qiwu Huang
  2020-07-10 10:02   ` Greg KH
  2020-07-10  9:59 ` [PATCH 1/5] power: supply: core: add quick charge type property Greg KH
  4 siblings, 1 reply; 14+ messages in thread
From: Qiwu Huang @ 2020-07-10  8:48 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, gregkh, jiangfei1, Qiwu Huang

From: Qiwu Huang <huangqiwu@xiaomi.com>

Broadcast battery soc with decimal form.
soc_decimal is the decimal part of battery soc.
soc_decimal_rate is update frequency of decimal
part of battery soc.

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

diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 1f489a250c19..60c5a0dd1b98 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -349,6 +349,26 @@ Description:
 		Access: Read
 		Valid values: Represented in microvolts
 
+What:		/sys/class/power_supply/<supply_name>/soc_decimal,
+Date:		Jul 2020
+Contact:	jiangfei1@xiaomi.com
+Description:
+		Broadcast battery soc with decimal form.
+		soc_decimal is the start decimal part of battery soc.
+
+		Access: Read
+                Valid values: 0 - 100
+
+What:		/sys/class/power_supply/<supply_name>/soc_decimal_rate,
+Date:		Jul 2020
+Contact:	jiangfei1@xiaomi.com
+Description:
+		Broadcast battery soc with decimal form.
+		soc_decimal_rate is the decimal part of battery soc update freqency.
+
+		Access: Read
+                Valid values: 0 - 100
+
 ===== USB Properties =====
 
 What: 		/sys/class/power_supply/<supply_name>/current_avg
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 4be762abba89..8defc22e0d7f 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -210,6 +210,8 @@ static struct power_supply_attr power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(tx_adapter),
 	POWER_SUPPLY_ATTR(signal_strength),
 	POWER_SUPPLY_ATTR(reverse_chg_mode),
+	POWER_SUPPLY_ATTR(soc_decimal),
+	POWER_SUPPLY_ATTR(soc_decimal_rate),
 };
 
 static struct attribute *
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 319bf6456867..d1aa5497938e 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -171,6 +171,8 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_TX_ADAPTER,
 	POWER_SUPPLY_PROP_SIGNAL_STRENGTH,
 	POWER_SUPPLY_PROP_REVERSE_CHG_MODE,
+	POWER_SUPPLY_PROP_SOC_DECIMAL,
+	POWER_SUPPLY_PROP_SOC_DECIMAL_RATE,
 };
 
 enum power_supply_type {
-- 
2.26.0


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

* Re: [PATCH 1/5] power: supply: core: add quick charge type property
  2020-07-10  8:48 [PATCH 1/5] power: supply: core: add quick charge type property Qiwu Huang
                   ` (3 preceding siblings ...)
  2020-07-10  8:48 ` [PATCH 5/5] power: supply: core: supply battery soc with decimal form Qiwu Huang
@ 2020-07-10  9:59 ` Greg KH
       [not found]   ` <cd5d62f2c2e4439998ccf9305be0c592@CNBOX07.mioffice.cn>
  4 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2020-07-10  9:59 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Fri, Jul 10, 2020 at 04:48:37PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> Reports the kind of quick charge type based on
> different adapter power. UI will show different
> animation effect for different quick charge type.
> 
> 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 216d61a22f1e..0d9d6b46e239 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -708,3 +708,13 @@ 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.
> +
> +		Access: Read-Only
> +		Valid values: "QUICK_CHARGE_NORMAL", "QUICK_CHARGE_FAST", "QUICK_CHARGE_FLASH",
> +		"QUICK_CHARGE_TURBE", "QUICK_CHARGE_SUPER".

"QUICK_CHARGE_TURBO"?

> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index bc79560229b5..f95574c41898 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),

Shouldn't this be all uppercase:
	QUICK_CHARGE_TYPE
?

And shouldn't there be a string with the expected values somewhere?

thanks,

greg k-h

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

* Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property
  2020-07-10  8:48 ` [PATCH 2/5] power: supply: core: add wireless charger adapter " Qiwu Huang
@ 2020-07-10 10:00   ` Greg KH
  2020-07-10 11:28     ` 答复: [External Mail]Re: " Fei1 Jiang 蒋飞
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2020-07-10 10:00 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Fri, Jul 10, 2020 at 04:48:38PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> Reports what type of wireless adapter connection is
> currently active forthe 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 | 13 +++++++++++++
>  drivers/power/supply/power_supply_sysfs.c   |  1 +
>  include/linux/power_supply.h                |  1 +
>  3 files changed, 15 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 0d9d6b46e239..2099cf194a89 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -718,3 +718,16 @@ Contact:	Fei Jiang <jiangfei1@xiaomi.com>
>  		Access: Read-Only
>  		Valid values: "QUICK_CHARGE_NORMAL", "QUICK_CHARGE_FAST", "QUICK_CHARGE_FLASH",
>  		"QUICK_CHARGE_TURBE", "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 what type of wireless adapter connection is currently active for
> +		the supply, for example it can show if ADAPTER_PD capable source
> +		is attached.
> +
> +		Access: Read-Only
> +		Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",
> +		"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.

Why are these strings not in the patch as well?

> \ No newline at end of file
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index f95574c41898..c864a14829ec 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),

upper case?

thanks,

greg k-h

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

* Re: [PATCH 3/5] power: supply: core: add wireless signal strength property
  2020-07-10  8:48 ` [PATCH 3/5] power: supply: core: add wireless signal strength property Qiwu Huang
@ 2020-07-10 10:01   ` Greg KH
  2020-07-10 11:03     ` 答复: [External Mail]Re: " Fei1 Jiang 蒋飞
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2020-07-10 10:01 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Fri, Jul 10, 2020 at 04:48:39PM +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 | 9 ++++++++-
>  drivers/power/supply/power_supply_sysfs.c   | 1 +
>  include/linux/power_supply.h                | 1 +
>  3 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 2099cf194a89..1f42aa0c071e 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -730,4 +730,11 @@ Description:
>  
>  		Access: Read-Only
>  		Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",
> -		"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
> \ No newline at end of file
> +		"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
> +
> +What:		/sys/class/power_supply/<supply_name>/signal_strength
> +Date:		Jul 2020
> +Contact:	Fei Jiang <jiangfei1@xiaomi.com>
> +Description:
> +		Reports wireless signal strength.
> +		The value show degree of coupling.

What units are this in?  The "value" means what?

thanks,

greg k-h

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

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

On Fri, Jul 10, 2020 at 04:48:40PM +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 | 13 ++++++++++++-
>  drivers/power/supply/power_supply_sysfs.c   |  1 +
>  include/linux/power_supply.h                |  1 +
>  3 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 1f42aa0c071e..1f489a250c19 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -737,4 +737,15 @@ Date:		Jul 2020
>  Contact:	Fei Jiang <jiangfei1@xiaomi.com>
>  Description:
>  		Reports wireless signal strength.
> -		The value show degree of coupling.
> \ No newline at end of file
> +		The value show degree of coupling.
> +What:		/sys/class/power_supply/<supply_name>/reverse_chg_mode
> +Date:		Jul 2020
> +Contact:	Fei Jiang <jiangfei1@xiaomi.com>
> +Description:
> +		The property supply interface to control wireless
> +		reverse charge mode.
> +
> +		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 42fbe1b68255..4be762abba89 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),

Again, uppercase for all of these?

thanks,

greg k-h

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

* Re: [PATCH 5/5] power: supply: core: supply battery soc with decimal form
  2020-07-10  8:48 ` [PATCH 5/5] power: supply: core: supply battery soc with decimal form Qiwu Huang
@ 2020-07-10 10:02   ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2020-07-10 10:02 UTC (permalink / raw)
  To: Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, jiangfei1, Qiwu Huang

On Fri, Jul 10, 2020 at 04:48:41PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
> 
> Broadcast battery soc with decimal form.
> soc_decimal is the decimal part of battery soc.
> soc_decimal_rate is update frequency of decimal
> part of battery soc.
> 
> Signed-off-by: Qiwu Huang <huangqiwu@xiaomi.com>
> ---
>  Documentation/ABI/testing/sysfs-class-power | 20 ++++++++++++++++++++
>  drivers/power/supply/power_supply_sysfs.c   |  2 ++
>  include/linux/power_supply.h                |  2 ++
>  3 files changed, 24 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 1f489a250c19..60c5a0dd1b98 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -349,6 +349,26 @@ Description:
>  		Access: Read
>  		Valid values: Represented in microvolts
>  
> +What:		/sys/class/power_supply/<supply_name>/soc_decimal,
> +Date:		Jul 2020
> +Contact:	jiangfei1@xiaomi.com
> +Description:
> +		Broadcast battery soc with decimal form.
> +		soc_decimal is the start decimal part of battery soc.
> +
> +		Access: Read
> +                Valid values: 0 - 100
> +
> +What:		/sys/class/power_supply/<supply_name>/soc_decimal_rate,
> +Date:		Jul 2020
> +Contact:	jiangfei1@xiaomi.com
> +Description:
> +		Broadcast battery soc with decimal form.
> +		soc_decimal_rate is the decimal part of battery soc update freqency.
> +
> +		Access: Read
> +                Valid values: 0 - 100

Why doesn't the existing battery attribute work for this?

Why can't this just be a new battery in the system and why just a single
attribute?

> +
>  ===== USB Properties =====
>  
>  What: 		/sys/class/power_supply/<supply_name>/current_avg
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index 4be762abba89..8defc22e0d7f 100644
> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -210,6 +210,8 @@ static struct power_supply_attr power_supply_attrs[] = {
>  	POWER_SUPPLY_ATTR(tx_adapter),
>  	POWER_SUPPLY_ATTR(signal_strength),
>  	POWER_SUPPLY_ATTR(reverse_chg_mode),
> +	POWER_SUPPLY_ATTR(soc_decimal),
> +	POWER_SUPPLY_ATTR(soc_decimal_rate),

Again, uppercase?

thanks,

greg k-h

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

* 答复: [External Mail]Re: [PATCH 3/5] power: supply: core: add wireless signal strength property
  2020-07-10 10:01   ` Greg KH
@ 2020-07-10 11:03     ` Fei1 Jiang 蒋飞
  0 siblings, 0 replies; 14+ messages in thread
From: Fei1 Jiang 蒋飞 @ 2020-07-10 11:03 UTC (permalink / raw)
  To: Greg KH, Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, 黄其武

Hi Greg,

/sys/class/power_supply/<supply_name>/signal_strength
What units are this in?  The "value" means what?

--> Unit is KHZ, the return value is also integer, the "value" means the working frequency of receiver chip of wireless charging.

B&R
Fei Jiang

-----邮件原件-----
发件人: Greg KH <gregkh@linuxfoundation.org>
发送时间: 2020年7月10日 18:01
收件人: Qiwu Huang <yanziily@gmail.com>
抄送: sre@kernel.org; linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org; Fei1 Jiang 蒋飞 <jiangfei1@xiaomi.com>; 黄其武 <huangqiwu@xiaomi.com>
主题: [External Mail]Re: [PATCH 3/5] power: supply: core: add wireless signal strength property

On Fri, Jul 10, 2020 at 04:48:39PM +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 | 9 ++++++++-
>  drivers/power/supply/power_supply_sysfs.c   | 1 +
>  include/linux/power_supply.h                | 1 +
>  3 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 2099cf194a89..1f42aa0c071e 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -730,4 +730,11 @@ Description:
>
>  Access: Read-Only
>  Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",
> -"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
> \ No newline at end of file
> +"ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.
> +
> +What:/sys/class/power_supply/<supply_name>/signal_strength
> +Date:Jul 2020
> +Contact:Fei Jiang <jiangfei1@xiaomi.com>
> +Description:
> +Reports wireless signal strength.
> +The value show degree of coupling.

What units are this in?  The "value" means what?

thanks,

greg k-h
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

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

* Re: 答复: [External Mail]Re: [PATCH 1/5] power: supply: core: add quick charge type property
       [not found]   ` <cd5d62f2c2e4439998ccf9305be0c592@CNBOX07.mioffice.cn>
@ 2020-07-10 11:19     ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2020-07-10 11:19 UTC (permalink / raw)
  To: Fei1 Jiang 蒋飞
  Cc: Qiwu Huang, sre, linux-pm, linux-kernel, 黄其武

On Fri, Jul 10, 2020 at 10:59:51AM +0000, Fei1 Jiang 蒋飞 wrote:
> #/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

Because of this footer, I can't respond to this email and have now
deleted it, and the other email you sent like this :(

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

* 答复: [External Mail]Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property
  2020-07-10 10:00   ` Greg KH
@ 2020-07-10 11:28     ` Fei1 Jiang 蒋飞
  2020-07-10 11:35       ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Fei1 Jiang 蒋飞 @ 2020-07-10 11:28 UTC (permalink / raw)
  To: Greg KH, Qiwu Huang; +Cc: sre, linux-pm, linux-kernel, 黄其武

Hi Greg,

Our new six power supply properties  return values are all integer, so please

add them above "Properties of type `const char" comment
xxx
...
/* Properties of type `const char *' */


Thanks!

B&R
Fei Jiang
________________________________________
发件人: Greg KH <gregkh@linuxfoundation.org>
发送时间: 2020年7月10日 18:00
收件人: Qiwu Huang
抄送: sre@kernel.org; linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org; Fei1 Jiang 蒋飞; 黄其武
主题: [External Mail]Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property

On Fri, Jul 10, 2020 at 04:48:38PM +0800, Qiwu Huang wrote:
> From: Qiwu Huang <huangqiwu@xiaomi.com>
>
> Reports what type of wireless adapter connection is
> currently active forthe 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 | 13 +++++++++++++
>  drivers/power/supply/power_supply_sysfs.c   |  1 +
>  include/linux/power_supply.h                |  1 +
>  3 files changed, 15 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> index 0d9d6b46e239..2099cf194a89 100644
> --- a/Documentation/ABI/testing/sysfs-class-power
> +++ b/Documentation/ABI/testing/sysfs-class-power
> @@ -718,3 +718,16 @@ Contact: Fei Jiang <jiangfei1@xiaomi.com>
>               Access: Read-Only
>               Valid values: "QUICK_CHARGE_NORMAL", "QUICK_CHARGE_FAST", "QUICK_CHARGE_FLASH",
>               "QUICK_CHARGE_TURBE", "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 what type of wireless adapter connection is currently active for
> +             the supply, for example it can show if ADAPTER_PD capable source
> +             is attached.
> +
> +             Access: Read-Only
> +             Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",
> +             "ADAPTER_QC2", "ADAPTER_QC3", "ADAPTER_PD" or other private adapter.

Why are these strings not in the patch as well?

> \ No newline at end of file
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index f95574c41898..c864a14829ec 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),

upper case?

thanks,

greg k-h
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

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

* Re: 答复: [External Mail]Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property
  2020-07-10 11:28     ` 答复: [External Mail]Re: " Fei1 Jiang 蒋飞
@ 2020-07-10 11:35       ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2020-07-10 11:35 UTC (permalink / raw)
  To: Fei1 Jiang 蒋飞
  Cc: Qiwu Huang, sre, linux-pm, linux-kernel, 黄其武

On Fri, Jul 10, 2020 at 11:28:13AM +0000, Fei1 Jiang 蒋飞 wrote:
> #/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

Now deleted :(

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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10  8:48 [PATCH 1/5] power: supply: core: add quick charge type property Qiwu Huang
2020-07-10  8:48 ` [PATCH 2/5] power: supply: core: add wireless charger adapter " Qiwu Huang
2020-07-10 10:00   ` Greg KH
2020-07-10 11:28     ` 答复: [External Mail]Re: " Fei1 Jiang 蒋飞
2020-07-10 11:35       ` Greg KH
2020-07-10  8:48 ` [PATCH 3/5] power: supply: core: add wireless signal strength property Qiwu Huang
2020-07-10 10:01   ` Greg KH
2020-07-10 11:03     ` 答复: [External Mail]Re: " Fei1 Jiang 蒋飞
2020-07-10  8:48 ` [PATCH 4/5] power: supply: core: property to control reverse charge Qiwu Huang
2020-07-10 10:01   ` Greg KH
2020-07-10  8:48 ` [PATCH 5/5] power: supply: core: supply battery soc with decimal form Qiwu Huang
2020-07-10 10:02   ` Greg KH
2020-07-10  9:59 ` [PATCH 1/5] power: supply: core: add quick charge type property Greg KH
     [not found]   ` <cd5d62f2c2e4439998ccf9305be0c592@CNBOX07.mioffice.cn>
2020-07-10 11:19     ` 答复: [External Mail]Re: " Greg KH

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