Hi, On Wed, Aug 13, 2014 at 12:56:27PM -0400, Alan Stern 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(). sounds good. I think we will be able to drop gadget->vbus_session() once this is all done as most current implementations will call gadget->disconnect/connect() conditionally on vbus being active or not. -- balbi
Attachment:
signature.asc
Description: Digital signature