diff options
author | supriya karanth <supriya.karanth@stericsson.com> | 2011-12-06 16:34:10 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:03:15 +0200 |
commit | f2ab5db5edc7db17a74ab95a746e24aaa041ea28 (patch) | |
tree | 66b3d309d9fe2e024e206f7544f56522e25ff74c | |
parent | 7da22d45b0365c8249fd801770aa50aa72e12054 (diff) |
usb: musb: TXMAXP,TXCSR setting in Device mode
The TXMAXP and TXCSR registers were not set correctly for
the BULK IN endpoints causing issues in Full speed in
device mode.
ST-Ericsson Linux next: NA
ST-Ericsson ID: 362969
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I9942821702e5f78b5bcf2439a378eb1a244cb86f
Signed-off-by: supriya karanth <supriya.karanth@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/39173
Reviewed-by: QATOOLS
Reviewed-by: QABUILD
Reviewed-by: Rajaram REGUPATHY <ragupathy.rajaram@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index c2d0e4bfa67..461b5f2d889 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -401,7 +401,21 @@ static void txstate(struct musb *musb, struct musb_request *req) csr |= (MUSB_TXCSR_DMAENAB | MUSB_TXCSR_DMAMODE | MUSB_TXCSR_MODE); - if (!musb_ep->hb_mult) + /* + * Enable Autoset according to table + * below + * ************************************ + * bulk_split hb_mult Autoset_Enable + * ************************************ + * 0 0 Yes(Normal) + * 0 >0 No(High BW ISO) + * 1 0 Yes(HS bulk) + * 1 >0 Yes(FS bulk) + */ + if (!musb_ep->hb_mult || + (musb_ep->hb_mult && + can_bulk_split(musb, + musb_ep->type))) csr |= MUSB_TXCSR_AUTOSET; } csr &= ~MUSB_TXCSR_P_UNDERRUN; @@ -1097,6 +1111,12 @@ static int musb_gadget_enable(struct usb_ep *ep, /* REVISIT if can_bulk_split(), use by updating "tmp"; * likewise high bandwidth periodic tx */ + /* Set the TXMAXP register correctly for Bulk IN + * endpoints in device mode + */ + if (can_bulk_split(musb, musb_ep->type)) + musb_ep->hb_mult = (hw_ep->max_packet_sz_tx / + musb_ep->packet_sz) - 1; /* Set TXMAXP with the FIFO size of the endpoint * to disable double buffering mode. */ |