Skip to contentSkip to conversation

power: supply: core: add quick charge type property

PATCH Superseded Qiwu Huang 3 participants 14 messages Jul 10, 2020 – Jul 11, 2020 1 message not in the archive Power supply

v1 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Qiwu Huang

author
#0 lore raw

PATCH 1/5 power: supply: core: add quick charge type property

From: Qiwu Huang <[email protected]>

Reports the kind of quick charge type based on
different adapter power. UI will show different
animation effect for different quick charge type.

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +10 -0
index 216d61a22f1e..0d9d6b46e239 100644
@@ -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 <[email protected]>
+		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".
drivers/power/supply/power_supply_sysfs.c +1 -0
index bc79560229b5..f95574c41898 100644
@@ -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 *
include/linux/power_supply.h +1 -0
index ac1345a48ad0..3fe7e9ef2f0f 100644
@@ -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 {
Signature · 1 line
2.26.0
author
#1 lore raw

PATCH 2/5 power: supply: core: add wireless charger adapter type property

From: Qiwu Huang <[email protected]>

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

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +13 -0
index 0d9d6b46e239..2099cf194a89 100644
@@ -718,3 +718,16 @@ Contact:	Fei Jiang <[email protected]>
 		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 <[email protected]>
+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
drivers/power/supply/power_supply_sysfs.c +1 -0
index f95574c41898..c864a14829ec 100644
@@ -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 *
include/linux/power_supply.h +1 -0
index 3fe7e9ef2f0f..2de9a4c93723 100644
@@ -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 {
Signature · 1 line
2.26.0
#2 lore raw

Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property

Quoted 24 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +3 -0
index 0d9d6b46e239..2099cf194a89 100644
@@ -718,3 +718,16 @@ Contact:	Fei Jiang <[email protected]>
 		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

Documentation/ABI/testing/sysfs-class-power Contact: Fei Jiang <[email protected]> · line 733

Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +10 -0
+Date:		Jul 2020
+Contact:	Fei Jiang <[email protected]>
+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?

drivers/power/supply/power_supply_sysfs.c static struct power_supply_attr power_supply_attrs[] = { · line 210

Quoted 10 lines

\ No newline at end of file

drivers/power/supply/power_supply_sysfs.c +1 -0
index f95574c41898..c864a14829ec 100644
@@ -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

#3 lore raw

答复: [External Mail]Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property

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 <[email protected]>
发送时间: 2020年7月10日 18:00
收件人: Qiwu Huang
抄送: [email protected]; [email protected]; [email protected]; Fei1 Jiang 蒋飞; 黄其武 主题: [External Mail]Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property

Quoted 24 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +3 -0
index 0d9d6b46e239..2099cf194a89 100644
@@ -718,3 +718,16 @@ Contact: Fei Jiang <[email protected]>
              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

Documentation/ABI/testing/sysfs-class-power Contact: Fei Jiang <[email protected]> · line 733

Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +10 -0
+Date:                Jul 2020
+Contact:     Fei Jiang <[email protected]>
+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?

drivers/power/supply/power_supply_sysfs.c static struct power_supply_attr power_supply_attrs[] = { · line 210

Quoted 10 lines

\ No newline at end of file

drivers/power/supply/power_supply_sysfs.c +1 -0
index f95574c41898..c864a14829ec 100644
@@ -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!******/#

#4 lore raw

Re: 答复: [External Mail]Re: [PATCH 2/5] power: supply: core: add wireless charger adapter type property

Quoted 1 line · 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 :(

author
#5 lore raw

PATCH 3/5 power: supply: core: add wireless signal strength property

In reply to Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(-)
Documentation/ABI/testing/sysfs-class-power +8 -1
index 2099cf194a89..1f42aa0c071e 100644
@@ -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 <[email protected]>
+Description:
+		Reports wireless signal strength.
+		The value show degree of coupling.
\ No newline at end of file
drivers/power/supply/power_supply_sysfs.c +1 -0
index c864a14829ec..42fbe1b68255 100644
@@ -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 *
include/linux/power_supply.h +1 -0
index 2de9a4c93723..397fb8e96b03 100644
@@ -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 {
Signature · 1 line
2.26.0
#6 lore raw

Re: [PATCH 3/5] power: supply: core: add wireless signal strength property

Quoted 20 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(-)
Documentation/ABI/testing/sysfs-class-power +0 -0
index 2099cf194a89..1f42aa0c071e 100644
@@ -730,4 +730,11 @@ Description:
 
 		Access: Read-Only
 		Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",

Documentation/ABI/testing/sysfs-class-power Description: · line 740

Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +8 -1
-		"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 <[email protected]>
+Description:
+		Reports wireless signal strength.
+		The value show degree of coupling.

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

thanks,

greg k-h

#7 lore raw

答复: [External Mail]Re: [PATCH 3/5] power: supply: core: add wireless signal strength property

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 <[email protected]>
发送时间: 2020年7月10日 18:01
收件人: Qiwu Huang <[email protected]>
抄送: [email protected]; [email protected]; [email protected]; Fei1 Jiang 蒋飞 <[email protected]>; 黄其武 <[email protected]> 主题: [External Mail]Re: [PATCH 3/5] power: supply: core: add wireless signal strength property

Quoted 20 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(-)
Documentation/ABI/testing/sysfs-class-power +0 -0
index 2099cf194a89..1f42aa0c071e 100644
@@ -730,4 +730,11 @@ Description:
 
 Access: Read-Only
 Valid values: "ADAPTER_NONE", "ADAPTER_SDP", "ADAPTER_DCP", "ADAPTER_CDP",

Documentation/ABI/testing/sysfs-class-power Description: · line 740

Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +8 -1
-"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 <[email protected]>
+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!******/#

author
#8 lore raw

PATCH 4/5 power: supply: core: property to control reverse charge

In reply to Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(-)
Documentation/ABI/testing/sysfs-class-power +12 -1
index 1f42aa0c071e..1f489a250c19 100644
@@ -737,4 +737,15 @@ Date:		Jul 2020
 Contact:	Fei Jiang <[email protected]>
 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 <[email protected]>
+Description:
+		The property supply interface to control wireless
+		reverse charge mode.
+
+		Valid values:
+		- 1: enabled
+		- 0: disabled
+
drivers/power/supply/power_supply_sysfs.c +1 -0
index 42fbe1b68255..4be762abba89 100644
@@ -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 *
include/linux/power_supply.h +1 -0
index 397fb8e96b03..319bf6456867 100644
@@ -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 {
Signature · 1 line
2.26.0
#9 lore raw

Re: [PATCH 4/5] power: supply: core: property to control reverse charge

Quoted 39 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

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

---
 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(-)
Documentation/ABI/testing/sysfs-class-power +12 -1
index 1f42aa0c071e..1f489a250c19 100644
@@ -737,4 +737,15 @@ Date:		Jul 2020
 Contact:	Fei Jiang <[email protected]>
 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 <[email protected]>
+Description:
+		The property supply interface to control wireless
+		reverse charge mode.
+
+		Valid values:
+		- 1: enabled
+		- 0: disabled
+
drivers/power/supply/power_supply_sysfs.c +0 -0
index 42fbe1b68255..4be762abba89 100644

drivers/power/supply/power_supply_sysfs.c static struct power_supply_attr power_supply_attrs[] = { · line 212

Quoted 4 lines
drivers/power/supply/power_supply_sysfs.c +1 -0
@@ -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

author
#10 lore raw

PATCH 5/5 power: supply: core: supply battery soc with decimal form

In reply to Qiwu Huang

From: Qiwu Huang <[email protected]>

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.

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +20 -0
index 1f489a250c19..60c5a0dd1b98 100644
@@ -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:	[email protected]
+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:	[email protected]
+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
drivers/power/supply/power_supply_sysfs.c +2 -0
index 4be762abba89..8defc22e0d7f 100644
@@ -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 *
include/linux/power_supply.h +2 -0
index 319bf6456867..d1aa5497938e 100644
@@ -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 {
Signature · 1 line
2.26.0
#11 lore raw

Re: [PATCH 5/5] power: supply: core: supply battery soc with decimal form

Quoted 31 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

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.

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +9 -0
index 1f489a250c19..60c5a0dd1b98 100644
@@ -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:	[email protected]
+Description:
+		Broadcast battery soc with decimal form.
+		soc_decimal is the start decimal part of battery soc.
+
+		Access: Read
+                Valid values: 0 - 100

Documentation/ABI/testing/sysfs-class-power Description: · line 370

Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +10 -0
+
+What:		/sys/class/power_supply/<supply_name>/soc_decimal_rate,
+Date:		Jul 2020
+Contact:	[email protected]
+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?

Quoted 9 lines
Documentation/ABI/testing/sysfs-class-power +1 -0
+
 ===== USB Properties =====
 
 What: 		/sys/class/power_supply/<supply_name>/current_avg
drivers/power/supply/power_supply_sysfs.c +0 -0
index 4be762abba89..8defc22e0d7f 100644

drivers/power/supply/power_supply_sysfs.c static struct power_supply_attr power_supply_attrs[] = { · line 214

Quoted 5 lines
drivers/power/supply/power_supply_sysfs.c +2 -0
@@ -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

#12 lore raw
In reply to Qiwu Huang
Quoted 21 lines · Qiwu Huang

From: Qiwu Huang <[email protected]>

Reports the kind of quick charge type based on
different adapter power. UI will show different
animation effect for different quick charge type.

---
 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(+)
Documentation/ABI/testing/sysfs-class-power +0 -0
index 216d61a22f1e..0d9d6b46e239 100644
@@ -708,3 +708,13 @@ Description:
 
 		Access: Read
 		Valid values: 1-31

Documentation/ABI/testing/sysfs-class-power Description: · line 720

Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +10 -0
+
+What:		/sys/class/power_supply/<supply_name>/quick_charge_type
+Date:		Jul 2020
+Contact:	Fei Jiang <[email protected]>
+		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"?

drivers/power/supply/power_supply_sysfs.c static struct power_supply_attr power_supply_attrs[] = { · line 209

Quoted 9 lines
drivers/power/supply/power_supply_sysfs.c +1 -0
index bc79560229b5..f95574c41898 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw
Quoted 1 line · 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 :(