Commit 58c4d26d authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Search and replace pDmaChannel with dma_channel

Search and replace pDmaChannel with dma_channel
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 847ab313
...@@ -628,7 +628,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -628,7 +628,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
u8 * buf, u32 len) u8 * buf, u32 len)
{ {
struct dma_controller *dma_controller; struct dma_controller *dma_controller;
struct dma_channel *pDmaChannel; struct dma_channel *dma_channel;
u8 bDmaOk; u8 bDmaOk;
void __iomem *mbase = musb->mregs; void __iomem *mbase = musb->mregs;
struct musb_hw_ep *hw_ep = musb->endpoints + epnum; struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
...@@ -656,17 +656,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -656,17 +656,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
/* candidate for DMA? */ /* candidate for DMA? */
dma_controller = musb->dma_controller; dma_controller = musb->dma_controller;
if (is_dma_capable() && epnum && dma_controller) { if (is_dma_capable() && epnum && dma_controller) {
pDmaChannel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel; dma_channel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel;
if (!pDmaChannel) { if (!dma_channel) {
pDmaChannel = dma_controller->channel_alloc( dma_channel = dma_controller->channel_alloc(
dma_controller, hw_ep, is_out); dma_controller, hw_ep, is_out);
if (is_out) if (is_out)
hw_ep->tx_channel = pDmaChannel; hw_ep->tx_channel = dma_channel;
else else
hw_ep->rx_channel = pDmaChannel; hw_ep->rx_channel = dma_channel;
} }
} else } else
pDmaChannel = NULL; dma_channel = NULL;
/* make sure we clear DMAEnab, autoSet bits from previous run */ /* make sure we clear DMAEnab, autoSet bits from previous run */
...@@ -760,7 +760,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -760,7 +760,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
wLoadCount = min((u32) packet_sz, len); wLoadCount = min((u32) packet_sz, len);
#ifdef CONFIG_USB_INVENTRA_DMA #ifdef CONFIG_USB_INVENTRA_DMA
if (pDmaChannel) { if (dma_channel) {
/* clear previous state */ /* clear previous state */
csr = musb_readw(epio, MUSB_TXCSR); csr = musb_readw(epio, MUSB_TXCSR);
...@@ -771,15 +771,15 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -771,15 +771,15 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_writew(epio, MUSB_TXCSR, musb_writew(epio, MUSB_TXCSR,
csr | MUSB_TXCSR_MODE); csr | MUSB_TXCSR_MODE);
qh->segsize = min(len, pDmaChannel->max_len); qh->segsize = min(len, dma_channel->max_len);
if (qh->segsize <= packet_sz) if (qh->segsize <= packet_sz)
pDmaChannel->desired_mode = 0; dma_channel->desired_mode = 0;
else else
pDmaChannel->desired_mode = 1; dma_channel->desired_mode = 1;
if (pDmaChannel->desired_mode == 0) { if (dma_channel->desired_mode == 0) {
csr &= ~(MUSB_TXCSR_AUTOSET csr &= ~(MUSB_TXCSR_AUTOSET
| MUSB_TXCSR_DMAMODE); | MUSB_TXCSR_DMAMODE);
csr |= (MUSB_TXCSR_DMAENAB); csr |= (MUSB_TXCSR_DMAENAB);
...@@ -792,25 +792,25 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -792,25 +792,25 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_writew(epio, MUSB_TXCSR, csr); musb_writew(epio, MUSB_TXCSR, csr);
bDmaOk = dma_controller->channel_program( bDmaOk = dma_controller->channel_program(
pDmaChannel, packet_sz, dma_channel, packet_sz,
pDmaChannel->desired_mode, dma_channel->desired_mode,
urb->transfer_dma, urb->transfer_dma,
qh->segsize); qh->segsize);
if (bDmaOk) { if (bDmaOk) {
wLoadCount = 0; wLoadCount = 0;
} else { } else {
dma_controller->channel_release(pDmaChannel); dma_controller->channel_release(dma_channel);
if (is_out) if (is_out)
hw_ep->tx_channel = NULL; hw_ep->tx_channel = NULL;
else else
hw_ep->rx_channel = NULL; hw_ep->rx_channel = NULL;
pDmaChannel = NULL; dma_channel = NULL;
} }
} }
#endif #endif
/* candidate for DMA */ /* candidate for DMA */
if ((is_cppi_enabled() || tusb_dma_omap()) && pDmaChannel) { if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) {
/* program endpoint CSRs first, then setup DMA. /* program endpoint CSRs first, then setup DMA.
* assume CPPI setup succeeds. * assume CPPI setup succeeds.
...@@ -824,14 +824,14 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -824,14 +824,14 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_writew(epio, MUSB_TXCSR, musb_writew(epio, MUSB_TXCSR,
csr | MUSB_TXCSR_MODE); csr | MUSB_TXCSR_MODE);
pDmaChannel->actual_len = 0L; dma_channel->actual_len = 0L;
qh->segsize = len; qh->segsize = len;
/* TX uses "rndis" mode automatically, but needs help /* TX uses "rndis" mode automatically, but needs help
* to identify the zero-length-final-packet case. * to identify the zero-length-final-packet case.
*/ */
bDmaOk = dma_controller->channel_program( bDmaOk = dma_controller->channel_program(
pDmaChannel, packet_sz, dma_channel, packet_sz,
(urb->transfer_flags (urb->transfer_flags
& URB_ZERO_PACKET) & URB_ZERO_PACKET)
== URB_ZERO_PACKET, == URB_ZERO_PACKET,
...@@ -840,8 +840,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -840,8 +840,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
if (bDmaOk) { if (bDmaOk) {
wLoadCount = 0; wLoadCount = 0;
} else { } else {
dma_controller->channel_release(pDmaChannel); dma_controller->channel_release(dma_channel);
pDmaChannel = hw_ep->tx_channel = NULL; dma_channel = hw_ep->tx_channel = NULL;
/* REVISIT there's an error path here that /* REVISIT there's an error path here that
* needs handling: can't do dma, but * needs handling: can't do dma, but
...@@ -901,10 +901,10 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -901,10 +901,10 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
/* kick things off */ /* kick things off */
if ((is_cppi_enabled() || tusb_dma_omap()) && pDmaChannel) { if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) {
/* candidate for DMA */ /* candidate for DMA */
if (pDmaChannel) { if (dma_channel) {
pDmaChannel->actual_len = 0L; dma_channel->actual_len = 0L;
qh->segsize = len; qh->segsize = len;
/* AUTOREQ is in a DMA register */ /* AUTOREQ is in a DMA register */
...@@ -916,15 +916,15 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -916,15 +916,15 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
* errors, we dare not queue multiple transfers. * errors, we dare not queue multiple transfers.
*/ */
bDmaOk = dma_controller->channel_program( bDmaOk = dma_controller->channel_program(
pDmaChannel, packet_sz, dma_channel, packet_sz,
!(urb->transfer_flags !(urb->transfer_flags
& URB_SHORT_NOT_OK), & URB_SHORT_NOT_OK),
urb->transfer_dma, urb->transfer_dma,
qh->segsize); qh->segsize);
if (!bDmaOk) { if (!bDmaOk) {
dma_controller->channel_release( dma_controller->channel_release(
pDmaChannel); dma_channel);
pDmaChannel = hw_ep->rx_channel = NULL; dma_channel = hw_ep->rx_channel = NULL;
} else } else
csr |= MUSB_RXCSR_DMAENAB; csr |= MUSB_RXCSR_DMAENAB;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment