From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbcFGBw7 (ORCPT ); Mon, 6 Jun 2016 21:52:59 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:50574 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbcFGBw4 (ORCPT ); Mon, 6 Jun 2016 21:52:56 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 X-AuditID: cbfee68d-f79646d000001386-6d-575628f45d91 Content-transfer-encoding: 8BIT Message-id: <575628F4.7000109@samsung.com> Date: Tue, 07 Jun 2016 10:52:52 +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 Cc: Venkat Reddy Talla , 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> <574D3EA7.9080907@samsung.com> In-reply-to: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsWyRsSkRPeLRli4wdXblhbzj5xjteh/s5DV 4tyrlYwWS/etZrG4vGsOm8XS6xeZLG43rmCzmDB9LYvF/z072C1W3XnP4sDlsWbeGkaPy329 TB4rl39h89i0qpPNo7f5HZtH35ZVjB6fN8kFsEdx2aSk5mSWpRbp2yVwZaxbtI614LhhxbQ5 E1kbGO+qdDFyckgImEisPr6SBcIWk7hwbz1bFyMXh5DACkaJVX2LWWGKLj1vgUosZZSYuvUo G0iCV0BQ4sfke0DdHBzMAvISRy5lQ5jqElOm5EKUP2CU6Jv2B6pcS+JY6ywwm0VAVWLDg0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PMIAlOgWCJfzO/M09gFJiF5LxZCOfNQjhvASPzKkaJ1ILkguKk9FzDvNRy veLE3OLSvHS95PzcTYzgRPBMagfjwV3uhxgFOBiVeHh3fAkNF2JNLCuuzD3EKMHBrCTCy6Ua Fi7Em5JYWZValB9fVJqTWnyI0RTov4nMUqLJ+cAklVcSb2hsYmZkaWRuaGFkbK4kzvv4/7ow IYH0xJLU7NTUgtQimD4mDk6pBsZtGwNUTi++fKB/E7vO2bCfDH++7j4vvVnszaoHOfIGq7r5 n6jtq1Of9Nlor3Upx5IcdhW2FS41vknluXPktZd+N5i00n1Wi2n2kk5tRYaA2ODFvC3rt5W/ XHNKu2atU1xg0ZIbRmqNs25YVjctUMl9Nvma3DwrFou0si9nE7XFfR56XjRoNVdiKc5INNRi LipOBAAefzAfGgMAAA== 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 Ping. Hi Rob, I add some comment about gpio-keys and extcon-gpio. I'm waiting for your reply. On 2016년 05월 31일 23:34, Chanwoo Choi wrote: > Hi Rob, > > On Tue, May 31, 2016 at 10:35 PM, Rob Herring wrote: >> On Tue, May 31, 2016 at 2:35 AM, Chanwoo Choi wrote: >>> 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 >> >> There is a big difference in that each gpio-key is independent. The >> only state is pressed or not. A USB connector has multiple pieces of >> state information. You may be treating them independently, but I don't >> think they should be. > > I think that is it not different because the EXTCON can only notify the whether > external connector is attached or detached such as gpio-key (pressed or not). > > EXTCON don't handle the any additional state except for attached or detached. > >> >>> 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 = ;' >> >> This is state information about what is currently attached. The >> analogy with gpio-keys would be multiple key codes on one gpio which >> would be broken... > > I compared between 'gpis-keys' and ' extcon-gpio' driver as following: > > name | gpio-keys | extcon-gpio > --------------------------------------------------------------------------------------------- > gpio | gpios = <> | extcon-gpio = <> > --------------------------------------------------------------------------------------------- > type | linux,code = <> | extcon-id = <> > --------------------------------------------------------------------------------------------- > key & | KEY_POWER | EXTCON_USB > extcon id | KEY_VOLUME_UP | EXTCON_CHG_USB_SDP > | KEY_VOLUME_DOWN | EXTCON_JACK_MICROPHONE > | etc | etc > --------------------------------------------------------------------------------------------- > state | pressed or not | attached or detached > --------------------------------------------------------------------------------------------- > >> >>> >>> 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. >> >> So? Different h/w needs different compatible strings. >> >> But again, you are mixing describing the connector (only what is >> soldered on a board) and state information (what is attached). Do not >> put state information into DT (describe the gpio signals or chip that >> provides the state information). >> >>> The extcon-gpio.c driver can separate the kind of external connector >>> by using the 'extcon-id' property. >> >> This use of DT is just broken. Come up with another way. >> >> Rob > > Thanks, > Chanwoo Choi Regards, Chanwoo Choi