blob: 21fc7691a5120a5940b12e644556f10b80895ba6 [file] [log] [blame]
From ed0a408a51295f69c3b17417b7789f0e8b42abd7 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon, 10 Dec 2012 22:44:07 -0800
Subject: usb: renesas_usbhs: gadget: usbhsg_ep_disable() care pipe settings
Current usbhsg_ep_disable() didn't care
uep->pipe and pipe->mod_private variable which is used on usbhsg_ep_enable().
It breaks renesas_usbhs gadget when resume.
This patch fixes it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/usb/renesas_usbhs/mod_gadget.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -597,7 +597,12 @@ static int usbhsg_ep_disable(struct usb_
{
struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
- return usbhsg_pipe_disable(uep);
+ usbhsg_pipe_disable(uep);
+
+ uep->pipe->mod_private = NULL;
+ uep->pipe = NULL;
+
+ return 0;
}
static struct usb_request *usbhsg_ep_alloc_request(struct usb_ep *ep,
@@ -752,7 +757,7 @@ static int usbhsg_try_start(struct usbhs
usbhsg_dma_map_ctrl);
usbhs_fifo_init(priv);
- /* dcp init */
+ /* dcp init instead of usbhsg_ep_enable() */
dcp->pipe = usbhs_dcp_malloc(priv);
dcp->pipe->mod_private = dcp;
usbhs_pipe_config_update(dcp->pipe, 0, 0, 64);
@@ -814,7 +819,7 @@ static int usbhsg_try_stop(struct usbhs_
usbhs_sys_set_test_mode(priv, 0);
usbhs_sys_function_ctrl(priv, 0);
- usbhsg_pipe_disable(dcp);
+ usbhsg_ep_disable(&dcp->ep);
dev_dbg(dev, "stop gadget\n");