Commit c74a37e9 authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Search and replace bDesiredMode with desired_mode

Search and replace bDesiredMode with desired_mode
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 0efb01c8
...@@ -105,7 +105,7 @@ struct dma_controller; ...@@ -105,7 +105,7 @@ struct dma_controller;
* transaction (typically representing many USB maximum-sized packets) * transaction (typically representing many USB maximum-sized packets)
* @actual_len: how many bytes have been transferred * @actual_len: how many bytes have been transferred
* @status: current channel status (updated e.g. on interrupt) * @status: current channel status (updated e.g. on interrupt)
* @bDesiredMode: TRUE if mode 1 is desired; FALSE if mode 0 is desired * @desired_mode: TRUE if mode 1 is desired; FALSE if mode 0 is desired
* *
* channels are associated with an endpoint for the duration of at least * channels are associated with an endpoint for the duration of at least
* one usb transfer. * one usb transfer.
...@@ -116,7 +116,7 @@ struct dma_channel { ...@@ -116,7 +116,7 @@ struct dma_channel {
size_t max_len; size_t max_len;
size_t actual_len; size_t actual_len;
enum dma_channel_status status; enum dma_channel_status status;
u8 bDesiredMode; u8 desired_mode;
}; };
/* /*
......
...@@ -306,16 +306,16 @@ static void txstate(struct musb *musb, struct musb_request *req) ...@@ -306,16 +306,16 @@ static void txstate(struct musb *musb, struct musb_request *req)
request_size = min(pRequest->length, request_size = min(pRequest->length,
musb_ep->dma->max_len); musb_ep->dma->max_len);
if (request_size <= musb_ep->wPacketSize) if (request_size <= musb_ep->wPacketSize)
musb_ep->dma->bDesiredMode = 0; musb_ep->dma->desired_mode = 0;
else else
musb_ep->dma->bDesiredMode = 1; musb_ep->dma->desired_mode = 1;
use_dma = use_dma && c->channel_program( use_dma = use_dma && c->channel_program(
musb_ep->dma, musb_ep->wPacketSize, musb_ep->dma, musb_ep->wPacketSize,
musb_ep->dma->bDesiredMode, musb_ep->dma->desired_mode,
pRequest->dma, request_size); pRequest->dma, request_size);
if (use_dma) { if (use_dma) {
if (musb_ep->dma->bDesiredMode == 0) { if (musb_ep->dma->desired_mode == 0) {
/* ASSERT: DMAENAB is clear */ /* ASSERT: DMAENAB is clear */
wCsrVal &= ~(MGC_M_TXCSR_AUTOSET | wCsrVal &= ~(MGC_M_TXCSR_AUTOSET |
MGC_M_TXCSR_DMAMODE); MGC_M_TXCSR_DMAMODE);
...@@ -487,7 +487,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) ...@@ -487,7 +487,7 @@ void musb_g_tx(struct musb *musb, u8 epnum)
== 0) == 0)
#ifdef CONFIG_USB_INVENTRA_DMA #ifdef CONFIG_USB_INVENTRA_DMA
|| (is_dma && || (is_dma &&
((!dma->bDesiredMode) || ((!dma->desired_mode) ||
(pRequest->actual & (pRequest->actual &
(musb_ep->wPacketSize - 1)))) (musb_ep->wPacketSize - 1))))
#endif #endif
...@@ -666,14 +666,14 @@ static void rxstate(struct musb *musb, struct musb_request *req) ...@@ -666,14 +666,14 @@ static void rxstate(struct musb *musb, struct musb_request *req)
transfer_size = len; transfer_size = len;
#endif #endif
if (transfer_size <= musb_ep->wPacketSize) if (transfer_size <= musb_ep->wPacketSize)
musb_ep->dma->bDesiredMode = 0; musb_ep->dma->desired_mode = 0;
else else
musb_ep->dma->bDesiredMode = 1; musb_ep->dma->desired_mode = 1;
use_dma = c->channel_program( use_dma = c->channel_program(
channel, channel,
musb_ep->wPacketSize, musb_ep->wPacketSize,
channel->bDesiredMode, channel->desired_mode,
pRequest->dma pRequest->dma
+ pRequest->actual, + pRequest->actual,
transfer_size); transfer_size);
...@@ -701,7 +701,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) ...@@ -701,7 +701,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
ret = c->channel_program(channel, ret = c->channel_program(channel,
musb_ep->wPacketSize, musb_ep->wPacketSize,
channel->bDesiredMode, channel->desired_mode,
dma_addr, dma_addr,
fifo_count); fifo_count);
if (ret == TRUE) if (ret == TRUE)
...@@ -805,7 +805,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) ...@@ -805,7 +805,7 @@ void musb_g_rx(struct musb *musb, u8 epnum)
#if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_TUSB_OMAP_DMA) #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_TUSB_OMAP_DMA)
/* Autoclear doesn't clear RxPktRdy for short packets */ /* Autoclear doesn't clear RxPktRdy for short packets */
if ((dma->bDesiredMode == 0) if ((dma->desired_mode == 0)
|| (dma->actual_len || (dma->actual_len
& (musb_ep->wPacketSize - 1))) { & (musb_ep->wPacketSize - 1))) {
/* ack the read! */ /* ack the read! */
......
...@@ -774,12 +774,12 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -774,12 +774,12 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
qh->segsize = min(dwLength, pDmaChannel->max_len); qh->segsize = min(dwLength, pDmaChannel->max_len);
if (qh->segsize <= wPacketSize) if (qh->segsize <= wPacketSize)
pDmaChannel->bDesiredMode = 0; pDmaChannel->desired_mode = 0;
else else
pDmaChannel->bDesiredMode = 1; pDmaChannel->desired_mode = 1;
if (pDmaChannel->bDesiredMode == 0) { if (pDmaChannel->desired_mode == 0) {
wCsr &= ~(MGC_M_TXCSR_AUTOSET wCsr &= ~(MGC_M_TXCSR_AUTOSET
| MGC_M_TXCSR_DMAMODE); | MGC_M_TXCSR_DMAMODE);
wCsr |= (MGC_M_TXCSR_DMAENAB); wCsr |= (MGC_M_TXCSR_DMAENAB);
...@@ -793,7 +793,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -793,7 +793,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
bDmaOk = dma_controller->channel_program( bDmaOk = dma_controller->channel_program(
pDmaChannel, wPacketSize, pDmaChannel, wPacketSize,
pDmaChannel->bDesiredMode, pDmaChannel->desired_mode,
pUrb->transfer_dma, pUrb->transfer_dma,
qh->segsize); qh->segsize);
if (bDmaOk) { if (bDmaOk) {
...@@ -1569,7 +1569,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) ...@@ -1569,7 +1569,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
c = musb->dma_controller; c = musb->dma_controller;
dma->bDesiredMode = 0; dma->desired_mode = 0;
#ifdef USE_MODE1 #ifdef USE_MODE1
/* because of the issue below, mode 1 will /* because of the issue below, mode 1 will
* only rarely behave with correct semantics. * only rarely behave with correct semantics.
...@@ -1579,7 +1579,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) ...@@ -1579,7 +1579,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
&& (pUrb->transfer_buffer_length - && (pUrb->transfer_buffer_length -
pUrb->actual_length) pUrb->actual_length)
> qh->maxpacket) > qh->maxpacket)
dma->bDesiredMode = 1; dma->desired_mode = 1;
#endif #endif
/* Disadvantage of using mode 1: /* Disadvantage of using mode 1:
...@@ -1602,7 +1602,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) ...@@ -1602,7 +1602,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
wVal = musb_readw(epio, MGC_O_HDRC_RXCSR); wVal = musb_readw(epio, MGC_O_HDRC_RXCSR);
wVal &= ~MGC_M_RXCSR_H_REQPKT; wVal &= ~MGC_M_RXCSR_H_REQPKT;
if (dma->bDesiredMode == 0) if (dma->desired_mode == 0)
wVal &= ~MGC_M_RXCSR_H_AUTOREQ; wVal &= ~MGC_M_RXCSR_H_AUTOREQ;
else else
wVal |= MGC_M_RXCSR_H_AUTOREQ; wVal |= MGC_M_RXCSR_H_AUTOREQ;
...@@ -1617,10 +1617,10 @@ void musb_host_rx(struct musb *musb, u8 epnum) ...@@ -1617,10 +1617,10 @@ void musb_host_rx(struct musb *musb, u8 epnum)
*/ */
status = c->channel_program( status = c->channel_program(
dma, qh->maxpacket, dma, qh->maxpacket,
dma->bDesiredMode, dma->desired_mode,
pUrb->transfer_dma pUrb->transfer_dma
+ pUrb->actual_length, + pUrb->actual_length,
(dma->bDesiredMode == 0) (dma->desired_mode == 0)
? wRxCount ? wRxCount
: pUrb->transfer_buffer_length); : pUrb->transfer_buffer_length);
......
...@@ -147,7 +147,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, ...@@ -147,7 +147,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c,
pChannel->status = MGC_DMA_STATUS_FREE; pChannel->status = MGC_DMA_STATUS_FREE;
pChannel->max_len = 0x10000; pChannel->max_len = 0x10000;
/* Tx => mode 1; Rx => mode 0 */ /* Tx => mode 1; Rx => mode 0 */
pChannel->bDesiredMode = bTransmit; pChannel->desired_mode = bTransmit;
pChannel->actual_len = 0; pChannel->actual_len = 0;
break; break;
} }
...@@ -348,7 +348,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) ...@@ -348,7 +348,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
/* completed */ /* completed */
if ((devctl & MGC_M_DEVCTL_HM) if ((devctl & MGC_M_DEVCTL_HM)
&& (pImplChannel->bTransmit) && (pImplChannel->bTransmit)
&& ((pChannel->bDesiredMode == 0) && ((pChannel->desired_mode == 0)
|| (pChannel->actual_len & || (pChannel->actual_len &
(pImplChannel->wMaxPacketSize - 1))) (pImplChannel->wMaxPacketSize - 1)))
) { ) {
......
...@@ -549,7 +549,7 @@ tusb_omap_dma_allocate(struct dma_controller *c, ...@@ -549,7 +549,7 @@ tusb_omap_dma_allocate(struct dma_controller *c,
chdat->tusb_dma = tusb_dma; chdat->tusb_dma = tusb_dma;
channel->max_len = 0x7fffffff; channel->max_len = 0x7fffffff;
channel->bDesiredMode = 0; channel->desired_mode = 0;
channel->actual_len = 0; channel->actual_len = 0;
if (dmareq_works()) { if (dmareq_works()) {
......
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