lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SEYPR02MB62308AE65824DC7F372EFCA585FC9@SEYPR02MB6230.apcprd02.prod.outlook.com>
Date:   Wed, 11 Jan 2023 09:00:59 +0000
From:   Andrew Lien/WHQ/Wistron <Andrew_Lien@...tron.com>
To:     Chanwoo Choi <cwchoi00@...il.com>,
        "myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>
CC:     "cw00.choi@...sung.com" <cw00.choi@...sung.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] extcon: Add EXTCON_BATTERY type for battery presence

Sorry I didn't describe it in detail enough

we have a standalone driver to do battery detection, this driver is separate from power_supply device driver
and not just report uevet to userspace, we also need a method to notify other kernel driver "battery removal event"
it will be better if using same battery detection driver to support different platform charger driver.

by the way, swappable battery usually have 4 pin connector (power / ground / ID / THERMAL)
you can find some phone that support battery swap feature (like Samsung xcover 6 pro)

-----Original Message-----
From: Chanwoo Choi <cwchoi00@...il.com> 
Sent: Tuesday, January 10, 2023 9:40 PM
To: Andrew Lien/WHQ/Wistron <Andrew_Lien@...tron.com>; myungjoo.ham@...sung.com
Cc: cw00.choi@...sung.com; linux-kernel@...r.kernel.org
Subject: Re: [PATCH] extcon: Add EXTCON_BATTERY type for battery presence

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ