diff options
author | Wolfgang Denk <wd@denx.de> | 2010-10-13 20:57:34 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-10-13 20:57:34 +0200 |
commit | 9de99326935c158adda792ed8dd1df630434813e (patch) | |
tree | 3890f9284882dd9016501729fc112d1609bd82f8 /drivers/usb/musb/musb_hcd.c | |
parent | cb2707af7a9792c0818e67987f74b3e42ce923cf (diff) | |
parent | 4ee691f6aced74c30bbe15d9e97313df21037ae3 (diff) | |
download | u-boot-imx-9de99326935c158adda792ed8dd1df630434813e.zip u-boot-imx-9de99326935c158adda792ed8dd1df630434813e.tar.gz u-boot-imx-9de99326935c158adda792ed8dd1df630434813e.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers/usb/musb/musb_hcd.c')
-rw-r--r-- | drivers/usb/musb/musb_hcd.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c index af989aa..f38b279 100644 --- a/drivers/usb/musb/musb_hcd.c +++ b/drivers/usb/musb/musb_hcd.c @@ -144,19 +144,28 @@ static void write_toggle(struct usb_device *dev, u8 ep, u8 dir_out) u16 csr; if (dir_out) { - if (!toggle) - writew(MUSB_TXCSR_CLRDATATOG, &musbr->txcsr); - else { - csr = readw(&musbr->txcsr); + csr = readw(&musbr->txcsr); + if (!toggle) { + if (csr & MUSB_TXCSR_MODE) + csr = MUSB_TXCSR_CLRDATATOG; + else + csr = 0; + writew(csr, &musbr->txcsr); + } else { csr |= MUSB_TXCSR_H_WR_DATATOGGLE; writew(csr, &musbr->txcsr); csr |= (toggle << MUSB_TXCSR_H_DATATOGGLE_SHIFT); writew(csr, &musbr->txcsr); } } else { - if (!toggle) - writew(MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr); - else { + if (!toggle) { + csr = readw(&musbr->txcsr); + if (csr & MUSB_TXCSR_MODE) + csr = MUSB_RXCSR_CLRDATATOG; + else + csr = 0; + writew(csr, &musbr->rxcsr); + } else { csr = readw(&musbr->rxcsr); csr |= MUSB_RXCSR_H_WR_DATATOGGLE; writew(csr, &musbr->rxcsr); |