On Wed, 13 Aug 2014, Felipe Balbi wrote: > > If you want libcomposite to handle the pullups on behalf of the > > function drivers, there has to be a way for the UDC driver to tell > > libcomposite when Vbus turns on and off. Add a new callback to the > > usb_gadget_driver structure? > > usb_gadget_driver, why ? We need a way for udc-core to ask the PHY if Not udc-core. libcomposite. > VBUS is already above session valid threshold. My fear is that we might > end up implementing this by polling this PHY method until it's valid. > > Are we starting to see a need for a kgadgetd which gets awaken on > different conditions ? Any other ideas ? The UDC driver ought to know when Vbus turns on or off, without polling. It should get an interrupt when that happens, or its ops->vbus_session routine should be called. So at that time, the UDC driver could invoke a new usb_gadget_driver callback. Let's also call it vbus_session. Since composite.c defines a usb_gadget_driver structure, it can have a composite_vbus_session() callback. When this routine is called, it will check to see whether all the functions are activated. If they are and Vbus is now on, it will call usb_gadget_connect(); otherwise it will call usb_gadget_disconnect(). Alan Stern -- 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