From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755670AbcEaHfK (ORCPT ); Tue, 31 May 2016 03:35:10 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:52392 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755290AbcEaHfH (ORCPT ); Tue, 31 May 2016 03:35:07 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 X-AuditID: cbfee68d-f79646d000001386-ad-574d3ea7e27d Content-transfer-encoding: 8BIT Message-id: <574D3EA7.9080907@samsung.com> Date: Tue, 31 May 2016 16:35:03 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Rob Herring , Venkat Reddy Talla Cc: MyungJoo Ham , Pawel Moll , Mark Rutland , Ian Campbell , devicetree@vger.kernel.org, Kumar Gala , linux-kernel@vger.kernel.org, Laxman Dewangan Subject: Re: [PATCH v4] extcon: gpio: Add the support for Device tree bindings References: <1464263265-20187-1-git-send-email-vreddytalla@nvidia.com> <20160527152934.GB12024@rob-hp-laptop> <574D32D7.2090902@samsung.com> In-reply-to: <574D32D7.2090902@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsWyRsSkUHe5nW+4Qe8PHYv5R86xWvS/Wchq ce7VSkaLpftWs1hc3jWHzWLp9YtMFrcbV7BZTJi+lsXi/54d7Bar7rxnceDyWDNvDaPH5b5e Jo+Vy7+weWxa1cnm0dv8js2jb8sqRo/Pm+QC2KO4bFJSczLLUov07RK4MiZt9ix4K1Gx7tpa xgbGx8JdjJwcEgImEo8nHGWDsMUkLtxbD2RzcQgJrGCUmNX2lRmmqKt/P1RiKaPEq6bzYB28 AoISPybfY+li5OBgFpCXOHIpG8JUl5gyJRei/AGjxL0tS9ghyrUkVp7pYASxWQRUJb7N+c8C YrM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ITzZiGct4CReRWjRGpBckFxUnquUV5quV5x Ym5xaV66XnJ+7iZGcBp4Jr2D8fAu90OMAhyMSjy8Dgd9woVYE8uKK3MPMUpwMCuJ8C4x8w0X 4k1JrKxKLcqPLyrNSS0+xGgK9N9EZinR5HxgisoriTc0NjEzsjQyN7QwMjZXEud9/H9dmJBA emJJanZqakFqEUwfEwenVAPj/stOb7erTPebGGn1T0vB++ytYNb58sYHjzBtCf461TSTTd1r 9plnK3S2LXBsvr+TZ4evI9/Wzw033pt9WxMx62Z28LnLjB83FIaoOjxJWLyJyUX8oNbqhCKh 2uOTmN57CzEYGZgKcqWKsO6OWTxLLdWkO/N33eOOK6xdE1czLjxhtubr3h/dSizFGYmGWsxF xYkA2k+45BkDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On 2016년 05월 31일 15:44, Chanwoo Choi wrote: > On 2016년 05월 28일 00:29, Rob Herring wrote: >> On Thu, May 26, 2016 at 05:17:45PM +0530, Venkat Reddy Talla wrote: >>> Add the support for Device tree bindings of extcon-gpio driver. >>> The extcon-gpio device tree node must include the both 'extcon-id' and >>> 'gpios' property. >> >> I think extcon bindings are a mess in general... >> >>> For example: >>> usb_cable: extcon-gpio-0 { >>> compatible = "extcon-gpio"; >>> extcon-id = ; >>> gpios = <&gpio6 1 GPIO_ACTIVE_HIGH>; >>> } >>> ta_cable: extcon-gpio-1 { >>> compatible = "extcon-gpio"; >>> extcon-id = ; >>> gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; >>> debounce-ms = <50>; /* 50 millisecond */ >>> wakeup-source; >>> } >> >> This is all 1 logical connector, the USB connector. Why are you >> describing cables? Those are not part of the h/w and are dynamic. >> Describe this as a connector which is one thing (i.e. node). Use a >> compatible string that reflects the type of connector >> (usb-microab-connector), not the driver you want to use. Then define >> GPIO lines needed to provide state information like VBus, ID, charger >> modes and control lines like soft connect (D+ pullup enable), VBus >> enable, etc. > > You're right. The extcon-gpio driver will not use the "extcon-gpio" raw compatible. > As you commented[1], the each connector will have the unique name to use the extcon-gpio.c driver. > [1] https://lkml.org/lkml/2015/10/21/906 > > > For example, > The extcon-gpio.c driver may have the different name including the h/w information > according to the kind of external connector. > > static const struct of_device_id gpio_extcon_of_match[] = { > { > .compatible = "extcon-chg-sdp", /* SDP charger connector */ > .data = EXTCON_CHG_SDP_DATA, > }, { > .compatible = "extcon-chg-dcp", /* DCP charger connector */ > .data = EXTCON_CHG_DCP_DATA, > }, { > .compatible = "extcon-jack-microphone", /* Microphone jack connector */ > .data = EXTCON_JACK_MICROPHONE_DATA, > }, { > .compatible = "extcon-disp-hdmi", /* HDMI connector*/ > .data = EXTCON_DISP_HDMI_DATA, > }, > ...... > }; I reply it again. The extcon-gpio.c is very similar with existing gpio_keys.c driver[1] [1] drivers/input/keyboard/gpio_keys.c The gpio_keys.c driver use the following style to support the device-tree. It use the "gpio-keys" compatible and this dt node include the specific 'key code' such as 'extcon-id = ;' gpio_keys { compatible = "gpio-keys"; power_key { gpios = <&gpx2 7 GPIO_ACTIVE_LOW>; linux,code = ; label = "power key"; debounce-interval = <10>; wakeup-source; }; }; If the extcon-gpio.c driver should have the separate compatible according to the kind of external connector, the list of compatible name of extcon-gpio.c driver will be increased when new external connector is attached. The extcon-gpio.c driver can separate the kind of external connector by using the 'extcon-id' property. Thanks, Chanwoo Choi