On Wed, Sep 28, 2016 at 04:05:36PM +0300, Felipe Balbi wrote:
> We have introduced a helper to calculate multiplier
> value from wMaxPacketSize. Start using it.
>
> Cc: Bin Liu <[email protected]>
> Signed-off-by: Felipe Balbi <[email protected]>
> ---
> drivers/usb/musb/musb_gadget.c | 6 +++---
> drivers/usb/musb/musb_host.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index bff4869a57cd..8a0882cc446d 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -974,8 +974,8 @@ static int musb_gadget_enable(struct usb_ep *ep,
> goto fail;
>
> /* REVISIT this rules out high bandwidth periodic transfers */
> - tmp = usb_endpoint_maxp(desc);
The bit 10~0 in tmp is also needed in the original code,
> - if (tmp & ~0x07ff) {
> + tmp = usb_endpoint_maxp_mult(desc) - 1;
but here bit 10~0 is lost.
Regards,
-Bin.
> + if (tmp) {
> int ok;
>
> if (usb_endpoint_dir_in(desc))
> @@ -987,7 +987,7 @@ static int musb_gadget_enable(struct usb_ep *ep,
> musb_dbg(musb, "no support for high bandwidth ISO");
> goto fail;
> }
> - musb_ep->hb_mult = (tmp >> 11) & 3;
> + musb_ep->hb_mult = tmp;
> } else {
> musb_ep->hb_mult = 0;
> }
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index 53bc4ceefe89..f6cdbad00dac 100644
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -2237,7 +2237,7 @@ static int musb_urb_enqueue(
> * Some musb cores don't support high bandwidth ISO transfers; and
> * we don't (yet!) support high bandwidth interrupt transfers.
> */
> - qh->hb_mult = 1 + ((qh->maxpacket >> 11) & 0x03);
> + qh->hb_mult = usb_endpoint_maxp_mult(epd);
> if (qh->hb_mult > 1) {
> int ok = (qh->type == USB_ENDPOINT_XFER_ISOC);
>
> --
> 2.10.0.440.g21f862b
>
--
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