]> git.sur5r.net Git - u-boot/commitdiff
usb: musb: change rxcsr register from write to read/modify/write
authorBryan Wu <bryan.wu@analog.com>
Thu, 17 Dec 2009 03:04:01 +0000 (22:04 -0500)
committerRemy Bohmer <linux@bohmer.net>
Sat, 9 Jan 2010 09:25:09 +0000 (10:25 +0100)
The RX Control/Status register has bits that we want to preserve, so don't
just write out a single bit.  Preserve the others bits in the process.

The original code posted to the u-boot list had this behavior, but looks
like it was lost somewhere along the way to merging.

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
drivers/usb/musb/musb_hcd.c

index 54816005096d8c9ad2896a874273fca7797130ca..adb8c38527465d769450e79d6138c378bdecae56 100644 (file)
@@ -604,7 +604,8 @@ int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
                                        (len-txlen) : dev->epmaxpacketin[ep];
 
                        /* Set the ReqPkt bit */
-                       writew(MUSB_RXCSR_H_REQPKT, &musbr->rxcsr);
+                       csr = readw(&musbr->rxcsr);
+                       writew(csr | MUSB_RXCSR_H_REQPKT, &musbr->rxcsr);
 
                        /* Wait until the RxPktRdy bit is set */
                        if (!wait_until_rxep_ready(dev, MUSB_BULK_EP)) {
@@ -775,7 +776,8 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe,
                                        (len-txlen) : dev->epmaxpacketin[ep];
 
                        /* Set the ReqPkt bit */
-                       writew(MUSB_RXCSR_H_REQPKT, &musbr->rxcsr);
+                       csr = readw(&musbr->rxcsr);
+                       writew(csr | MUSB_RXCSR_H_REQPKT, &musbr->rxcsr);
 
                        /* Wait until the RxPktRdy bit is set */
                        if (!wait_until_rxep_ready(dev, MUSB_INTR_EP)) {