diff options
author | Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com> | 2015-05-26 07:13:42 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-05-26 11:21:48 -0400 |
commit | e73d42f15f90614538edeb5d4102f847105f86f2 (patch) | |
tree | ecacf781dec5e9f0839d56d62949ab8a4f9ad74c | |
parent | 342f39a6c8d34d638a87b7d5f2156adc4db2585c (diff) |
usb: renesas_usbhs: Fix fifo unclear in usbhsf_prepare_pop
This patch fixes an issue for control write. When usbhsf_prepare_pop()
is called after this driver called a gadget setup function, this controller
doesn't receive the control write data. So, this patch adds a code to clear
the fifo for control write in usbhsf_prepare_pop().
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index bc23b4a2c415..0bad84ebe9aa 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -611,6 +611,8 @@ struct usbhs_pkt_handle usbhs_fifo_pio_push_handler = { | |||
611 | static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) | 611 | static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) |
612 | { | 612 | { |
613 | struct usbhs_pipe *pipe = pkt->pipe; | 613 | struct usbhs_pipe *pipe = pkt->pipe; |
614 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | ||
615 | struct usbhs_fifo *fifo = usbhsf_get_cfifo(priv); | ||
614 | 616 | ||
615 | if (usbhs_pipe_is_busy(pipe)) | 617 | if (usbhs_pipe_is_busy(pipe)) |
616 | return 0; | 618 | return 0; |
@@ -624,6 +626,9 @@ static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) | |||
624 | usbhs_pipe_data_sequence(pipe, pkt->sequence); | 626 | usbhs_pipe_data_sequence(pipe, pkt->sequence); |
625 | pkt->sequence = -1; /* -1 sequence will be ignored */ | 627 | pkt->sequence = -1; /* -1 sequence will be ignored */ |
626 | 628 | ||
629 | if (usbhs_pipe_is_dcp(pipe)) | ||
630 | usbhsf_fifo_clear(pipe, fifo); | ||
631 | |||
627 | usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length); | 632 | usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length); |
628 | usbhs_pipe_enable(pipe); | 633 | usbhs_pipe_enable(pipe); |
629 | usbhs_pipe_running(pipe, 1); | 634 | usbhs_pipe_running(pipe, 1); |