Skip to contentSkip to conversation

power: supply: add dock type

PATCH In review Jack Wu 2 participants 3 messages Mar 7, 2022 – Jun 9, 2022 Power supply

lore
Share & tools
lore

Jack Wu

author
#0 lore raw

PATCH v2 1/1 power: supply: add dock type

Add dock power_supply_type for the drivers which supports dock can register a power supply class device with POWER_SUPPLY_TYPE_DOCK.

---
 Documentation/ABI/testing/sysfs-class-power | 2 +-
 drivers/power/supply/power_supply_sysfs.c   | 1 +
 include/linux/power_supply.h                | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-class-power +1 -1
index 859501366777..0b45d9d3a50f 100644
@@ -34,7 +34,7 @@ Description:
 		Describes the main type of the supply.
 
 		Access: Read
-		Valid values: "Battery", "UPS", "Mains", "USB", "Wireless"
+		Valid values: "Battery", "UPS", "Mains", "USB", "Wireless", "Dock"
 
 **Battery and USB properties**
 
drivers/power/supply/power_supply_sysfs.c +1 -0
index c0dfcfa33206..2b1f18b7f98c 100644
@@ -57,6 +57,7 @@ static const char * const POWER_SUPPLY_TYPE_TEXT[] = {
 	[POWER_SUPPLY_TYPE_USB_PD_DRP]		= "USB_PD_DRP",
 	[POWER_SUPPLY_TYPE_APPLE_BRICK_ID]	= "BrickID",
 	[POWER_SUPPLY_TYPE_WIRELESS]		= "Wireless",
+	[POWER_SUPPLY_TYPE_DOCK]		= "Dock",
 };
 
 static const char * const POWER_SUPPLY_USB_TYPE_TEXT[] = {
include/linux/power_supply.h +1 -0
index e218041cc000..8f0425f00803 100644
@@ -189,6 +189,7 @@ enum power_supply_type {
 	POWER_SUPPLY_TYPE_USB_PD_DRP,		/* PD Dual Role Port */
 	POWER_SUPPLY_TYPE_APPLE_BRICK_ID,	/* Apple Charging Method */
 	POWER_SUPPLY_TYPE_WIRELESS,		/* Wireless */
+	POWER_SUPPLY_TYPE_DOCK,			/* Dock Charging */
 };
 
 enum power_supply_usb_type {
Signature · 1 line
2.35.1.616.g0bdcbb4464-goog
author
#1 lore raw

Hi Sebastian,

Currently, power_supply framework supports only Battery, UPS, Mains, USB and WIRELESS power_supply_type. Add dock power_supply_type so that the drivers which supports dock can register a power supply class device with POWER_SUPPLY_TYPE_DOCK.

change log
---
v2: updates to Documentation

Thanks!
Jack

Jack Wu <[email protected]> 於 2022年3月7日 週一 上午11:44寫道:

Quoted 51 lines

Add dock power_supply_type for the drivers which supports dock can register a power supply class device with POWER_SUPPLY_TYPE_DOCK.

---
 Documentation/ABI/testing/sysfs-class-power | 2 +-
 drivers/power/supply/power_supply_sysfs.c   | 1 +
 include/linux/power_supply.h                | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-class-power +1 -1
index 859501366777..0b45d9d3a50f 100644
@@ -34,7 +34,7 @@ Description:
                Describes the main type of the supply.
 
                Access: Read
-               Valid values: "Battery", "UPS", "Mains", "USB", "Wireless"
+               Valid values: "Battery", "UPS", "Mains", "USB", "Wireless", "Dock"
 
 **Battery and USB properties**
 
drivers/power/supply/power_supply_sysfs.c +1 -0
index c0dfcfa33206..2b1f18b7f98c 100644
@@ -57,6 +57,7 @@ static const char * const POWER_SUPPLY_TYPE_TEXT[] = {
        [POWER_SUPPLY_TYPE_USB_PD_DRP]          = "USB_PD_DRP",
        [POWER_SUPPLY_TYPE_APPLE_BRICK_ID]      = "BrickID",
        [POWER_SUPPLY_TYPE_WIRELESS]            = "Wireless",
+       [POWER_SUPPLY_TYPE_DOCK]                = "Dock",
 };
 
 static const char * const POWER_SUPPLY_USB_TYPE_TEXT[] = {
include/linux/power_supply.h +1 -1
index e218041cc000..8f0425f00803 100644
@@ -189,6 +189,7 @@ enum power_supply_type {
        POWER_SUPPLY_TYPE_USB_PD_DRP,           /* PD Dual Role Port */
        POWER_SUPPLY_TYPE_APPLE_BRICK_ID,       /* Apple Charging Method */
        POWER_SUPPLY_TYPE_WIRELESS,             /* Wireless */
+       POWER_SUPPLY_TYPE_DOCK,                 /* Dock Charging */
 };
 
 enum power_supply_usb_type {
--

2.35.1.616.g0bdcbb4464-goog

#2 lore raw

Hi,

Quoted 4 lines · Jack Wu

Currently, power_supply framework supports only Battery, UPS, Mains, USB and WIRELESS power_supply_type. Add dock power_supply_type so that the drivers which supports dock can register a power supply class device with POWER_SUPPLY_TYPE_DOCK.

I asked for a driver using this. We do not add/extend sysfs API just for the sake of downstream drivers. Either you send the new driver/driver changes upstream that need POWER_SUPPLY_TYPE_DOCK, or this will not get added.

Please don't waste reviewer's time!

-- Sebastian

Quoted 57 lines

v2: updates to Documentation

Thanks!
Jack

Jack Wu <[email protected]> 於 2022年3月7日 週一 上午11:44寫道:

Quoted 51 lines

Add dock power_supply_type for the drivers which supports dock can register a power supply class device with POWER_SUPPLY_TYPE_DOCK.

---
 Documentation/ABI/testing/sysfs-class-power | 2 +-
 drivers/power/supply/power_supply_sysfs.c   | 1 +
 include/linux/power_supply.h                | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-class-power +1 -1
index 859501366777..0b45d9d3a50f 100644
@@ -34,7 +34,7 @@ Description:
                Describes the main type of the supply.
 
                Access: Read
-               Valid values: "Battery", "UPS", "Mains", "USB", "Wireless"
+               Valid values: "Battery", "UPS", "Mains", "USB", "Wireless", "Dock"
 
 **Battery and USB properties**
 
drivers/power/supply/power_supply_sysfs.c +1 -0
index c0dfcfa33206..2b1f18b7f98c 100644
@@ -57,6 +57,7 @@ static const char * const POWER_SUPPLY_TYPE_TEXT[] = {
        [POWER_SUPPLY_TYPE_USB_PD_DRP]          = "USB_PD_DRP",
        [POWER_SUPPLY_TYPE_APPLE_BRICK_ID]      = "BrickID",
        [POWER_SUPPLY_TYPE_WIRELESS]            = "Wireless",
+       [POWER_SUPPLY_TYPE_DOCK]                = "Dock",
 };
 
 static const char * const POWER_SUPPLY_USB_TYPE_TEXT[] = {
include/linux/power_supply.h +1 -1
index e218041cc000..8f0425f00803 100644
@@ -189,6 +189,7 @@ enum power_supply_type {
        POWER_SUPPLY_TYPE_USB_PD_DRP,           /* PD Dual Role Port */
        POWER_SUPPLY_TYPE_APPLE_BRICK_ID,       /* Apple Charging Method */
        POWER_SUPPLY_TYPE_WIRELESS,             /* Wireless */
+       POWER_SUPPLY_TYPE_DOCK,                 /* Dock Charging */
 };
 
 enum power_supply_usb_type {
--

2.35.1.616.g0bdcbb4464-goog