]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/usb/gadget/s3c-hsotg.c
USB: s3c-hsotg: The NPTX/PTX FIFO sizes are in words, not bytes
[net-next-2.6.git] / drivers / usb / gadget / s3c-hsotg.c
index 26193eceb3231d48c06e98b29a09cf9849b319f5..4a251458c61d057688f5a3f0541962383d5bc858 100644 (file)
@@ -310,11 +310,11 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg)
                hsotg->regs + S3C_GNPTXFSIZ);
        */
 
-       /* set FIFO sizes to 2048/0x1C0 */
+       /* set FIFO sizes to 2048/1024 */
 
        writel(2048, hsotg->regs + S3C_GRXFSIZ);
        writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) |
-              S3C_GNPTXFSIZ_NPTxFDep(0x1C0),
+              S3C_GNPTXFSIZ_NPTxFDep(1024),
               hsotg->regs + S3C_GNPTXFSIZ);
 
        /* arange all the rest of the TX FIFOs, as some versions of this
@@ -505,6 +505,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg,
                }
 
                can_write = S3C_GNPTXSTS_NPTxFSpcAvail_GET(gnptxsts);
+               can_write *= 4; /* fifo size is in 32bit quantities. */
        }
 
        dev_dbg(hsotg->dev, "%s: GNPTXSTS=%08x, can=%d, to=%d, mps %d\n",
@@ -2732,7 +2733,7 @@ static void __devinit s3c_hsotg_initep(struct s3c_hsotg *hsotg,
         */
 
        ptxfifo = readl(hsotg->regs + S3C_DPTXFSIZn(epnum));
-       hs_ep->fifo_size = S3C_DPTXFSIZn_DPTxFSize_GET(ptxfifo);
+       hs_ep->fifo_size = S3C_DPTXFSIZn_DPTxFSize_GET(ptxfifo) * 4;
 
        /* if we're using dma, we need to set the next-endpoint pointer
         * to be something valid.