From: Chanwoo Choi <cwchoi00@gmail.com>
To: andrew lien/WHQ/Wistron <andrew_lien@wistron.com>,
myungjoo.ham@samsung.com
Cc: cw00.choi@samsung.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: Add EXTCON_BATTERY type for battery presence
Date: Tue, 10 Jan 2023 22:39:38 +0900 [thread overview]
Message-ID: <dc62d036-dcab-532b-1c3c-fbebcd1705fa@gmail.com> (raw)
In-Reply-To: <20230110023656.1334114-1-andrew_lien@wistron.com>
On 23. 1. 10. 11:36, andrew lien/WHQ/Wistron wrote:
> 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@wistron.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.
Actually, battery is not external connector. The power_supply
subsystem already provided the POWER_SUPPLY_PROP_PRESENT
for the battery present. You have to develop the power_supply device driver
and then use power_supply_changed() to send the uevent to user-space.
--
Best Regards,
Samsung Electronics
Chanwoo Choi
next prev parent reply other threads:[~2023-01-10 13:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 2:36 andrew lien/WHQ/Wistron
2023-01-10 13:39 ` Chanwoo Choi [this message]
2023-01-11 9:00 ` Andrew Lien/WHQ/Wistron
2023-01-30 14:17 ` Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc62d036-dcab-532b-1c3c-fbebcd1705fa@gmail.com \
--to=cwchoi00@gmail.com \
--cc=andrew_lien@wistron.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®