diff options
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 18 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.h | 1 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 2 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_host.c | 2 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.c | 8 |
5 files changed, 27 insertions, 4 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 0e079256e533..9b48384c95a7 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -1160,6 +1160,24 @@ static void usbhsf_dma_complete(void *arg) | |||
1160 | usbhs_pipe_number(pipe), ret); | 1160 | usbhs_pipe_number(pipe), ret); |
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | void usbhs_fifo_clear_dcp(struct usbhs_pipe *pipe) | ||
1164 | { | ||
1165 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | ||
1166 | struct usbhs_fifo *fifo = usbhsf_get_cfifo(priv); /* CFIFO */ | ||
1167 | |||
1168 | /* clear DCP FIFO of transmission */ | ||
1169 | if (usbhsf_fifo_select(pipe, fifo, 1) < 0) | ||
1170 | return; | ||
1171 | usbhsf_fifo_clear(pipe, fifo); | ||
1172 | usbhsf_fifo_unselect(pipe, fifo); | ||
1173 | |||
1174 | /* clear DCP FIFO of reception */ | ||
1175 | if (usbhsf_fifo_select(pipe, fifo, 0) < 0) | ||
1176 | return; | ||
1177 | usbhsf_fifo_clear(pipe, fifo); | ||
1178 | usbhsf_fifo_unselect(pipe, fifo); | ||
1179 | } | ||
1180 | |||
1163 | /* | 1181 | /* |
1164 | * fifo init | 1182 | * fifo init |
1165 | */ | 1183 | */ |
diff --git a/drivers/usb/renesas_usbhs/fifo.h b/drivers/usb/renesas_usbhs/fifo.h index a168a1760fce..79ad5f971035 100644 --- a/drivers/usb/renesas_usbhs/fifo.h +++ b/drivers/usb/renesas_usbhs/fifo.h | |||
@@ -74,6 +74,7 @@ int usbhs_fifo_probe(struct usbhs_priv *priv); | |||
74 | void usbhs_fifo_remove(struct usbhs_priv *priv); | 74 | void usbhs_fifo_remove(struct usbhs_priv *priv); |
75 | void usbhs_fifo_init(struct usbhs_priv *priv); | 75 | void usbhs_fifo_init(struct usbhs_priv *priv); |
76 | void usbhs_fifo_quit(struct usbhs_priv *priv); | 76 | void usbhs_fifo_quit(struct usbhs_priv *priv); |
77 | void usbhs_fifo_clear_dcp(struct usbhs_pipe *pipe); | ||
77 | 78 | ||
78 | /* | 79 | /* |
79 | * packet info | 80 | * packet info |
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 2457306e0924..8697e6efcabf 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -782,9 +782,9 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status) | |||
782 | /* | 782 | /* |
783 | * pipe initialize and enable DCP | 783 | * pipe initialize and enable DCP |
784 | */ | 784 | */ |
785 | usbhs_fifo_init(priv); | ||
785 | usbhs_pipe_init(priv, | 786 | usbhs_pipe_init(priv, |
786 | usbhsg_dma_map_ctrl); | 787 | usbhsg_dma_map_ctrl); |
787 | usbhs_fifo_init(priv); | ||
788 | 788 | ||
789 | /* dcp init instead of usbhsg_ep_enable() */ | 789 | /* dcp init instead of usbhsg_ep_enable() */ |
790 | dcp->pipe = usbhs_dcp_malloc(priv); | 790 | dcp->pipe = usbhs_dcp_malloc(priv); |
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 10e1ded9c9cc..f0d323125871 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c | |||
@@ -1474,9 +1474,9 @@ static int usbhsh_start(struct usbhs_priv *priv) | |||
1474 | /* | 1474 | /* |
1475 | * pipe initialize and enable DCP | 1475 | * pipe initialize and enable DCP |
1476 | */ | 1476 | */ |
1477 | usbhs_fifo_init(priv); | ||
1477 | usbhs_pipe_init(priv, | 1478 | usbhs_pipe_init(priv, |
1478 | usbhsh_dma_map_ctrl); | 1479 | usbhsh_dma_map_ctrl); |
1479 | usbhs_fifo_init(priv); | ||
1480 | usbhsh_pipe_init_for_host(priv); | 1480 | usbhsh_pipe_init_for_host(priv); |
1481 | 1481 | ||
1482 | /* | 1482 | /* |
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index 040bcefcb040..007f45abe96c 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c | |||
@@ -618,8 +618,12 @@ void usbhs_pipe_data_sequence(struct usbhs_pipe *pipe, int sequence) | |||
618 | 618 | ||
619 | void usbhs_pipe_clear(struct usbhs_pipe *pipe) | 619 | void usbhs_pipe_clear(struct usbhs_pipe *pipe) |
620 | { | 620 | { |
621 | usbhsp_pipectrl_set(pipe, ACLRM, ACLRM); | 621 | if (usbhs_pipe_is_dcp(pipe)) { |
622 | usbhsp_pipectrl_set(pipe, ACLRM, 0); | 622 | usbhs_fifo_clear_dcp(pipe); |
623 | } else { | ||
624 | usbhsp_pipectrl_set(pipe, ACLRM, ACLRM); | ||
625 | usbhsp_pipectrl_set(pipe, ACLRM, 0); | ||
626 | } | ||
623 | } | 627 | } |
624 | 628 | ||
625 | static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type) | 629 | static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type) |