usb: gadget: net2280: physically disable endpoint on disable operation
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Sat, 16 May 2015 20:33:38 +0000 (22:33 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 26 May 2015 15:40:26 +0000 (10:40 -0500)
Reset configuration in ep_cfg on disable to physically disable the
endpoint.

Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/net2280.c

index 779e6fe0005f9ba9621cd993de5ad2226c4f70fb..5740e0d885bcefcaf9ac747149202918a6d385f1 100644 (file)
@@ -461,6 +461,13 @@ static void ep_reset_338x(struct net2280_regs __iomem *regs,
               BIT(DATA_PACKET_TRANSMITTED_INTERRUPT) |
               BIT(DATA_OUT_PING_TOKEN_INTERRUPT) |
               BIT(DATA_IN_TOKEN_INTERRUPT), &ep->regs->ep_stat);
+
+       tmp = readl(&ep->cfg->ep_cfg);
+       if (ep->is_in)
+               tmp &= ~USB3380_EP_CFG_MASK_IN;
+       else
+               tmp &= ~USB3380_EP_CFG_MASK_OUT;
+       writel(tmp, &ep->cfg->ep_cfg);
 }
 
 static void nuke(struct net2280_ep *);