]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/renesas_usbhs/fifo.c
Merge tag 'gadget-for-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
[karo-tx-linux.git] / drivers / usb / renesas_usbhs / fifo.c
index c021b202c0f3fe05894d3a94075c55bea8dd1a66..9538f0feafe2c37f6b98f5598126fa8b75906af3 100644 (file)
@@ -163,7 +163,7 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type)
                func = pkt->handler->dma_done;
                break;
        default:
-               dev_err(dev, "unknown pkt hander\n");
+               dev_err(dev, "unknown pkt handler\n");
                goto __usbhs_pkt_handler_end;
        }
 
@@ -192,8 +192,8 @@ void usbhs_pkt_start(struct usbhs_pipe *pipe)
 /*
  *             irq enable/disable function
  */
-#define usbhsf_irq_empty_ctrl(p, e) usbhsf_irq_callback_ctrl(p, bempsts, e)
-#define usbhsf_irq_ready_ctrl(p, e) usbhsf_irq_callback_ctrl(p, brdysts, e)
+#define usbhsf_irq_empty_ctrl(p, e) usbhsf_irq_callback_ctrl(p, irq_bempsts, e)
+#define usbhsf_irq_ready_ctrl(p, e) usbhsf_irq_callback_ctrl(p, irq_brdysts, e)
 #define usbhsf_irq_callback_ctrl(pipe, status, enable)                 \
        ({                                                              \
                struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);     \
@@ -202,9 +202,9 @@ void usbhs_pkt_start(struct usbhs_pipe *pipe)
                if (!mod)                                               \
                        return;                                         \
                if (enable)                                             \
-                       mod->irq_##status |= status;                    \
+                       mod->status |= status;                          \
                else                                                    \
-                       mod->irq_##status &= ~status;                   \
+                       mod->status &= ~status;                         \
                usbhs_irq_callback_update(priv, mod);                   \
        })
 
@@ -488,6 +488,8 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
        usbhs_pipe_data_sequence(pipe, pkt->sequence);
        pkt->sequence = -1; /* -1 sequence will be ignored */
 
+       usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length);
+
        ret = usbhsf_fifo_select(pipe, fifo, 1);
        if (ret < 0)
                return 0;
@@ -594,6 +596,7 @@ static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done)
        usbhs_pipe_data_sequence(pipe, pkt->sequence);
        pkt->sequence = -1; /* -1 sequence will be ignored */
 
+       usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length);
        usbhs_pipe_enable(pipe);
        usbhsf_rx_irq_ctrl(pipe, 1);
 
@@ -795,6 +798,7 @@ static void xfer_work(struct work_struct *work)
        dev_dbg(dev, "  %s %d (%d/ %d)\n",
                fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);
 
+       usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans);
        usbhs_pipe_enable(pipe);
        usbhsf_dma_start(pipe, fifo);
        dma_async_issue_pending(chan);