aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPeter Chen2020-09-01 10:33:50 +0800
committerFelipe Balbi2020-10-02 09:57:40 +0300
commit0eeda059956d57b16143cc1dd0aed7e5fc383d5d (patch)
treed25fc5dd4461e0484e0400227f30f2daf37e078a /drivers/usb/cdns3
parentb5148d946f45bb7a780c2dc45a20f5b47e73f995 (diff)
usb: cdns3: gadget: clear the interrupt status when disconnect the host
It is meaningless to handle any interrupts after disconnecting with host Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/gadget.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 081447bf7313..4c939dad9c33 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2739,10 +2739,13 @@ static int cdns3_gadget_pullup(struct usb_gadget *gadget, int is_on)
{
struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
- if (is_on)
+ if (is_on) {
writel(USB_CONF_DEVEN, &priv_dev->regs->usb_conf);
- else
+ } else {
+ writel(~0, &priv_dev->regs->ep_ists);
+ writel(~0, &priv_dev->regs->usb_ists);
writel(USB_CONF_DEVDS, &priv_dev->regs->usb_conf);
+ }
return 0;
}