diff options
author | Mian Yousaf Kaukab <yousaf.kaukab@intel.com> | 2015-05-16 22:33:32 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-05-26 10:39:56 -0500 |
commit | 3fc0a7c3d3539a4e57b249d1fb5b2ab80c075174 (patch) | |
tree | d19ac9d8afa7bf34d875db8901a02cb64a4e7f41 /drivers/usb/gadget/udc | |
parent | e6ac4bb0590d6482f48a86a10884a9f2eb66c111 (diff) | |
download | op-kernel-dev-3fc0a7c3d3539a4e57b249d1fb5b2ab80c075174.zip op-kernel-dev-3fc0a7c3d3539a4e57b249d1fb5b2ab80c075174.tar.gz |
usb: gadget: net2280: unconditionally reset dma in usb_reset
If ep->dma is set, abort_dma() takes care of dma clean-up. If ep->dma
is not set, unconditionally reset dma channel.
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>
Diffstat (limited to 'drivers/usb/gadget/udc')
-rw-r--r-- | drivers/usb/gadget/udc/net2280.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index a91da36..07e0dba 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -1979,9 +1979,15 @@ static void usb_reset_338x(struct net2280 *dev) /* clear old dma and irq state */ for (tmp = 0; tmp < 4; tmp++) { struct net2280_ep *ep = &dev->ep[tmp + 1]; + struct net2280_dma_regs __iomem *dma; - if (ep->dma) + if (ep->dma) { abort_dma(ep); + } else { + dma = &dev->dma[tmp]; + writel(BIT(DMA_ABORT), &dma->dmastat); + writel(0, &dma->dmactl); + } } writel(~0, &dev->regs->irqstat0), writel(~0, &dev->regs->irqstat1); |