From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chanwoo Choi Subject: Re: [PATCH v4] extcon: gpio: Add the support for Device tree bindings Date: Tue, 31 May 2016 15:44:39 +0900 Message-ID: <574D32D7.2090902@samsung.com> References: <1464263265-20187-1-git-send-email-vreddytalla@nvidia.com> <20160527152934.GB12024@rob-hp-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-reply-to: <20160527152934.GB12024@rob-hp-laptop> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@vger.kernel.org On 2016=EB=85=84 05=EC=9B=94 28=EC=9D=BC 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' a= nd >> 'gpios' property. >=20 > I think extcon bindings are a mess in general... >=20 >> For example: >> usb_cable: extcon-gpio-0 { >> compatible =3D "extcon-gpio"; >> extcon-id =3D ; >> gpios =3D <&gpio6 1 GPIO_ACTIVE_HIGH>; >> } >> ta_cable: extcon-gpio-1 { >> compatible =3D "extcon-gpio"; >> extcon-id =3D ; >> gpios =3D <&gpio3 2 GPIO_ACTIVE_LOW>; >> debounce-ms =3D <50>; /* 50 millisecond */ >> wakeup-source; >> } >=20 > This is all 1 logical connector, the USB connector. Why are you=20 > describing cables? Those are not part of the h/w and are dynamic.=20 > Describe this as a connector which is one thing (i.e. node). Use a=20 > compatible string that reflects the type of connector=20 > (usb-microab-connector), not the driver you want to use. Then define=20 > GPIO lines needed to provide state information like VBus, ID, charger= =20 > modes and control lines like soft connect (D+ pullup enable), VBus=20 > 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 us= e the extcon-gpio.c driver. [1] https://lkml.org/lkml/2015/10/21/906 =46or 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[] =3D { { .compatible =3D "extcon-chg-sdp", /* SDP charger connector */ .data =3D EXTCON_CHG_SDP_DATA, }, { .compatible =3D "extcon-chg-dcp", /* DCP charger connector */ .data =3D EXTCON_CHG_DCP_DATA, }, { .compatible =3D "extcon-jack-microphone", /* Microphone jack connecto= r */ .data =3D EXTCON_JACK_MICROPHONE_DATA, }, { .compatible =3D "extcon-disp-hdmi", /* HDMI connector*/ .data =3D EXTCON_DISP_HDMI_DATA, }, ...... }; Thanks, Chanwoo Choi