summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2019-07-26 08:05:31 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-08-12 08:54:48 +0300
commitd042c35eb86a8ef13c4b5180fd6953a51d9e1efc (patch)
tree150ac28e021a64fe0bac33c3ca0a8e31e505b16c /drivers/usb/gadget/udc/aspeed-vhub/ep0.c
parent9fbbeb4eff076859891c022c151ad20eda83d983 (diff)
downloadlinux-d042c35eb86a8ef13c4b5180fd6953a51d9e1efc.tar.xz
usb: gadget: aspeed: Cleanup EP0 state on port reset
Otherwise, we can have a stale state after a disconnect and reconnect causing errors on the first SETUP packet to the device. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/aspeed-vhub/ep0.c')
-rw-r--r--drivers/usb/gadget/udc/aspeed-vhub/ep0.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/ep0.c b/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
index e2927fb083cf..5e4714d7febb 100644
--- a/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
@@ -459,6 +459,15 @@ static const struct usb_ep_ops ast_vhub_ep0_ops = {
.free_request = ast_vhub_free_request,
};
+void ast_vhub_reset_ep0(struct ast_vhub_dev *dev)
+{
+ struct ast_vhub_ep *ep = &dev->ep0;
+
+ ast_vhub_nuke(ep, -EIO);
+ ep->ep0.state = ep0_state_token;
+}
+
+
void ast_vhub_init_ep0(struct ast_vhub *vhub, struct ast_vhub_ep *ep,
struct ast_vhub_dev *dev)
{