[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230110023656.1334114-1-andrew_lien@wistron.com>
Date: Tue, 10 Jan 2023 10:36:56 +0800
From: andrew lien/WHQ/Wistron <andrew_lien@...tron.com>
To: <myungjoo.ham@...sung.com>
CC: <cw00.choi@...sung.com>, <linux-kernel@...r.kernel.org>,
"andrew lien/WHQ/Wistron" <andrew_lien@...tron.com>
Subject: [PATCH] extcon: Add EXTCON_BATTERY type for battery presence
This information can be useful to device that support battery swap,
for example allowing them to indicate that a battery is present or not,
so provide a standard way to report it to userspace.
Signed-off-by: andrew lien/WHQ/Wistron <andrew_lien@...tron.com>
---
drivers/extcon/extcon.c | 5 +++++
include/linux/extcon.h | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index b4df4372f097..6c47d23244c3 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -184,6 +184,11 @@ static const struct __extcon_info {
.id = EXTCON_MECHANICAL,
.name = "MECHANICAL",
},
+ [EXTCON_BATTERY] = {
+ .type = EXTCON_TYPE_MISC,
+ .id = EXTCON_BATTERY,
+ .name = "BATTERY",
+ },
{ /* sentinel */ }
};
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index b0b4abb018ee..88210b481b6c 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -81,8 +81,9 @@
#define EXTCON_DOCK 60
#define EXTCON_JIG 61
#define EXTCON_MECHANICAL 62
+#define EXTCON_BATTERY 63
-#define EXTCON_NUM 63
+#define EXTCON_NUM 64
/*
* Define the properties of supported external connectors.
--
2.25.1
Powered by blists - more mailing lists