On Thu, May 12, 2016 at 02:47:09PM +0530, maitysanchayan@xxxxxxxxx wrote: > Hello Peter, > > On 16-05-12 16:40:16, Peter Chen wrote: > > On Wed, May 11, 2016 at 06:11:36PM +0530, Sanchayan Maity wrote: > > > Use USBC_DET feature of standard Colibri SODIMM pin 137 for USB > > > device/host switching using the generic extcon USB gpio implementation. > > > > > > Signed-off-by: Sanchayan Maity <maitysanchayan@xxxxxxxxx> > > > --- > > > arch/arm/boot/dts/vf-colibri-eval-v3.dtsi | 12 ++++++++++++ > > > arch/arm/boot/dts/vf-colibri.dtsi | 7 +++++++ > > > 2 files changed, 19 insertions(+) > > > > > > diff --git a/arch/arm/boot/dts/vf-colibri-eval-v3.dtsi b/arch/arm/boot/dts/vf-colibri-eval-v3.dtsi > > > index a8a8e43..a012f80 100644 > > > --- a/arch/arm/boot/dts/vf-colibri-eval-v3.dtsi > > > +++ b/arch/arm/boot/dts/vf-colibri-eval-v3.dtsi > > > @@ -50,6 +50,14 @@ > > > clock-frequency = <16000000>; > > > }; > > > > > > + extcon_usbc_det: usbc_det { > > > + compatible = "linux,extcon-usb-gpio"; > > > + debounce = <25>; > > > + id-gpio = <&gpio3 6 GPIO_ACTIVE_HIGH>; > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&pinctrl_usbc_det>; > > > + }; > > > + > > > panel: panel { > > > compatible = "edt,et057090dhu"; > > > backlight = <&bl>; > > > @@ -162,6 +170,10 @@ > > > status = "okay"; > > > }; > > > > > > +&usbdev0 { > > > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>; > > > +}; > > > + > > > > I still not understand why vbus needs id-extcon too? Per my understand, > > this pin will not be changed between connects to pc and disconnects to > > pc. > > While the ID extcon will take care of switching the role, without the > vbus gadget connect/disconnect being called appropriately as per the > current state, I have observed the client configuration to not work. > > From the descriptions of usb_gadget_vbus_connect/disconnect I understand > this to be required. Do I understand wrong? Your understand is right, but most of problem is your platform is lack of vbus detect, so you don't know when to call usb_gadget_vbus_connect/ disconnect. extcon_usbc_det is the external connector for ID, you can't use it for both ID and VBUS. If you can add one gpio for vbus, then current framework can support. Roger is working on DRD/OTG framework [1], currently, it needs both ID and VBUS input for state machine. Your case is the new case, it has only one input (ID), but role switch is needed to support too. [1] http://www.spinics.net/lists/linux-usb/msg140138.html -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html