linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: add "Wireless" to power_supply_type and power_supply_type_text
       [not found] <CGME20200715051353epcas1p46ae6b84555180be315752ef69262dfce@epcas1p4.samsung.com>
@ 2020-07-15  5:38 ` Jeehong Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jeehong Kim @ 2020-07-15  5:38 UTC (permalink / raw)
  To: jhez.kim, sre; +Cc: linux-pm, linux-kernel, Dohyung Kim

In android platform(BatteryMonitor.cpp), SysfsStringEnumMap<int>
supplyTypeMap[] is declred for communication with kernel(sysfs)
and there is "Wireless". But, no type for "Wireless" in kernel.
So, we suggest to add "Wireless" to power_supply_type and
power_supply_type_text.
I hope this will not only synchronize the text values with
android platform, but also help other platforms.

Reported-by: Jaeho Song <jaeho21.song@samsung.com>
Signed-off-by: Dohyung Kim <dh0703.kim@samsung.com>
Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
---
 drivers/power/supply/power_supply_sysfs.c | 1 +
 include/linux/power_supply.h              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bc79560229b5..35582b67eff5 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -56,6 +56,7 @@ static const char * const POWER_SUPPLY_TYPE_TEXT[] = {
 	[POWER_SUPPLY_TYPE_USB_PD]		= "USB_PD",
 	[POWER_SUPPLY_TYPE_USB_PD_DRP]		= "USB_PD_DRP",
 	[POWER_SUPPLY_TYPE_APPLE_BRICK_ID]	= "BrickID",
+	[POWER_SUPPLY_TYPE_WIRELESS]		= "Wireless",
 };

 static const char * const POWER_SUPPLY_USB_TYPE_TEXT[] = {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index ac1345a48ad0..c8bad17a9483 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -182,6 +182,7 @@ enum power_supply_type {
 	POWER_SUPPLY_TYPE_USB_PD,		/* Power Delivery Port */
 	POWER_SUPPLY_TYPE_USB_PD_DRP,		/* PD Dual Role Port */
 	POWER_SUPPLY_TYPE_APPLE_BRICK_ID,	/* Apple Charging Method */
+	POWER_SUPPLY_TYPE_WIRELESS,		/* Wireless */
 };

enum power_supply_usb_type {

base-commit: e9919e11e219eaa5e8041b7b1a196839143e9125
--
2.17.1


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

* [PATCH] power: supply: add "Wireless" to power_supply_type and power_supply_type_text
       [not found] <CGME20200729234356epcas1p483bdaa2460e89b6dd461b45f1650b646@epcas1p4.samsung.com>
@ 2020-07-30  0:09 ` Jeehong Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jeehong Kim @ 2020-07-30  0:09 UTC (permalink / raw)
  To: jhez.kim, sre; +Cc: linux-pm, linux-kernel

In android platform(BatteryMonitor.cpp), SysfsStringEnumMap<int>
supplyTypeMap[] is declred for communication with kernel(sysfs)
and there is "Wireless". But, no type for "Wireless" in kernel.
So, we suggest to add "Wireless" to power_supply_type and
power_supply_type_text.
I hope this will not only synchronize the text values with
android platform, but also help other platforms.

Signed-off-by: Jeehong Kim <jhez.kim@samsung.com>
---
 drivers/power/supply/power_supply_sysfs.c | 1 +
 include/linux/power_supply.h              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bc79560229b5..35582b67eff5 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -56,6 +56,7 @@ static const char * const POWER_SUPPLY_TYPE_TEXT[] = {
	[POWER_SUPPLY_TYPE_USB_PD]		= "USB_PD",
	[POWER_SUPPLY_TYPE_USB_PD_DRP]		= "USB_PD_DRP",
	[POWER_SUPPLY_TYPE_APPLE_BRICK_ID]	= "BrickID",
+	[POWER_SUPPLY_TYPE_WIRELESS]		= "Wireless",
 };

 static const char * const POWER_SUPPLY_USB_TYPE_TEXT[] = {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index ac1345a48ad0..c8bad17a9483 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -182,6 +182,7 @@ enum power_supply_type {
	POWER_SUPPLY_TYPE_USB_PD,		/* Power Delivery Port */
	POWER_SUPPLY_TYPE_USB_PD_DRP,		/* PD Dual Role Port */
	POWER_SUPPLY_TYPE_APPLE_BRICK_ID,	/* Apple Charging Method */
+	POWER_SUPPLY_TYPE_WIRELESS,		/* Wireless */
 };

 enum power_supply_usb_type {
--
2.17.1

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

end of thread, other threads:[~2020-07-29 23:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200715051353epcas1p46ae6b84555180be315752ef69262dfce@epcas1p4.samsung.com>
2020-07-15  5:38 ` [PATCH] power: supply: add "Wireless" to power_supply_type and power_supply_type_text Jeehong Kim
     [not found] <CGME20200729234356epcas1p483bdaa2460e89b6dd461b45f1650b646@epcas1p4.samsung.com>
2020-07-30  0:09 ` Jeehong Kim

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