Re: [PATCH 01/13] usb: gadget: introduce .connect gadget driver API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 19, 2014 at 10:56:58AM -0400, Alan Stern wrote:
> On Tue, 19 Aug 2014, Peter Chen wrote:
> 
> > > > --- a/include/linux/usb/gadget.h
> > > > +++ b/include/linux/usb/gadget.h
> > > > @@ -873,12 +873,39 @@ struct usb_gadget_driver {
> > > >  	void			(*disconnect)(struct usb_gadget *);
> > > >  	void			(*suspend)(struct usb_gadget *);
> > > >  	void			(*resume)(struct usb_gadget *);
> > > > +	int			(*connect)(struct usb_gadget *, bool connect);
> > > >  
> > > >  	/* FIXME support safe rmmod */
> > > >  	struct device_driver	driver;
> > > >  };
> > > 
> > > This looks strange.  Why do you have the "bool connect" parameter?  
> > 
> > How can I tell the gadget driver to pull down dp after vbus is off?
> > 
> > > There's already a disconnect callback.
> > 
> > Maybe I need to use other name rather than connect, the .disconnect sometimes
> > is called at bus reset handler so I can't put dp control in it.
> 
> We could fix that.  Right now there are only about four files that 
> define a usb_gadget_driver structure.  All you have to do is make sure 
> they each contain a reset handler.
> 

Yes, it is easy to add reset handler, I am waiting Felipe's comment,
if he is no comments, I will send a patchset for adding reset handler first.

-- 
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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux