usb: renesas_usbhs: support byte addressable CFIFO
[linux-2.6-block.git] / drivers / usb / renesas_usbhs / fifo.c
index 39fa2fc1b8b767e10d37b6bde54a696d00de9f0c..452b456ac24e154e772c2f3490d6fe2247c6115f 100644 (file)
@@ -543,8 +543,13 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
        }
 
        /* the rest operation */
-       for (i = 0; i < len; i++)
-               iowrite8(buf[i], addr + (0x03 - (i & 0x03)));
+       if (usbhs_get_dparam(priv, cfifo_byte_addr)) {
+               for (i = 0; i < len; i++)
+                       iowrite8(buf[i], addr + (i & 0x03));
+       } else {
+               for (i = 0; i < len; i++)
+                       iowrite8(buf[i], addr + (0x03 - (i & 0x03)));
+       }
 
        /*
         * variable update