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]
Date:	Tue, 02 Aug 2016 16:41:46 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Roger Quadros <rogerq@...com>, linux-kernel@...r.kernel.org
Cc:	myungjoo.ham@...sung.com, zyw@...k-chips.com, groeck@...omium.org,
	chanwoo@...nel.org, Krzysztof Kozlowski <k.kozlowski@...sung.com>
Subject: Re: [PATCH v3 1/6] extcon: Add the extcon_type to gather each
 connector into five category

Hi Roger,

On 2016년 08월 02일 16:27, Roger Quadros wrote:
> Hi,
> 
> On 02/08/16 04:58, Chanwoo Choi wrote:
>> This patch adds the new extcon type to group the each connecotr
>> into following five category. This type would be used to handle
>> the connectors as a group unit instead of a connector unit.
>> - EXTCON_TYPE_USB  : USB connector
>> - EXTCON_TYPE_CHG  : Charger connector
>> - EXTCON_TYPE_JACK : Jack connector
>> - EXTCON_TYPE_DISP : Display connector
>> - EXTCON_TYPE_MISC : Miscellaneous connector
>>
>> Also, each external connector is possible to belong to one more extcon type.
>> In caes of EXTCON_CHG_USB_SDP, it have the EXTCON_TYPE_CHG and EXTCON_TYPE_USB.
>>
>> Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
>> Tested-by: Chris Zhong <zyw@...k-chips.com>
>> Tested-by: Guenter Roeck <groeck@...omium.org>
>> Signed-off-by: MyungJoo Ham <myungjoo.ham@...sung.com>
>> Reviewed-by: Guenter Roeck <groeck@...omium.org>
>> ---
>>  drivers/extcon/extcon.c | 159 +++++++++++++++++++++++++++++++++++++++---------
>>  include/linux/extcon.h  |   9 +++
>>  2 files changed, 139 insertions(+), 29 deletions(-)
>>
>> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
>> index 9a266e5c7e10..129afc87313e 100644
>> --- a/drivers/extcon/extcon.c
>> +++ b/drivers/extcon/extcon.c
>> @@ -38,43 +38,144 @@
>>  #define SUPPORTED_CABLE_MAX	32
>>  #define CABLE_NAME_MAX		30
>>  
>> -static const char *extcon_name[] =  {
>> -	[EXTCON_NONE]			= "NONE",
>> +struct __extcon_info {
>> +	unsigned int type;
>> +	unsigned int id;
>> +	const char *name;
>> +
>> +} extcon_info[] = {
>> +	[EXTCON_NONE] = {
>> +		.type = EXTCON_TYPE_MISC,
>> +		.id = EXTCON_NONE,
>> +		.name = "NONE",
>> +	},
>>  
>>  	/* USB external connector */
>> -	[EXTCON_USB]			= "USB",
>> -	[EXTCON_USB_HOST]		= "USB-HOST",
>> +	[EXTCON_USB] = {
>> +		.type = EXTCON_TYPE_USB,
>> +		.id = EXTCON_USB,
>> +		.name = "USB",
>> +	},
>> +	[EXTCON_USB_HOST] = {
>> +		.type = EXTCON_TYPE_USB,
>> +		.id = EXTCON_USB,
>> +		.name = "USB_HOST",
>> +	},
> 
> EXTCON_USB_HOST should now be redundant as we can get all the
> necessary information via EXTCON_USB.

It is my mistake. I'll fix it.
	.id = EXTCON_USB, -> .id = EXTCON_USB_HOST,

On the user-space, the process don't handle the ID and VBUS information directly.
they need the identical type of attached external connector.

For exmaple,
The extcon separate the following two case:
- mobile phone is connected to desktop pc.
- mobile phone is connected to mouse/keyboard with otg cable.

Regards,
Chanwoo Choi




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ