On Mon, Mar 04, 2013 at 11:26:07AM +0800, Peter Chen wrote:
> On Fri, Mar 01, 2013 at 03:42:24PM +0100, Michael Grzeschik wrote:
> > The implementation is derived from the fsl_udc_core code in
> > fsl_ep_enable and makes basic iso handling possible.
> >
> > Signed-off-by: Michael Grzeschik <[email protected]>
> > Signed-off-by: Marc Kleine-Budde <[email protected]>
> > ---
> > Changes since v1:
> > - fixed coding style issues mentioned by Sergei
> >
> > drivers/usb/chipidea/udc.c | 12 ++++++++++--
> > 1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> > index 22d37d8..45cce45 100644
> > --- a/drivers/usb/chipidea/udc.c
> > +++ b/drivers/usb/chipidea/udc.c
> > @@ -1076,6 +1076,9 @@ static int ep_enable(struct usb_ep *ep,
> > int retval = 0;
> > unsigned long flags;
> >
> > + unsigned short max;
> > + unsigned char mult = 0;
> > +
> > if (ep == NULL || desc == NULL)
> > return -EINVAL;
> >
> > @@ -1093,6 +1096,7 @@ static int ep_enable(struct usb_ep *ep,
> > mEp->type = usb_endpoint_type(desc);
> >
> > mEp->ep.maxpacket = usb_endpoint_maxp(desc);
> > + max = usb_endpoint_maxp(desc);
>
> Why not using mEp->ep.maxpacket directly?
Will fix.
> >
> > dbg_event(_usb_addr(mEp), "ENABLE", 0);
> >
> > @@ -1100,8 +1104,12 @@ static int ep_enable(struct usb_ep *ep,
> >
> > if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
> > mEp->qh.ptr->cap |= QH_IOS;
> > - else if (mEp->type == USB_ENDPOINT_XFER_ISOC)
> > - mEp->qh.ptr->cap &= ~QH_MULT;
> > + else if (mEp->type == USB_ENDPOINT_XFER_ISOC) {
> > + /* Calculate transactions needed for high bandwidth iso */
> > + mult = (unsigned char)(1 + ((max >> 11) & 0x03));
>
> Better to use MACRO, not use number directly.
I will add defines und use them.
> > + max &= 0x7ff; /* bit 0~10 */
>
> Useless line?
Not intended. I will have to change the capability
setting of the qh to use max instead of mEp->ep.maxpacket.
> > + mEp->qh.ptr->cap |= mult << 30;
>
> Better to use MACRO, not use number directly.
I will add defines und use them.
> > + }
> > else
> > mEp->qh.ptr->cap &= ~QH_ZLT;
>
> Do you plan to port all ISO supports from fsl_core_udc.c?
Can you point me to missing parts beside that.
I did not find much more ISO related in the fsl_code_udc.
Thanks,
Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html