Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550AbbEQJJn (ORCPT ); Sun, 17 May 2015 05:09:43 -0400 Received: from mail-vn0-f54.google.com ([209.85.216.54]:46947 "EHLO mail-vn0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752419AbbEQJJd (ORCPT ); Sun, 17 May 2015 05:09:33 -0400 MIME-Version: 1.0 In-Reply-To: References: <1431700278-30465-1-git-send-email-cw00.choi@samsung.com> <1431700278-30465-2-git-send-email-cw00.choi@samsung.com> Date: Sun, 17 May 2015 18:09:32 +0900 X-Google-Sender-Auth: vfkyudEbCySyIldkJEUSwm4_yPg Message-ID: Subject: Re: [PATCH 1/2] extcon: Use the unique id for external connector instead of string From: Krzysztof Kozlowski To: cw00.choi@samsung.com Cc: Krzysztof Kozlowski , linux-kernel , "myungjoo.ham@samsung.com" , Charles Keepax , gg@slimlogic.co.uk, Kishon Vijay Abraham I , jaewon02.kim@samsung.com, Roger Quadros , "Pallala, Ramakrishna" , Felipe Balbi , Aaro Koskinen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3784 Lines: 102 --george.cherian@ti.com Mail bounces. 2015-05-17 16:53 GMT+09:00 Chanwoo Choi : > Hi Krzysztof, > > On Sun, May 17, 2015 at 4:10 PM, Krzysztof Kozlowski >>> @@ -32,36 +35,43 @@ >>> #include >>> #include >>> >>> -/* >>> - * extcon_cable_name suggests the standard cable names for commonly used >>> - * cable types. >>> - * >>> - * However, please do not use extcon_cable_name directly for extcon_dev >>> - * struct's supported_cable pointer unless your device really supports >>> - * every single port-type of the following cable names. Please choose cable >>> - * names that are actually used in your extcon device. >>> - */ >>> -const char extcon_cable_name[][CABLE_NAME_MAX + 1] = { >>> +#define SUPPORTED_CABLE_MAX 32 >> >> Why only 32 cables are supported? I mean what is the reason behind the >> hard limit? > > Current extcon core use the 32bit variable to identify the supported > external connectors of each extcon device. But, the number of > supported connectors should be updated. I have the plan about it. I get it, it is related to 'state' variable which is u32 now. > >> >>> +#define CABLE_NAME_MAX 30 >>> + >>> +static const char *extcon_name[] = { >>> + [EXTCON_NONE] = "NONE", >>> + >>> + /* USB external connector */ >>> [EXTCON_USB] = "USB", >>> - [EXTCON_USB_HOST] = "USB-Host", >>> + [EXTCON_USB_HOST] = "USB-HOST", >>> + >>> + /* Charger external connector */ >>> [EXTCON_TA] = "TA", >>> - [EXTCON_FAST_CHARGER] = "Fast-charger", >>> - [EXTCON_SLOW_CHARGER] = "Slow-charger", >>> - [EXTCON_CHARGE_DOWNSTREAM] = "Charge-downstream", >>> + [EXTCON_FAST_CHARGER] = "FAST-CHARGER", >>> + [EXTCON_SLOW_CHARGER] = "SLOW-CHARGER", >>> + [EXTCON_CHARGE_DOWNSTREAM] = "CHARGE-DOWNSTREAM", >>> + >>> + /* Audio/Video external connector */ >>> + [EXTCON_LINE_IN] = "LINE-IN", >>> + [EXTCON_LINE_OUT] = "LINE-OUT", >>> + [EXTCON_MICROPHONE] = "MICROPHONE", >>> + [EXTCON_HEADPHONE] = "HEADPHONE", >>> + >>> [EXTCON_HDMI] = "HDMI", >>> [EXTCON_MHL] = "MHL", >>> [EXTCON_DVI] = "DVI", >>> [EXTCON_VGA] = "VGA", >>> - [EXTCON_DOCK] = "Dock", >>> - [EXTCON_LINE_IN] = "Line-in", >>> - [EXTCON_LINE_OUT] = "Line-out", >>> - [EXTCON_MIC_IN] = "Microphone", >>> - [EXTCON_HEADPHONE_OUT] = "Headphone", >>> - [EXTCON_SPDIF_IN] = "SPDIF-in", >>> - [EXTCON_SPDIF_OUT] = "SPDIF-out", >>> - [EXTCON_VIDEO_IN] = "Video-in", >>> - [EXTCON_VIDEO_OUT] = "Video-out", >>> - [EXTCON_MECHANICAL] = "Mechanical", >>> + [EXTCON_SPDIF_IN] = "SPDIF-IN", >>> + [EXTCON_SPDIF_OUT] = "SPDIF-OUT", >>> + [EXTCON_VIDEO_IN] = "VIDEO-IN", >>> + [EXTCON_VIDEO_OUT] = "VIDEO-OUT", >>> + >>> + /* Etc external connector */ >>> + [EXTCON_DOCK] = "DOCK", >>> + [EXTCON_JIG] = "JIG", >>> + [EXTCON_MECHANICAL] = "MECHANICAL", >>> + >>> + NULL, >>> }; >> >> This change does not look related to the topic. Can you split it to >> separate patch? > > Do you mean about changing the name of external connectors from small > letter to capital letter? Yes. This should be separate commit. Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/