usb: gadget: s3c-hsotg: fix s3c_hsotg_write_fifo function for dedicated fifo mode
authorRobert Baldyga <r.baldyga@samsung.com>
Thu, 19 Sep 2013 09:50:18 +0000 (11:50 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 15 Oct 2013 13:43:22 +0000 (08:43 -0500)
In s3c_hsotg_write_fifo function PTxFEmp/NPTxFEmp interrupts are enabled
only in shared-fifo mode. In dedicated-fifo mode they should not be used
(when enabled then cause interrupt storm).

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/s3c-hsotg.c

index 4faf5e70e0938fcb25becb685f5cab1f418be7cb..bb173852ae4c460a3abfc66188914a784834e25d 100644 (file)
@@ -563,9 +563,11 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg,
        if (to_write > max_transfer) {
                to_write = max_transfer;
 
-               s3c_hsotg_en_gsint(hsotg,
-                                  periodic ? GINTSTS_PTxFEmp :
-                                  GINTSTS_NPTxFEmp);
+               /* it's needed only when we do not use dedicated fifos */
+               if (!hsotg->dedicated_fifos)
+                       s3c_hsotg_en_gsint(hsotg,
+                                          periodic ? GINTSTS_PTxFEmp :
+                                          GINTSTS_NPTxFEmp);
        }
 
        /* see if we can write data */
@@ -590,9 +592,11 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg,
                 * is more room left.
                 */
 
-               s3c_hsotg_en_gsint(hsotg,
-                                  periodic ? GINTSTS_PTxFEmp :
-                                  GINTSTS_NPTxFEmp);
+               /* it's needed only when we do not use dedicated fifos */
+               if (!hsotg->dedicated_fifos)
+                       s3c_hsotg_en_gsint(hsotg,
+                                          periodic ? GINTSTS_PTxFEmp :
+                                          GINTSTS_NPTxFEmp);
        }
 
        dev_dbg(hsotg->dev, "write %d/%d, can_write %d, done %d\n",