power: supply: core: add quick charge type property
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 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
@@ -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: Reported as integer +
drivers/power/supply/power_supply_sysfs.c +1 -0
@@ -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
@@ -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.27.0
Quoted 6 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.
Quoted 6 lines
Signed-off-by Qiwu Huang <[email protected]>--- 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(+)
What changed from v1 of this patch? SHouldn't that always be below the --- line?
Quoted 6 lines
Documentation/ABI/testing/sysfs-class-power +0
-0
Documentation/ABI/testing/sysfs-class-power Description: · line 716
Quoted 9 lines
Documentation/ABI/testing/sysfs-class-power +6
-0@@ -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.
What are the allowed types here? Shouldn't that also be an enumerated type with a predefined string?
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): CAPtXDt2ALhYRTTn7m6Jb3k+339VC84YUDC7V=Yb7-a+DpvuVtg@mail.gmail.com
A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
Quoted 1 line · ivan
I think we should add an enumederated for this
What is "this"?
Quoted 28 lines
for example
abi document
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. Different quick charge type represent different charging power.QUICK_CHARGE_NORMAL: Charging Power <= 10WQUICK_CHARGE_FAST: 10W < Charging Power <= 20WQUICK_CHARGE_FLASH: 20W < Charging Power <= 30WQUICK_CHARGE_TURBE: 30W < Charging Power <= 50WQUICK_CHARGE_SUPER: Charging Power > 50WAccess: Read-Only
Valid values:
0:QUICK_CHARGE_NORMAL,
1:QUICK_CHARGE_FAST,
2:QUICK_CHARGE_FLASH,
3:QUICK_CHARGE_TURBE,
4:QUICK_CHARGE_SUPER.
power_supply.h
Quoted 8 lines
enum
power_supply_quick_charge_type{QUICK_CHARGE_NORMAL= 0,QUICK_CHARGE_FAST,QUICK_CHARGE_FLASH,QUICK_CHARGE_TURBE,QUICK_CHARGE_SUPER,QUICK_CHARGE_MAX,
};
That seems like a good change, why not do this? :)
thanks,
greg k-h
PATCH v2 2/5 power: supply: core: add wireless charger adapter type property
In reply to a message not in the archiveFrom: 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 | 11 +++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 13 insertions(+)
Documentation/ABI/testing/sysfs-class-power +11 -0
@@ -718,3 +718,14 @@ Contact: Fei Jiang <[email protected]> Access: Read-Only Valid values: Reported as integer +===== 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: Reported as integer
drivers/power/supply/power_supply_sysfs.c +1 -0
@@ -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
@@ -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.27.0
Re: [PATCH v2 2/5] power: supply: core: add wireless charger adapter type property
Quoted 19 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 ifADAPTER_PDcapable source is attached.Signed-off-by Qiwu Huang <[email protected]>--- Documentation/ABI/testing/sysfs-class-power | 11 +++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 13 insertions(+)Documentation/ABI/testing/sysfs-class-power +0
-0@@ -718,3 +718,14 @@ Contact: Fei Jiang <[email protected]> Access: Read-Only
Documentation/ABI/testing/sysfs-class-power Contact: Fei Jiang <[email protected]> · line 728
Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +8
-0Valid values: Reported as integer +===== 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.
Same question as before, what are the allowed types here?
Documentation/ABI/testing/sysfs-class-power Contact: Fei Jiang <[email protected]> · line 731
Quoted 3 lines
Documentation/ABI/testing/sysfs-class-power +3
-0+ + Access: Read-Only + Valid values: Reported as integer
What integer maps to what values?
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): CAPtXDt3kX0=MNXUjDfKr0EgmTxejctdoSoDWUY561gfT6CAr1Q@mail.gmail.com
Re: [PATCH v2 2/5] power: supply: core: add wireless charger adapter type property
Quoted 1 line · ivan
same as before, we should add it
Please do.
PATCH v2 3/5 power: supply: core: add wireless signal strength property
In reply to a message not in the archiveFrom: Qiwu Huang <[email protected]>
reports wireless signal strength.
The value show degree of coupling between tx and rx.
--- Documentation/ABI/testing/sysfs-class-power | 11 +++++++++++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 13 insertions(+)
Documentation/ABI/testing/sysfs-class-power +11 -0
@@ -729,3 +729,14 @@ Description: Access: Read-Only Valid values: Reported as integer + +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. + Unit is KHZ,the "value" means the working frequency of receiver + chip of wireless charging. + + Access: Read-Only + Valid values: Reported as integer
drivers/power/supply/power_supply_sysfs.c +1 -0
@@ -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
@@ -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.27.0
PATCH v2 4/5 power: supply: core: property to control reverse charge
In reply to a message not in the archiveFrom: Qiwu Huang <[email protected]>
Interface to control wireless reverse charge.
Supply reverse charge function when enabled.
--- 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(+)
Documentation/ABI/testing/sysfs-class-power +12 -0
@@ -740,3 +740,15 @@ Description: Access: Read-Only Valid values: Reported as integer + +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
@@ -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
@@ -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.27.0
PATCH v2 5/5 power: supply: core: supply battery soc with decimal form
In reply to a message not in the archiveFrom: 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.
We want to report such as 0.01 to 99.99% to user space to improve user experience when do very quick charging.
--- 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
@@ -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
@@ -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
@@ -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.27.0
Re: [PATCH v2 5/5] power: supply: core: supply battery soc with decimal form
Quoted 24 lines · Qiwu Huang
From: Qiwu Huang <[email protected]>
Broadcast battery soc with decimal form.
soc_decimalis the decimal part of battery soc.soc_decimal_rateis update frequency of decimal part of battery soc.
We want to report such as 0.01 to 99.99% to user space to improve user experience when do very quick charging.Signed-off-by Qiwu Huang <[email protected]>--- 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 +0
-0@@ -349,6 +349,26 @@ Description: Access: Read Valid values: Represented in microvolts
Documentation/ABI/testing/sysfs-class-power Description: · line 360
Quoted 10 lines
Documentation/ABI/testing/sysfs-class-power +9
-0+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
How can "100" be a valid decimal form here if this is a percent?
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
I think you need to document this a lot better as I still don't really understand what this is for or how to use it or report it.
And what does "soc" mean here?
thanks,
greg k-h