From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512AbcHBH56 (ORCPT ); Tue, 2 Aug 2016 03:57:58 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:42457 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755464AbcHBH5e (ORCPT ); Tue, 2 Aug 2016 03:57:34 -0400 Subject: Re: [PATCH v3 1/6] extcon: Add the extcon_type to gather each connector into five category To: Chanwoo Choi , References: <1470103105-5992-1-git-send-email-cw00.choi@samsung.com> <1470103105-5992-2-git-send-email-cw00.choi@samsung.com> CC: , , , , Krzysztof Kozlowski From: Roger Quadros Message-ID: <3ea3334e-96f5-6ce0-1402-6b9baf192db3@ti.com> Date: Tue, 2 Aug 2016 10:27:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1470103105-5992-2-git-send-email-cw00.choi@samsung.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Tested-by: Chris Zhong > Tested-by: Guenter Roeck > Signed-off-by: MyungJoo Ham > Reviewed-by: Guenter Roeck > --- > 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. > > /* Charging external connector */ cheers, -roger