diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2011-06-09 03:48:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-14 17:23:23 -0400 |
commit | 08e6c611123ab499757e4133df7ddc0875c0dccf (patch) | |
tree | e763cc68029233eaabaca44c25106fd62997ae05 /drivers/usb/renesas_usbhs | |
parent | dcc854579059ff9633db4dc41c681371d22f794e (diff) |
usb: renesas_usbhs: fixup connection fail
Sometimes the connection fail happen on renesas_usbhs.
This patch fix it up.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 5 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.c | 9 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.h | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 46e247ad14f..aa591b66383 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -462,8 +462,11 @@ static int usbhsg_ep_enable(struct usb_ep *ep, | |||
462 | * if it already have pipe, | 462 | * if it already have pipe, |
463 | * nothing to do | 463 | * nothing to do |
464 | */ | 464 | */ |
465 | if (uep->pipe) | 465 | if (uep->pipe) { |
466 | usbhs_pipe_clear(uep->pipe); | ||
467 | usbhs_pipe_clear_sequence(uep->pipe); | ||
466 | return 0; | 468 | return 0; |
469 | } | ||
467 | 470 | ||
468 | pipe = usbhs_pipe_malloc(priv, desc); | 471 | pipe = usbhs_pipe_malloc(priv, desc); |
469 | if (pipe) { | 472 | if (pipe) { |
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index d0ae846632c..1b14cae4570 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c | |||
@@ -500,6 +500,12 @@ void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe) | |||
500 | usbhsp_pipectrl_set(pipe, SQCLR, SQCLR); | 500 | usbhsp_pipectrl_set(pipe, SQCLR, SQCLR); |
501 | } | 501 | } |
502 | 502 | ||
503 | void usbhs_pipe_clear(struct usbhs_pipe *pipe) | ||
504 | { | ||
505 | usbhsp_pipectrl_set(pipe, ACLRM, ACLRM); | ||
506 | usbhsp_pipectrl_set(pipe, ACLRM, 0); | ||
507 | } | ||
508 | |||
503 | static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type) | 509 | static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type) |
504 | { | 510 | { |
505 | struct usbhs_pipe *pos, *pipe; | 511 | struct usbhs_pipe *pos, *pipe; |
@@ -568,8 +574,7 @@ void usbhs_pipe_init(struct usbhs_priv *priv, | |||
568 | INIT_LIST_HEAD(&pipe->list); | 574 | INIT_LIST_HEAD(&pipe->list); |
569 | 575 | ||
570 | /* pipe force init */ | 576 | /* pipe force init */ |
571 | usbhsp_pipectrl_set(pipe, ACLRM, ACLRM); | 577 | usbhs_pipe_clear(pipe); |
572 | usbhsp_pipectrl_set(pipe, ACLRM, 0); | ||
573 | } | 578 | } |
574 | 579 | ||
575 | info->done = done; | 580 | info->done = done; |
diff --git a/drivers/usb/renesas_usbhs/pipe.h b/drivers/usb/renesas_usbhs/pipe.h index 35e100477e5..41534cb0e73 100644 --- a/drivers/usb/renesas_usbhs/pipe.h +++ b/drivers/usb/renesas_usbhs/pipe.h | |||
@@ -87,6 +87,7 @@ void usbhs_pipe_init(struct usbhs_priv *priv, | |||
87 | int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map)); | 87 | int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map)); |
88 | int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); | 88 | int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe); |
89 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe); | 89 | void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe); |
90 | void usbhs_pipe_clear(struct usbhs_pipe *pipe); | ||
90 | int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe); | 91 | int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe); |
91 | void usbhs_pipe_enable(struct usbhs_pipe *pipe); | 92 | void usbhs_pipe_enable(struct usbhs_pipe *pipe); |
92 | void usbhs_pipe_disable(struct usbhs_pipe *pipe); | 93 | void usbhs_pipe_disable(struct usbhs_pipe *pipe); |