Re: [PATCH v4 04/23] usb: add usb_otg_caps to usb_gadget structure.

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

 




On Wed, Jun 17, 2015 at 11:29:36AM +0300, Roger Quadros wrote:
> 
> On Wed, 17 Jun 2015 13:43:36 +0800
> Li Jun <jun.li@xxxxxxxxxxxxx> wrote:
> 
> > From: Macpaul Lin <macpaul@xxxxxxxxx>
> > 
> > Add usb_otg_caps pointer to usb_gadget structure to indicate its
> > otg capabilities.
> > 
> > Signed-off-by: Macpaul Lin <macpaul@xxxxxxxxx>
> > Signed-off-by: Li Jun <jun.li@xxxxxxxxxxxxx>
> > ---
> >  include/linux/usb/gadget.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> > index 4f3dfb7..6b39087 100644
> > --- a/include/linux/usb/gadget.h
> > +++ b/include/linux/usb/gadget.h
> > @@ -511,6 +511,7 @@ struct usb_gadget_ops {
> >   * @dev: Driver model state for this abstract device.
> >   * @out_epnum: last used out ep number
> >   * @in_epnum: last used in ep number
> > + * @otg_caps: OTG capabilities of this gadget.
> >   * @sg_supported: true if we can handle scatter-gather
> >   * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
> >   *	gadget driver must provide a USB OTG descriptor.
> > @@ -559,6 +560,7 @@ struct usb_gadget {
> >  	struct device			dev;
> >  	unsigned			out_epnum;
> >  	unsigned			in_epnum;
> > +	struct usb_otg_caps		*otg_caps;
> 
> Why does this need to be a pointer?
> 
we need create the same struct in controller driver anyway;
usb_otg_caps is not only used for gadget, can be used for whole OTG,
it's not proper we judge host's otg capability by gadget's setting;
with a pointer, we need not create another one and no need data copy,
instead, we have only one this struct in whole OTG device.

Li Jun
> >  
> >  	unsigned			sg_supported:1;
> >  	unsigned			is_otg:1;
> 
> 
> cheers,
> -roger
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux