* (no subject) @ 2007-08-13 13:48 Tony Lindgren 2007-08-13 13:48 ` [PATCH 1/52] musb_hdrc: Search and replace pThis with musb Tony Lindgren ` (2 more replies) 0 siblings, 3 replies; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source As the musb/tusb code now mostly works for host and peripheral, I'm planning to push a series of search and replace patches to start converting the musb/tusb driver into something that follows CodingStyle. Following is a list of changes I've done. I haven't gone through DaVinci or 2430 specific code, as I cannot test them right now. No functional changes should be included. Code has been tested with tusb6010. Regards, Tony [PATCH 1/52] musb_hdrc: Search and replace pThis with musb [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase [PATCH 7/52] musb_hdrc: Search and replace pSource with src [PATCH 8/52] musb_hdrc: Search and replace pDest with dst [PATCH 9/52] musb_hdrc: Search and replace dwCount with len [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count [PATCH 11/52] musb_hdrc: Search and replace wCount with len [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum [PATCH 18/52] musb_hdrc: Search and replace Lock with lock [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine [PATCH 31/52] musb_hdrc: Search and replace bAddress with address [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len [PATCH 40/52] musb_hdrc: Search and replace bStatus with status [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode [PATCH 42/52] musb_hdrc: Search and replace bMode with mode [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest [PATCH 45/52] musb_hdrc: Search and replace bResult with result [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip [PATCH 48/52] musb_hdrc: Search and replace pRequest with request [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr [PATCH 50/52] musb_hdrc: Search and replace bTx with tx [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 1/52] musb_hdrc: Search and replace pThis with musb 2007-08-13 13:48 (no subject) Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep Tony Lindgren 2007-08-13 13:58 ` (no subject) Felipe Balbi 2007-08-14 8:06 ` musb CaMeLcAsEnOmOre (was: (no subject)) David Brownell 2 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pThis with musb Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 14 +- drivers/usb/musb/g_ep0.c | 6 +- drivers/usb/musb/musb_gadget.c | 20 ++-- drivers/usb/musb/musb_gadget.h | 6 +- drivers/usb/musb/musb_host.c | 88 ++++++------ drivers/usb/musb/musb_procfs.c | 148 +++++++++--------- drivers/usb/musb/musbdefs.h | 4 +- drivers/usb/musb/musbhsdma.c | 12 +- drivers/usb/musb/plat_uds.c | 320 ++++++++++++++++++++-------------------- 9 files changed, 309 insertions(+), 309 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -1134,7 +1134,7 @@ static int cppi_rx_scan(struct cppi *cppi, unsigned ch) return completed; } -void cppi_completion(struct musb *pThis, u32 rx, u32 tx) +void cppi_completion(struct musb *musb, u32 rx, u32 tx) { void *__iomem regBase; int i, chanNum, numCompleted; @@ -1143,9 +1143,9 @@ void cppi_completion(struct musb *pThis, u32 rx, u32 tx) struct cppi_descriptor *bdPtr; struct musb_hw_ep *pEnd = NULL; - cppi = container_of(pThis->pDmaController, struct cppi, Controller); + cppi = container_of(musb->pDmaController, struct cppi, Controller); - regBase = pThis->ctrl_base; + regBase = musb->ctrl_base; chanNum = 0; /* process TX channels */ @@ -1253,13 +1253,13 @@ void cppi_completion(struct musb *pThis, u32 rx, u32 tx) } if (bReqComplete) musb_dma_completion( - pThis, chanNum + 1, 1); + musb, chanNum + 1, 1); } else { /* Bigger transfer than we could fit in * that first batch of descriptors... */ - cppi_next_tx_segment(pThis, txChannel); + cppi_next_tx_segment(musb, txChannel); } } else txChannel->activeQueueHead = bdPtr; @@ -1283,7 +1283,7 @@ void cppi_completion(struct musb *pThis, u32 rx, u32 tx) if (rxChannel->actualLen != rxChannel->transferSize && rxChannel->actualLen == rxChannel->currOffset) { - cppi_next_rx_segment(pThis, rxChannel, 1); + cppi_next_rx_segment(musb, rxChannel, 1); continue; } @@ -1295,7 +1295,7 @@ void cppi_completion(struct musb *pThis, u32 rx, u32 tx) rxChannel->Channel.dwActualLength = rxChannel->actualLen; core_rxirq_disable(regBase, chanNum + 1); - musb_dma_completion(pThis, chanNum + 1, 0); + musb_dma_completion(musb, chanNum + 1, 0); } } --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -828,7 +828,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) return -EINVAL; ep = to_musb_ep(e); - musb = ep->pThis; + musb = ep->musb; regs = musb->control_ep->regs; req = to_musb_request(r); @@ -879,7 +879,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) musb_writew(regs, MGC_O_HDRC_CSR0, musb->ackpend | MGC_M_CSR0_P_DATAEND); musb->ackpend = 0; - musb_g_ep0_giveback(ep->pThis, r); + musb_g_ep0_giveback(ep->musb, r); } /* else for sequence #2 (OUT), caller provides a buffer @@ -916,7 +916,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) return -EINVAL; ep = to_musb_ep(e); - musb = ep->pThis; + musb = ep->musb; base = musb->pRegs; regs = musb->control_ep->regs; --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -159,12 +159,12 @@ __acquires(ep->musb->Lock) static void nuke(struct musb_ep *ep, const int status) { struct musb_request *req = NULL; - void __iomem *epio = ep->pThis->aLocalEnd[ep->bEndNumber].regs; + void __iomem *epio = ep->musb->aLocalEnd[ep->bEndNumber].regs; ep->busy = 1; if (is_dma_capable() && ep->dma) { - struct dma_controller *c = ep->pThis->pDmaController; + struct dma_controller *c = ep->musb->pDmaController; int value; if (ep->is_in) { musb_writew(epio, MGC_O_HDRC_TXCSR, @@ -867,7 +867,7 @@ static int musb_gadget_enable(struct usb_ep *ep, pEnd = to_musb_ep(ep); hw_ep = pEnd->hw_ep; regs = hw_ep->regs; - musb = pEnd->pThis; + musb = pEnd->musb; pBase = musb->pRegs; bEnd = pEnd->bEndNumber; @@ -1005,7 +1005,7 @@ static int musb_gadget_disable(struct usb_ep *ep) int status = 0; pEnd = to_musb_ep(ep); - musb = pEnd->pThis; + musb = pEnd->musb; bEnd = pEnd->bEndNumber; epio = musb->aLocalEnd[bEnd].regs; @@ -1108,7 +1108,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, return -ENODATA; pEnd = to_musb_ep(ep); - musb = pEnd->pThis; + musb = pEnd->musb; pRequest = to_musb_request(req); pRequest->musb = musb; @@ -1176,7 +1176,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) struct usb_request *r; unsigned long flags; int status = 0; - struct musb *musb = pEnd->pThis; + struct musb *musb = pEnd->musb; if (!ep || !pRequest || to_musb_request(pRequest)->ep != pEnd) return -EINVAL; @@ -1230,7 +1230,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) { struct musb_ep *pEnd = to_musb_ep(ep); u8 bEnd = pEnd->bEndNumber; - struct musb *musb = pEnd->pThis; + struct musb *musb = pEnd->musb; void __iomem *epio = musb->aLocalEnd[bEnd].regs; void __iomem *pBase; unsigned long flags; @@ -1310,7 +1310,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) int retval = -EINVAL; if (musb_ep->desc && !musb_ep->is_in) { - struct musb *musb = musb_ep->pThis; + struct musb *musb = musb_ep->musb; int bEnd = musb_ep->bEndNumber; void __iomem *mbase = musb->pRegs; unsigned long flags; @@ -1329,7 +1329,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) static void musb_gadget_fifo_flush(struct usb_ep *ep) { struct musb_ep *musb_ep = to_musb_ep(ep); - struct musb *musb = musb_ep->pThis; + struct musb *musb = musb_ep->musb; u8 nEnd = musb_ep->bEndNumber; void __iomem *epio = musb->aLocalEnd[nEnd].regs; void __iomem *mbase; @@ -1562,7 +1562,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in) memset(ep, 0, sizeof *ep); ep->bEndNumber = bEnd; - ep->pThis = musb; + ep->musb = musb; ep->hw_ep = hw_ep; ep->is_in = is_in; --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -61,7 +61,7 @@ struct musb_ep { struct usb_ep end_point; char name[12]; struct musb_hw_ep *hw_ep; - struct musb *pThis; + struct musb *musb; u8 bEndNumber; /* ... when enabled/disabled ... */ @@ -92,8 +92,8 @@ static inline struct usb_request *next_request(struct musb_ep *ep) return container_of(queue->next, struct usb_request, list); } -extern void musb_g_tx(struct musb *pThis, u8 bEnd); -extern void musb_g_rx(struct musb *pThis, u8 bEnd); +extern void musb_g_tx(struct musb *musb, u8 bEnd); +extern void musb_g_rx(struct musb *musb, u8 bEnd); extern const struct usb_ep_ops musb_g_ep0_ops; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -103,7 +103,7 @@ /*************************** Forwards ***************************/ -static void musb_ep_program(struct musb *pThis, u8 bEnd, +static void musb_ep_program(struct musb *musb, u8 bEnd, struct urb *pUrb, unsigned int nOut, u8 * pBuffer, u32 dwLength); @@ -132,7 +132,7 @@ static inline void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) /* * Start transmit. Caller is responsible for locking shared resources. - * pThis must be locked. + * musb must be locked. */ static inline void musb_h_tx_start(struct musb_hw_ep *ep) { @@ -424,7 +424,7 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) * Context: caller owns controller lock, irqs are blocked */ static void -musb_advance_schedule(struct musb *pThis, struct urb *urb, +musb_advance_schedule(struct musb *musb, struct urb *urb, struct musb_hw_ep *pEnd, int is_in) { struct musb_qh *qh; @@ -439,7 +439,7 @@ musb_advance_schedule(struct musb *pThis, struct urb *urb, DBG(4, "... next ep%d %cX urb %p\n", pEnd->bLocalEnd, is_in ? 'R' : 'T', next_urb(qh)); - musb_start_urb(pThis, is_in, qh); + musb_start_urb(musb, is_in, qh); } } @@ -466,7 +466,7 @@ static inline u16 musb_h_flush_rxfifo(struct musb_hw_ep *hw_ep, u16 csr) /* * PIO RX for a packet (or part of it). */ -static u8 musb_host_packet_rx(struct musb *pThis, struct urb *pUrb, +static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, u8 bEnd, u8 bIsochError) { u16 wRxCount; @@ -475,7 +475,7 @@ static u8 musb_host_packet_rx(struct musb *pThis, struct urb *pUrb, u8 bDone = FALSE; u32 length; int do_flush = 0; - struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd; + struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; void __iomem *epio = pEnd->regs; struct musb_qh *qh = pEnd->in_qh; int nPipe = pUrb->pipe; @@ -623,15 +623,15 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) * Program an HDRC endpoint as per the given URB * Context: irqs blocked, controller lock held */ -static void musb_ep_program(struct musb *pThis, u8 bEnd, +static void musb_ep_program(struct musb *musb, u8 bEnd, struct urb *pUrb, unsigned int is_out, u8 * pBuffer, u32 dwLength) { struct dma_controller *pDmaController; struct dma_channel *pDmaChannel; u8 bDmaOk; - void __iomem *pBase = pThis->pRegs; - struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd; + void __iomem *pBase = musb->pRegs; + struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; void __iomem *epio = pEnd->regs; struct musb_qh *qh; u16 wPacketSize; @@ -654,7 +654,7 @@ static void musb_ep_program(struct musb *pThis, u8 bEnd, MGC_SelectEnd(pBase, bEnd); /* candidate for DMA? */ - pDmaController = pThis->pDmaController; + pDmaController = musb->pDmaController; if (is_dma_capable() && bEnd && pDmaController) { pDmaChannel = is_out ? pEnd->tx_channel : pEnd->rx_channel; if (!pDmaChannel) { @@ -720,7 +720,7 @@ static void musb_ep_program(struct musb *pThis, u8 bEnd, } /* target addr and (for multipoint) hub addr/port */ - if (pThis->bIsMultipoint) { + if (musb->bIsMultipoint) { musb_writeb(pBase, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXFUNCADDR), qh->addr_reg); @@ -737,7 +737,7 @@ static void musb_ep_program(struct musb *pThis, u8 bEnd, /* protocol/endpoint/interval/NAKlimit */ if (bEnd) { musb_writeb(epio, MGC_O_HDRC_TXTYPE, qh->type_reg); - if (can_bulk_split(pThis, qh->type)) + if (can_bulk_split(musb, qh->type)) musb_writew(epio, MGC_O_HDRC_TXMAXP, wPacketSize | ((pEnd->wMaxPacketSizeTx / @@ -748,12 +748,12 @@ static void musb_ep_program(struct musb *pThis, u8 bEnd, musb_writeb(epio, MGC_O_HDRC_TXINTERVAL, qh->intv_reg); } else { musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, qh->intv_reg); - if (pThis->bIsMultipoint) + if (musb->bIsMultipoint) musb_writeb(epio, MGC_O_HDRC_TYPE0, qh->type_reg); } - if (can_bulk_split(pThis, qh->type)) + if (can_bulk_split(musb, qh->type)) wLoadCount = min((u32) pEnd->wMaxPacketSizeTx, dwLength); else @@ -875,7 +875,7 @@ static void musb_ep_program(struct musb *pThis, u8 bEnd, u16 csr; if (pEnd->rx_reinit) { - musb_rx_reinit(pThis, qh, pEnd); + musb_rx_reinit(musb, qh, pEnd); /* init new state: toggle and NYET, maybe DMA later */ if (usb_gettoggle(pUrb->dev, qh->epnum, 0)) @@ -942,17 +942,17 @@ static void musb_ep_program(struct musb *pThis, u8 bEnd, * Service the default endpoint (ep0) as host. * Return TRUE until it's time to start the status stage. */ -static int musb_h_ep0_continue(struct musb *pThis, +static int musb_h_ep0_continue(struct musb *musb, u16 wCount, struct urb *pUrb) { int bMore = FALSE; u8 *pFifoDest = NULL; u16 wFifoCount = 0; - struct musb_hw_ep *pEnd = pThis->control_ep; + struct musb_hw_ep *pEnd = musb->control_ep; struct musb_qh *qh = pEnd->in_qh; struct usb_ctrlrequest *pRequest; - switch (pThis->bEnd0Stage) { + switch (musb->bEnd0Stage) { case MGC_END0_IN: pFifoDest = pUrb->transfer_buffer + pUrb->actual_length; wFifoCount = min(wCount, ((u16) (pUrb->transfer_buffer_length @@ -979,12 +979,12 @@ static int musb_h_ep0_continue(struct musb *pThis, break; } else if (pRequest->bRequestType & USB_DIR_IN) { DBG(4, "start IN-DATA\n"); - pThis->bEnd0Stage = MGC_END0_IN; + musb->bEnd0Stage = MGC_END0_IN; bMore = TRUE; break; } else { DBG(4, "start OUT-DATA\n"); - pThis->bEnd0Stage = MGC_END0_OUT; + musb->bEnd0Stage = MGC_END0_OUT; bMore = TRUE; } /* FALLTHROUGH */ @@ -1005,7 +1005,7 @@ static int musb_h_ep0_continue(struct musb *pThis, } break; default: - ERR("bogus ep0 stage %d\n", pThis->bEnd0Stage); + ERR("bogus ep0 stage %d\n", musb->bEnd0Stage); break; } @@ -1018,13 +1018,13 @@ static int musb_h_ep0_continue(struct musb *pThis, * * called with controller irqlocked */ -irqreturn_t musb_h_ep0_irq(struct musb *pThis) +irqreturn_t musb_h_ep0_irq(struct musb *musb) { struct urb *pUrb; u16 wCsrVal, wCount; int status = 0; - void __iomem *pBase = pThis->pRegs; - struct musb_hw_ep *pEnd = pThis->control_ep; + void __iomem *pBase = musb->pRegs; + struct musb_hw_ep *pEnd = musb->control_ep; void __iomem *epio = pEnd->regs; struct musb_qh *qh = pEnd->in_qh; u8 bComplete = FALSE; @@ -1040,10 +1040,10 @@ irqreturn_t musb_h_ep0_irq(struct musb *pThis) : 0; DBG(4, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d\n", - wCsrVal, qh, wCount, pUrb, pThis->bEnd0Stage); + wCsrVal, qh, wCount, pUrb, musb->bEnd0Stage); /* if we just did status stage, we are done */ - if (MGC_END0_STATUS == pThis->bEnd0Stage) { + if (MGC_END0_STATUS == musb->bEnd0Stage) { retval = IRQ_HANDLED; bComplete = TRUE; } @@ -1112,9 +1112,9 @@ irqreturn_t musb_h_ep0_irq(struct musb *pThis) if (!bComplete) { /* call common logic and prepare response */ - if (musb_h_ep0_continue(pThis, wCount, pUrb)) { + if (musb_h_ep0_continue(musb, wCount, pUrb)) { /* more packets required */ - wCsrVal = (MGC_END0_IN == pThis->bEnd0Stage) + wCsrVal = (MGC_END0_IN == musb->bEnd0Stage) ? MGC_M_CSR0_H_REQPKT : MGC_M_CSR0_TXPKTRDY; } else { /* data transfer complete; perform status phase */ @@ -1127,7 +1127,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *pThis) | MGC_M_CSR0_TXPKTRDY; /* flag status stage */ - pThis->bEnd0Stage = MGC_END0_STATUS; + musb->bEnd0Stage = MGC_END0_STATUS; DBG(5, "ep0 STATUS, csr %04x\n", wCsrVal); @@ -1135,11 +1135,11 @@ irqreturn_t musb_h_ep0_irq(struct musb *pThis) musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); retval = IRQ_HANDLED; } else - pThis->bEnd0Stage = MGC_END0_IDLE; + musb->bEnd0Stage = MGC_END0_IDLE; /* call completion handler if done */ if (bComplete) - musb_advance_schedule(pThis, pUrb, pEnd, 1); + musb_advance_schedule(musb, pUrb, pEnd, 1); done: return retval; } @@ -1162,7 +1162,7 @@ done: #endif /* Service a Tx-Available or dma completion irq for the endpoint */ -void musb_host_tx(struct musb *pThis, u8 bEnd) +void musb_host_tx(struct musb *musb, u8 bEnd) { int nPipe; u8 bDone = FALSE; @@ -1170,11 +1170,11 @@ void musb_host_tx(struct musb *pThis, u8 bEnd) size_t wLength = 0; u8 *pBuffer = NULL; struct urb *pUrb; - struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd; + struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; void __iomem *epio = pEnd->regs; struct musb_qh *qh = pEnd->out_qh; u32 status = 0; - void __iomem *pBase = pThis->pRegs; + void __iomem *pBase = musb->pRegs; struct dma_channel *dma; pUrb = next_urb(qh); @@ -1227,7 +1227,7 @@ void musb_host_tx(struct musb *pThis, u8 bEnd) if (status) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) pThis->pDmaController->channel_abort(dma); + (void) musb->pDmaController->channel_abort(dma); } /* do the proper sequence to abort the transfer in the @@ -1309,7 +1309,7 @@ void musb_host_tx(struct musb *pThis, u8 bEnd) /* set status */ pUrb->status = status; pUrb->actual_length = qh->offset; - musb_advance_schedule(pThis, pUrb, pEnd, USB_DIR_OUT); + musb_advance_schedule(musb, pUrb, pEnd, USB_DIR_OUT); } else if (!(wTxCsrVal & MGC_M_TXCSR_DMAENAB)) { // WARN_ON(!pBuffer); @@ -1377,14 +1377,14 @@ finish: * Service an RX interrupt for the given IN endpoint; docs cover bulk, iso, * and high-bandwidth IN transfer cases. */ -void musb_host_rx(struct musb *pThis, u8 bEnd) +void musb_host_rx(struct musb *musb, u8 bEnd) { struct urb *pUrb; - struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd; + struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; void __iomem *epio = pEnd->regs; struct musb_qh *qh = pEnd->in_qh; size_t xfer_len; - void __iomem *pBase = pThis->pRegs; + void __iomem *pBase = musb->pRegs; int nPipe; u16 wRxCsrVal, wVal; u8 bIsochError = FALSE; @@ -1461,7 +1461,7 @@ void musb_host_rx(struct musb *pThis, u8 bEnd) /* clean up dma and collect transfer count */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) pThis->pDmaController->channel_abort(dma); + (void) musb->pDmaController->channel_abort(dma); xfer_len = dma->dwActualLength; } musb_h_flush_rxfifo(pEnd, 0); @@ -1492,7 +1492,7 @@ void musb_host_rx(struct musb *pThis, u8 bEnd) */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) pThis->pDmaController->channel_abort(dma); + (void) musb->pDmaController->channel_abort(dma); xfer_len = dma->dwActualLength; bDone = TRUE; } @@ -1567,7 +1567,7 @@ void musb_host_rx(struct musb *pThis, u8 bEnd) qh->offset, pUrb->transfer_buffer_length); - c = pThis->pDmaController; + c = musb->pDmaController; dma->bDesiredMode = 0; #ifdef USE_MODE1 @@ -1633,7 +1633,7 @@ void musb_host_rx(struct musb *pThis, u8 bEnd) #endif /* Mentor DMA */ if (!dma) { - bDone = musb_host_packet_rx(pThis, pUrb, + bDone = musb_host_packet_rx(musb, pUrb, bEnd, bIsochError); DBG(6, "read %spacket\n", bDone ? "last " : ""); } @@ -1645,7 +1645,7 @@ finish: if (bDone) { if (pUrb->status == -EINPROGRESS) pUrb->status = status; - musb_advance_schedule(pThis, pUrb, pEnd, USB_DIR_IN); + musb_advance_schedule(musb, pUrb, pEnd, USB_DIR_IN); } } --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -171,7 +171,7 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) if (is_cppi_enabled() && ep->bEndNumber) { unsigned cppi = ep->bEndNumber - 1; - void __iomem *base = ep->pThis->ctrl_base; + void __iomem *base = ep->musb->ctrl_base; unsigned off1 = cppi << 2; void __iomem *ram = base; char tmp[16]; @@ -233,16 +233,16 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) #endif static int -dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) +dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) { int code = 0; char *buf = aBuffer; - struct musb_hw_ep *pEnd = &pThis->aLocalEnd[bEnd]; + struct musb_hw_ep *pEnd = &musb->aLocalEnd[bEnd]; do { - MGC_SelectEnd(pThis->pRegs, bEnd); + MGC_SelectEnd(musb->pRegs, bEnd); #ifdef CONFIG_USB_MUSB_HDRC_HCD - if (is_host_active(pThis)) { + if (is_host_active(musb)) { int dump_rx, dump_tx; void __iomem *regs = pEnd->regs; @@ -253,15 +253,15 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) /* control is shared, uses RX queue * but (mostly) shadowed tx registers */ - dump_tx = !list_empty(&pThis->control); + dump_tx = !list_empty(&musb->control); dump_rx = 0; - } else if (pEnd == pThis->bulk_ep) { - dump_tx = !list_empty(&pThis->out_bulk); - dump_rx = !list_empty(&pThis->in_bulk); - } else if (pThis->periodic[bEnd]) { + } else if (pEnd == musb->bulk_ep) { + dump_tx = !list_empty(&musb->out_bulk); + dump_rx = !list_empty(&musb->in_bulk); + } else if (musb->periodic[bEnd]) { struct usb_host_endpoint *hep; - hep = pThis->periodic[bEnd]->hep; + hep = musb->periodic[bEnd]->hep; dump_rx = hep->desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK; dump_tx = !dump_rx; @@ -284,13 +284,13 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) musb_readw(regs, MGC_O_HDRC_RXMAXP), musb_readb(regs, MGC_O_HDRC_RXTYPE), /* FIXME: assumes multipoint */ - musb_readb(pThis->pRegs, + musb_readb(musb->pRegs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_RXFUNCADDR)), - musb_readb(pThis->pRegs, + musb_readb(musb->pRegs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_RXHUBADDR)), - musb_readb(pThis->pRegs, + musb_readb(musb->pRegs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_RXHUBPORT)) ); @@ -309,7 +309,7 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) void __iomem *ram; char tmp[16]; - base = pThis->ctrl_base; + base = musb->ctrl_base; ram = DAVINCI_RXCPPI_STATERAM_OFFSET( cppi) + base; snprintf(tmp, sizeof tmp, "%d left, ", @@ -337,18 +337,18 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) max -= code; } - if (pEnd == pThis->bulk_ep + if (pEnd == musb->bulk_ep && !list_empty( - &pThis->in_bulk)) { - code = dump_queue(&pThis->in_bulk, + &musb->in_bulk)) { + code = dump_queue(&musb->in_bulk, buf, max); if (code <= 0) break; code = min(code, (int) max); buf += code; max -= code; - } else if (pThis->periodic[bEnd]) { - code = dump_qh(pThis->periodic[bEnd], + } else if (musb->periodic[bEnd]) { + code = dump_qh(musb->periodic[bEnd], buf, max); if (code <= 0) break; @@ -372,13 +372,13 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) musb_readw(regs, MGC_O_HDRC_TXMAXP), musb_readb(regs, MGC_O_HDRC_TXTYPE), /* FIXME: assumes multipoint */ - musb_readb(pThis->pRegs, + musb_readb(musb->pRegs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXFUNCADDR)), - musb_readb(pThis->pRegs, + musb_readb(musb->pRegs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBADDR)), - musb_readb(pThis->pRegs, + musb_readb(musb->pRegs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBPORT)) ); @@ -395,7 +395,7 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) void __iomem *base; void __iomem *ram; - base = pThis->ctrl_base; + base = musb->ctrl_base; ram = DAVINCI_RXCPPI_STATERAM_OFFSET( cppi) + base; code = snprintf(buf, max, @@ -418,28 +418,28 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) max -= code; } - if (pEnd == pThis->control_ep + if (pEnd == musb->control_ep && !list_empty( - &pThis->control)) { - code = dump_queue(&pThis->control, + &musb->control)) { + code = dump_queue(&musb->control, buf, max); if (code <= 0) break; code = min(code, (int) max); buf += code; max -= code; - } else if (pEnd == pThis->bulk_ep + } else if (pEnd == musb->bulk_ep && !list_empty( - &pThis->out_bulk)) { - code = dump_queue(&pThis->out_bulk, + &musb->out_bulk)) { + code = dump_queue(&musb->out_bulk, buf, max); if (code <= 0) break; code = min(code, (int) max); buf += code; max -= code; - } else if (pThis->periodic[bEnd]) { - code = dump_qh(pThis->periodic[bEnd], + } else if (musb->periodic[bEnd]) { + code = dump_qh(musb->periodic[bEnd], buf, max); if (code <= 0) break; @@ -451,7 +451,7 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) } #endif #ifdef CONFIG_USB_GADGET_MUSB_HDRC - if (is_peripheral_active(pThis)) { + if (is_peripheral_active(musb)) { code = 0; if (pEnd->ep_in.desc || !bEnd) { @@ -478,19 +478,19 @@ dump_end_info(struct musb *pThis, u8 bEnd, char *aBuffer, unsigned max) } /** Dump the current status and compile options. - * @param pThis the device driver instance + * @param musb the device driver instance * @param buffer where to dump the status; it must be big enough hold the * result otherwise "BAD THINGS HAPPENS(TM)". */ -static int dump_header_stats(struct musb *pThis, char *buffer) +static int dump_header_stats(struct musb *musb, char *buffer) { int code, count = 0; - const void __iomem *pBase = pThis->pRegs; + const void __iomem *pBase = musb->pRegs; *buffer = 0; count = sprintf(buffer, "Status: %sHDRC, Mode=%s " "(Power=%02x, DevCtl=%02x)\n", - (pThis->bIsMultipoint ? "M" : ""), MUSB_MODE(pThis), + (musb->bIsMultipoint ? "M" : ""), MUSB_MODE(musb), musb_readb(pBase, MGC_O_HDRC_POWER), musb_readb(pBase, MGC_O_HDRC_DEVCTL)); if (count <= 0) @@ -498,8 +498,8 @@ static int dump_header_stats(struct musb *pThis, char *buffer) buffer += count; code = sprintf(buffer, "OTG state: %s; %sactive\n", - otg_state_string(pThis), - pThis->is_active ? "" : "in"); + otg_state_string(musb), + musb->is_active ? "" : "in"); if (code <= 0) goto done; buffer += code; @@ -528,7 +528,7 @@ static int dump_header_stats(struct musb *pThis, char *buffer) #endif ", debug=%d [eps=%d]\n", debug, - pThis->bEndCount); + musb->bEndCount); if (code <= 0) goto done; count += code; @@ -536,7 +536,7 @@ static int dump_header_stats(struct musb *pThis, char *buffer) #ifdef CONFIG_USB_GADGET_MUSB_HDRC code = sprintf(buffer, "Peripheral address: %02x\n", - musb_readb(pThis, MGC_O_HDRC_FADDR)); + musb_readb(musb, MGC_O_HDRC_FADDR)); if (code <= 0) goto done; buffer += code; @@ -545,7 +545,7 @@ static int dump_header_stats(struct musb *pThis, char *buffer) #ifdef CONFIG_USB_MUSB_HDRC_HCD code = sprintf(buffer, "Root port status: %08x\n", - pThis->port1_status); + musb->port1_status); if (code <= 0) goto done; buffer += code; @@ -557,14 +557,14 @@ static int dump_header_stats(struct musb *pThis, char *buffer) "DaVinci: ctrl=%02x stat=%1x phy=%03x\n" "\trndis=%05x auto=%04x intsrc=%08x intmsk=%08x" "\n", - musb_readl(pThis->ctrl_base, DAVINCI_USB_CTRL_REG), - musb_readl(pThis->ctrl_base, DAVINCI_USB_STAT_REG), + musb_readl(musb->ctrl_base, DAVINCI_USB_CTRL_REG), + musb_readl(musb->ctrl_base, DAVINCI_USB_STAT_REG), __raw_readl(IO_ADDRESS(USBPHY_CTL_PADDR)), - musb_readl(pThis->ctrl_base, DAVINCI_RNDIS_REG), - musb_readl(pThis->ctrl_base, DAVINCI_AUTOREQ_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_RNDIS_REG), + musb_readl(musb->ctrl_base, DAVINCI_AUTOREQ_REG), + musb_readl(musb->ctrl_base, DAVINCI_USB_INT_SOURCE_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_USB_INT_MASK_REG)); if (code <= 0) goto done; @@ -578,37 +578,37 @@ static int dump_header_stats(struct musb *pThis, char *buffer) "\n\totg %03x timer %08x" "\n\tprcm conf %08x mgmt %08x; int src %08x mask %08x" "\n", - musb_readl(pThis->ctrl_base, TUSB_DEV_CONF), - musb_readl(pThis->ctrl_base, TUSB_PHY_OTG_CTRL_ENABLE), - musb_readl(pThis->ctrl_base, TUSB_PHY_OTG_CTRL), - musb_readl(pThis->ctrl_base, TUSB_DEV_OTG_STAT), - musb_readl(pThis->ctrl_base, TUSB_DEV_OTG_TIMER), - musb_readl(pThis->ctrl_base, TUSB_PRCM_CONF), - musb_readl(pThis->ctrl_base, TUSB_PRCM_MNGMT), - musb_readl(pThis->ctrl_base, TUSB_INT_SRC), - musb_readl(pThis->ctrl_base, TUSB_INT_MASK)); + musb_readl(musb->ctrl_base, TUSB_DEV_CONF), + musb_readl(musb->ctrl_base, TUSB_PHY_OTG_CTRL_ENABLE), + musb_readl(musb->ctrl_base, TUSB_PHY_OTG_CTRL), + musb_readl(musb->ctrl_base, TUSB_DEV_OTG_STAT), + musb_readl(musb->ctrl_base, TUSB_DEV_OTG_TIMER), + musb_readl(musb->ctrl_base, TUSB_PRCM_CONF), + musb_readl(musb->ctrl_base, TUSB_PRCM_MNGMT), + musb_readl(musb->ctrl_base, TUSB_INT_SRC), + musb_readl(musb->ctrl_base, TUSB_INT_MASK)); if (code <= 0) goto done; count += code; buffer += code; #endif /* DAVINCI */ - if (is_cppi_enabled() && pThis->pDmaController) { + if (is_cppi_enabled() && musb->pDmaController) { code = sprintf(buffer, "CPPI: txcr=%d txsrc=%01x txena=%01x; " "rxcr=%d rxsrc=%01x rxena=%01x " "\n", - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_TXCPPI_CTRL_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_TXCPPI_RAW_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_TXCPPI_INTENAB_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_RXCPPI_CTRL_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_RXCPPI_RAW_REG), - musb_readl(pThis->ctrl_base, + musb_readl(musb->ctrl_base, DAVINCI_RXCPPI_INTENAB_REG)); if (code <= 0) goto done; @@ -617,10 +617,10 @@ static int dump_header_stats(struct musb *pThis, char *buffer) } #ifdef CONFIG_USB_GADGET_MUSB_HDRC - if (is_peripheral_enabled(pThis)) { + if (is_peripheral_enabled(musb)) { code = sprintf(buffer, "Gadget driver: %s\n", - pThis->pGadgetDriver - ? pThis->pGadgetDriver->driver.name + musb->pGadgetDriver + ? musb->pGadgetDriver->driver.name : "(none)"); if (code <= 0) goto done; @@ -784,7 +784,7 @@ static int musb_proc_read(char *page, char **start, char *buffer = page; int code = 0; unsigned long flags; - struct musb *pThis = data; + struct musb *musb = data; unsigned bEnd; count -= off; @@ -792,9 +792,9 @@ static int musb_proc_read(char *page, char **start, if (count <= 0) return -EINVAL; - spin_lock_irqsave(&pThis->Lock, flags); + spin_lock_irqsave(&musb->Lock, flags); - code = dump_header_stats(pThis, buffer); + code = dump_header_stats(musb, buffer); if (code > 0) { buffer += code; count -= code; @@ -802,18 +802,18 @@ static int musb_proc_read(char *page, char **start, /* generate the report for the end points */ // REVISIT ... not unless something's connected! - for (bEnd = 0; count >= 0 && bEnd < pThis->bEndCount; + for (bEnd = 0; count >= 0 && bEnd < musb->bEndCount; bEnd++) { - code = dump_end_info(pThis, bEnd, buffer, count); + code = dump_end_info(musb, bEnd, buffer, count); if (code > 0) { buffer += code; count -= code; } } - musb_platform_try_idle(pThis, 0); + musb_platform_try_idle(musb, 0); - spin_unlock_irqrestore(&pThis->Lock, flags); + spin_unlock_irqrestore(&musb->Lock, flags); *eof = 1; return buffer - page; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -496,8 +496,8 @@ static inline struct musb *gadget_to_musb(struct usb_gadget *g) extern const char musb_driver_name[]; -extern void musb_start(struct musb *pThis); -extern void musb_stop(struct musb *pThis); +extern void musb_start(struct musb *musb); +extern void musb_stop(struct musb *musb); extern void musb_write_fifo(struct musb_hw_ep *ep, u16 wCount, const u8 * pSource); --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -104,12 +104,12 @@ static int dma_controller_stop(struct dma_controller *c) { struct musb_dma_controller *pController = container_of(c, struct musb_dma_controller, Controller); - struct musb *pThis = (struct musb *) pController->pDmaPrivate; + struct musb *musb = (struct musb *) pController->pDmaPrivate; struct dma_channel *pChannel; u8 bBit; if (pController->bmUsedChannels != 0) { - dev_err(pThis->controller, + dev_err(musb->controller, "Stopping DMA controller while channel active\n"); for (bBit = 0; bBit < MGC_HSDMA_CHANNELS; bBit++) { @@ -387,10 +387,10 @@ void dma_controller_destroy(struct dma_controller *c) } struct dma_controller *__init -dma_controller_create(struct musb *pThis, void __iomem *pCoreBase) +dma_controller_create(struct musb *musb, void __iomem *pCoreBase) { struct musb_dma_controller *pController; - struct device *dev = pThis->controller; + struct device *dev = musb->controller; struct platform_device *pdev = to_platform_device(dev); int irq = platform_get_irq(pdev, 1); @@ -404,7 +404,7 @@ dma_controller_create(struct musb *pThis, void __iomem *pCoreBase) return NULL; pController->bChannelCount = MGC_HSDMA_CHANNELS; - pController->pDmaPrivate = pThis; + pController->pDmaPrivate = musb; pController->pCoreBase = pCoreBase; pController->Controller.pPrivateData = pController; @@ -416,7 +416,7 @@ dma_controller_create(struct musb *pThis, void __iomem *pCoreBase) pController->Controller.channel_abort = dma_channel_abort; if (request_irq(irq, dma_controller_irq, IRQF_DISABLED, - pThis->controller->bus_id, &pController->Controller)) { + musb->controller->bus_id, &pController->Controller)) { dev_err(dev, "request_irq %d failed!\n", irq); dma_controller_destroy(&pController->Controller); return NULL; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -350,7 +350,7 @@ void musb_hnp_stop(struct musb *musb) * paramount importance, it seems OK to check them individually; * the order of the tests is specified in the manual * - * @param pThis instance pointer + * @param musb instance pointer * @param bIntrUSB register contents * @param devctl * @param power @@ -360,12 +360,12 @@ void musb_hnp_stop(struct musb *musb) | MGC_M_INTR_VBUSERROR | MGC_M_INTR_CONNECT \ | MGC_M_INTR_RESET ) -static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, +static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, u8 devctl, u8 power) { irqreturn_t handled = IRQ_NONE; #ifdef CONFIG_USB_MUSB_HDRC_HCD - void __iomem *pBase = pThis->pRegs; + void __iomem *pBase = musb->pRegs; #endif DBG(3, "<== Power=%02x, DevCtl=%02x, bIntrUSB=0x%x\n", power, devctl, @@ -377,11 +377,11 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, */ if (bIntrUSB & MGC_M_INTR_RESUME) { handled = IRQ_HANDLED; - DBG(3, "RESUME (%s)\n", otg_state_string(pThis)); + DBG(3, "RESUME (%s)\n", otg_state_string(musb)); if (devctl & MGC_M_DEVCTL_HM) { #ifdef CONFIG_USB_MUSB_HDRC_HCD - switch (pThis->xceiv.state) { + switch (musb->xceiv.state) { case OTG_STATE_A_SUSPEND: /* remote wakeup? later, GetPortStatus * will stop RESUME signaling @@ -389,7 +389,7 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, if (power & MGC_M_POWER_SUSPENDM) { /* spurious */ - pThis->int_usb &= ~MGC_M_INTR_SUSPEND; + musb->int_usb &= ~MGC_M_INTR_SUSPEND; DBG(2, "Spurious SUSPENDM\n"); break; } @@ -398,34 +398,34 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, musb_writeb(pBase, MGC_O_HDRC_POWER, power | MGC_M_POWER_RESUME); - pThis->port1_status |= + musb->port1_status |= (USB_PORT_STAT_C_SUSPEND << 16) | MUSB_PORT_STAT_RESUME; - pThis->rh_timer = jiffies + musb->rh_timer = jiffies + msecs_to_jiffies(20); - pThis->xceiv.state = OTG_STATE_A_HOST; - pThis->is_active = 1; - usb_hcd_resume_root_hub(musb_to_hcd(pThis)); + musb->xceiv.state = OTG_STATE_A_HOST; + musb->is_active = 1; + usb_hcd_resume_root_hub(musb_to_hcd(musb)); break; case OTG_STATE_B_WAIT_ACON: - pThis->xceiv.state = OTG_STATE_B_PERIPHERAL; - pThis->is_active = 1; - MUSB_DEV_MODE(pThis); + musb->xceiv.state = OTG_STATE_B_PERIPHERAL; + musb->is_active = 1; + MUSB_DEV_MODE(musb); break; default: WARN("bogus %s RESUME (%s)\n", "host", - otg_state_string(pThis)); + otg_state_string(musb)); } #endif } else { - switch (pThis->xceiv.state) { + switch (musb->xceiv.state) { #ifdef CONFIG_USB_MUSB_HDRC_HCD case OTG_STATE_A_SUSPEND: /* possibly DISCONNECT is upcoming */ - pThis->xceiv.state = OTG_STATE_A_HOST; - usb_hcd_resume_root_hub(musb_to_hcd(pThis)); + musb->xceiv.state = OTG_STATE_A_HOST; + usb_hcd_resume_root_hub(musb_to_hcd(musb)); break; #endif #ifdef CONFIG_USB_GADGET_MUSB_HDRC @@ -436,20 +436,20 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, */ if ((devctl & MGC_M_DEVCTL_VBUS) != (3 << MGC_S_DEVCTL_VBUS)) { - pThis->int_usb |= MGC_M_INTR_DISCONNECT; - pThis->int_usb &= ~MGC_M_INTR_SUSPEND; + musb->int_usb |= MGC_M_INTR_DISCONNECT; + musb->int_usb &= ~MGC_M_INTR_SUSPEND; break; } - musb_g_resume(pThis); + musb_g_resume(musb); break; case OTG_STATE_B_IDLE: - pThis->int_usb &= ~MGC_M_INTR_SUSPEND; + musb->int_usb &= ~MGC_M_INTR_SUSPEND; break; #endif default: WARN("bogus %s RESUME (%s)\n", "peripheral", - otg_state_string(pThis)); + otg_state_string(musb)); } } } @@ -457,7 +457,7 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, #ifdef CONFIG_USB_MUSB_HDRC_HCD /* see manual for the order of the tests */ if (bIntrUSB & MGC_M_INTR_SESSREQ) { - DBG(1, "SESSION_REQUEST (%s)\n", otg_state_string(pThis)); + DBG(1, "SESSION_REQUEST (%s)\n", otg_state_string(musb)); /* IRQ arrives from ID pin sense or (later, if VBUS power * is removed) SRP. responses are time critical: @@ -467,10 +467,10 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, * a_wait_vrise_tmout triggers VBUS_ERROR transitions */ musb_writeb(pBase, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); - pThis->bEnd0Stage = MGC_END0_START; - pThis->xceiv.state = OTG_STATE_A_IDLE; - MUSB_HST_MODE(pThis); - musb_set_vbus(pThis, 1); + musb->bEnd0Stage = MGC_END0_START; + musb->xceiv.state = OTG_STATE_A_IDLE; + MUSB_HST_MODE(musb); + musb_set_vbus(musb, 1); handled = IRQ_HANDLED; } @@ -494,7 +494,7 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, * REVISIT: do delays from lots of DEBUG_KERNEL checks * make trouble here, keeping VBUS < 4.4V ? */ - switch (pThis->xceiv.state) { + switch (musb->xceiv.state) { case OTG_STATE_A_HOST: /* recovery is dicey once we've gotten past the * initial stages of enumeration, but if VBUS @@ -504,13 +504,13 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, */ case OTG_STATE_A_WAIT_BCON: case OTG_STATE_A_WAIT_VRISE: - if (pThis->vbuserr_retry) { - pThis->vbuserr_retry--; + if (musb->vbuserr_retry) { + musb->vbuserr_retry--; ignore = 1; devctl |= MGC_M_DEVCTL_SESSION; musb_writeb(pBase, MGC_O_HDRC_DEVCTL, devctl); } else { - pThis->port1_status |= + musb->port1_status |= (1 << USB_PORT_FEAT_OVER_CURRENT) | (1 << USB_PORT_FEAT_C_OVER_CURRENT); } @@ -520,7 +520,7 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, } DBG(1, "VBUS_ERROR in %s (%02x, %s), retry #%d, port1 %08x\n", - otg_state_string(pThis), + otg_state_string(musb), devctl, ({ char *s; switch (devctl & MGC_M_DEVCTL_VBUS) { @@ -534,69 +534,69 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, default: s = "VALID"; break; }; s; }), - VBUSERR_RETRY_COUNT - pThis->vbuserr_retry, - pThis->port1_status); + VBUSERR_RETRY_COUNT - musb->vbuserr_retry, + musb->port1_status); /* go through A_WAIT_VFALL then start a new session */ if (!ignore) - musb_set_vbus(pThis, 0); + musb_set_vbus(musb, 0); handled = IRQ_HANDLED; } if (bIntrUSB & MGC_M_INTR_CONNECT) { - struct usb_hcd *hcd = musb_to_hcd(pThis); + struct usb_hcd *hcd = musb_to_hcd(musb); handled = IRQ_HANDLED; - pThis->is_active = 1; + musb->is_active = 1; set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); - pThis->bEnd0Stage = MGC_END0_START; + musb->bEnd0Stage = MGC_END0_START; #ifdef CONFIG_USB_MUSB_OTG /* flush endpoints when transitioning from Device Mode */ - if (is_peripheral_active(pThis)) { + if (is_peripheral_active(musb)) { // REVISIT HNP; just force disconnect } - pThis->bDelayPortPowerOff = FALSE; - musb_writew(pBase, MGC_O_HDRC_INTRTXE, pThis->wEndMask); - musb_writew(pBase, MGC_O_HDRC_INTRRXE, pThis->wEndMask & 0xfffe); + musb->bDelayPortPowerOff = FALSE; + musb_writew(pBase, MGC_O_HDRC_INTRTXE, musb->wEndMask); + musb_writew(pBase, MGC_O_HDRC_INTRRXE, musb->wEndMask & 0xfffe); musb_writeb(pBase, MGC_O_HDRC_INTRUSBE, 0xf7); #endif - pThis->port1_status &= ~(USB_PORT_STAT_LOW_SPEED + musb->port1_status &= ~(USB_PORT_STAT_LOW_SPEED |USB_PORT_STAT_HIGH_SPEED |USB_PORT_STAT_ENABLE ); - pThis->port1_status |= USB_PORT_STAT_CONNECTION + musb->port1_status |= USB_PORT_STAT_CONNECTION |(USB_PORT_STAT_C_CONNECTION << 16); /* high vs full speed is just a guess until after reset */ if (devctl & MGC_M_DEVCTL_LSDEV) - pThis->port1_status |= USB_PORT_STAT_LOW_SPEED; + musb->port1_status |= USB_PORT_STAT_LOW_SPEED; if (hcd->status_urb) usb_hcd_poll_rh_status(hcd); else usb_hcd_resume_root_hub(hcd); - MUSB_HST_MODE(pThis); + MUSB_HST_MODE(musb); /* indicate new connection to OTG machine */ - switch (pThis->xceiv.state) { + switch (musb->xceiv.state) { case OTG_STATE_B_WAIT_ACON: DBG(1, "HNP: Waiting to switch to b_host state\n"); - pThis->xceiv.state = OTG_STATE_B_HOST; + musb->xceiv.state = OTG_STATE_B_HOST; hcd->self.is_b_host = 1; break; default: if ((devctl & MGC_M_DEVCTL_VBUS) == (3 << MGC_S_DEVCTL_VBUS)) { - pThis->xceiv.state = OTG_STATE_A_HOST; + musb->xceiv.state = OTG_STATE_A_HOST; hcd->self.is_b_host = 0; } break; } DBG(1, "CONNECT (%s) devctl %02x\n", - otg_state_string(pThis), devctl); + otg_state_string(musb), devctl); } #endif /* CONFIG_USB_MUSB_HDRC_HCD */ @@ -621,8 +621,8 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, } else { DBG(1, "BUS RESET\n"); - musb_g_reset(pThis); - schedule_work(&pThis->irq_work); + musb_g_reset(musb); + schedule_work(&musb->irq_work); } handled = IRQ_HANDLED; @@ -637,12 +637,12 @@ static irqreturn_t musb_stage0_irq(struct musb * pThis, u8 bIntrUSB, * paramount importance, it seems OK to check them individually; * the order of the tests is specified in the manual * - * @param pThis instance pointer + * @param musb instance pointer * @param bIntrUSB register contents * @param devctl * @param power */ -static irqreturn_t musb_stage2_irq(struct musb * pThis, u8 bIntrUSB, +static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, u8 devctl, u8 power) { irqreturn_t handled = IRQ_NONE; @@ -660,7 +660,7 @@ static irqreturn_t musb_stage2_irq(struct musb * pThis, u8 bIntrUSB, * to support ISO transfers yet. */ if (bIntrUSB & MGC_M_INTR_SOF) { - void __iomem *pBase = pThis->pRegs; + void __iomem *pBase = musb->pRegs; struct musb_hw_ep *ep; u8 bEnd; u16 wFrame; @@ -670,9 +670,9 @@ static irqreturn_t musb_stage2_irq(struct musb * pThis, u8 bIntrUSB, /* start any periodic Tx transfers waiting for current frame */ wFrame = musb_readw(pBase, MGC_O_HDRC_FRAME); - ep = pThis->aLocalEnd; - for (bEnd = 1; (bEnd < pThis->bEndCount) - && (pThis->wEndMask >= (1 << bEnd)); + ep = musb->aLocalEnd; + for (bEnd = 1; (bEnd < musb->bEndCount) + && (musb->wEndMask >= (1 << bEnd)); bEnd++, ep++) { // FIXME handle framecounter wraps (12 bits) // eliminate duplicated StartUrb logic @@ -682,86 +682,86 @@ static irqreturn_t musb_stage2_irq(struct musb * pThis, u8 bIntrUSB, ep->tx_channel ? " DMA" : "", bEnd); if (!ep->tx_channel) - musb_h_tx_start(pThis, bEnd); + musb_h_tx_start(musb, bEnd); else - cppi_hostdma_start(pThis, bEnd); + cppi_hostdma_start(musb, bEnd); } } /* end of for loop */ } #endif - if ((bIntrUSB & MGC_M_INTR_DISCONNECT) && !pThis->bIgnoreDisconnect) { + if ((bIntrUSB & MGC_M_INTR_DISCONNECT) && !musb->bIgnoreDisconnect) { DBG(1, "DISCONNECT (%s) as %s, devctl %02x\n", - otg_state_string(pThis), - MUSB_MODE(pThis), devctl); + otg_state_string(musb), + MUSB_MODE(musb), devctl); handled = IRQ_HANDLED; - switch (pThis->xceiv.state) { + switch (musb->xceiv.state) { #ifdef CONFIG_USB_MUSB_HDRC_HCD case OTG_STATE_A_HOST: case OTG_STATE_A_SUSPEND: - musb_root_disconnect(pThis); - if (pThis->a_wait_bcon != 0) - musb_platform_try_idle(pThis, jiffies - + msecs_to_jiffies(pThis->a_wait_bcon)); + musb_root_disconnect(musb); + if (musb->a_wait_bcon != 0) + musb_platform_try_idle(musb, jiffies + + msecs_to_jiffies(musb->a_wait_bcon)); break; #endif /* HOST */ #ifdef CONFIG_USB_MUSB_OTG case OTG_STATE_B_HOST: - musb_hnp_stop(pThis); + musb_hnp_stop(musb); break; /* FALLTHROUGH */ case OTG_STATE_A_PERIPHERAL: - musb_root_disconnect(pThis); + musb_root_disconnect(musb); /* FALLTHROUGH */ case OTG_STATE_B_WAIT_ACON: #endif /* OTG */ #ifdef CONFIG_USB_GADGET_MUSB_HDRC case OTG_STATE_B_PERIPHERAL: - musb_g_disconnect(pThis); + musb_g_disconnect(musb); break; #endif /* GADGET */ default: WARN("unhandled DISCONNECT transition (%s)\n", - otg_state_string(pThis)); + otg_state_string(musb)); break; } - schedule_work(&pThis->irq_work); + schedule_work(&musb->irq_work); } if (bIntrUSB & MGC_M_INTR_SUSPEND) { DBG(1, "SUSPEND (%s) devctl %02x power %02x\n", - otg_state_string(pThis), devctl, power); + otg_state_string(musb), devctl, power); handled = IRQ_HANDLED; - switch (pThis->xceiv.state) { + switch (musb->xceiv.state) { case OTG_STATE_A_PERIPHERAL: - musb_hnp_stop(pThis); + musb_hnp_stop(musb); break; case OTG_STATE_B_PERIPHERAL: - musb_g_suspend(pThis); - pThis->is_active = is_otg_enabled(pThis) - && pThis->xceiv.gadget->b_hnp_enable; - if (pThis->is_active) { - pThis->xceiv.state = OTG_STATE_B_WAIT_ACON; + musb_g_suspend(musb); + musb->is_active = is_otg_enabled(musb) + && musb->xceiv.gadget->b_hnp_enable; + if (musb->is_active) { + musb->xceiv.state = OTG_STATE_B_WAIT_ACON; #ifdef CONFIG_USB_MUSB_OTG DBG(1, "HNP: Setting timer for b_ase0_brst\n"); - musb_otg_timer.data = (unsigned long)pThis; + musb_otg_timer.data = (unsigned long)musb; mod_timer(&musb_otg_timer, jiffies + msecs_to_jiffies(TB_ASE0_BRST)); #endif } break; case OTG_STATE_A_WAIT_BCON: - if (pThis->a_wait_bcon != 0) - musb_platform_try_idle(pThis, jiffies - + msecs_to_jiffies(pThis->a_wait_bcon)); + if (musb->a_wait_bcon != 0) + musb_platform_try_idle(musb, jiffies + + msecs_to_jiffies(musb->a_wait_bcon)); break; case OTG_STATE_A_HOST: - pThis->xceiv.state = OTG_STATE_A_SUSPEND; - pThis->is_active = is_otg_enabled(pThis) - && pThis->xceiv.host->b_hnp_enable; + musb->xceiv.state = OTG_STATE_A_SUSPEND; + musb->is_active = is_otg_enabled(musb) + && musb->xceiv.host->b_hnp_enable; break; case OTG_STATE_B_HOST: /* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */ @@ -769,7 +769,7 @@ static irqreturn_t musb_stage2_irq(struct musb * pThis, u8 bIntrUSB, break; default: /* "should not happen" */ - pThis->is_active = 0; + musb->is_active = 0; break; } } @@ -833,9 +833,9 @@ void musb_start(struct musb *musb) } -static void musb_generic_disable(struct musb *pThis) +static void musb_generic_disable(struct musb *musb) { - void __iomem *pBase = pThis->pRegs; + void __iomem *pBase = musb->pRegs; u16 temp; /* disable interrupts */ @@ -1174,7 +1174,7 @@ static int __init ep_config_from_table(struct musb *musb) /* * ep_config_from_hw - when MUSB_C_DYNFIFO_DEF is false - * @param pThis the controller + * @param musb the controller */ static int __init ep_config_from_hw(struct musb *musb) { @@ -1243,7 +1243,7 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, }; /* Initialize MUSB (M)HDRC part of the USB hardware subsystem; * configure endpoints, or take their config from silicon */ -static int __init musb_core_init(u16 wType, struct musb *pThis) +static int __init musb_core_init(u16 wType, struct musb *musb) { #ifdef MUSB_AHB_ID u32 dwData; @@ -1252,7 +1252,7 @@ static int __init musb_core_init(u16 wType, struct musb *pThis) char *type; u16 wRelease, wRelMajor, wRelMinor; char aInfo[78], aRevision[32], aDate[12]; - void __iomem *pBase = pThis->pRegs; + void __iomem *pBase = musb->pRegs; int status = 0; int i; @@ -1267,7 +1267,7 @@ static int __init musb_core_init(u16 wType, struct musb *pThis) if (reg & MGC_M_CONFIGDATA_MPRXE) { strcat(aInfo, ", bulk combine"); #ifdef C_MP_RX - pThis->bBulkCombine = TRUE; + musb->bBulkCombine = TRUE; #else strcat(aInfo, " (X)"); /* no driver support */ #endif @@ -1275,7 +1275,7 @@ static int __init musb_core_init(u16 wType, struct musb *pThis) if (reg & MGC_M_CONFIGDATA_MPTXE) { strcat(aInfo, ", bulk split"); #ifdef C_MP_TX - pThis->bBulkSplit = TRUE; + musb->bBulkSplit = TRUE; #else strcat(aInfo, " (X)"); /* no driver support */ #endif @@ -1310,10 +1310,10 @@ static int __init musb_core_init(u16 wType, struct musb *pThis) aDate[0] = 0; #endif if (MUSB_CONTROLLER_MHDRC == wType) { - pThis->bIsMultipoint = 1; + musb->bIsMultipoint = 1; type = "M"; } else { - pThis->bIsMultipoint = 0; + musb->bIsMultipoint = 0; type = ""; #ifdef CONFIG_USB_MUSB_HDRC_HCD #ifndef CONFIG_USB_OTG_BLACKLIST_HUB @@ -1334,23 +1334,23 @@ static int __init musb_core_init(u16 wType, struct musb *pThis) musb_driver_name, type, aRevision, aDate); /* configure ep0 */ - pThis->aLocalEnd[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE; - pThis->aLocalEnd[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; + musb->aLocalEnd[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE; + musb->aLocalEnd[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; /* discover endpoint configuration */ - pThis->bEndCount = 1; - pThis->wEndMask = 1; + musb->bEndCount = 1; + musb->wEndMask = 1; if (reg & MGC_M_CONFIGDATA_DYNFIFO) { if (can_dynfifo()) - status = ep_config_from_table(pThis); + status = ep_config_from_table(musb); else { ERR("reconfigure software for Dynamic FIFOs\n"); status = -ENODEV; } } else { if (!can_dynfifo()) - status = ep_config_from_hw(pThis); + status = ep_config_from_hw(musb); else { ERR("reconfigure software for static FIFOs\n"); return -ENODEV; @@ -1361,15 +1361,15 @@ static int __init musb_core_init(u16 wType, struct musb *pThis) return status; /* finish init, and print endpoint config */ - for (i = 0; i < pThis->bEndCount; i++) { - struct musb_hw_ep *hw_ep = pThis->aLocalEnd + i; + for (i = 0; i < musb->bEndCount; i++) { + struct musb_hw_ep *hw_ep = musb->aLocalEnd + i; hw_ep->fifo = MUSB_FIFO_OFFSET(i) + pBase; #ifdef CONFIG_USB_TUSB6010 - hw_ep->fifo_async = pThis->async + 0x400 + MUSB_FIFO_OFFSET(i); - hw_ep->fifo_sync = pThis->sync + 0x400 + MUSB_FIFO_OFFSET(i); + hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i); + hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i); hw_ep->fifo_sync_va = - pThis->sync_va + 0x400 + MUSB_FIFO_OFFSET(i); + musb->sync_va + 0x400 + MUSB_FIFO_OFFSET(i); if (i == 0) hw_ep->conf = pBase - 0x400 + TUSB_EP0_CONF; @@ -1842,7 +1842,7 @@ static int __init musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) { int status; - struct musb *pThis; + struct musb *musb; struct musb_hdrc_platform_data *plat = dev->platform_data; /* The driver might handle more features than the board; OK. @@ -1877,15 +1877,15 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) } /* allocate */ - pThis = allocate_instance(dev, ctrl); - if (!pThis) + musb = allocate_instance(dev, ctrl); + if (!musb) return -ENOMEM; - spin_lock_init(&pThis->Lock); - pThis->board_mode = plat->mode; - pThis->board_set_power = plat->set_power; - pThis->set_clock = plat->set_clock; - pThis->min_power = plat->min_power; + spin_lock_init(&musb->Lock); + musb->board_mode = plat->mode; + musb->board_set_power = plat->set_power; + musb->set_clock = plat->set_clock; + musb->min_power = plat->min_power; /* Clock usage is chip-specific ... functional clock (DaVinci, * OMAP2430), or PHY ref (some TUSB6010 boards). All this core @@ -1893,25 +1893,25 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) * code manages it during start/stop and suspend/resume. */ if (plat->clock) { - pThis->clock = clk_get(dev, plat->clock); - if (IS_ERR(pThis->clock)) { - status = PTR_ERR(pThis->clock); - pThis->clock = NULL; + musb->clock = clk_get(dev, plat->clock); + if (IS_ERR(musb->clock)) { + status = PTR_ERR(musb->clock); + musb->clock = NULL; goto fail; } } /* assume vbus is off */ - /* platform adjusts pThis->pRegs and pThis->isr if needed, + /* platform adjusts musb->pRegs and musb->isr if needed, * and activates clocks */ - pThis->isr = generic_interrupt; - status = musb_platform_init(pThis); + musb->isr = generic_interrupt; + status = musb_platform_init(musb); if (status < 0) goto fail; - if (!pThis->isr) { + if (!musb->isr) { status = -ENODEV; goto fail2; } @@ -1920,34 +1920,34 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (use_dma && dev->dma_mask) { struct dma_controller *c; - c = dma_controller_create(pThis, pThis->pRegs); - pThis->pDmaController = c; + c = dma_controller_create(musb, musb->pRegs); + musb->pDmaController = c; if (c) (void) c->start(c->pPrivateData); } #endif /* ideally this would be abstracted in platform setup */ - if (!is_dma_capable() || !pThis->pDmaController) + if (!is_dma_capable() || !musb->pDmaController) dev->dma_mask = NULL; /* be sure interrupts are disabled before connecting ISR */ - musb_platform_disable(pThis); - musb_generic_disable(pThis); + musb_platform_disable(musb); + musb_generic_disable(musb); /* setup musb parts of the core (especially endpoints) */ status = musb_core_init(plat->multipoint ? MUSB_CONTROLLER_MHDRC - : MUSB_CONTROLLER_HDRC, pThis); + : MUSB_CONTROLLER_HDRC, musb); if (status < 0) goto fail2; /* attach to the IRQ */ - if (request_irq (nIrq, pThis->isr, 0, dev->bus_id, pThis)) { + if (request_irq (nIrq, musb->isr, 0, dev->bus_id, musb)) { dev_err(dev, "request_irq %d failed!\n", nIrq); status = -ENODEV; goto fail2; } - pThis->nIrq = nIrq; + musb->nIrq = nIrq; // FIXME this handles wakeup irqs wrong if (enable_irq_wake(nIrq) == 0) device_init_wakeup(dev, 1); @@ -1955,24 +1955,24 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) pr_info("%s: USB %s mode controller at %p using %s, IRQ %d\n", musb_driver_name, ({char *s; - switch (pThis->board_mode) { + switch (musb->board_mode) { case MUSB_HOST: s = "Host"; break; case MUSB_PERIPHERAL: s = "Peripheral"; break; default: s = "OTG"; break; }; s; }), ctrl, - (is_dma_capable() && pThis->pDmaController) + (is_dma_capable() && musb->pDmaController) ? "DMA" : "PIO", - pThis->nIrq); + musb->nIrq); #ifdef CONFIG_USB_MUSB_HDRC_HCD /* host side needs more setup, except for no-host modes */ - if (pThis->board_mode != MUSB_PERIPHERAL) { - struct usb_hcd *hcd = musb_to_hcd(pThis); + if (musb->board_mode != MUSB_PERIPHERAL) { + struct usb_hcd *hcd = musb_to_hcd(musb); - if (pThis->board_mode == MUSB_OTG) + if (musb->board_mode == MUSB_OTG) hcd->self.otg_port = 1; - pThis->xceiv.host = &hcd->self; + musb->xceiv.host = &hcd->self; hcd->power_budget = 2 * (plat->power ? : 250); } #endif /* CONFIG_USB_MUSB_HDRC_HCD */ @@ -1981,46 +1981,46 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) * (We expect the ID pin to be forcibly grounded!!) * Otherwise, wait till the gadget driver hooks up. */ - if (!is_otg_enabled(pThis) && is_host_enabled(pThis)) { - MUSB_HST_MODE(pThis); - pThis->xceiv.default_a = 1; - pThis->xceiv.state = OTG_STATE_A_IDLE; + if (!is_otg_enabled(musb) && is_host_enabled(musb)) { + MUSB_HST_MODE(musb); + musb->xceiv.default_a = 1; + musb->xceiv.state = OTG_STATE_A_IDLE; - status = usb_add_hcd(musb_to_hcd(pThis), -1, 0); + status = usb_add_hcd(musb_to_hcd(musb), -1, 0); DBG(1, "%s mode, status %d, devctl %02x %c\n", "HOST", status, - musb_readb(pThis->pRegs, MGC_O_HDRC_DEVCTL), - (musb_readb(pThis->pRegs, MGC_O_HDRC_DEVCTL) + musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL), + (musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL) & MGC_M_DEVCTL_BDEVICE ? 'B' : 'A')); } else /* peripheral is enabled */ { - MUSB_DEV_MODE(pThis); - pThis->xceiv.default_a = 0; - pThis->xceiv.state = OTG_STATE_B_IDLE; + MUSB_DEV_MODE(musb); + musb->xceiv.default_a = 0; + musb->xceiv.state = OTG_STATE_B_IDLE; - status = musb_gadget_setup(pThis); + status = musb_gadget_setup(musb); DBG(1, "%s mode, status %d, dev%02x\n", - is_otg_enabled(pThis) ? "OTG" : "PERIPHERAL", + is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", status, - musb_readb(pThis->pRegs, MGC_O_HDRC_DEVCTL)); + musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL)); } if (status == 0) - musb_debug_create("driver/musb_hdrc", pThis); + musb_debug_create("driver/musb_hdrc", musb); else { fail: - if (pThis->clock) - clk_put(pThis->clock); + if (musb->clock) + clk_put(musb->clock); device_init_wakeup(dev, 0); - musb_free(pThis); + musb_free(musb); return status; } - INIT_WORK(&pThis->irq_work, musb_irq_work); + INIT_WORK(&musb->irq_work, musb_irq_work); #ifdef CONFIG_SYSFS status = device_create_file(dev, &dev_attr_mode); @@ -2035,7 +2035,7 @@ fail: return status; fail2: - musb_platform_exit(pThis); + musb_platform_exit(musb); goto fail; } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep 2007-08-13 13:48 ` [PATCH 1/52] musb_hdrc: Search and replace pThis with musb Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pEndPt with hw_ep Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 26 +++++++++++++------------- drivers/usb/musb/cppi_dma.h | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -318,10 +318,10 @@ cppi_channel_allocate(struct dma_controller *c, /* REVISIT make this an error later once the same driver code works * with the Mentor DMA engine too */ - if (otgCh->pEndPt) + if (otgCh->hw_ep) DBG(1, "re-allocating DMA%d %cX channel %p\n", chNum, bTransmit ? 'T' : 'R', otgCh); - otgCh->pEndPt = ep; + otgCh->hw_ep = ep; otgCh->Channel.bStatus = MGC_DMA_STATUS_FREE; DBG(4, "Allocate CPPI%d %cX\n", chNum, bTransmit ? 'T' : 'R'); @@ -341,13 +341,13 @@ static void cppi_channel_release(struct dma_channel *channel) c = container_of(channel, struct cppi_channel, Channel); epnum = c->chNo + 1; tibase = c->pController->pCoreBase - DAVINCI_BASE_OFFSET; - if (!c->pEndPt) + if (!c->hw_ep) DBG(1, "releasing idle DMA channel %p\n", c); else if (!c->bTransmit) core_rxirq_enable(tibase, epnum); /* for now, leave its cppi IRQ enabled (we won't trigger it) */ - c->pEndPt = NULL; + c->hw_ep = NULL; channel->bStatus = MGC_DMA_STATUS_UNKNOWN; } @@ -366,7 +366,7 @@ cppi_dump_rx(int level, struct cppi_channel *c, const char *tag) c->chNo, tag, musb_readl(base - DAVINCI_BASE_OFFSET, DAVINCI_RXCPPI_BUFCNT0_REG + 4 *c->chNo), - musb_readw(c->pEndPt->regs, MGC_O_HDRC_RXCSR), + musb_readw(c->hw_ep->regs, MGC_O_HDRC_RXCSR), musb_readl(c->stateRam, 0 * 4), /* buf offset */ musb_readl(c->stateRam, 1 * 4), /* head ptr */ @@ -393,7 +393,7 @@ cppi_dump_tx(int level, struct cppi_channel *c, const char *tag) "F%08x L%08x .. %08x" "\n", c->chNo, tag, - musb_readw(c->pEndPt->regs, MGC_O_HDRC_TXCSR), + musb_readw(c->hw_ep->regs, MGC_O_HDRC_TXCSR), musb_readl(c->stateRam, 0 * 4), /* head ptr */ musb_readl(c->stateRam, 1 * 4), /* sop bd */ @@ -498,7 +498,7 @@ static inline int cppi_autoreq_update(struct cppi_channel *rx, /* REQPKT is turned off after each segment */ if (n_bds && rx->actualLen) { - void *__iomem regs = rx->pEndPt->regs; + void *__iomem regs = rx->hw_ep->regs; val = musb_readw(regs, MGC_O_HDRC_RXCSR); if (!(val & MGC_M_RXCSR_H_REQPKT)) { @@ -1008,7 +1008,7 @@ static int cppi_rx_scan(struct cppi *cppi, unsigned ch) int completed = 0, acked = 0; int i; dma_addr_t safe2ack; - void *__iomem regs = rx->pEndPt->regs; + void *__iomem regs = rx->hw_ep->regs; cppi_dump_rx(6, rx, "/K"); @@ -1116,14 +1116,14 @@ static int cppi_rx_scan(struct cppi *cppi, unsigned ch) /* REVISIT seems like "autoreq all but EOP" doesn't... * setting it here "should" be racey, but seems to work */ - csr = musb_readw(rx->pEndPt->regs, MGC_O_HDRC_RXCSR); + csr = musb_readw(rx->hw_ep->regs, MGC_O_HDRC_RXCSR); if (is_host_active(cppi->musb) && bd && !(csr & MGC_M_RXCSR_H_REQPKT)) { csr |= MGC_M_RXCSR_H_REQPKT; musb_writew(regs, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | csr); - csr = musb_readw(rx->pEndPt->regs, MGC_O_HDRC_RXCSR); + csr = musb_readw(rx->hw_ep->regs, MGC_O_HDRC_RXCSR); } } else { rx->activeQueueHead = NULL; @@ -1227,7 +1227,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) txChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; - pEnd = txChannel->pEndPt; + pEnd = txChannel->hw_ep; txChannel->Channel.dwActualLength = txChannel->actualLen; @@ -1290,7 +1290,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) /* all segments completed! */ rxChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; - pEnd = rxChannel->pEndPt; + pEnd = rxChannel->hw_ep; rxChannel->Channel.dwActualLength = rxChannel->actualLen; @@ -1381,7 +1381,7 @@ static int cppi_channel_abort(struct dma_channel *channel) /* from RX or TX fault irq handler */ case MGC_DMA_STATUS_BUSY: /* the hardware needs shutting down */ - regs = otgCh->pEndPt->regs; + regs = otgCh->hw_ep->regs; break; case MGC_DMA_STATUS_UNKNOWN: case MGC_DMA_STATUS_FREE: --- a/drivers/usb/musb/cppi_dma.h +++ b/drivers/usb/musb/cppi_dma.h @@ -65,7 +65,7 @@ struct cppi_channel { struct cppi *pController; /* which direction of which endpoint? */ - struct musb_hw_ep *pEndPt; + struct musb_hw_ep *hw_ep; u8 bTransmit; u8 chNo; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep 2007-08-13 13:48 ` [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pEnd with musb_ep when struct musb_ep Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 18 ++-- drivers/usb/musb/musb_gadget.c | 266 ++++++++++++++++++++-------------------- 2 files changed, 142 insertions(+), 142 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -257,7 +257,7 @@ __acquires(musb->Lock) break; case USB_RECIP_ENDPOINT:{ const u8 bEnd = pControlRequest->wIndex & 0x0f; - struct musb_ep *pEnd; + struct musb_ep *musb_ep; if (bEnd == 0 || bEnd >= MUSB_C_NUM_EPS @@ -266,15 +266,15 @@ __acquires(musb->Lock) break; if (pControlRequest->wIndex & USB_DIR_IN) - pEnd = &musb->aLocalEnd[bEnd].ep_in; + musb_ep = &musb->aLocalEnd[bEnd].ep_in; else - pEnd = &musb->aLocalEnd[bEnd].ep_out; - if (!pEnd->desc) + musb_ep = &musb->aLocalEnd[bEnd].ep_out; + if (!musb_ep->desc) break; /* REVISIT do it directly, no locking games */ spin_unlock(&musb->Lock); - musb_gadget_set_halt(&pEnd->end_point, 0); + musb_gadget_set_halt(&musb_ep->end_point, 0); spin_lock(&musb->Lock); /* select ep0 again */ @@ -366,7 +366,7 @@ stall: case USB_RECIP_ENDPOINT:{ const u8 bEnd = pControlRequest->wIndex & 0x0f; - struct musb_ep *pEnd; + struct musb_ep *musb_ep; struct musb_hw_ep *ep; void __iomem *regs; int is_in; @@ -382,10 +382,10 @@ stall: regs = ep->regs; is_in = pControlRequest->wIndex & USB_DIR_IN; if (is_in) - pEnd = &ep->ep_in; + musb_ep = &ep->ep_in; else - pEnd = &ep->ep_out; - if (!pEnd->desc) + musb_ep = &ep->ep_out; + if (!musb_ep->desc) break; MGC_SelectEnd(pBase, bEnd); --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -253,16 +253,16 @@ static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) static void txstate(struct musb *musb, struct musb_request *req) { u8 bEnd = req->bEnd; - struct musb_ep *pEnd; + struct musb_ep *musb_ep; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct usb_request *pRequest; u16 wFifoCount = 0, wCsrVal; int use_dma = 0; - pEnd = req->ep; + musb_ep = req->ep; /* we shouldn't get here while DMA is active ... but we do ... */ - if (dma_channel_status(pEnd->dma) == MGC_DMA_STATUS_BUSY) { + if (dma_channel_status(musb_ep->dma) == MGC_DMA_STATUS_BUSY) { DBG(4, "dma pending...\n"); return; } @@ -271,27 +271,27 @@ static void txstate(struct musb *musb, struct musb_request *req) wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); pRequest = &req->request; - wFifoCount = min(max_ep_writesize(musb, pEnd), + wFifoCount = min(max_ep_writesize(musb, musb_ep), (int)(pRequest->length - pRequest->actual)); if (wCsrVal & MGC_M_TXCSR_TXPKTRDY) { DBG(5, "%s old packet still ready , txcsr %03x\n", - pEnd->end_point.name, wCsrVal); + musb_ep->end_point.name, wCsrVal); return; } if (wCsrVal & MGC_M_TXCSR_P_SENDSTALL) { DBG(5, "%s stalling, txcsr %03x\n", - pEnd->end_point.name, wCsrVal); + musb_ep->end_point.name, wCsrVal); return; } DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", - bEnd, pEnd->wPacketSize, wFifoCount, + bEnd, musb_ep->wPacketSize, wFifoCount, wCsrVal); #ifndef CONFIG_USB_INVENTRA_FIFO - if (is_dma_capable() && pEnd->dma) { + if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; use_dma = (pRequest->dma != DMA_ADDR_INVALID); @@ -304,18 +304,18 @@ static void txstate(struct musb *musb, struct musb_request *req) /* setup DMA, then program endpoint CSR */ request_size = min(pRequest->length, - pEnd->dma->dwMaxLength); - if (request_size <= pEnd->wPacketSize) - pEnd->dma->bDesiredMode = 0; + musb_ep->dma->dwMaxLength); + if (request_size <= musb_ep->wPacketSize) + musb_ep->dma->bDesiredMode = 0; else - pEnd->dma->bDesiredMode = 1; + musb_ep->dma->bDesiredMode = 1; use_dma = use_dma && c->channel_program( - pEnd->dma, pEnd->wPacketSize, - pEnd->dma->bDesiredMode, + musb_ep->dma, musb_ep->wPacketSize, + musb_ep->dma->bDesiredMode, pRequest->dma, request_size); if (use_dma) { - if (pEnd->dma->bDesiredMode == 0) { + if (musb_ep->dma->bDesiredMode == 0) { /* ASSERT: DMAENAB is clear */ wCsrVal &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAMODE); @@ -359,20 +359,20 @@ static void txstate(struct musb *musb, struct musb_request *req) * except for the last-packet-is-already-short case. */ use_dma = use_dma && c->channel_program( - pEnd->dma, pEnd->wPacketSize, + musb_ep->dma, musb_ep->wPacketSize, 0, pRequest->dma, pRequest->length); if (!use_dma) { - c->channel_release(pEnd->dma); - pEnd->dma = NULL; + c->channel_release(musb_ep->dma); + musb_ep->dma = NULL; /* ASSERT: DMAENAB clear */ wCsrVal &= ~(MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_MODE); /* invariant: prequest->buf is non-null */ } #elif defined(CONFIG_USB_TUSB_OMAP_DMA) use_dma = use_dma && c->channel_program( - pEnd->dma, pEnd->wPacketSize, + musb_ep->dma, musb_ep->wPacketSize, pRequest->zero, pRequest->dma, pRequest->length); @@ -381,7 +381,7 @@ static void txstate(struct musb *musb, struct musb_request *req) #endif if (!use_dma) { - musb_write_fifo(pEnd->hw_ep, wFifoCount, + musb_write_fifo(musb_ep->hw_ep, wFifoCount, (u8 *) (pRequest->buf + pRequest->actual)); pRequest->actual += wFifoCount; wCsrVal |= MGC_M_TXCSR_TXPKTRDY; @@ -391,7 +391,7 @@ static void txstate(struct musb *musb, struct musb_request *req) /* host may already have the data when this message shows... */ DBG(3, "%s TX/IN %s len %d/%d, txcsr %04x, fifo %d/%d\n", - pEnd->end_point.name, use_dma ? "dma" : "pio", + musb_ep->end_point.name, use_dma ? "dma" : "pio", pRequest->actual, pRequest->length, musb_readw(epio, MGC_O_HDRC_TXCSR), wFifoCount, @@ -407,17 +407,17 @@ void musb_g_tx(struct musb *musb, u8 bEnd) u16 wCsrVal; struct usb_request *pRequest; u8 __iomem *pBase = musb->pRegs; - struct musb_ep *pEnd = &musb->aLocalEnd[bEnd].ep_in; + struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_in; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct dma_channel *dma; MGC_SelectEnd(pBase, bEnd); - pRequest = next_request(pEnd); + pRequest = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - DBG(4, "<== %s, txcsr %04x\n", pEnd->end_point.name, wCsrVal); + DBG(4, "<== %s, txcsr %04x\n", musb_ep->end_point.name, wCsrVal); - dma = is_dma_capable() ? pEnd->dma : NULL; + dma = is_dma_capable() ? musb_ep->dma : NULL; do { /* REVISIT for high bandwidth, MGC_M_TXCSR_P_INCOMPTX * probably rates reporting as a host error @@ -432,7 +432,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) } if (pRequest) - musb_g_giveback(pEnd, pRequest, -EPIPE); + musb_g_giveback(musb_ep, pRequest, -EPIPE); break; } @@ -450,7 +450,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) /* SHOULD NOT HAPPEN ... has with cppi though, after * changing SENDSTALL (and other cases); harmless? */ - DBG(5, "%s dma still busy?\n", pEnd->end_point.name); + DBG(5, "%s dma still busy?\n", musb_ep->end_point.name); break; } @@ -466,11 +466,11 @@ void musb_g_tx(struct musb *musb, u8 bEnd) musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); /* ensure writebuffer is empty */ wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - pRequest->actual += pEnd->dma->dwActualLength; + pRequest->actual += musb_ep->dma->dwActualLength; DBG(4, "TXCSR%d %04x, dma off, " "len %Zd, req %p\n", bEnd, wCsrVal, - pEnd->dma->dwActualLength, + musb_ep->dma->dwActualLength, pRequest); } @@ -483,13 +483,13 @@ void musb_g_tx(struct musb *musb, u8 bEnd) if ((pRequest->zero && pRequest->length && (pRequest->length - % pEnd->wPacketSize) + % musb_ep->wPacketSize) == 0) #ifdef CONFIG_USB_INVENTRA_DMA || (is_dma && ((!dma->bDesiredMode) || (pRequest->actual & - (pEnd->wPacketSize - 1)))) + (musb_ep->wPacketSize - 1)))) #endif ) { /* on dma completion, fifo may not @@ -506,7 +506,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) } /* ... or if not, then complete it */ - musb_g_giveback(pEnd, pRequest, 0); + musb_g_giveback(musb_ep, pRequest, 0); /* kickstart next transfer if appropriate; * the packet that just completed might not @@ -518,12 +518,12 @@ void musb_g_tx(struct musb *musb, u8 bEnd) wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsrVal & MGC_M_TXCSR_FIFONOTEMPTY) break; - pRequest = pEnd->desc - ? next_request(pEnd) + pRequest = musb_ep->desc + ? next_request(musb_ep) : NULL; if (!pRequest) { DBG(4, "%s idle now\n", - pEnd->end_point.name); + musb_ep->end_point.name); break; } } @@ -575,16 +575,16 @@ static void rxstate(struct musb *musb, struct musb_request *req) u16 wCsrVal = 0; const u8 bEnd = req->bEnd; struct usb_request *pRequest = &req->request; - struct musb_ep *pEnd = &musb->aLocalEnd[bEnd].ep_out; + struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; void __iomem *epio = musb->aLocalEnd[bEnd].regs; u16 wFifoCount = 0; - u16 wCount = pEnd->wPacketSize; + u16 wCount = musb_ep->wPacketSize; wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); - if (is_cppi_enabled() && pEnd->dma) { + if (is_cppi_enabled() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; - struct dma_channel *channel = pEnd->dma; + struct dma_channel *channel = musb_ep->dma; /* NOTE: CPPI won't actually stop advancing the DMA * queue after short packet transfers, so this is almost @@ -592,7 +592,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) * faults will be handled correctly. */ if (c->channel_program(channel, - pEnd->wPacketSize, + musb_ep->wPacketSize, !pRequest->short_not_ok, pRequest->dma + pRequest->actual, pRequest->length - pRequest->actual)) { @@ -613,13 +613,13 @@ static void rxstate(struct musb *musb, struct musb_request *req) wCount = musb_readw(epio, MGC_O_HDRC_RXCOUNT); if (pRequest->actual < pRequest->length) { #ifdef CONFIG_USB_INVENTRA_DMA - if (is_dma_capable() && pEnd->dma) { + if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c; struct dma_channel *channel; int use_dma = 0; c = musb->pDmaController; - channel = pEnd->dma; + channel = musb_ep->dma; /* We use DMA Req mode 0 in RxCsr, and DMA controller operates in * mode 0 only. So we do not get endpoint interrupts due to DMA @@ -665,14 +665,14 @@ static void rxstate(struct musb *musb, struct musb_request *req) #else transfer_size = wCount; #endif - if (transfer_size <= pEnd->wPacketSize) - pEnd->dma->bDesiredMode = 0; + if (transfer_size <= musb_ep->wPacketSize) + musb_ep->dma->bDesiredMode = 0; else - pEnd->dma->bDesiredMode = 1; + musb_ep->dma->bDesiredMode = 1; use_dma = c->channel_program( channel, - pEnd->wPacketSize, + musb_ep->wPacketSize, channel->bDesiredMode, pRequest->dma + pRequest->actual, @@ -686,21 +686,21 @@ static void rxstate(struct musb *musb, struct musb_request *req) wFifoCount = pRequest->length - pRequest->actual; DBG(3, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n", - pEnd->end_point.name, + musb_ep->end_point.name, wCount, wFifoCount, - pEnd->wPacketSize); + musb_ep->wPacketSize); wFifoCount = min(wCount, wFifoCount); #ifdef CONFIG_USB_TUSB_OMAP_DMA - if (tusb_dma_omap() && pEnd->dma) { + if (tusb_dma_omap() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; - struct dma_channel *channel = pEnd->dma; + struct dma_channel *channel = musb_ep->dma; u32 dma_addr = pRequest->dma + pRequest->actual; int ret; ret = c->channel_program(channel, - pEnd->wPacketSize, + musb_ep->wPacketSize, channel->bDesiredMode, dma_addr, wFifoCount); @@ -709,7 +709,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) } #endif - musb_read_fifo(pEnd->hw_ep, wFifoCount, (u8 *) + musb_read_fifo(musb_ep->hw_ep, wFifoCount, (u8 *) (pRequest->buf + pRequest->actual)); pRequest->actual += wFifoCount; @@ -725,8 +725,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) } /* reach the end or short packet detected */ - if (pRequest->actual == pRequest->length || wCount < pEnd->wPacketSize) - musb_g_giveback(pEnd, pRequest, 0); + if (pRequest->actual == pRequest->length || wCount < musb_ep->wPacketSize) + musb_g_giveback(musb_ep, pRequest, 0); } /* @@ -737,25 +737,25 @@ void musb_g_rx(struct musb *musb, u8 bEnd) u16 wCsrVal; struct usb_request *pRequest; void __iomem *pBase = musb->pRegs; - struct musb_ep *pEnd = &musb->aLocalEnd[bEnd].ep_out; + struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct dma_channel *dma; MGC_SelectEnd(pBase, bEnd); - pRequest = next_request(pEnd); + pRequest = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); - dma = is_dma_capable() ? pEnd->dma : NULL; + dma = is_dma_capable() ? musb_ep->dma : NULL; - DBG(4, "<== %s, rxcsr %04x%s %p\n", pEnd->end_point.name, + DBG(4, "<== %s, rxcsr %04x%s %p\n", musb_ep->end_point.name, wCsrVal, dma ? " (dma)" : "", pRequest); if (wCsrVal & MGC_M_RXCSR_P_SENTSTALL) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; (void) musb->pDmaController->channel_abort(dma); - pRequest->actual += pEnd->dma->dwActualLength; + pRequest->actual += musb_ep->dma->dwActualLength; } wCsrVal |= MGC_M_RXCSR_P_WZC_BITS; @@ -763,7 +763,7 @@ void musb_g_rx(struct musb *musb, u8 bEnd) musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); if (pRequest) - musb_g_giveback(pEnd, pRequest, -EPIPE); + musb_g_giveback(musb_ep, pRequest, -EPIPE); goto done; } @@ -772,20 +772,20 @@ void musb_g_rx(struct musb *musb, u8 bEnd) wCsrVal &= ~MGC_M_RXCSR_P_OVERRUN; musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); - DBG(3, "%s iso overrun on %p\n", pEnd->name, pRequest); + DBG(3, "%s iso overrun on %p\n", musb_ep->name, pRequest); if (pRequest && pRequest->status == -EINPROGRESS) pRequest->status = -EOVERFLOW; } if (wCsrVal & MGC_M_RXCSR_INCOMPRX) { /* REVISIT not necessarily an error */ - DBG(4, "%s, incomprx\n", pEnd->end_point.name); + DBG(4, "%s, incomprx\n", musb_ep->end_point.name); } if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { /* "should not happen"; likely RXPKTRDY pending for DMA */ DBG((wCsrVal & MGC_M_RXCSR_DMAENAB) ? 4 : 1, "%s busy, csr %04x\n", - pEnd->end_point.name, wCsrVal); + musb_ep->end_point.name, wCsrVal); goto done; } @@ -796,18 +796,18 @@ void musb_g_rx(struct musb *musb, u8 bEnd) musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_P_WZC_BITS | wCsrVal); - pRequest->actual += pEnd->dma->dwActualLength; + pRequest->actual += musb_ep->dma->dwActualLength; DBG(4, "RXCSR%d %04x, dma off, %04x, len %Zd, req %p\n", bEnd, wCsrVal, musb_readw(epio, MGC_O_HDRC_RXCSR), - pEnd->dma->dwActualLength, pRequest); + musb_ep->dma->dwActualLength, pRequest); #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_TUSB_OMAP_DMA) /* Autoclear doesn't clear RxPktRdy for short packets */ if ((dma->bDesiredMode == 0) || (dma->dwActualLength - & (pEnd->wPacketSize - 1))) { + & (musb_ep->wPacketSize - 1))) { /* ack the read! */ wCsrVal &= ~MGC_M_RXCSR_RXPKTRDY; musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); @@ -815,13 +815,13 @@ void musb_g_rx(struct musb *musb, u8 bEnd) /* incomplete, and not short? wait for next IN packet */ if ((pRequest->actual < pRequest->length) - && (pEnd->dma->dwActualLength - == pEnd->wPacketSize)) + && (musb_ep->dma->dwActualLength + == musb_ep->wPacketSize)) goto done; #endif - musb_g_giveback(pEnd, pRequest, 0); + musb_g_giveback(musb_ep, pRequest, 0); - pRequest = next_request(pEnd); + pRequest = next_request(musb_ep); if (!pRequest) goto done; @@ -838,8 +838,8 @@ void musb_g_rx(struct musb *musb, u8 bEnd) rxstate(musb, to_musb_request(pRequest)); else DBG(3, "packet waiting for %s%s request\n", - pEnd->desc ? "" : "inactive ", - pEnd->end_point.name); + musb_ep->desc ? "" : "inactive ", + musb_ep->end_point.name); done: return; @@ -851,7 +851,7 @@ static int musb_gadget_enable(struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) { unsigned long flags; - struct musb_ep *pEnd; + struct musb_ep *musb_ep; struct musb_hw_ep *hw_ep; void __iomem *regs; struct musb *musb; @@ -864,20 +864,20 @@ static int musb_gadget_enable(struct usb_ep *ep, if (!ep || !desc) return -EINVAL; - pEnd = to_musb_ep(ep); - hw_ep = pEnd->hw_ep; + musb_ep = to_musb_ep(ep); + hw_ep = musb_ep->hw_ep; regs = hw_ep->regs; - musb = pEnd->musb; + musb = musb_ep->musb; pBase = musb->pRegs; - bEnd = pEnd->bEndNumber; + bEnd = musb_ep->bEndNumber; spin_lock_irqsave(&musb->Lock, flags); - if (pEnd->desc) { + if (musb_ep->desc) { status = -EBUSY; goto fail; } - pEnd->type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; + musb_ep->type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; /* check direction and (later) maxpacket size against endpoint */ if ((desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) != bEnd) @@ -887,7 +887,7 @@ static int musb_gadget_enable(struct usb_ep *ep, tmp = le16_to_cpu(desc->wMaxPacketSize); if (tmp & ~0x07ff) goto fail; - pEnd->wPacketSize = tmp; + musb_ep->wPacketSize = tmp; /* enable the interrupts for the endpoint, set the endpoint * packet size (or fail), set the mode, clear the fifo @@ -897,8 +897,8 @@ static int musb_gadget_enable(struct usb_ep *ep, u16 wIntrTxE = musb_readw(pBase, MGC_O_HDRC_INTRTXE); if (hw_ep->bIsSharedFifo) - pEnd->is_in = 1; - if (!pEnd->is_in) + musb_ep->is_in = 1; + if (!musb_ep->is_in) goto fail; if (tmp > hw_ep->wMaxPacketSizeTx) goto fail; @@ -915,7 +915,7 @@ static int musb_gadget_enable(struct usb_ep *ep, if (musb_readw(regs, MGC_O_HDRC_TXCSR) & MGC_M_TXCSR_FIFONOTEMPTY) csr |= MGC_M_TXCSR_FLUSHFIFO; - if (pEnd->type == USB_ENDPOINT_XFER_ISOC) + if (musb_ep->type == USB_ENDPOINT_XFER_ISOC) csr |= MGC_M_TXCSR_P_ISO; /* set twice in case of double buffering */ @@ -927,8 +927,8 @@ static int musb_gadget_enable(struct usb_ep *ep, u16 wIntrRxE = musb_readw(pBase, MGC_O_HDRC_INTRRXE); if (hw_ep->bIsSharedFifo) - pEnd->is_in = 0; - if (pEnd->is_in) + musb_ep->is_in = 0; + if (musb_ep->is_in) goto fail; if (tmp > hw_ep->wMaxPacketSizeRx) goto fail; @@ -949,9 +949,9 @@ static int musb_gadget_enable(struct usb_ep *ep, } csr = MGC_M_RXCSR_FLUSHFIFO | MGC_M_RXCSR_CLRDATATOG; - if (pEnd->type == USB_ENDPOINT_XFER_ISOC) + if (musb_ep->type == USB_ENDPOINT_XFER_ISOC) csr |= MGC_M_RXCSR_P_ISO; - else if (pEnd->type == USB_ENDPOINT_XFER_INT) + else if (musb_ep->type == USB_ENDPOINT_XFER_INT) csr |= MGC_M_RXCSR_DISNYET; /* set twice in case of double buffering */ @@ -965,25 +965,25 @@ static int musb_gadget_enable(struct usb_ep *ep, if (is_dma_capable() && musb->pDmaController) { struct dma_controller *c = musb->pDmaController; - pEnd->dma = c->channel_alloc(c, hw_ep, + musb_ep->dma = c->channel_alloc(c, hw_ep, (desc->bEndpointAddress & USB_DIR_IN)); } else - pEnd->dma = NULL; + musb_ep->dma = NULL; - pEnd->desc = desc; - pEnd->busy = 0; + musb_ep->desc = desc; + musb_ep->busy = 0; status = 0; pr_debug("%s periph: enabled %s for %s %s, %smaxpacket %d\n", - musb_driver_name, pEnd->end_point.name, - ({ char *s; switch (pEnd->type) { + musb_driver_name, musb_ep->end_point.name, + ({ char *s; switch (musb_ep->type) { case USB_ENDPOINT_XFER_BULK: s = "bulk"; break; case USB_ENDPOINT_XFER_INT: s = "int"; break; default: s = "iso"; break; }; s; }), - pEnd->is_in ? "IN" : "OUT", - pEnd->dma ? "dma, " : "", - pEnd->wPacketSize); + musb_ep->is_in ? "IN" : "OUT", + musb_ep->dma ? "dma, " : "", + musb_ep->wPacketSize); schedule_work(&musb->irq_work); @@ -1000,20 +1000,20 @@ static int musb_gadget_disable(struct usb_ep *ep) unsigned long flags; struct musb *musb; u8 bEnd; - struct musb_ep *pEnd; + struct musb_ep *musb_ep; void __iomem *epio; int status = 0; - pEnd = to_musb_ep(ep); - musb = pEnd->musb; - bEnd = pEnd->bEndNumber; + musb_ep = to_musb_ep(ep); + musb = musb_ep->musb; + bEnd = musb_ep->bEndNumber; epio = musb->aLocalEnd[bEnd].regs; spin_lock_irqsave(&musb->Lock, flags); MGC_SelectEnd(musb->pRegs, bEnd); /* zero the endpoint sizes */ - if (pEnd->is_in) { + if (musb_ep->is_in) { u16 wIntrTxE = musb_readw(musb->pRegs, MGC_O_HDRC_INTRTXE); wIntrTxE &= ~(1 << bEnd); musb_writew(musb->pRegs, MGC_O_HDRC_INTRTXE, wIntrTxE); @@ -1025,16 +1025,16 @@ static int musb_gadget_disable(struct usb_ep *ep) musb_writew(epio, MGC_O_HDRC_RXMAXP, 0); } - pEnd->desc = NULL; + musb_ep->desc = NULL; /* abort all pending DMA and requests */ - nuke(pEnd, -ESHUTDOWN); + nuke(musb_ep, -ESHUTDOWN); schedule_work(&musb->irq_work); spin_unlock_irqrestore(&(musb->Lock), flags); - DBG(2, "%s\n", pEnd->end_point.name); + DBG(2, "%s\n", musb_ep->end_point.name); return status; } @@ -1096,7 +1096,7 @@ static void musb_ep_restart(struct musb *musb, struct musb_request *req) static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) { - struct musb_ep *pEnd; + struct musb_ep *musb_ep; struct musb_request *pRequest; struct musb *musb; int status = 0; @@ -1107,13 +1107,13 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, if (!req->buf) return -ENODATA; - pEnd = to_musb_ep(ep); - musb = pEnd->musb; + musb_ep = to_musb_ep(ep); + musb = musb_ep->musb; pRequest = to_musb_request(req); pRequest->musb = musb; - if (pRequest->ep != pEnd) + if (pRequest->ep != musb_ep) return -EINVAL; DBG(4, "<== to %s request=%p\n", ep->name, req); @@ -1121,10 +1121,10 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, /* request is mine now... */ pRequest->request.actual = 0; pRequest->request.status = -EINPROGRESS; - pRequest->bEnd = pEnd->bEndNumber; - pRequest->bTx = pEnd->is_in; + pRequest->bEnd = musb_ep->bEndNumber; + pRequest->bTx = musb_ep->is_in; - if (is_dma_capable() && pEnd->dma) { + if (is_dma_capable() && musb_ep->dma) { if (pRequest->request.dma == DMA_ADDR_INVALID) { pRequest->request.dma = dma_map_single( musb->controller, @@ -1151,7 +1151,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, spin_lock_irqsave(&musb->Lock, lockflags); /* don't queue if the ep is down */ - if (!pEnd->desc) { + if (!musb_ep->desc) { DBG(4, "req %p queued to %s while ep %s\n", req, ep->name, "disabled"); status = -ESHUTDOWN; @@ -1159,10 +1159,10 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, } /* add pRequest to the list */ - list_add_tail(&(pRequest->request.list), &(pEnd->req_list)); + list_add_tail(&(pRequest->request.list), &(musb_ep->req_list)); /* it this is the head of the queue, start i/o ... */ - if (!pEnd->busy && &pRequest->request.list == pEnd->req_list.next) + if (!musb_ep->busy && &pRequest->request.list == musb_ep->req_list.next) musb_ep_restart(musb, pRequest); cleanup: @@ -1172,18 +1172,18 @@ cleanup: static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) { - struct musb_ep *pEnd = to_musb_ep(ep); + struct musb_ep *musb_ep = to_musb_ep(ep); struct usb_request *r; unsigned long flags; int status = 0; - struct musb *musb = pEnd->musb; + struct musb *musb = musb_ep->musb; - if (!ep || !pRequest || to_musb_request(pRequest)->ep != pEnd) + if (!ep || !pRequest || to_musb_request(pRequest)->ep != musb_ep) return -EINVAL; spin_lock_irqsave(&musb->Lock, flags); - list_for_each_entry(r, &pEnd->req_list, list) { + list_for_each_entry(r, &musb_ep->req_list, list) { if (r == pRequest) break; } @@ -1194,25 +1194,25 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) } /* if the hardware doesn't have the request, easy ... */ - if (pEnd->req_list.next != &pRequest->list || pEnd->busy) - musb_g_giveback(pEnd, pRequest, -ECONNRESET); + if (musb_ep->req_list.next != &pRequest->list || musb_ep->busy) + musb_g_giveback(musb_ep, pRequest, -ECONNRESET); /* ... else abort the dma transfer ... */ - else if (is_dma_capable() && pEnd->dma) { + else if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; - MGC_SelectEnd(musb->pRegs, pEnd->bEndNumber); + MGC_SelectEnd(musb->pRegs, musb_ep->bEndNumber); if (c->channel_abort) - status = c->channel_abort(pEnd->dma); + status = c->channel_abort(musb_ep->dma); else status = -EBUSY; if (status == 0) - musb_g_giveback(pEnd, pRequest, -ECONNRESET); + musb_g_giveback(musb_ep, pRequest, -ECONNRESET); } else { /* NOTE: by sticking to easily tested hardware/driver states, * we leave counting of in-flight packets imprecise. */ - musb_g_giveback(pEnd, pRequest, -ECONNRESET); + musb_g_giveback(musb_ep, pRequest, -ECONNRESET); } done: @@ -1228,9 +1228,9 @@ done: */ int musb_gadget_set_halt(struct usb_ep *ep, int value) { - struct musb_ep *pEnd = to_musb_ep(ep); - u8 bEnd = pEnd->bEndNumber; - struct musb *musb = pEnd->musb; + struct musb_ep *musb_ep = to_musb_ep(ep); + u8 bEnd = musb_ep->bEndNumber; + struct musb *musb = musb_ep->musb; void __iomem *epio = musb->aLocalEnd[bEnd].regs; void __iomem *pBase; unsigned long flags; @@ -1244,7 +1244,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) spin_lock_irqsave(&musb->Lock, flags); - if ((USB_ENDPOINT_XFER_ISOC == pEnd->type)) { + if ((USB_ENDPOINT_XFER_ISOC == musb_ep->type)) { status = -EINVAL; goto done; } @@ -1252,8 +1252,8 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) MGC_SelectEnd(pBase, bEnd); /* cannot portably stall with non-empty FIFO */ - pRequest = to_musb_request(next_request(pEnd)); - if (value && pEnd->is_in) { + pRequest = to_musb_request(next_request(musb_ep)); + if (value && musb_ep->is_in) { wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsr & MGC_M_TXCSR_FIFONOTEMPTY) { DBG(3, "%s fifo busy, cannot halt\n", ep->name); @@ -1265,7 +1265,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) /* set/clear the stall and toggle bits */ DBG(2, "%s: %s stall\n", ep->name, value ? "set" : "clear"); - if (pEnd->is_in) { + if (musb_ep->is_in) { wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsr & MGC_M_TXCSR_FIFONOTEMPTY) wCsr |= MGC_M_TXCSR_FLUSHFIFO; @@ -1294,7 +1294,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) done: /* maybe start the first request in the queue */ - if (!pEnd->busy && !value && pRequest) { + if (!musb_ep->busy && !value && pRequest) { DBG(3, "restarting the request\n"); musb_ep_restart(musb, pRequest); } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep 2007-08-13 13:48 ` [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs Tony Lindgren 2007-08-14 9:23 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren 0 siblings, 2 replies; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pEnd with musb_ep when struct musb_hw_ep Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 8 +- drivers/usb/musb/musb_host.c | 140 ++++++++++++++++++++-------------------- drivers/usb/musb/musb_procfs.c | 28 ++++---- drivers/usb/musb/plat_uds.c | 24 ++++---- 4 files changed, 100 insertions(+), 100 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -1141,7 +1141,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) u8 bReqComplete; struct cppi *cppi; struct cppi_descriptor *bdPtr; - struct musb_hw_ep *pEnd = NULL; + struct musb_hw_ep *hw_ep = NULL; cppi = container_of(musb->pDmaController, struct cppi, Controller); @@ -1227,7 +1227,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) txChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; - pEnd = txChannel->hw_ep; + hw_ep = txChannel->hw_ep; txChannel->Channel.dwActualLength = txChannel->actualLen; @@ -1245,7 +1245,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) */ int csr; - csr = musb_readw(pEnd->regs, + csr = musb_readw(hw_ep->regs, MGC_O_HDRC_TXCSR); if (csr & MGC_M_TXCSR_TXPKTRDY) #endif @@ -1290,7 +1290,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) /* all segments completed! */ rxChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; - pEnd = rxChannel->hw_ep; + hw_ep = rxChannel->hw_ep; rxChannel->Channel.dwActualLength = rxChannel->actualLen; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -174,10 +174,10 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) void *pBuffer; void __iomem *pBase = musb->pRegs; struct urb *urb = next_urb(qh); - struct musb_hw_ep *pEnd = qh->hw_ep; + struct musb_hw_ep *hw_ep = qh->hw_ep; unsigned nPipe = urb->pipe; u8 bAddress = usb_pipedevice(nPipe); - int bEnd = pEnd->bLocalEnd; + int bEnd = hw_ep->bLocalEnd; /* initialize software qh state */ qh->offset = 0; @@ -188,7 +188,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) case USB_ENDPOINT_XFER_CONTROL: /* control transfers always start with SETUP */ is_in = 0; - pEnd->out_qh = qh; + hw_ep->out_qh = qh; musb->bEnd0Stage = MGC_END0_START; pBuffer = urb->setup_packet; dwLength = 8; @@ -216,10 +216,10 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) bEnd, pBuffer, dwLength); /* Configure endpoint */ - if (is_in || pEnd->bIsSharedFifo) - pEnd->in_qh = qh; + if (is_in || hw_ep->bIsSharedFifo) + hw_ep->in_qh = qh; else - pEnd->out_qh = qh; + hw_ep->out_qh = qh; musb_ep_program(musb, bEnd, urb, !is_in, pBuffer, dwLength); /* transmit may have more work: start it when it is time */ @@ -255,12 +255,12 @@ DBG(1,"SOF for %d\n", bEnd); default: start: DBG(4, "Start TX%d %s\n", bEnd, - pEnd->tx_channel ? "dma" : "pio"); + hw_ep->tx_channel ? "dma" : "pio"); - if (!pEnd->tx_channel) - musb_h_tx_start(pEnd); + if (!hw_ep->tx_channel) + musb_h_tx_start(hw_ep); else if (is_cppi_enabled() || tusb_dma_omap()) - cppi_host_txdma_start(pEnd); + cppi_host_txdma_start(hw_ep); } } @@ -425,19 +425,19 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) */ static void musb_advance_schedule(struct musb *musb, struct urb *urb, - struct musb_hw_ep *pEnd, int is_in) + struct musb_hw_ep *hw_ep, int is_in) { struct musb_qh *qh; - if (is_in || pEnd->bIsSharedFifo) - qh = pEnd->in_qh; + if (is_in || hw_ep->bIsSharedFifo) + qh = hw_ep->in_qh; else - qh = pEnd->out_qh; + qh = hw_ep->out_qh; qh = musb_giveback(qh, urb, 0); if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) { DBG(4, "... next ep%d %cX urb %p\n", - pEnd->bLocalEnd, is_in ? 'R' : 'T', + hw_ep->bLocalEnd, is_in ? 'R' : 'T', next_urb(qh)); musb_start_urb(musb, is_in, qh); } @@ -475,9 +475,9 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, u8 bDone = FALSE; u32 length; int do_flush = 0; - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; - void __iomem *epio = pEnd->regs; - struct musb_qh *qh = pEnd->in_qh; + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + void __iomem *epio = hw_ep->regs; + struct musb_qh *qh = hw_ep->in_qh; int nPipe = pUrb->pipe; void *buffer = pUrb->transfer_buffer; @@ -542,12 +542,12 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, pUrb->status = -EREMOTEIO; } - musb_read_fifo(pEnd, length, pBuffer); + musb_read_fifo(hw_ep, length, pBuffer); wCsr = musb_readw(epio, MGC_O_HDRC_RXCSR); wCsr |= MGC_M_RXCSR_H_WZC_BITS; if (unlikely(do_flush)) - musb_h_flush_rxfifo(pEnd, wCsr); + musb_h_flush_rxfifo(hw_ep, wCsr); else { /* REVISIT this assumes AUTOCLEAR is never set */ wCsr &= ~(MGC_M_RXCSR_RXPKTRDY | MGC_M_RXCSR_H_REQPKT); @@ -631,15 +631,15 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, struct dma_channel *pDmaChannel; u8 bDmaOk; void __iomem *pBase = musb->pRegs; - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; - void __iomem *epio = pEnd->regs; + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + void __iomem *epio = hw_ep->regs; struct musb_qh *qh; u16 wPacketSize; - if (!is_out || pEnd->bIsSharedFifo) - qh = pEnd->in_qh; + if (!is_out || hw_ep->bIsSharedFifo) + qh = hw_ep->in_qh; else - qh = pEnd->out_qh; + qh = hw_ep->out_qh; wPacketSize = qh->maxpacket; @@ -656,14 +656,14 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* candidate for DMA? */ pDmaController = musb->pDmaController; if (is_dma_capable() && bEnd && pDmaController) { - pDmaChannel = is_out ? pEnd->tx_channel : pEnd->rx_channel; + pDmaChannel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel; if (!pDmaChannel) { pDmaChannel = pDmaController->channel_alloc( - pDmaController, pEnd, is_out); + pDmaController, hw_ep, is_out); if (is_out) - pEnd->tx_channel = pDmaChannel; + hw_ep->tx_channel = pDmaChannel; else - pEnd->rx_channel = pDmaChannel; + hw_ep->rx_channel = pDmaChannel; } } else pDmaChannel = NULL; @@ -689,7 +689,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* ASSERT: TXCSR_DMAENAB was already cleared */ /* flush all old state, set default */ - musb_h_tx_flush_fifo(pEnd); + musb_h_tx_flush_fifo(hw_ep); csr &= ~(MGC_M_TXCSR_H_NAKTIMEOUT | MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_FRCDATATOG @@ -740,7 +740,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, if (can_bulk_split(musb, qh->type)) musb_writew(epio, MGC_O_HDRC_TXMAXP, wPacketSize - | ((pEnd->wMaxPacketSizeTx / + | ((hw_ep->wMaxPacketSizeTx / wPacketSize) - 1) << 11); else musb_writew(epio, MGC_O_HDRC_TXMAXP, @@ -754,7 +754,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, } if (can_bulk_split(musb, qh->type)) - wLoadCount = min((u32) pEnd->wMaxPacketSizeTx, + wLoadCount = min((u32) hw_ep->wMaxPacketSizeTx, dwLength); else wLoadCount = min((u32) wPacketSize, dwLength); @@ -801,9 +801,9 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, } else { pDmaController->channel_release(pDmaChannel); if (is_out) - pEnd->tx_channel = NULL; + hw_ep->tx_channel = NULL; else - pEnd->rx_channel = NULL; + hw_ep->rx_channel = NULL; pDmaChannel = NULL; } } @@ -841,7 +841,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, wLoadCount = 0; } else { pDmaController->channel_release(pDmaChannel); - pDmaChannel = pEnd->tx_channel = NULL; + pDmaChannel = hw_ep->tx_channel = NULL; /* REVISIT there's an error path here that * needs handling: can't do dma, but @@ -855,7 +855,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* PIO to load FIFO */ qh->segsize = wLoadCount; - musb_write_fifo(pEnd, wLoadCount, pBuffer); + musb_write_fifo(hw_ep, wLoadCount, pBuffer); wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); wCsr &= ~(MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_DMAMODE @@ -874,8 +874,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, } else { u16 csr; - if (pEnd->rx_reinit) { - musb_rx_reinit(musb, qh, pEnd); + if (hw_ep->rx_reinit) { + musb_rx_reinit(musb, qh, hw_ep); /* init new state: toggle and NYET, maybe DMA later */ if (usb_gettoggle(pUrb->dev, qh->epnum, 0)) @@ -887,13 +887,13 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, csr |= MGC_M_RXCSR_DISNYET; } else { - csr = musb_readw(pEnd->regs, MGC_O_HDRC_RXCSR); + csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); if (csr & (MGC_M_RXCSR_RXPKTRDY | MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_H_REQPKT)) ERR("broken !rx_reinit, ep%d csr %04x\n", - pEnd->bLocalEnd, csr); + hw_ep->bLocalEnd, csr); /* scrub any stale state, leaving toggle alone */ csr &= MGC_M_RXCSR_DISNYET; @@ -908,8 +908,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, qh->segsize = dwLength; /* AUTOREQ is in a DMA register */ - musb_writew(pEnd->regs, MGC_O_HDRC_RXCSR, csr); - csr = musb_readw(pEnd->regs, + musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, csr); + csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); /* unless caller treats short rx transfers as @@ -924,7 +924,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, if (!bDmaOk) { pDmaController->channel_release( pDmaChannel); - pDmaChannel = pEnd->rx_channel = NULL; + pDmaChannel = hw_ep->rx_channel = NULL; } else csr |= MGC_M_RXCSR_DMAENAB; } @@ -932,8 +932,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, csr |= MGC_M_RXCSR_H_REQPKT; DBG(7, "RXCSR%d := %04x\n", bEnd, csr); - musb_writew(pEnd->regs, MGC_O_HDRC_RXCSR, csr); - csr = musb_readw(pEnd->regs, MGC_O_HDRC_RXCSR); + musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, csr); + csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); } } @@ -948,8 +948,8 @@ static int musb_h_ep0_continue(struct musb *musb, int bMore = FALSE; u8 *pFifoDest = NULL; u16 wFifoCount = 0; - struct musb_hw_ep *pEnd = musb->control_ep; - struct musb_qh *qh = pEnd->in_qh; + struct musb_hw_ep *hw_ep = musb->control_ep; + struct musb_qh *qh = hw_ep->in_qh; struct usb_ctrlrequest *pRequest; switch (musb->bEnd0Stage) { @@ -960,7 +960,7 @@ static int musb_h_ep0_continue(struct musb *musb, if (wFifoCount < wCount) pUrb->status = -EOVERFLOW; - musb_read_fifo(pEnd, wFifoCount, pFifoDest); + musb_read_fifo(hw_ep, wFifoCount, pFifoDest); pUrb->actual_length += wFifoCount; if (wCount < qh->maxpacket) { @@ -998,7 +998,7 @@ static int musb_h_ep0_continue(struct musb *musb, + pUrb->actual_length); DBG(3, "Sending %d bytes to %p\n", wFifoCount, pFifoDest); - musb_write_fifo(pEnd, wFifoCount, pFifoDest); + musb_write_fifo(hw_ep, wFifoCount, pFifoDest); pUrb->actual_length += wFifoCount; bMore = TRUE; @@ -1024,9 +1024,9 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) u16 wCsrVal, wCount; int status = 0; void __iomem *pBase = musb->pRegs; - struct musb_hw_ep *pEnd = musb->control_ep; - void __iomem *epio = pEnd->regs; - struct musb_qh *qh = pEnd->in_qh; + struct musb_hw_ep *hw_ep = musb->control_ep; + void __iomem *epio = hw_ep->regs; + struct musb_qh *qh = hw_ep->in_qh; u8 bComplete = FALSE; irqreturn_t retval = IRQ_NONE; @@ -1139,7 +1139,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* call completion handler if done */ if (bComplete) - musb_advance_schedule(musb, pUrb, pEnd, 1); + musb_advance_schedule(musb, pUrb, hw_ep, 1); done: return retval; } @@ -1170,9 +1170,9 @@ void musb_host_tx(struct musb *musb, u8 bEnd) size_t wLength = 0; u8 *pBuffer = NULL; struct urb *pUrb; - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; - void __iomem *epio = pEnd->regs; - struct musb_qh *qh = pEnd->out_qh; + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + void __iomem *epio = hw_ep->regs; + struct musb_qh *qh = hw_ep->out_qh; u32 status = 0; void __iomem *pBase = musb->pRegs; struct dma_channel *dma; @@ -1189,7 +1189,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) } nPipe = pUrb->pipe; - dma = is_dma_capable() ? pEnd->tx_channel : NULL; + dma = is_dma_capable() ? hw_ep->tx_channel : NULL; DBG(4, "OUT/TX%d end, csr %04x%s\n", bEnd, wTxCsrVal, dma ? ", dma" : ""); @@ -1233,7 +1233,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) /* do the proper sequence to abort the transfer in the * usb core; the dma engine should already be stopped. */ - musb_h_tx_flush_fifo(pEnd); + musb_h_tx_flush_fifo(hw_ep); wTxCsrVal &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_H_ERROR @@ -1309,18 +1309,18 @@ void musb_host_tx(struct musb *musb, u8 bEnd) /* set status */ pUrb->status = status; pUrb->actual_length = qh->offset; - musb_advance_schedule(musb, pUrb, pEnd, USB_DIR_OUT); + musb_advance_schedule(musb, pUrb, hw_ep, USB_DIR_OUT); } else if (!(wTxCsrVal & MGC_M_TXCSR_DMAENAB)) { // WARN_ON(!pBuffer); - /* REVISIT: some docs say that when pEnd->tx_double_buffered, + /* REVISIT: some docs say that when hw_ep->tx_double_buffered, * (and presumably, fifo is not half-full) we should write TWO * packets before updating TXCSR ... other docs disagree ... */ /* PIO: start next packet in this URB */ wLength = min(qh->maxpacket, (u16) wLength); - musb_write_fifo(pEnd, wLength, pBuffer); + musb_write_fifo(hw_ep, wLength, pBuffer); qh->segsize = wLength; MGC_SelectEnd(pBase, bEnd); @@ -1380,9 +1380,9 @@ finish: void musb_host_rx(struct musb *musb, u8 bEnd) { struct urb *pUrb; - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; - void __iomem *epio = pEnd->regs; - struct musb_qh *qh = pEnd->in_qh; + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + void __iomem *epio = hw_ep->regs; + struct musb_qh *qh = hw_ep->in_qh; size_t xfer_len; void __iomem *pBase = musb->pRegs; int nPipe; @@ -1395,7 +1395,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) MGC_SelectEnd(pBase, bEnd); pUrb = next_urb(qh); - dma = is_dma_capable() ? pEnd->rx_channel : NULL; + dma = is_dma_capable() ? hw_ep->rx_channel : NULL; status = 0; xfer_len = 0; @@ -1408,7 +1408,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) */ DBG(3, "BOGUS RX%d ready, csr %04x, count %d\n", bEnd, wVal, musb_readw(epio, MGC_O_HDRC_RXCOUNT)); - musb_h_flush_rxfifo(pEnd, MGC_M_RXCSR_CLRDATATOG); + musb_h_flush_rxfifo(hw_ep, MGC_M_RXCSR_CLRDATATOG); return; } @@ -1464,7 +1464,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) (void) musb->pDmaController->channel_abort(dma); xfer_len = dma->dwActualLength; } - musb_h_flush_rxfifo(pEnd, 0); + musb_h_flush_rxfifo(hw_ep, 0); musb_writeb(epio, MGC_O_HDRC_RXINTERVAL, 0); bDone = TRUE; goto finish; @@ -1513,7 +1513,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) | MGC_M_RXCSR_H_AUTOREQ | MGC_M_RXCSR_AUTOCLEAR | MGC_M_RXCSR_RXPKTRDY); - musb_writew(pEnd->regs, MGC_O_HDRC_RXCSR, wVal); + musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, wVal); #ifdef CONFIG_USB_INVENTRA_DMA /* bDone if pUrb buffer is full or short packet is recd */ @@ -1626,7 +1626,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) if (!status) { c->channel_release(dma); - dma = pEnd->rx_channel = NULL; + dma = hw_ep->rx_channel = NULL; /* REVISIT reset CSR */ } } @@ -1645,7 +1645,7 @@ finish: if (bDone) { if (pUrb->status == -EINPROGRESS) pUrb->status = status; - musb_advance_schedule(musb, pUrb, pEnd, USB_DIR_IN); + musb_advance_schedule(musb, pUrb, hw_ep, USB_DIR_IN); } } --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -237,14 +237,14 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) { int code = 0; char *buf = aBuffer; - struct musb_hw_ep *pEnd = &musb->aLocalEnd[bEnd]; + struct musb_hw_ep *hw_ep = &musb->aLocalEnd[bEnd]; do { MGC_SelectEnd(musb->pRegs, bEnd); #ifdef CONFIG_USB_MUSB_HDRC_HCD if (is_host_active(musb)) { int dump_rx, dump_tx; - void __iomem *regs = pEnd->regs; + void __iomem *regs = hw_ep->regs; /* TEMPORARY (!) until we have a real periodic * schedule tree ... @@ -255,7 +255,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) */ dump_tx = !list_empty(&musb->control); dump_rx = 0; - } else if (pEnd == musb->bulk_ep) { + } else if (hw_ep == musb->bulk_ep) { dump_tx = !list_empty(&musb->out_bulk); dump_rx = !list_empty(&musb->in_bulk); } else if (musb->periodic[bEnd]) { @@ -277,7 +277,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) "dev %d hub %d port %d" "\n", bEnd, - pEnd->rx_double_buffered + hw_ep->rx_double_buffered ? "2buf" : "1buf", musb_readw(regs, MGC_O_HDRC_RXCSR), musb_readb(regs, MGC_O_HDRC_RXINTERVAL), @@ -302,7 +302,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) if (is_cppi_enabled() && bEnd - && pEnd->rx_channel) { + && hw_ep->rx_channel) { unsigned cppi = bEnd - 1; unsigned off1 = cppi << 2; void __iomem *base; @@ -337,7 +337,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) max -= code; } - if (pEnd == musb->bulk_ep + if (hw_ep == musb->bulk_ep && !list_empty( &musb->in_bulk)) { code = dump_queue(&musb->in_bulk, @@ -365,7 +365,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) "dev %d hub %d port %d" "\n", bEnd, - pEnd->tx_double_buffered + hw_ep->tx_double_buffered ? "2buf" : "1buf", musb_readw(regs, MGC_O_HDRC_TXCSR), musb_readb(regs, MGC_O_HDRC_TXINTERVAL), @@ -390,7 +390,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) if (is_cppi_enabled() && bEnd - && pEnd->tx_channel) { + && hw_ep->tx_channel) { unsigned cppi = bEnd - 1; void __iomem *base; void __iomem *ram; @@ -418,7 +418,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) max -= code; } - if (pEnd == musb->control_ep + if (hw_ep == musb->control_ep && !list_empty( &musb->control)) { code = dump_queue(&musb->control, @@ -428,7 +428,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) code = min(code, (int) max); buf += code; max -= code; - } else if (pEnd == musb->bulk_ep + } else if (hw_ep == musb->bulk_ep && !list_empty( &musb->out_bulk)) { code = dump_queue(&musb->out_bulk, @@ -454,16 +454,16 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) if (is_peripheral_active(musb)) { code = 0; - if (pEnd->ep_in.desc || !bEnd) { - code = dump_ep(&pEnd->ep_in, buf, max); + if (hw_ep->ep_in.desc || !bEnd) { + code = dump_ep(&hw_ep->ep_in, buf, max); if (code <= 0) break; code = min(code, (int) max); buf += code; max -= code; } - if (pEnd->ep_out.desc) { - code = dump_ep(&pEnd->ep_out, buf, max); + if (hw_ep->ep_out.desc) { + code = dump_ep(&hw_ep->ep_out, buf, max); if (code <= 0) break; code = min(code, (int) max); --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1179,7 +1179,7 @@ static int __init ep_config_from_table(struct musb *musb) static int __init ep_config_from_hw(struct musb *musb) { u8 bEnd = 0, reg; - struct musb_hw_ep *pEnd; + struct musb_hw_ep *hw_ep; void *pBase = musb->pRegs; DBG(2, "<== static silicon ep config\n"); @@ -1188,10 +1188,10 @@ static int __init ep_config_from_hw(struct musb *musb) for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) { MGC_SelectEnd(pBase, bEnd); - pEnd = musb->aLocalEnd + bEnd; + hw_ep = musb->aLocalEnd + bEnd; /* read from core using indexed model */ - reg = musb_readb(pEnd->regs, 0x10 + MGC_O_HDRC_FIFOSIZE); + reg = musb_readb(hw_ep->regs, 0x10 + MGC_O_HDRC_FIFOSIZE); if (!reg) { /* 0's returned when no more endpoints */ break; @@ -1199,24 +1199,24 @@ static int __init ep_config_from_hw(struct musb *musb) musb->bEndCount++; musb->wEndMask |= (1 << bEnd); - pEnd->wMaxPacketSizeTx = 1 << (reg & 0x0f); + hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f); /* shared TX/RX FIFO? */ if ((reg & 0xf0) == 0xf0) { - pEnd->wMaxPacketSizeRx = pEnd->wMaxPacketSizeTx; - pEnd->bIsSharedFifo = TRUE; + hw_ep->wMaxPacketSizeRx = hw_ep->wMaxPacketSizeTx; + hw_ep->bIsSharedFifo = TRUE; continue; } else { - pEnd->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); - pEnd->bIsSharedFifo = FALSE; + hw_ep->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); + hw_ep->bIsSharedFifo = FALSE; } - /* FIXME set up pEnd->{rx,tx}_double_buffered */ + /* FIXME set up hw_ep->{rx,tx}_double_buffered */ #ifdef CONFIG_USB_MUSB_HDRC_HCD /* pick an RX/TX endpoint for bulk */ - if (pEnd->wMaxPacketSizeTx < 512 - || pEnd->wMaxPacketSizeRx < 512) + if (hw_ep->wMaxPacketSizeTx < 512 + || hw_ep->wMaxPacketSizeRx < 512) continue; /* REVISIT: this algorithm is lazy, we should at least @@ -1224,7 +1224,7 @@ static int __init ep_config_from_hw(struct musb *musb) */ if (musb->bulk_ep) continue; - musb->bulk_ep = pEnd; + musb->bulk_ep = hw_ep; #endif } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs 2007-08-13 13:48 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase Tony Lindgren 2007-08-14 9:23 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren 1 sibling, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pRegs with mregs Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/davinci.c | 10 +++--- drivers/usb/musb/g_ep0.c | 12 ++++---- drivers/usb/musb/musb_gadget.c | 42 ++++++++++++++-------------- drivers/usb/musb/musb_host.c | 16 +++++----- drivers/usb/musb/musb_procfs.c | 18 ++++++------ drivers/usb/musb/musbdefs.h | 4 +- drivers/usb/musb/musbhdrc.h | 2 +- drivers/usb/musb/omap2430.c | 6 ++-- drivers/usb/musb/plat_uds.c | 54 +++++++++++++++++++------------------- drivers/usb/musb/tusb6010.c | 14 +++++----- drivers/usb/musb/tusb6010_omap.c | 4 +- drivers/usb/musb/virthub.c | 12 ++++---- 12 files changed, 97 insertions(+), 97 deletions(-) --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -116,7 +116,7 @@ void musb_platform_disable(struct musb *musb) DAVINCI_USB_USBINT_MASK | DAVINCI_USB_TXINT_MASK | DAVINCI_USB_RXINT_MASK); - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, 0); + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, 0); musb_writel(musb->ctrl_base, DAVINCI_USB_EOI_REG, 0); if (is_dma_capable() && !dma_off) @@ -200,7 +200,7 @@ static struct timer_list otg_workaround; static void otg_timer(unsigned long _musb) { struct musb *musb = (void *)_musb; - void *__iomem mregs = musb->pRegs; + void *__iomem mregs = musb->mregs; u8 devctl; unsigned long flags; @@ -309,7 +309,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) */ if (tmp & (DAVINCI_INTR_DRVVBUS << DAVINCI_USB_USBINT_SHIFT)) { int drvvbus = musb_readl(tibase, DAVINCI_USB_STAT_REG); - void *__iomem mregs = musb->pRegs; + void *__iomem mregs = musb->mregs; u8 devctl = musb_readb(mregs, MGC_O_HDRC_DEVCTL); int err = musb->int_usb & MGC_M_INTR_VBUSERROR; @@ -381,7 +381,7 @@ int __init musb_platform_init(struct musb *musb) void *__iomem tibase = musb->ctrl_base; u32 revision; - musb->pRegs += DAVINCI_BASE_OFFSET; + musb->mregs += DAVINCI_BASE_OFFSET; #if 0 /* REVISIT there's something odd about clocking, this * didn't appear do the job ... @@ -440,7 +440,7 @@ int musb_platform_exit(struct musb *musb) * long time to fall, especially on EVM with huge C133. */ do { - devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); if (!(devctl & MGC_M_DEVCTL_VBUS)) break; if ((devctl & MGC_M_DEVCTL_VBUS) != warn) { --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -74,7 +74,7 @@ static int service_tx_status_request( struct musb *musb, const struct usb_ctrlrequest *pControlRequest) { - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; int handled = 1; u8 bResult[2], bEnd = 0; const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; @@ -205,7 +205,7 @@ static void musb_g_ep0_giveback(struct musb *musb, struct usb_request *req) */ static inline void musb_try_b_hnp_enable(struct musb *musb) { - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; u8 devctl; DBG(1, "HNP: Setting HR\n"); @@ -230,7 +230,7 @@ __releases(musb->Lock) __acquires(musb->Lock) { int handled = -EINVAL; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; /* the gadget driver handles everything except what we MUST handle */ @@ -600,7 +600,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) { u16 wCsrVal; u16 wCount; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; void __iomem *regs = musb->aLocalEnd[0].regs; irqreturn_t retval = IRQ_NONE; @@ -864,7 +864,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) ep->name, ep->is_in ? "IN/TX" : "OUT/RX", req->request.length); - MGC_SelectEnd(musb->pRegs, 0); + MGC_SelectEnd(musb->mregs, 0); /* sequence #1, IN ... start writing the data */ if (musb->ep0_state == MGC_END0_STAGE_TX) @@ -917,7 +917,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) ep = to_musb_ep(e); musb = ep->musb; - base = musb->pRegs; + base = musb->mregs; regs = musb->control_ep->regs; spin_lock_irqsave(&musb->Lock, flags); --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -406,7 +406,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) { u16 wCsrVal; struct usb_request *pRequest; - u8 __iomem *pBase = musb->pRegs; + u8 __iomem *pBase = musb->mregs; struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_in; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct dma_channel *dma; @@ -736,7 +736,7 @@ void musb_g_rx(struct musb *musb, u8 bEnd) { u16 wCsrVal; struct usb_request *pRequest; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct dma_channel *dma; @@ -868,7 +868,7 @@ static int musb_gadget_enable(struct usb_ep *ep, hw_ep = musb_ep->hw_ep; regs = hw_ep->regs; musb = musb_ep->musb; - pBase = musb->pRegs; + pBase = musb->mregs; bEnd = musb_ep->bEndNumber; spin_lock_irqsave(&musb->Lock, flags); @@ -1010,18 +1010,18 @@ static int musb_gadget_disable(struct usb_ep *ep) epio = musb->aLocalEnd[bEnd].regs; spin_lock_irqsave(&musb->Lock, flags); - MGC_SelectEnd(musb->pRegs, bEnd); + MGC_SelectEnd(musb->mregs, bEnd); /* zero the endpoint sizes */ if (musb_ep->is_in) { - u16 wIntrTxE = musb_readw(musb->pRegs, MGC_O_HDRC_INTRTXE); + u16 wIntrTxE = musb_readw(musb->mregs, MGC_O_HDRC_INTRTXE); wIntrTxE &= ~(1 << bEnd); - musb_writew(musb->pRegs, MGC_O_HDRC_INTRTXE, wIntrTxE); + musb_writew(musb->mregs, MGC_O_HDRC_INTRTXE, wIntrTxE); musb_writew(epio, MGC_O_HDRC_TXMAXP, 0); } else { - u16 wIntrRxE = musb_readw(musb->pRegs, MGC_O_HDRC_INTRRXE); + u16 wIntrRxE = musb_readw(musb->mregs, MGC_O_HDRC_INTRRXE); wIntrRxE &= ~(1 << bEnd); - musb_writew(musb->pRegs, MGC_O_HDRC_INTRRXE, wIntrRxE); + musb_writew(musb->mregs, MGC_O_HDRC_INTRRXE, wIntrRxE); musb_writew(epio, MGC_O_HDRC_RXMAXP, 0); } @@ -1086,7 +1086,7 @@ static void musb_ep_restart(struct musb *musb, struct musb_request *req) req->bTx ? "TX/IN" : "RX/OUT", &req->request, req->request.length, req->bEnd); - MGC_SelectEnd(musb->pRegs, req->bEnd); + MGC_SelectEnd(musb->mregs, req->bEnd); if (req->bTx) txstate(musb, req); else @@ -1201,7 +1201,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) else if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; - MGC_SelectEnd(musb->pRegs, musb_ep->bEndNumber); + MGC_SelectEnd(musb->mregs, musb_ep->bEndNumber); if (c->channel_abort) status = c->channel_abort(musb_ep->dma); else @@ -1240,7 +1240,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) if (!ep) return -EINVAL; - pBase = musb->pRegs; + pBase = musb->mregs; spin_lock_irqsave(&musb->Lock, flags); @@ -1312,7 +1312,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) if (musb_ep->desc && !musb_ep->is_in) { struct musb *musb = musb_ep->musb; int bEnd = musb_ep->bEndNumber; - void __iomem *mbase = musb->pRegs; + void __iomem *mbase = musb->mregs; unsigned long flags; spin_lock_irqsave(&musb->Lock, flags); @@ -1336,7 +1336,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) unsigned long flags; u16 wCsr, wIntrTxE; - mbase = musb->pRegs; + mbase = musb->mregs; spin_lock_irqsave(&musb->Lock, flags); MGC_SelectEnd(mbase, (u8) nEnd); @@ -1383,13 +1383,13 @@ static int musb_gadget_get_frame(struct usb_gadget *gadget) { struct musb *musb = gadget_to_musb(gadget); - return (int)musb_readw(musb->pRegs, MGC_O_HDRC_FRAME); + return (int)musb_readw(musb->mregs, MGC_O_HDRC_FRAME); } static int musb_gadget_wakeup(struct usb_gadget *gadget) { struct musb *musb = gadget_to_musb(gadget); - void __iomem *mregs = musb->pRegs; + void __iomem *mregs = musb->mregs; unsigned long flags; int status = -EINVAL; u8 power, devctl; @@ -1467,7 +1467,7 @@ static void musb_pullup(struct musb *musb, int is_on) { u8 power; - power = musb_readb(musb->pRegs, MGC_O_HDRC_POWER); + power = musb_readb(musb->mregs, MGC_O_HDRC_POWER); if (is_on) power |= MGC_M_POWER_SOFTCONN; else @@ -1477,7 +1477,7 @@ static void musb_pullup(struct musb *musb, int is_on) DBG(3, "gadget %s D+ pullup %s\n", musb->pGadgetDriver->function, is_on ? "on" : "off"); - musb_writeb(musb->pRegs, MGC_O_HDRC_POWER, power); + musb_writeb(musb->mregs, MGC_O_HDRC_POWER, power); } #if 0 @@ -1799,7 +1799,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) for (i = 0, hw_ep = musb->aLocalEnd; i < musb->bEndCount; i++, hw_ep++) { - MGC_SelectEnd(musb->pRegs, i); + MGC_SelectEnd(musb->mregs, i); if (hw_ep->bIsSharedFifo /* || !bEnd */) { nuke(&hw_ep->ep_in, -ESHUTDOWN); } else { @@ -1902,7 +1902,7 @@ void musb_g_suspend(struct musb *musb) { u8 devctl; - devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); DBG(3, "devctl %02x\n", devctl); switch (musb->xceiv.state) { @@ -1936,7 +1936,7 @@ void musb_g_wakeup(struct musb *musb) /* called when VBUS drops below session threshold, and in other cases */ void musb_g_disconnect(struct musb *musb) { - void __iomem *mregs = musb->pRegs; + void __iomem *mregs = musb->mregs; u8 devctl = musb_readb(mregs, MGC_O_HDRC_DEVCTL); DBG(3, "devctl %02x\n", devctl); @@ -1979,7 +1979,7 @@ void musb_g_reset(struct musb *musb) __releases(musb->Lock) __acquires(musb->Lock) { - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; u8 devctl = musb_readb(pBase, MGC_O_HDRC_DEVCTL); u8 power; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -172,7 +172,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) u16 wFrame; u32 dwLength; void *pBuffer; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; struct urb *urb = next_urb(qh); struct musb_hw_ep *hw_ep = qh->hw_ep; unsigned nPipe = urb->pipe; @@ -607,7 +607,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) musb_writeb(ep->target_regs, MGC_O_HDRC_RXHUBPORT, qh->h_port_reg); } else - musb_writeb(musb->pRegs, MGC_O_HDRC_FADDR, qh->addr_reg); + musb_writeb(musb->mregs, MGC_O_HDRC_FADDR, qh->addr_reg); /* protocol/endpoint, interval/NAKlimit, i/o size */ musb_writeb(ep->regs, MGC_O_HDRC_RXTYPE, qh->type_reg); @@ -630,7 +630,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, struct dma_controller *pDmaController; struct dma_channel *pDmaChannel; u8 bDmaOk; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; void __iomem *epio = hw_ep->regs; struct musb_qh *qh; @@ -1023,7 +1023,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) struct urb *pUrb; u16 wCsrVal, wCount; int status = 0; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; struct musb_hw_ep *hw_ep = musb->control_ep; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; @@ -1174,7 +1174,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->out_qh; u32 status = 0; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; struct dma_channel *dma; pUrb = next_urb(qh); @@ -1384,7 +1384,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; size_t xfer_len; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; int nPipe; u16 wRxCsrVal, wVal; u8 bIsochError = FALSE; @@ -1904,7 +1904,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in) struct musb_hw_ep *ep = qh->hw_ep; void __iomem *epio = ep->regs; unsigned hw_end = ep->bLocalEnd; - void __iomem *regs = ep->musb->pRegs; + void __iomem *regs = ep->musb->mregs; u16 csr; int status = 0; @@ -2107,7 +2107,7 @@ static int musb_h_get_frame_number(struct usb_hcd *hcd) { struct musb *musb = hcd_to_musb(hcd); - return musb_readw(musb->pRegs, MGC_O_HDRC_FRAME); + return musb_readw(musb->mregs, MGC_O_HDRC_FRAME); } static int musb_h_start(struct usb_hcd *hcd) --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -240,7 +240,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) struct musb_hw_ep *hw_ep = &musb->aLocalEnd[bEnd]; do { - MGC_SelectEnd(musb->pRegs, bEnd); + MGC_SelectEnd(musb->mregs, bEnd); #ifdef CONFIG_USB_MUSB_HDRC_HCD if (is_host_active(musb)) { int dump_rx, dump_tx; @@ -284,13 +284,13 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) musb_readw(regs, MGC_O_HDRC_RXMAXP), musb_readb(regs, MGC_O_HDRC_RXTYPE), /* FIXME: assumes multipoint */ - musb_readb(musb->pRegs, + musb_readb(musb->mregs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_RXFUNCADDR)), - musb_readb(musb->pRegs, + musb_readb(musb->mregs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_RXHUBADDR)), - musb_readb(musb->pRegs, + musb_readb(musb->mregs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_RXHUBPORT)) ); @@ -372,13 +372,13 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) musb_readw(regs, MGC_O_HDRC_TXMAXP), musb_readb(regs, MGC_O_HDRC_TXTYPE), /* FIXME: assumes multipoint */ - musb_readb(musb->pRegs, + musb_readb(musb->mregs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXFUNCADDR)), - musb_readb(musb->pRegs, + musb_readb(musb->mregs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBADDR)), - musb_readb(musb->pRegs, + musb_readb(musb->mregs, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBPORT)) ); @@ -485,7 +485,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) static int dump_header_stats(struct musb *musb, char *buffer) { int code, count = 0; - const void __iomem *pBase = musb->pRegs; + const void __iomem *pBase = musb->mregs; *buffer = 0; count = sprintf(buffer, "Status: %sHDRC, Mode=%s " @@ -653,7 +653,7 @@ static int musb_proc_write(struct file *file, const char __user *buffer, char cmd; u8 bReg; struct musb *musb = (struct musb *)data; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; /* MOD_INC_USE_COUNT; */ --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -242,7 +242,7 @@ enum musb_g_ep0_state { { (_pthis)->bIsHost=FALSE; } #define test_devctl_hst_mode(_x) \ - (musb_readb((_x)->pRegs, MGC_O_HDRC_DEVCTL)&MGC_M_DEVCTL_HM) + (musb_readb((_x)->mregs, MGC_O_HDRC_DEVCTL)&MGC_M_DEVCTL_HM) #define MUSB_MODE(musb) ((musb)->bIsHost ? "Host" : "Peripheral") @@ -380,7 +380,7 @@ struct musb { struct device *controller; void __iomem *ctrl_base; - void __iomem *pRegs; + void __iomem *mregs; #ifdef CONFIG_USB_TUSB6010 dma_addr_t async; --- a/drivers/usb/musb/musbhdrc.h +++ b/drivers/usb/musb/musbhdrc.h @@ -61,7 +61,7 @@ #define MGC_O_HDRC_INDEX 0x0E /* 8 bit */ #define MGC_O_HDRC_TESTMODE 0x0F /* 8 bit */ -/* Get offset for a given FIFO from musb->pRegs */ +/* Get offset for a given FIFO from musb->mregs */ #ifdef CONFIG_USB_TUSB6010 #define MUSB_FIFO_OFFSET(epnum) (0x200 + ((epnum) * 0x20)) #else --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -59,7 +59,7 @@ static void omap_set_vbus(struct musb *musb, int is_on) * that must be ignored. */ - devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); if (is_on) { musb->is_active = 1; @@ -81,12 +81,12 @@ static void omap_set_vbus(struct musb *musb, int is_on) MUSB_DEV_MODE(musb); } - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, devctl); + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, devctl); DBG(1, "VBUS %s, devctl %02x " /* otg %3x conf %08x prcm %08x */ "\n", otg_state_string(musb), - musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL)); + musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL)); } static int omap_set_power(struct otg_transceiver *x, unsigned mA) { --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -273,7 +273,7 @@ void musb_load_testpacket(struct musb *musb) { void __iomem *regs = musb->aLocalEnd[0].regs; - MGC_SelectEnd(musb->pRegs, 0); + MGC_SelectEnd(musb->mregs, 0); musb_write_fifo(musb->control_ep, sizeof(musb_test_packet), musb_test_packet); musb_writew(regs, MGC_O_HDRC_CSR0, MGC_M_CSR0_TXPKTRDY); @@ -315,7 +315,7 @@ static DEFINE_TIMER(musb_otg_timer, musb_otg_timer_func, 0, 0); void musb_hnp_stop(struct musb *musb) { struct usb_hcd *hcd = musb_to_hcd(musb); - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; u8 reg; switch (musb->xceiv.state) { @@ -365,7 +365,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, { irqreturn_t handled = IRQ_NONE; #ifdef CONFIG_USB_MUSB_HDRC_HCD - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; #endif DBG(3, "<== Power=%02x, DevCtl=%02x, bIntrUSB=0x%x\n", power, devctl, @@ -660,7 +660,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, * to support ISO transfers yet. */ if (bIntrUSB & MGC_M_INTR_SOF) { - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; struct musb_hw_ep *ep; u8 bEnd; u16 wFrame; @@ -785,7 +785,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, */ void musb_start(struct musb *musb) { - void __iomem *regs = musb->pRegs; + void __iomem *regs = musb->mregs; u8 devctl = musb_readb(regs, MGC_O_HDRC_DEVCTL); DBG(2, "<== devctl %02x\n", devctl); @@ -835,7 +835,7 @@ void musb_start(struct musb *musb) static void musb_generic_disable(struct musb *musb) { - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; u16 temp; /* disable interrupts */ @@ -1022,7 +1022,7 @@ static int __init fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, const struct fifo_cfg *cfg, u16 offset) { - void __iomem *mbase = musb->pRegs; + void __iomem *mbase = musb->mregs; int size = 0; u16 maxpacket = cfg->maxpacket; u16 c_off = offset >> 3; @@ -1180,7 +1180,7 @@ static int __init ep_config_from_hw(struct musb *musb) { u8 bEnd = 0, reg; struct musb_hw_ep *hw_ep; - void *pBase = musb->pRegs; + void *pBase = musb->mregs; DBG(2, "<== static silicon ep config\n"); @@ -1252,7 +1252,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) char *type; u16 wRelease, wRelMajor, wRelMinor; char aInfo[78], aRevision[32], aDate[12]; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; int status = 0; int i; @@ -1421,9 +1421,9 @@ static irqreturn_t generic_interrupt(int irq, void *__hci) spin_lock_irqsave(&musb->Lock, flags); - musb->int_usb = musb_readb(musb->pRegs, MGC_O_HDRC_INTRUSB); - musb->int_tx = musb_readw(musb->pRegs, MGC_O_HDRC_INTRTX); - musb->int_rx = musb_readw(musb->pRegs, MGC_O_HDRC_INTRRX); + musb->int_usb = musb_readb(musb->mregs, MGC_O_HDRC_INTRUSB); + musb->int_tx = musb_readw(musb->mregs, MGC_O_HDRC_INTRTX); + musb->int_rx = musb_readw(musb->mregs, MGC_O_HDRC_INTRRX); if (musb->int_usb || musb->int_tx || musb->int_rx) retval = musb_interrupt(musb); @@ -1457,8 +1457,8 @@ irqreturn_t musb_interrupt(struct musb *musb) int ep_num; u32 reg; - devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); - power = musb_readb(musb->pRegs, MGC_O_HDRC_POWER); + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); + power = musb_readb(musb->mregs, MGC_O_HDRC_POWER); DBG(4, "** IRQ %s usb%04x tx%04x rx%04x\n", (devctl & MGC_M_DEVCTL_HM) ? "host" : "peripheral", @@ -1486,7 +1486,7 @@ irqreturn_t musb_interrupt(struct musb *musb) ep_num = 1; while (reg) { if (reg & 1) { - // MGC_SelectEnd(musb->pRegs, ep_num); + // MGC_SelectEnd(musb->mregs, ep_num); /* REVISIT just retval = ep->rx_irq(...) */ retval = IRQ_HANDLED; if (devctl & MGC_M_DEVCTL_HM) { @@ -1507,7 +1507,7 @@ irqreturn_t musb_interrupt(struct musb *musb) ep_num = 1; while (reg) { if (reg & 1) { - // MGC_SelectEnd(musb->pRegs, ep_num); + // MGC_SelectEnd(musb->mregs, ep_num); /* REVISIT just retval |= ep->tx_irq(...) */ retval = IRQ_HANDLED; if (devctl & MGC_M_DEVCTL_HM) { @@ -1540,7 +1540,7 @@ MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); void musb_dma_completion(struct musb *musb, u8 bLocalEnd, u8 bTransmit) { - u8 devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + u8 devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); /* called with controller lock already held */ @@ -1640,7 +1640,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf) * VBUS high for a long time after power has been removed, can * cause temporary false indications of a connection. */ - vbus = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + vbus = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); if (vbus & 0x10) { /* REVISIT retest on real OTG hardware */ switch (musb->board_mode) { @@ -1768,7 +1768,7 @@ allocate_instance(struct device *dev, void __iomem *mbase) #endif - musb->pRegs = mbase; + musb->mregs = mbase; musb->ctrl_base = mbase; musb->nIrq = -ENODEV; for (epnum = 0, ep = musb->aLocalEnd; @@ -1814,9 +1814,9 @@ static void musb_free(struct musb *musb) dma_controller_destroy(c); } - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, 0); + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, 0); musb_platform_exit(musb); - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, 0); + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, 0); if (musb->clock) { clk_disable(musb->clock); @@ -1835,7 +1835,7 @@ static void musb_free(struct musb *musb) * * @pDevice: the controller (already clocked, etc) * @nIrq: irq - * @pRegs: virtual address of controller registers, + * @mregs: virtual address of controller registers, * not yet corrected for platform-specific offsets */ static int __init @@ -1903,7 +1903,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) /* assume vbus is off */ - /* platform adjusts musb->pRegs and musb->isr if needed, + /* platform adjusts musb->mregs and musb->isr if needed, * and activates clocks */ musb->isr = generic_interrupt; @@ -1920,7 +1920,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (use_dma && dev->dma_mask) { struct dma_controller *c; - c = dma_controller_create(musb, musb->pRegs); + c = dma_controller_create(musb, musb->mregs); musb->pDmaController = c; if (c) (void) c->start(c->pPrivateData); @@ -1990,8 +1990,8 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) DBG(1, "%s mode, status %d, devctl %02x %c\n", "HOST", status, - musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL), - (musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL) + musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL), + (musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL) & MGC_M_DEVCTL_BDEVICE ? 'B' : 'A')); @@ -2005,7 +2005,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) DBG(1, "%s mode, status %d, dev%02x\n", is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", status, - musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL)); + musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL)); } --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -504,7 +504,7 @@ static void tusb_source_power(struct musb *musb, int is_on) prcm = musb_readl(base, TUSB_PRCM_MNGMT); conf = musb_readl(base, TUSB_DEV_CONF); - devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); if (is_on) { musb->is_active = 1; @@ -535,11 +535,11 @@ static void tusb_source_power(struct musb *musb, int is_on) musb_writel(base, TUSB_PRCM_MNGMT, prcm); musb_writel(base, TUSB_DEV_OTG_TIMER, timer); musb_writel(base, TUSB_DEV_CONF, conf); - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, devctl); + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, devctl); DBG(1, "VBUS %s, devctl %02x otg %3x conf %08x prcm %08x\n", otg_state_string(musb), - musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL), + musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL), musb_readl(base, TUSB_DEV_OTG_STAT), conf, prcm); } @@ -679,10 +679,10 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *base) switch (musb->xceiv.state) { case OTG_STATE_A_IDLE: DBG(2, "Got SRP, turning on VBUS\n"); - devctl = musb_readb(musb->pRegs, + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); devctl |= MGC_M_DEVCTL_SESSION; - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, devctl); musb->xceiv.state = OTG_STATE_A_WAIT_VRISE; @@ -726,7 +726,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *base) /* VBUS has probably been valid for a while now, * but may well have bounced out of range a bit */ - devctl = musb_readb(musb->pRegs, MGC_O_HDRC_DEVCTL); + devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); if (otg_stat & TUSB_DEV_OTG_STAT_VBUS_VALID) { if ((devctl & MGC_M_DEVCTL_VBUS) != MGC_M_DEVCTL_VBUS) { @@ -1077,7 +1077,7 @@ int __init musb_platform_init(struct musb *musb) /* Offsets from base: VLYNQ at 0x000, MUSB regs at 0x400, * FIFOs at 0x600, TUSB at 0x800 */ - musb->pRegs += TUSB_BASE_OFFSET; + musb->mregs += TUSB_BASE_OFFSET; ret = tusb_start(musb); if (ret) { --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -145,7 +145,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) struct musb *musb = chdat->musb; struct musb_hw_ep *hw_ep = chdat->hw_ep; void __iomem *ep_conf = hw_ep->conf; - void __iomem *musb_base = musb->pRegs; + void __iomem *musb_base = musb->mregs; unsigned long remaining, flags, pio; int ch; @@ -240,7 +240,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, struct tusb_omap_dma *tusb_dma = chdat->tusb_dma; struct musb *musb = chdat->musb; struct musb_hw_ep *hw_ep = chdat->hw_ep; - void __iomem *musb_base = musb->pRegs; + void __iomem *musb_base = musb->mregs; void __iomem *ep_conf = hw_ep->conf; dma_addr_t fifo = hw_ep->fifo_sync; struct omap_dma_channel_params dma_params; --- a/drivers/usb/musb/virthub.c +++ b/drivers/usb/musb/virthub.c @@ -49,7 +49,7 @@ static void musb_port_suspend(struct musb *musb, u8 bSuspend) { u8 power; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; if (!is_host_active(musb)) return; @@ -110,7 +110,7 @@ static void musb_port_suspend(struct musb *musb, u8 bSuspend) static void musb_port_reset(struct musb *musb, u8 bReset) { u8 power; - void __iomem *pBase = musb->pRegs; + void __iomem *pBase = musb->mregs; #ifdef CONFIG_USB_MUSB_OTG /* REVISIT this looks wrong for HNP */ @@ -308,11 +308,11 @@ int musb_hub_control( && time_after(jiffies, musb->rh_timer)) { u8 power; - power = musb_readb(musb->pRegs, MGC_O_HDRC_POWER); + power = musb_readb(musb->mregs, MGC_O_HDRC_POWER); power &= ~MGC_M_POWER_RESUME; DBG(4, "root port resume stopped, power %02x\n", power); - musb_writeb(musb->pRegs, MGC_O_HDRC_POWER, power); + musb_writeb(musb->mregs, MGC_O_HDRC_POWER, power); /* ISSUE: DaVinci (RTL 1.300) disconnects after * resume of high speed peripherals (but not full @@ -388,7 +388,7 @@ int musb_hub_control( temp = MGC_M_TEST_FORCE_HOST | MGC_M_TEST_FORCE_HS; - musb_writeb(musb->pRegs, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); + musb_writeb(musb->mregs, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); break; case 6: pr_debug("TEST_FIFO_ACCESS\n"); @@ -397,7 +397,7 @@ int musb_hub_control( default: goto error; } - musb_writeb(musb->pRegs, MGC_O_HDRC_TESTMODE, temp); + musb_writeb(musb->mregs, MGC_O_HDRC_TESTMODE, temp); break; default: goto error; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase 2007-08-13 13:48 ` [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 7/52] musb_hdrc: Search and replace pSource with src Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pBase with mbase Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 34 +++++++++--------- drivers/usb/musb/musb_gadget.c | 42 +++++++++++----------- drivers/usb/musb/musb_host.c | 50 ++++++++++++++-------------- drivers/usb/musb/musb_procfs.c | 52 ++++++++++++++-------------- drivers/usb/musb/musbdefs.h | 10 +++--- drivers/usb/musb/musbhsdma.c | 38 ++++++++++---------- drivers/usb/musb/plat_uds.c | 72 ++++++++++++++++++++-------------------- drivers/usb/musb/virthub.c | 26 +++++++------- 8 files changed, 162 insertions(+), 162 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -74,7 +74,7 @@ static int service_tx_status_request( struct musb *musb, const struct usb_ctrlrequest *pControlRequest) { - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; int handled = 1; u8 bResult[2], bEnd = 0; const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; @@ -127,14 +127,14 @@ static int service_tx_status_request( break; } - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); if (is_in) tmp = musb_readw(regs, MGC_O_HDRC_TXCSR) & MGC_M_TXCSR_P_SENDSTALL; else tmp = musb_readw(regs, MGC_O_HDRC_RXCSR) & MGC_M_RXCSR_P_SENDSTALL; - MGC_SelectEnd(pBase, 0); + MGC_SelectEnd(mbase, 0); bResult[0] = tmp ? 1 : 0; } break; @@ -205,12 +205,12 @@ static void musb_g_ep0_giveback(struct musb *musb, struct usb_request *req) */ static inline void musb_try_b_hnp_enable(struct musb *musb) { - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; u8 devctl; DBG(1, "HNP: Setting HR\n"); - devctl = musb_readb(pBase, MGC_O_HDRC_DEVCTL); - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, devctl | MGC_M_DEVCTL_HR); + devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, devctl | MGC_M_DEVCTL_HR); } /* @@ -230,7 +230,7 @@ __releases(musb->Lock) __acquires(musb->Lock) { int handled = -EINVAL; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; /* the gadget driver handles everything except what we MUST handle */ @@ -278,7 +278,7 @@ __acquires(musb->Lock) spin_lock(&musb->Lock); /* select ep0 again */ - MGC_SelectEnd(pBase, 0); + MGC_SelectEnd(mbase, 0); handled = 1; } break; default: @@ -388,7 +388,7 @@ stall: if (!musb_ep->desc) break; - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); if (is_in) { csr = musb_readw(regs, MGC_O_HDRC_TXCSR); @@ -411,7 +411,7 @@ stall: } /* select ep0 again */ - MGC_SelectEnd(pBase, 0); + MGC_SelectEnd(mbase, 0); handled = 1; } break; @@ -600,17 +600,17 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) { u16 wCsrVal; u16 wCount; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; void __iomem *regs = musb->aLocalEnd[0].regs; irqreturn_t retval = IRQ_NONE; - MGC_SelectEnd(pBase, 0); /* select ep0 */ + MGC_SelectEnd(mbase, 0); /* select ep0 */ wCsrVal = musb_readw(regs, MGC_O_HDRC_CSR0); wCount = musb_readb(regs, MGC_O_HDRC_COUNT0); DBG(4, "csr %04x, count %d, myaddr %d, ep0stage %s\n", wCsrVal, wCount, - musb_readb(pBase, MGC_O_HDRC_FADDR), + musb_readb(mbase, MGC_O_HDRC_FADDR), decode_ep0stage(musb->ep0_state)); /* I sent a stall.. need to acknowledge it now.. */ @@ -663,7 +663,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) */ if (musb->bSetAddress) { musb->bSetAddress = FALSE; - musb_writeb(pBase, MGC_O_HDRC_FADDR, musb->bAddress); + musb_writeb(mbase, MGC_O_HDRC_FADDR, musb->bAddress); } /* enter test mode if needed (exit by reset) */ @@ -673,7 +673,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) if (MGC_M_TEST_PACKET == musb->bTestModeValue) musb_load_testpacket(musb); - musb_writeb(pBase, MGC_O_HDRC_TESTMODE, + musb_writeb(mbase, MGC_O_HDRC_TESTMODE, musb->bTestModeValue); } /* FALLTHROUGH */ @@ -710,7 +710,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) printk(KERN_NOTICE "%s: peripheral reset " "irq lost!\n", musb_driver_name); - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); musb->g.speed = (power & MGC_M_POWER_HSMODE) ? USB_SPEED_HIGH : USB_SPEED_FULL; @@ -769,7 +769,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) handled = forward_to_driver(musb, &setup); if (handled < 0) { - MGC_SelectEnd(pBase, 0); + MGC_SelectEnd(mbase, 0); stall: DBG(3, "stall (%d)\n", handled); musb->ackpend |= MGC_M_CSR0_P_SENDSTALL; --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -406,12 +406,12 @@ void musb_g_tx(struct musb *musb, u8 bEnd) { u16 wCsrVal; struct usb_request *pRequest; - u8 __iomem *pBase = musb->mregs; + u8 __iomem *mbase = musb->mregs; struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_in; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct dma_channel *dma; - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); pRequest = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); @@ -514,7 +514,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) * REVISIT for double buffering... * FIXME revisit for stalls too... */ - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsrVal & MGC_M_TXCSR_FIFONOTEMPTY) break; @@ -736,12 +736,12 @@ void musb_g_rx(struct musb *musb, u8 bEnd) { u16 wCsrVal; struct usb_request *pRequest; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct dma_channel *dma; - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); pRequest = next_request(musb_ep); @@ -826,7 +826,7 @@ void musb_g_rx(struct musb *musb, u8 bEnd) goto done; /* don't start more i/o till the stall clears */ - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); if (wCsrVal & MGC_M_RXCSR_P_SENDSTALL) goto done; @@ -855,7 +855,7 @@ static int musb_gadget_enable(struct usb_ep *ep, struct musb_hw_ep *hw_ep; void __iomem *regs; struct musb *musb; - void __iomem *pBase; + void __iomem *mbase; u8 bEnd; u16 csr; unsigned tmp; @@ -868,7 +868,7 @@ static int musb_gadget_enable(struct usb_ep *ep, hw_ep = musb_ep->hw_ep; regs = hw_ep->regs; musb = musb_ep->musb; - pBase = musb->mregs; + mbase = musb->mregs; bEnd = musb_ep->bEndNumber; spin_lock_irqsave(&musb->Lock, flags); @@ -892,9 +892,9 @@ static int musb_gadget_enable(struct usb_ep *ep, /* enable the interrupts for the endpoint, set the endpoint * packet size (or fail), set the mode, clear the fifo */ - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); if (desc->bEndpointAddress & USB_DIR_IN) { - u16 wIntrTxE = musb_readw(pBase, MGC_O_HDRC_INTRTXE); + u16 wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); if (hw_ep->bIsSharedFifo) musb_ep->is_in = 1; @@ -904,7 +904,7 @@ static int musb_gadget_enable(struct usb_ep *ep, goto fail; wIntrTxE |= (1 << bEnd); - musb_writew(pBase, MGC_O_HDRC_INTRTXE, wIntrTxE); + musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE); /* REVISIT if can_bulk_split(), use by updating "tmp"; * likewise high bandwidth periodic tx @@ -924,7 +924,7 @@ static int musb_gadget_enable(struct usb_ep *ep, musb_writew(regs, MGC_O_HDRC_TXCSR, csr); } else { - u16 wIntrRxE = musb_readw(pBase, MGC_O_HDRC_INTRRXE); + u16 wIntrRxE = musb_readw(mbase, MGC_O_HDRC_INTRRXE); if (hw_ep->bIsSharedFifo) musb_ep->is_in = 0; @@ -934,7 +934,7 @@ static int musb_gadget_enable(struct usb_ep *ep, goto fail; wIntrRxE |= (1 << bEnd); - musb_writew(pBase, MGC_O_HDRC_INTRRXE, wIntrRxE); + musb_writew(mbase, MGC_O_HDRC_INTRRXE, wIntrRxE); /* REVISIT if can_bulk_combine() use by updating "tmp" * likewise high bandwidth periodic rx @@ -1232,7 +1232,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) u8 bEnd = musb_ep->bEndNumber; struct musb *musb = musb_ep->musb; void __iomem *epio = musb->aLocalEnd[bEnd].regs; - void __iomem *pBase; + void __iomem *mbase; unsigned long flags; u16 wCsr; struct musb_request *pRequest = NULL; @@ -1240,7 +1240,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) if (!ep) return -EINVAL; - pBase = musb->mregs; + mbase = musb->mregs; spin_lock_irqsave(&musb->Lock, flags); @@ -1249,7 +1249,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) goto done; } - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); /* cannot portably stall with non-empty FIFO */ pRequest = to_musb_request(next_request(musb_ep)); @@ -1979,14 +1979,14 @@ void musb_g_reset(struct musb *musb) __releases(musb->Lock) __acquires(musb->Lock) { - void __iomem *pBase = musb->mregs; - u8 devctl = musb_readb(pBase, MGC_O_HDRC_DEVCTL); + void __iomem *mbase = musb->mregs; + u8 devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); u8 power; DBG(3, "<== %s addr=%x driver '%s'\n", (devctl & MGC_M_DEVCTL_BDEVICE) ? "B-Device" : "A-Device", - musb_readb(pBase, MGC_O_HDRC_FADDR), + musb_readb(mbase, MGC_O_HDRC_FADDR), musb->pGadgetDriver ? musb->pGadgetDriver->driver.name : NULL @@ -1998,11 +1998,11 @@ __acquires(musb->Lock) /* clear HR */ else if (devctl & MGC_M_DEVCTL_HR) - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); /* what speed did we negotiate? */ - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); musb->g.speed = (power & MGC_M_POWER_HSMODE) ? USB_SPEED_HIGH : USB_SPEED_FULL; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -172,7 +172,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) u16 wFrame; u32 dwLength; void *pBuffer; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; struct urb *urb = next_urb(qh); struct musb_hw_ep *hw_ep = qh->hw_ep; unsigned nPipe = urb->pipe; @@ -232,7 +232,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) case USB_ENDPOINT_XFER_INT: DBG(3, "check whether there's still time for periodic Tx\n"); qh->iso_idx = 0; - wFrame = musb_readw(pBase, MGC_O_HDRC_FRAME); + wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME); /* FIXME this doesn't implement that scheduling policy ... * or handle framecounter wrapping */ @@ -248,7 +248,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) /* enable SOF interrupt so we can count down */ DBG(1,"SOF for %d\n", bEnd); #if 1 // ifndef CONFIG_ARCH_DAVINCI - musb_writeb(pBase, MGC_O_HDRC_INTRUSBE, 0xff); + musb_writeb(mbase, MGC_O_HDRC_INTRUSBE, 0xff); #endif } break; @@ -481,7 +481,7 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, int nPipe = pUrb->pipe; void *buffer = pUrb->transfer_buffer; - // MGC_SelectEnd(pBase, bEnd); + // MGC_SelectEnd(mbase, bEnd); wRxCount = musb_readw(epio, MGC_O_HDRC_RXCOUNT); DBG(3, "RX%d count %d, buffer %p len %d/%d\n", bEnd, wRxCount, pUrb->transfer_buffer, qh->offset, @@ -630,7 +630,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, struct dma_controller *pDmaController; struct dma_channel *pDmaChannel; u8 bDmaOk; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; void __iomem *epio = hw_ep->regs; struct musb_qh *qh; @@ -651,7 +651,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, qh->h_addr_reg, qh->h_port_reg, dwLength); - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); /* candidate for DMA? */ pDmaController = musb->pDmaController; @@ -679,8 +679,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); /* disable interrupt in case we flush */ - wIntrTxE = musb_readw(pBase, MGC_O_HDRC_INTRTXE); - musb_writew(pBase, MGC_O_HDRC_INTRTXE, wIntrTxE & ~(1 << bEnd)); + wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); + musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE & ~(1 << bEnd)); /* general endpoint setup */ if (bEnd) { @@ -721,18 +721,18 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* target addr and (for multipoint) hub addr/port */ if (musb->bIsMultipoint) { - musb_writeb(pBase, + musb_writeb(mbase, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXFUNCADDR), qh->addr_reg); - musb_writeb(pBase, + musb_writeb(mbase, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBADDR), qh->h_addr_reg); - musb_writeb(pBase, + musb_writeb(mbase, MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBPORT), qh->h_port_reg); /* FIXME if !bEnd, do the same for RX ... */ } else - musb_writeb(pBase, MGC_O_HDRC_FADDR, qh->addr_reg); + musb_writeb(mbase, MGC_O_HDRC_FADDR, qh->addr_reg); /* protocol/endpoint/interval/NAKlimit */ if (bEnd) { @@ -868,7 +868,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, } /* re-enable interrupt */ - musb_writew(pBase, MGC_O_HDRC_INTRTXE, wIntrTxE); + musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE); /* IN/receive */ } else { @@ -1023,7 +1023,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) struct urb *pUrb; u16 wCsrVal, wCount; int status = 0; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; struct musb_hw_ep *hw_ep = musb->control_ep; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; @@ -1033,7 +1033,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* ep0 only has one queue, "in" */ pUrb = next_urb(qh); - MGC_SelectEnd(pBase, 0); + MGC_SelectEnd(mbase, 0); wCsrVal = musb_readw(epio, MGC_O_HDRC_CSR0); wCount = (wCsrVal & MGC_M_CSR0_RXPKTRDY) ? musb_readb(epio, MGC_O_HDRC_COUNT0) @@ -1174,12 +1174,12 @@ void musb_host_tx(struct musb *musb, u8 bEnd) void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->out_qh; u32 status = 0; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; struct dma_channel *dma; pUrb = next_urb(qh); - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); wTxCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); /* with CPPI, DMA sometimes triggers "extra" irqs */ @@ -1217,7 +1217,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) * if (bulk && qh->ring.next != &musb->out_bulk), then * we have a candidate... NAKing is *NOT* an error */ - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); musb_writew(epio, MGC_O_HDRC_CSR0, MGC_M_TXCSR_H_WZC_BITS | MGC_M_TXCSR_TXPKTRDY); @@ -1241,7 +1241,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) | MGC_M_TXCSR_H_NAKTIMEOUT ); - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); musb_writew(epio, MGC_O_HDRC_TXCSR, wTxCsrVal); /* REVISIT may need to clear FLUSHFIFO ... */ musb_writew(epio, MGC_O_HDRC_TXCSR, wTxCsrVal); @@ -1323,7 +1323,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) musb_write_fifo(hw_ep, wLength, pBuffer); qh->segsize = wLength; - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); musb_writew(epio, MGC_O_HDRC_TXCSR, MGC_M_TXCSR_H_WZC_BITS | MGC_M_TXCSR_TXPKTRDY); } else @@ -1384,7 +1384,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; size_t xfer_len; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; int nPipe; u16 wRxCsrVal, wVal; u8 bIsochError = FALSE; @@ -1392,7 +1392,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) u32 status; struct dma_channel *dma; - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); pUrb = next_urb(qh); dma = is_dma_capable() ? hw_ep->rx_channel : NULL; @@ -1443,7 +1443,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) * we have a candidate... NAKing is *NOT* an error */ DBG(6, "RX end %d NAK timeout\n", bEnd); - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | MGC_M_RXCSR_H_REQPKT); @@ -1501,7 +1501,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) xfer_len, dma ? ", dma" : ""); wRxCsrVal &= ~MGC_M_RXCSR_H_REQPKT; - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | wRxCsrVal); } @@ -1545,7 +1545,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) // SCRUB (RX) /* do the proper sequence to abort the transfer */ - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); wVal &= ~MGC_M_RXCSR_H_REQPKT; musb_writew(epio, MGC_O_HDRC_RXCSR, wVal); goto finish; --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -485,14 +485,14 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) static int dump_header_stats(struct musb *musb, char *buffer) { int code, count = 0; - const void __iomem *pBase = musb->mregs; + const void __iomem *mbase = musb->mregs; *buffer = 0; count = sprintf(buffer, "Status: %sHDRC, Mode=%s " "(Power=%02x, DevCtl=%02x)\n", (musb->bIsMultipoint ? "M" : ""), MUSB_MODE(musb), - musb_readb(pBase, MGC_O_HDRC_POWER), - musb_readb(pBase, MGC_O_HDRC_DEVCTL)); + musb_readb(mbase, MGC_O_HDRC_POWER), + musb_readb(mbase, MGC_O_HDRC_DEVCTL)); if (count <= 0) return 0; buffer += count; @@ -653,7 +653,7 @@ static int musb_proc_write(struct file *file, const char __user *buffer, char cmd; u8 bReg; struct musb *musb = (struct musb *)data; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; /* MOD_INC_USE_COUNT; */ @@ -662,65 +662,65 @@ static int musb_proc_write(struct file *file, const char __user *buffer, switch (cmd) { case 'C': - if (pBase) { - bReg = musb_readb(pBase, MGC_O_HDRC_POWER) + if (mbase) { + bReg = musb_readb(mbase, MGC_O_HDRC_POWER) | MGC_M_POWER_SOFTCONN; - musb_writeb(pBase, MGC_O_HDRC_POWER, bReg); + musb_writeb(mbase, MGC_O_HDRC_POWER, bReg); } break; case 'c': - if (pBase) { - bReg = musb_readb(pBase, MGC_O_HDRC_POWER) + if (mbase) { + bReg = musb_readb(mbase, MGC_O_HDRC_POWER) & ~MGC_M_POWER_SOFTCONN; - musb_writeb(pBase, MGC_O_HDRC_POWER, bReg); + musb_writeb(mbase, MGC_O_HDRC_POWER, bReg); } break; case 'I': - if (pBase) { - bReg = musb_readb(pBase, MGC_O_HDRC_POWER) + if (mbase) { + bReg = musb_readb(mbase, MGC_O_HDRC_POWER) | MGC_M_POWER_HSENAB; - musb_writeb(pBase, MGC_O_HDRC_POWER, bReg); + musb_writeb(mbase, MGC_O_HDRC_POWER, bReg); } break; case 'i': - if (pBase) { - bReg = musb_readb(pBase, MGC_O_HDRC_POWER) + if (mbase) { + bReg = musb_readb(mbase, MGC_O_HDRC_POWER) & ~MGC_M_POWER_HSENAB; - musb_writeb(pBase, MGC_O_HDRC_POWER, bReg); + musb_writeb(mbase, MGC_O_HDRC_POWER, bReg); } break; case 'F': - bReg = musb_readb(pBase, MGC_O_HDRC_DEVCTL); + bReg = musb_readb(mbase, MGC_O_HDRC_DEVCTL); bReg |= MGC_M_DEVCTL_SESSION; - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, bReg); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, bReg); break; case 'H': - if (pBase) { - bReg = musb_readb(pBase, MGC_O_HDRC_DEVCTL); + if (mbase) { + bReg = musb_readb(mbase, MGC_O_HDRC_DEVCTL); bReg |= MGC_M_DEVCTL_HR; - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, bReg); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, bReg); //MUSB_HST_MODE( ((struct musb*)data) ); //WARN("Host Mode\n"); } break; case 'h': - if (pBase) { - bReg = musb_readb(pBase, MGC_O_HDRC_DEVCTL); + if (mbase) { + bReg = musb_readb(mbase, MGC_O_HDRC_DEVCTL); bReg &= ~MGC_M_DEVCTL_HR; - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, bReg); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, bReg); } break; case 'T': - if (pBase) { + if (mbase) { musb_load_testpacket(musb); - musb_writeb(pBase, MGC_O_HDRC_TESTMODE, + musb_writeb(mbase, MGC_O_HDRC_TESTMODE, MGC_M_TEST_PACKET); } break; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -218,19 +218,19 @@ enum musb_g_ep0_state { /* TUSB mapping: "flat" plus ep0 special cases */ #if defined(CONFIG_USB_TUSB6010) -#define MGC_SelectEnd(_pBase, _bEnd) \ - musb_writeb((_pBase), MGC_O_HDRC_INDEX, (_bEnd)) +#define MGC_SelectEnd(_mbase, _bEnd) \ + musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_bEnd)) #define MGC_END_OFFSET MGC_TUSB_OFFSET /* "flat" mapping: each endpoint has its own i/o address */ #elif defined(MUSB_FLAT_REG) -#define MGC_SelectEnd(_pBase, _bEnd) (((void)(_pBase)),((void)(_bEnd))) +#define MGC_SelectEnd(_mbase, _bEnd) (((void)(_mbase)),((void)(_bEnd))) #define MGC_END_OFFSET MGC_FLAT_OFFSET /* "indexed" mapping: INDEX register controls register bank select */ #else -#define MGC_SelectEnd(_pBase, _bEnd) \ - musb_writeb((_pBase), MGC_O_HDRC_INDEX, (_bEnd)) +#define MGC_SelectEnd(_mbase, _bEnd) \ + musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_bEnd)) #define MGC_END_OFFSET MGC_INDEXED_OFFSET #endif --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -177,7 +177,7 @@ static void configure_channel(struct dma_channel *pChannel, struct musb_dma_channel *pImplChannel = (struct musb_dma_channel *) pChannel->pPrivateData; struct musb_dma_controller *pController = pImplChannel->pController; - u8 *pBase = pController->pCoreBase; + u8 *mbase = pController->pCoreBase; u8 bChannel = pImplChannel->bIndex; u16 wCsr = 0; @@ -207,15 +207,15 @@ static void configure_channel(struct dma_channel *pChannel, | (pImplChannel->bTransmit ? (1 << MGC_S_HSDMA_TRANSMIT) : 0); /* address/count */ - musb_writel(pBase, + musb_writel(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_ADDRESS), dma_addr); - musb_writel(pBase, + musb_writel(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_COUNT), dwLength); /* control (this should start things) */ - musb_writew(pBase, + musb_writew(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_CONTROL), wCsr); } @@ -256,37 +256,37 @@ static int dma_channel_abort(struct dma_channel *pChannel) struct musb_dma_channel *pImplChannel = (struct musb_dma_channel *) pChannel->pPrivateData; u8 bChannel = pImplChannel->bIndex; - u8 *pBase = pImplChannel->pController->pCoreBase; + u8 *mbase = pImplChannel->pController->pCoreBase; u16 csr; if (pChannel->bStatus == MGC_DMA_STATUS_BUSY) { if (pImplChannel->bTransmit) { - csr = musb_readw(pBase, + csr = musb_readw(mbase, MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_TXCSR)); csr &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_DMAMODE); - musb_writew(pBase, + musb_writew(mbase, MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_TXCSR), csr); } else { - csr = musb_readw(pBase, + csr = musb_readw(mbase, MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_RXCSR)); csr &= ~(MGC_M_RXCSR_AUTOCLEAR | MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_DMAMODE); - musb_writew(pBase, + musb_writew(mbase, MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_RXCSR), csr); } - musb_writew(pBase, + musb_writew(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_CONTROL), 0); - musb_writel(pBase, + musb_writel(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_ADDRESS), 0); - musb_writel(pBase, + musb_writel(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_COUNT), 0); pChannel->bStatus = MGC_DMA_STATUS_FREE; @@ -299,7 +299,7 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) struct musb_dma_controller *pController = (struct musb_dma_controller *)pPrivateData; struct musb_dma_channel *pImplChannel; - u8 *pBase = pController->pCoreBase; + u8 *mbase = pController->pCoreBase; struct dma_channel *pChannel; u8 bChannel; u16 wCsr; @@ -307,7 +307,7 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) u8 bIntr; irqreturn_t retval = IRQ_NONE; - bIntr = musb_readb(pBase, MGC_O_HSDMA_INTR); + bIntr = musb_readb(mbase, MGC_O_HSDMA_INTR); if (!bIntr) goto done; @@ -317,7 +317,7 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) &(pController->aChannel[bChannel]); pChannel = &pImplChannel->Channel; - wCsr = musb_readw(pBase, + wCsr = musb_readw(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_CONTROL)); @@ -325,7 +325,7 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) pImplChannel->Channel.bStatus = MGC_DMA_STATUS_BUS_ABORT; } else { - dwAddress = musb_readl(pBase, + dwAddress = musb_readl(mbase, MGC_HSDMA_CHANNEL_OFFSET( bChannel, MGC_O_HSDMA_ADDRESS)); @@ -340,7 +340,7 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) pImplChannel->dwCount) ? "=> reconfig 0": "=> complete"); - u8 devctl = musb_readb(pBase, + u8 devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); pChannel->bStatus = MGC_DMA_STATUS_FREE; @@ -353,9 +353,9 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) (pImplChannel->wMaxPacketSize - 1))) ) { /* Send out the packet */ - MGC_SelectEnd(pBase, + MGC_SelectEnd(mbase, pImplChannel->bEnd); - musb_writew(pBase, + musb_writew(mbase, MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_TXCSR), MGC_M_TXCSR_TXPKTRDY); } else --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -315,7 +315,7 @@ static DEFINE_TIMER(musb_otg_timer, musb_otg_timer_func, 0, 0); void musb_hnp_stop(struct musb *musb) { struct usb_hcd *hcd = musb_to_hcd(musb); - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; u8 reg; switch (musb->xceiv.state) { @@ -331,9 +331,9 @@ void musb_hnp_stop(struct musb *musb) DBG(1, "HNP: Disabling HR\n"); hcd->self.is_b_host = 0; musb->xceiv.state = OTG_STATE_B_PERIPHERAL; - reg = musb_readb(pBase, MGC_O_HDRC_POWER); + reg = musb_readb(mbase, MGC_O_HDRC_POWER); reg |= MGC_M_POWER_SUSPENDM; - musb_writeb(pBase, MGC_O_HDRC_POWER, reg); + musb_writeb(mbase, MGC_O_HDRC_POWER, reg); /* REVISIT: Start SESSION_REQUEST here? */ break; default: @@ -365,7 +365,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, { irqreturn_t handled = IRQ_NONE; #ifdef CONFIG_USB_MUSB_HDRC_HCD - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; #endif DBG(3, "<== Power=%02x, DevCtl=%02x, bIntrUSB=0x%x\n", power, devctl, @@ -395,7 +395,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, } power &= ~MGC_M_POWER_SUSPENDM; - musb_writeb(pBase, MGC_O_HDRC_POWER, + musb_writeb(mbase, MGC_O_HDRC_POWER, power | MGC_M_POWER_RESUME); musb->port1_status |= @@ -466,7 +466,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, * - ... to A_WAIT_BCON. * a_wait_vrise_tmout triggers VBUS_ERROR transitions */ - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); musb->bEnd0Stage = MGC_END0_START; musb->xceiv.state = OTG_STATE_A_IDLE; MUSB_HST_MODE(musb); @@ -508,7 +508,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, musb->vbuserr_retry--; ignore = 1; devctl |= MGC_M_DEVCTL_SESSION; - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, devctl); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, devctl); } else { musb->port1_status |= (1 << USB_PORT_FEAT_OVER_CURRENT) @@ -558,9 +558,9 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, // REVISIT HNP; just force disconnect } musb->bDelayPortPowerOff = FALSE; - musb_writew(pBase, MGC_O_HDRC_INTRTXE, musb->wEndMask); - musb_writew(pBase, MGC_O_HDRC_INTRRXE, musb->wEndMask & 0xfffe); - musb_writeb(pBase, MGC_O_HDRC_INTRUSBE, 0xf7); + musb_writew(mbase, MGC_O_HDRC_INTRTXE, musb->wEndMask); + musb_writew(mbase, MGC_O_HDRC_INTRRXE, musb->wEndMask & 0xfffe); + musb_writeb(mbase, MGC_O_HDRC_INTRUSBE, 0xf7); #endif musb->port1_status &= ~(USB_PORT_STAT_LOW_SPEED |USB_PORT_STAT_HIGH_SPEED @@ -616,7 +616,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, DBG(1, "BABBLE devctl: %02x\n", devctl); else { ERR("Stopping host session because of babble\n"); - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, 0); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, 0); } } else { DBG(1, "BUS RESET\n"); @@ -660,7 +660,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, * to support ISO transfers yet. */ if (bIntrUSB & MGC_M_INTR_SOF) { - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; struct musb_hw_ep *ep; u8 bEnd; u16 wFrame; @@ -669,7 +669,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, handled = IRQ_HANDLED; /* start any periodic Tx transfers waiting for current frame */ - wFrame = musb_readw(pBase, MGC_O_HDRC_FRAME); + wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME); ep = musb->aLocalEnd; for (bEnd = 1; (bEnd < musb->bEndCount) && (musb->wEndMask >= (1 << bEnd)); @@ -835,21 +835,21 @@ void musb_start(struct musb *musb) static void musb_generic_disable(struct musb *musb) { - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; u16 temp; /* disable interrupts */ - musb_writeb(pBase, MGC_O_HDRC_INTRUSBE, 0); - musb_writew(pBase, MGC_O_HDRC_INTRTXE, 0); - musb_writew(pBase, MGC_O_HDRC_INTRRXE, 0); + musb_writeb(mbase, MGC_O_HDRC_INTRUSBE, 0); + musb_writew(mbase, MGC_O_HDRC_INTRTXE, 0); + musb_writew(mbase, MGC_O_HDRC_INTRRXE, 0); /* off */ - musb_writeb(pBase, MGC_O_HDRC_DEVCTL, 0); + musb_writeb(mbase, MGC_O_HDRC_DEVCTL, 0); /* flush pending interrupts */ - temp = musb_readb(pBase, MGC_O_HDRC_INTRUSB); - temp = musb_readw(pBase, MGC_O_HDRC_INTRTX); - temp = musb_readw(pBase, MGC_O_HDRC_INTRRX); + temp = musb_readb(mbase, MGC_O_HDRC_INTRUSB); + temp = musb_readw(mbase, MGC_O_HDRC_INTRTX); + temp = musb_readw(mbase, MGC_O_HDRC_INTRRX); } @@ -1180,14 +1180,14 @@ static int __init ep_config_from_hw(struct musb *musb) { u8 bEnd = 0, reg; struct musb_hw_ep *hw_ep; - void *pBase = musb->mregs; + void *mbase = musb->mregs; DBG(2, "<== static silicon ep config\n"); /* FIXME pick up ep0 maxpacket size */ for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) { - MGC_SelectEnd(pBase, bEnd); + MGC_SelectEnd(mbase, bEnd); hw_ep = musb->aLocalEnd + bEnd; /* read from core using indexed model */ @@ -1252,13 +1252,13 @@ static int __init musb_core_init(u16 wType, struct musb *musb) char *type; u16 wRelease, wRelMajor, wRelMinor; char aInfo[78], aRevision[32], aDate[12]; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; int status = 0; int i; /* log core options (read using indexed model) */ - MGC_SelectEnd(pBase, 0); - reg = musb_readb(pBase, 0x10 + MGC_O_HDRC_CONFIGDATA); + MGC_SelectEnd(mbase, 0); + reg = musb_readb(mbase, 0x10 + MGC_O_HDRC_CONFIGDATA); strcpy(aInfo, (reg & MGC_M_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8"); if (reg & MGC_M_CONFIGDATA_DYNFIFO) { @@ -1296,15 +1296,15 @@ static int __init musb_core_init(u16 wType, struct musb *musb) musb_driver_name, reg, aInfo); #ifdef MUSB_AHB_ID - dwData = musb_readl(pBase, 0x404); + dwData = musb_readl(mbase, 0x404); sprintf(aDate, "%04d-%02x-%02x", (dwData & 0xffff), (dwData >> 16) & 0xff, (dwData >> 24) & 0xff); /* FIXME ID2 and ID3 are unused */ - dwData = musb_readl(pBase, 0x408); + dwData = musb_readl(mbase, 0x408); printk("ID2=%lx\n", (long unsigned)dwData); - dwData = musb_readl(pBase, 0x40c); + dwData = musb_readl(mbase, 0x40c); printk("ID3=%lx\n", (long unsigned)dwData); - reg = musb_readb(pBase, 0x400); + reg = musb_readb(mbase, 0x400); wType = ('M' == reg) ? MUSB_CONTROLLER_MHDRC : MUSB_CONTROLLER_HDRC; #else aDate[0] = 0; @@ -1325,7 +1325,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) } /* log release info */ - wRelease = musb_readw(pBase, MGC_O_HDRC_HWVERS); + wRelease = musb_readw(mbase, MGC_O_HDRC_HWVERS); wRelMajor = (wRelease >> 10) & 0x1f; wRelMinor = wRelease & 0x3ff; snprintf(aRevision, 32, "%d.%d%s", wRelMajor, @@ -1364,7 +1364,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) for (i = 0; i < musb->bEndCount; i++) { struct musb_hw_ep *hw_ep = musb->aLocalEnd + i; - hw_ep->fifo = MUSB_FIFO_OFFSET(i) + pBase; + hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase; #ifdef CONFIG_USB_TUSB6010 hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i); hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i); @@ -1372,14 +1372,14 @@ static int __init musb_core_init(u16 wType, struct musb *musb) musb->sync_va + 0x400 + MUSB_FIFO_OFFSET(i); if (i == 0) - hw_ep->conf = pBase - 0x400 + TUSB_EP0_CONF; + hw_ep->conf = mbase - 0x400 + TUSB_EP0_CONF; else - hw_ep->conf = pBase + 0x400 + (((i - 1) & 0xf) << 2); + hw_ep->conf = mbase + 0x400 + (((i - 1) & 0xf) << 2); #endif - hw_ep->regs = MGC_END_OFFSET(i, 0) + pBase; + hw_ep->regs = MGC_END_OFFSET(i, 0) + mbase; #ifdef CONFIG_USB_MUSB_HDRC_HCD - hw_ep->target_regs = MGC_BUSCTL_OFFSET(i, 0) + pBase; + hw_ep->target_regs = MGC_BUSCTL_OFFSET(i, 0) + mbase; hw_ep->rx_reinit = 1; hw_ep->tx_reinit = 1; #endif --- a/drivers/usb/musb/virthub.c +++ b/drivers/usb/musb/virthub.c @@ -49,7 +49,7 @@ static void musb_port_suspend(struct musb *musb, u8 bSuspend) { u8 power; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; if (!is_host_active(musb)) return; @@ -59,18 +59,18 @@ static void musb_port_suspend(struct musb *musb, u8 bSuspend) * MGC_M_POWER_ENSUSPEND. PHY may need a clock (sigh) to detect * SE0 changing to connect (J) or wakeup (K) states. */ - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); if (bSuspend) { int retries = 10000; power &= ~MGC_M_POWER_RESUME; power |= MGC_M_POWER_SUSPENDM; - musb_writeb(pBase, MGC_O_HDRC_POWER, power); + musb_writeb(mbase, MGC_O_HDRC_POWER, power); /* Needed for OPT A tests */ - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); while (power & MGC_M_POWER_SUSPENDM) { - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); if (retries-- < 1) break; } @@ -97,7 +97,7 @@ static void musb_port_suspend(struct musb *musb, u8 bSuspend) } else if (power & MGC_M_POWER_SUSPENDM) { power &= ~MGC_M_POWER_SUSPENDM; power |= MGC_M_POWER_RESUME; - musb_writeb(pBase, MGC_O_HDRC_POWER, power); + musb_writeb(mbase, MGC_O_HDRC_POWER, power); DBG(3, "Root port resuming, power %02x\n", power); @@ -110,11 +110,11 @@ static void musb_port_suspend(struct musb *musb, u8 bSuspend) static void musb_port_reset(struct musb *musb, u8 bReset) { u8 power; - void __iomem *pBase = musb->mregs; + void __iomem *mbase = musb->mregs; #ifdef CONFIG_USB_MUSB_OTG /* REVISIT this looks wrong for HNP */ - u8 devctl = musb_readb(pBase, MGC_O_HDRC_DEVCTL); + u8 devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); if (musb->bDelayPortPowerOff || !(devctl & MGC_M_DEVCTL_HM)) { return; @@ -127,7 +127,7 @@ static void musb_port_reset(struct musb *musb, u8 bReset) /* NOTE: caller guarantees it will turn off the reset when * the appropriate amount of time has passed */ - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); if (bReset) { /* @@ -140,14 +140,14 @@ static void musb_port_reset(struct musb *musb, u8 bReset) if (power & MGC_M_POWER_RESUME) { while (time_before(jiffies, musb->rh_timer)) msleep(1); - musb_writeb(pBase, MGC_O_HDRC_POWER, + musb_writeb(mbase, MGC_O_HDRC_POWER, power & ~MGC_M_POWER_RESUME); msleep(1); } musb->bIgnoreDisconnect = TRUE; power &= 0xf0; - musb_writeb(pBase, MGC_O_HDRC_POWER, + musb_writeb(mbase, MGC_O_HDRC_POWER, power | MGC_M_POWER_RESET); musb->port1_status |= USB_PORT_STAT_RESET; @@ -155,12 +155,12 @@ static void musb_port_reset(struct musb *musb, u8 bReset) musb->rh_timer = jiffies + msecs_to_jiffies(50); } else { DBG(4, "root port reset stopped\n"); - musb_writeb(pBase, MGC_O_HDRC_POWER, + musb_writeb(mbase, MGC_O_HDRC_POWER, power & ~MGC_M_POWER_RESET); musb->bIgnoreDisconnect = FALSE; - power = musb_readb(pBase, MGC_O_HDRC_POWER); + power = musb_readb(mbase, MGC_O_HDRC_POWER); if (power & MGC_M_POWER_HSMODE) { DBG(4, "high-speed device connected\n"); musb->port1_status |= USB_PORT_STAT_HIGH_SPEED; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 7/52] musb_hdrc: Search and replace pSource with src 2007-08-13 13:48 ` [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 8/52] musb_hdrc: Search and replace pDest with dst Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pSource with src Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -500,7 +500,7 @@ extern void musb_start(struct musb *musb); extern void musb_stop(struct musb *musb); extern void musb_write_fifo(struct musb_hw_ep *ep, - u16 wCount, const u8 * pSource); + u16 wCount, const u8 * src); extern void musb_read_fifo(struct musb_hw_ep *ep, u16 wCount, u8 * pDest); --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -169,40 +169,40 @@ static inline struct musb *dev_to_musb(struct device *dev) /* * Load an endpoint's FIFO */ -void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 wCount, const u8 *pSource) +void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 wCount, const u8 *src) { void __iomem *fifo = hw_ep->fifo; - prefetch((u8 *)pSource); + prefetch((u8 *)src); DBG(4, "%cX ep%d fifo %p count %d buf %p\n", - 'T', hw_ep->bLocalEnd, fifo, wCount, pSource); + 'T', hw_ep->bLocalEnd, fifo, wCount, src); /* we can't assume unaligned reads work */ - if (likely((0x01 & (unsigned long) pSource) == 0)) { + if (likely((0x01 & (unsigned long) src) == 0)) { u16 index = 0; /* best case is 32bit-aligned source address */ - if ((0x02 & (unsigned long) pSource) == 0) { + if ((0x02 & (unsigned long) src) == 0) { if (wCount >= 4) { - writesl(fifo, pSource + index, wCount >> 2); + writesl(fifo, src + index, wCount >> 2); index += wCount & ~0x03; } if (wCount & 0x02) { - musb_writew(fifo, 0, *(u16*)&pSource[index]); + musb_writew(fifo, 0, *(u16*)&src[index]); index += 2; } } else { if (wCount >= 2) { - writesw(fifo, pSource + index, wCount >> 1); + writesw(fifo, src + index, wCount >> 1); index += wCount & ~0x01; } } if (wCount & 0x01) - musb_writeb(fifo, 0, pSource[index]); + musb_writeb(fifo, 0, src[index]); } else { /* byte aligned */ - writesb(fifo, pSource, wCount); + writesb(fifo, src, wCount); } } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 8/52] musb_hdrc: Search and replace pDest with dst 2007-08-13 13:48 ` [PATCH 7/52] musb_hdrc: Search and replace pSource with src Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 9/52] musb_hdrc: Search and replace dwCount with len Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace pDest with dst Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -502,7 +502,7 @@ extern void musb_stop(struct musb *musb); extern void musb_write_fifo(struct musb_hw_ep *ep, u16 wCount, const u8 * src); extern void musb_read_fifo(struct musb_hw_ep *ep, - u16 wCount, u8 * pDest); + u16 wCount, u8 * dst); extern void musb_load_testpacket(struct musb *); --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -209,38 +209,38 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 wCount, const u8 *src) /* * Unload an endpoint's FIFO */ -void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 wCount, u8 *pDest) +void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 wCount, u8 *dst) { void __iomem *fifo = hw_ep->fifo; DBG(4, "%cX ep%d fifo %p count %d buf %p\n", - 'R', hw_ep->bLocalEnd, fifo, wCount, pDest); + 'R', hw_ep->bLocalEnd, fifo, wCount, dst); /* we can't assume unaligned writes work */ - if (likely((0x01 & (unsigned long) pDest) == 0)) { + if (likely((0x01 & (unsigned long) dst) == 0)) { u16 index = 0; /* best case is 32bit-aligned destination address */ - if ((0x02 & (unsigned long) pDest) == 0) { + if ((0x02 & (unsigned long) dst) == 0) { if (wCount >= 4) { - readsl(fifo, pDest, wCount >> 2); + readsl(fifo, dst, wCount >> 2); index = wCount & ~0x03; } if (wCount & 0x02) { - *(u16*)&pDest[index] = musb_readw(fifo, 0); + *(u16*)&dst[index] = musb_readw(fifo, 0); index += 2; } } else { if (wCount >= 2) { - readsw(fifo, pDest, wCount >> 1); + readsw(fifo, dst, wCount >> 1); index = wCount & ~0x01; } } if (wCount & 0x01) - pDest[index] = musb_readb(fifo, 0); + dst[index] = musb_readb(fifo, 0); } else { /* byte aligned */ - readsb(fifo, pDest, wCount); + readsb(fifo, dst, wCount); } } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 9/52] musb_hdrc: Search and replace dwCount with len 2007-08-13 13:48 ` [PATCH 8/52] musb_hdrc: Search and replace pDest with dst Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace dwCount with len Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbhsdma.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -75,7 +75,7 @@ struct musb_dma_channel { struct dma_channel Channel; struct musb_dma_controller *pController; u32 dwStartAddress; - u32 dwCount; + u32 len; u16 wMaxPacketSize; u8 bIndex; u8 bEnd; @@ -162,7 +162,7 @@ static void dma_channel_release(struct dma_channel *pChannel) pChannel->dwActualLength = 0; pImplChannel->dwStartAddress = 0; - pImplChannel->dwCount = 0; + pImplChannel->len = 0; pImplChannel->pController->bmUsedChannels &= ~(1 << pImplChannel->bIndex); @@ -237,7 +237,7 @@ static int dma_channel_program(struct dma_channel * pChannel, pChannel->dwActualLength = 0; pImplChannel->dwStartAddress = dma_addr; - pImplChannel->dwCount = dwLength; + pImplChannel->len = dwLength; pImplChannel->wMaxPacketSize = wPacketSize; pChannel->bStatus = MGC_DMA_STATUS_BUSY; @@ -335,9 +335,9 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) DBG(2, "ch %p, 0x%x -> 0x%x (%d / %d) %s\n", pChannel, pImplChannel->dwStartAddress, dwAddress, pChannel->dwActualLength, - pImplChannel->dwCount, + pImplChannel->len, (pChannel->dwActualLength < - pImplChannel->dwCount) ? + pImplChannel->len) ? "=> reconfig 0": "=> complete"); u8 devctl = musb_readb(mbase, -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count 2007-08-13 13:48 ` [PATCH 9/52] musb_hdrc: Search and replace dwCount with len Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 11/52] musb_hdrc: Search and replace wCount with len Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace wFifoCount with fifo_count Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 10 +++++----- drivers/usb/musb/musb_gadget.c | 26 +++++++++++++------------- drivers/usb/musb/musb_host.c | 20 ++++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -487,7 +487,7 @@ static void ep0_txstate(struct musb *musb) struct usb_request *pRequest = next_ep0_request(musb); u16 wCsrVal = MGC_M_CSR0_TXPKTRDY; u8 *pFifoSource; - u8 wFifoCount; + u8 fifo_count; if (!pRequest) { // WARN_ON(1); @@ -497,13 +497,13 @@ static void ep0_txstate(struct musb *musb) /* load the data */ pFifoSource = (u8 *) pRequest->buf + pRequest->actual; - wFifoCount = min((unsigned) MGC_END0_FIFOSIZE, + fifo_count = min((unsigned) MGC_END0_FIFOSIZE, pRequest->length - pRequest->actual); - musb_write_fifo(&musb->aLocalEnd[0], wFifoCount, pFifoSource); - pRequest->actual += wFifoCount; + musb_write_fifo(&musb->aLocalEnd[0], fifo_count, pFifoSource); + pRequest->actual += fifo_count; /* update the flags */ - if (wFifoCount < MUSB_MAX_END0_PACKET + if (fifo_count < MUSB_MAX_END0_PACKET || pRequest->actual == pRequest->length) { musb->ep0_state = MGC_END0_STAGE_STATUSOUT; wCsrVal |= MGC_M_CSR0_P_DATAEND; --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -256,7 +256,7 @@ static void txstate(struct musb *musb, struct musb_request *req) struct musb_ep *musb_ep; void __iomem *epio = musb->aLocalEnd[bEnd].regs; struct usb_request *pRequest; - u16 wFifoCount = 0, wCsrVal; + u16 fifo_count = 0, wCsrVal; int use_dma = 0; musb_ep = req->ep; @@ -271,7 +271,7 @@ static void txstate(struct musb *musb, struct musb_request *req) wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); pRequest = &req->request; - wFifoCount = min(max_ep_writesize(musb, musb_ep), + fifo_count = min(max_ep_writesize(musb, musb_ep), (int)(pRequest->length - pRequest->actual)); if (wCsrVal & MGC_M_TXCSR_TXPKTRDY) { @@ -287,7 +287,7 @@ static void txstate(struct musb *musb, struct musb_request *req) } DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", - bEnd, musb_ep->wPacketSize, wFifoCount, + bEnd, musb_ep->wPacketSize, fifo_count, wCsrVal); #ifndef CONFIG_USB_INVENTRA_FIFO @@ -381,9 +381,9 @@ static void txstate(struct musb *musb, struct musb_request *req) #endif if (!use_dma) { - musb_write_fifo(musb_ep->hw_ep, wFifoCount, + musb_write_fifo(musb_ep->hw_ep, fifo_count, (u8 *) (pRequest->buf + pRequest->actual)); - pRequest->actual += wFifoCount; + pRequest->actual += fifo_count; wCsrVal |= MGC_M_TXCSR_TXPKTRDY; wCsrVal &= ~MGC_M_TXCSR_P_UNDERRUN; musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); @@ -394,7 +394,7 @@ static void txstate(struct musb *musb, struct musb_request *req) musb_ep->end_point.name, use_dma ? "dma" : "pio", pRequest->actual, pRequest->length, musb_readw(epio, MGC_O_HDRC_TXCSR), - wFifoCount, + fifo_count, musb_readw(epio, MGC_O_HDRC_TXMAXP)); } @@ -577,7 +577,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) struct usb_request *pRequest = &req->request; struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; void __iomem *epio = musb->aLocalEnd[bEnd].regs; - u16 wFifoCount = 0; + u16 fifo_count = 0; u16 wCount = musb_ep->wPacketSize; wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); @@ -684,13 +684,13 @@ static void rxstate(struct musb *musb, struct musb_request *req) } #endif /* Mentor's USB */ - wFifoCount = pRequest->length - pRequest->actual; + fifo_count = pRequest->length - pRequest->actual; DBG(3, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n", musb_ep->end_point.name, - wCount, wFifoCount, + wCount, fifo_count, musb_ep->wPacketSize); - wFifoCount = min(wCount, wFifoCount); + fifo_count = min(wCount, fifo_count); #ifdef CONFIG_USB_TUSB_OMAP_DMA if (tusb_dma_omap() && musb_ep->dma) { @@ -703,15 +703,15 @@ static void rxstate(struct musb *musb, struct musb_request *req) musb_ep->wPacketSize, channel->bDesiredMode, dma_addr, - wFifoCount); + fifo_count); if (ret == TRUE) return; } #endif - musb_read_fifo(musb_ep->hw_ep, wFifoCount, (u8 *) + musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) (pRequest->buf + pRequest->actual)); - pRequest->actual += wFifoCount; + pRequest->actual += fifo_count; /* REVISIT if we left anything in the fifo, flush * it and report -EOVERFLOW --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -947,7 +947,7 @@ static int musb_h_ep0_continue(struct musb *musb, { int bMore = FALSE; u8 *pFifoDest = NULL; - u16 wFifoCount = 0; + u16 fifo_count = 0; struct musb_hw_ep *hw_ep = musb->control_ep; struct musb_qh *qh = hw_ep->in_qh; struct usb_ctrlrequest *pRequest; @@ -955,14 +955,14 @@ static int musb_h_ep0_continue(struct musb *musb, switch (musb->bEnd0Stage) { case MGC_END0_IN: pFifoDest = pUrb->transfer_buffer + pUrb->actual_length; - wFifoCount = min(wCount, ((u16) (pUrb->transfer_buffer_length + fifo_count = min(wCount, ((u16) (pUrb->transfer_buffer_length - pUrb->actual_length))); - if (wFifoCount < wCount) + if (fifo_count < wCount) pUrb->status = -EOVERFLOW; - musb_read_fifo(hw_ep, wFifoCount, pFifoDest); + musb_read_fifo(hw_ep, fifo_count, pFifoDest); - pUrb->actual_length += wFifoCount; + pUrb->actual_length += fifo_count; if (wCount < qh->maxpacket) { /* always terminate on short read; it's * rarely reported as an error. @@ -989,18 +989,18 @@ static int musb_h_ep0_continue(struct musb *musb, } /* FALLTHROUGH */ case MGC_END0_OUT: - wFifoCount = min(qh->maxpacket, ((u16) + fifo_count = min(qh->maxpacket, ((u16) (pUrb->transfer_buffer_length - pUrb->actual_length))); - if (wFifoCount) { + if (fifo_count) { pFifoDest = (u8 *) (pUrb->transfer_buffer + pUrb->actual_length); DBG(3, "Sending %d bytes to %p\n", - wFifoCount, pFifoDest); - musb_write_fifo(hw_ep, wFifoCount, pFifoDest); + fifo_count, pFifoDest); + musb_write_fifo(hw_ep, fifo_count, pFifoDest); - pUrb->actual_length += wFifoCount; + pUrb->actual_length += fifo_count; bMore = TRUE; } break; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 11/52] musb_hdrc: Search and replace wCount with len 2007-08-13 13:48 ` [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace wCount with len Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 10 ++++---- drivers/usb/musb/musb_gadget.c | 12 +++++----- drivers/usb/musb/musb_host.c | 16 +++++++------- drivers/usb/musb/musbdefs.h | 4 +- drivers/usb/musb/plat_uds.c | 44 ++++++++++++++++++++-------------------- 5 files changed, 43 insertions(+), 43 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -599,17 +599,17 @@ __acquires(musb->Lock) irqreturn_t musb_g_ep0_irq(struct musb *musb) { u16 wCsrVal; - u16 wCount; + u16 len; void __iomem *mbase = musb->mregs; void __iomem *regs = musb->aLocalEnd[0].regs; irqreturn_t retval = IRQ_NONE; MGC_SelectEnd(mbase, 0); /* select ep0 */ wCsrVal = musb_readw(regs, MGC_O_HDRC_CSR0); - wCount = musb_readb(regs, MGC_O_HDRC_COUNT0); + len = musb_readb(regs, MGC_O_HDRC_COUNT0); DBG(4, "csr %04x, count %d, myaddr %d, ep0stage %s\n", - wCsrVal, wCount, + wCsrVal, len, musb_readb(mbase, MGC_O_HDRC_FADDR), decode_ep0stage(musb->ep0_state)); @@ -696,8 +696,8 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) struct usb_ctrlrequest setup; int handled = 0; - if (wCount != 8) { - ERR("SETUP packet len %d != 8 ?\n", wCount); + if (len != 8) { + ERR("SETUP packet len %d != 8 ?\n", len); break; } musb_read_setup(musb, &setup); --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -578,7 +578,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; void __iomem *epio = musb->aLocalEnd[bEnd].regs; u16 fifo_count = 0; - u16 wCount = musb_ep->wPacketSize; + u16 len = musb_ep->wPacketSize; wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); @@ -610,7 +610,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) } if (wCsrVal & MGC_M_RXCSR_RXPKTRDY) { - wCount = musb_readw(epio, MGC_O_HDRC_RXCOUNT); + len = musb_readw(epio, MGC_O_HDRC_RXCOUNT); if (pRequest->actual < pRequest->length) { #ifdef CONFIG_USB_INVENTRA_DMA if (is_dma_capable() && musb_ep->dma) { @@ -663,7 +663,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) transfer_size = min(pRequest->length, channel->dwMaxLength); #else - transfer_size = wCount; + transfer_size = len; #endif if (transfer_size <= musb_ep->wPacketSize) musb_ep->dma->bDesiredMode = 0; @@ -687,10 +687,10 @@ static void rxstate(struct musb *musb, struct musb_request *req) fifo_count = pRequest->length - pRequest->actual; DBG(3, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n", musb_ep->end_point.name, - wCount, fifo_count, + len, fifo_count, musb_ep->wPacketSize); - fifo_count = min(wCount, fifo_count); + fifo_count = min(len, fifo_count); #ifdef CONFIG_USB_TUSB_OMAP_DMA if (tusb_dma_omap() && musb_ep->dma) { @@ -725,7 +725,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) } /* reach the end or short packet detected */ - if (pRequest->actual == pRequest->length || wCount < musb_ep->wPacketSize) + if (pRequest->actual == pRequest->length || len < musb_ep->wPacketSize) musb_g_giveback(musb_ep, pRequest, 0); } --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -943,7 +943,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, * Return TRUE until it's time to start the status stage. */ static int musb_h_ep0_continue(struct musb *musb, - u16 wCount, struct urb *pUrb) + u16 len, struct urb *pUrb) { int bMore = FALSE; u8 *pFifoDest = NULL; @@ -955,15 +955,15 @@ static int musb_h_ep0_continue(struct musb *musb, switch (musb->bEnd0Stage) { case MGC_END0_IN: pFifoDest = pUrb->transfer_buffer + pUrb->actual_length; - fifo_count = min(wCount, ((u16) (pUrb->transfer_buffer_length + fifo_count = min(len, ((u16) (pUrb->transfer_buffer_length - pUrb->actual_length))); - if (fifo_count < wCount) + if (fifo_count < len) pUrb->status = -EOVERFLOW; musb_read_fifo(hw_ep, fifo_count, pFifoDest); pUrb->actual_length += fifo_count; - if (wCount < qh->maxpacket) { + if (len < qh->maxpacket) { /* always terminate on short read; it's * rarely reported as an error. */ @@ -1021,7 +1021,7 @@ static int musb_h_ep0_continue(struct musb *musb, irqreturn_t musb_h_ep0_irq(struct musb *musb) { struct urb *pUrb; - u16 wCsrVal, wCount; + u16 wCsrVal, len; int status = 0; void __iomem *mbase = musb->mregs; struct musb_hw_ep *hw_ep = musb->control_ep; @@ -1035,12 +1035,12 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) MGC_SelectEnd(mbase, 0); wCsrVal = musb_readw(epio, MGC_O_HDRC_CSR0); - wCount = (wCsrVal & MGC_M_CSR0_RXPKTRDY) + len = (wCsrVal & MGC_M_CSR0_RXPKTRDY) ? musb_readb(epio, MGC_O_HDRC_COUNT0) : 0; DBG(4, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d\n", - wCsrVal, qh, wCount, pUrb, musb->bEnd0Stage); + wCsrVal, qh, len, pUrb, musb->bEnd0Stage); /* if we just did status stage, we are done */ if (MGC_END0_STATUS == musb->bEnd0Stage) { @@ -1112,7 +1112,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) if (!bComplete) { /* call common logic and prepare response */ - if (musb_h_ep0_continue(musb, wCount, pUrb)) { + if (musb_h_ep0_continue(musb, len, pUrb)) { /* more packets required */ wCsrVal = (MGC_END0_IN == musb->bEnd0Stage) ? MGC_M_CSR0_H_REQPKT : MGC_M_CSR0_TXPKTRDY; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -500,9 +500,9 @@ extern void musb_start(struct musb *musb); extern void musb_stop(struct musb *musb); extern void musb_write_fifo(struct musb_hw_ep *ep, - u16 wCount, const u8 * src); + u16 len, const u8 * src); extern void musb_read_fifo(struct musb_hw_ep *ep, - u16 wCount, u8 * dst); + u16 len, u8 * dst); extern void musb_load_testpacket(struct musb *); --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -169,14 +169,14 @@ static inline struct musb *dev_to_musb(struct device *dev) /* * Load an endpoint's FIFO */ -void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 wCount, const u8 *src) +void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) { void __iomem *fifo = hw_ep->fifo; prefetch((u8 *)src); DBG(4, "%cX ep%d fifo %p count %d buf %p\n", - 'T', hw_ep->bLocalEnd, fifo, wCount, src); + 'T', hw_ep->bLocalEnd, fifo, len, src); /* we can't assume unaligned reads work */ if (likely((0x01 & (unsigned long) src) == 0)) { @@ -184,37 +184,37 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 wCount, const u8 *src) /* best case is 32bit-aligned source address */ if ((0x02 & (unsigned long) src) == 0) { - if (wCount >= 4) { - writesl(fifo, src + index, wCount >> 2); - index += wCount & ~0x03; + if (len >= 4) { + writesl(fifo, src + index, len >> 2); + index += len & ~0x03; } - if (wCount & 0x02) { + if (len & 0x02) { musb_writew(fifo, 0, *(u16*)&src[index]); index += 2; } } else { - if (wCount >= 2) { - writesw(fifo, src + index, wCount >> 1); - index += wCount & ~0x01; + if (len >= 2) { + writesw(fifo, src + index, len >> 1); + index += len & ~0x01; } } - if (wCount & 0x01) + if (len & 0x01) musb_writeb(fifo, 0, src[index]); } else { /* byte aligned */ - writesb(fifo, src, wCount); + writesb(fifo, src, len); } } /* * Unload an endpoint's FIFO */ -void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 wCount, u8 *dst) +void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) { void __iomem *fifo = hw_ep->fifo; DBG(4, "%cX ep%d fifo %p count %d buf %p\n", - 'R', hw_ep->bLocalEnd, fifo, wCount, dst); + 'R', hw_ep->bLocalEnd, fifo, len, dst); /* we can't assume unaligned writes work */ if (likely((0x01 & (unsigned long) dst) == 0)) { @@ -222,25 +222,25 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 wCount, u8 *dst) /* best case is 32bit-aligned destination address */ if ((0x02 & (unsigned long) dst) == 0) { - if (wCount >= 4) { - readsl(fifo, dst, wCount >> 2); - index = wCount & ~0x03; + if (len >= 4) { + readsl(fifo, dst, len >> 2); + index = len & ~0x03; } - if (wCount & 0x02) { + if (len & 0x02) { *(u16*)&dst[index] = musb_readw(fifo, 0); index += 2; } } else { - if (wCount >= 2) { - readsw(fifo, dst, wCount >> 1); - index = wCount & ~0x01; + if (len >= 2) { + readsw(fifo, dst, len >> 1); + index = len & ~0x01; } } - if (wCount & 0x01) + if (len & 0x01) dst[index] = musb_readb(fifo, 0); } else { /* byte aligned */ - readsb(fifo, dst, wCount); + readsb(fifo, dst, len); } } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum 2007-08-13 13:48 ` [PATCH 11/52] musb_hdrc: Search and replace wCount with len Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bLocalEnd with epnum Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 2 +- drivers/usb/musb/dma.h | 2 +- drivers/usb/musb/musb_host.c | 16 ++++++++-------- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/musbhsdma.c | 2 +- drivers/usb/musb/plat_uds.c | 24 ++++++++++++------------ drivers/usb/musb/tusb6010.c | 4 ++-- drivers/usb/musb/tusb6010_omap.c | 8 ++++---- 8 files changed, 30 insertions(+), 30 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -289,7 +289,7 @@ cppi_channel_allocate(struct dma_controller *c, u8 chNum; struct cppi_channel *otgCh; void __iomem *tibase; - int local_end = ep->bLocalEnd; + int local_end = ep->epnum; pController = container_of(c, struct cppi, Controller); tibase = pController->pCoreBase - DAVINCI_BASE_OFFSET; --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -180,7 +180,7 @@ struct dma_controller { }; /* called after channel_program(), may indicate a fault */ -extern void musb_dma_completion(struct musb *musb, u8 bLocalEnd, u8 bTransmit); +extern void musb_dma_completion(struct musb *musb, u8 epnum, u8 bTransmit); extern struct dma_controller *__init --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -139,7 +139,7 @@ static inline void musb_h_tx_start(struct musb_hw_ep *ep) u16 txcsr; /* NOTE: no locks here; caller should lock and select EP */ - if (ep->bLocalEnd) { + if (ep->epnum) { txcsr = musb_readw(ep->regs, MGC_O_HDRC_TXCSR); txcsr |= MGC_M_TXCSR_TXPKTRDY | MGC_M_TXCSR_H_WZC_BITS; musb_writew(ep->regs, MGC_O_HDRC_TXCSR, txcsr); @@ -177,7 +177,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) struct musb_hw_ep *hw_ep = qh->hw_ep; unsigned nPipe = urb->pipe; u8 bAddress = usb_pipedevice(nPipe); - int bEnd = hw_ep->bLocalEnd; + int bEnd = hw_ep->epnum; /* initialize software qh state */ qh->offset = 0; @@ -396,7 +396,7 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) * de-allocated if it's tracked and allocated; * and where we'd update the schedule tree... */ - musb->periodic[ep->bLocalEnd] = NULL; + musb->periodic[ep->epnum] = NULL; kfree(qh); qh = NULL; break; @@ -437,7 +437,7 @@ musb_advance_schedule(struct musb *musb, struct urb *urb, if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) { DBG(4, "... next ep%d %cX urb %p\n", - hw_ep->bLocalEnd, is_in ? 'R' : 'T', + hw_ep->epnum, is_in ? 'R' : 'T', next_urb(qh)); musb_start_urb(musb, is_in, qh); } @@ -592,7 +592,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) } else { csr = musb_readw(ep->regs, MGC_O_HDRC_RXCSR); if (csr & MGC_M_RXCSR_RXPKTRDY) - WARN("rx%d, packet/%d ready?\n", ep->bLocalEnd, + WARN("rx%d, packet/%d ready?\n", ep->epnum, musb_readw(ep->regs, MGC_O_HDRC_RXCOUNT)); musb_h_flush_rxfifo(ep, MGC_M_RXCSR_CLRDATATOG); @@ -893,7 +893,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, | MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_H_REQPKT)) ERR("broken !rx_reinit, ep%d csr %04x\n", - hw_ep->bLocalEnd, csr); + hw_ep->epnum, csr); /* scrub any stale state, leaving toggle alone */ csr &= MGC_M_RXCSR_DISNYET; @@ -1903,7 +1903,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in) { struct musb_hw_ep *ep = qh->hw_ep; void __iomem *epio = ep->regs; - unsigned hw_end = ep->bLocalEnd; + unsigned hw_end = ep->epnum; void __iomem *regs = ep->musb->mregs; u16 csr; int status = 0; @@ -1918,7 +1918,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in) status = ep->musb->pDmaController->channel_abort(dma); DBG(status ? 1 : 3, "abort %cX%d DMA for urb %p --> %d\n", - is_in ? 'R' : 'T', ep->bLocalEnd, + is_in ? 'R' : 'T', ep->epnum, urb, status); urb->actual_length += dma->dwActualLength; } --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -283,7 +283,7 @@ struct musb_hw_ep { #endif /* index in musb->aLocalEnd[] */ - u8 bLocalEnd; + u8 epnum; /* hardware configuration, possibly dynamic */ u8 bIsSharedFifo; --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -140,7 +140,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pImplChannel = &(pController->aChannel[bBit]); pImplChannel->pController = pController; pImplChannel->bIndex = bBit; - pImplChannel->bEnd = hw_ep->bLocalEnd; + pImplChannel->bEnd = hw_ep->epnum; pImplChannel->bTransmit = bTransmit; pChannel = &(pImplChannel->Channel); pChannel->pPrivateData = pImplChannel; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -176,7 +176,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) prefetch((u8 *)src); DBG(4, "%cX ep%d fifo %p count %d buf %p\n", - 'T', hw_ep->bLocalEnd, fifo, len, src); + 'T', hw_ep->epnum, fifo, len, src); /* we can't assume unaligned reads work */ if (likely((0x01 & (unsigned long) src) == 0)) { @@ -214,7 +214,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) void __iomem *fifo = hw_ep->fifo; DBG(4, "%cX ep%d fifo %p count %d buf %p\n", - 'R', hw_ep->bLocalEnd, fifo, len, dst); + 'R', hw_ep->epnum, fifo, len, dst); /* we can't assume unaligned writes work */ if (likely((0x01 & (unsigned long) dst) == 0)) { @@ -1044,13 +1044,13 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, } /* configure the FIFO */ - musb_writeb(mbase, MGC_O_HDRC_INDEX, hw_ep->bLocalEnd); + musb_writeb(mbase, MGC_O_HDRC_INDEX, hw_ep->epnum); #ifdef CONFIG_USB_MUSB_HDRC_HCD /* EP0 reserved endpoint for control, bidirectional; * EP1 reserved for bulk, two unidirection halves. */ - if (hw_ep->bLocalEnd == 1) + if (hw_ep->epnum == 1) musb->bulk_ep = hw_ep; /* REVISIT error check: be sure ep0 can both rx and tx ... */ #endif @@ -1085,7 +1085,7 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, /* NOTE rx and tx endpoint irqs aren't managed separately, * which happens to be ok */ - musb->wEndMask |= (1 << hw_ep->bLocalEnd); + musb->wEndMask |= (1 << hw_ep->epnum); return offset + (maxpacket << ((c_size & MGC_M_FIFOSZ_DPB) ? 1 : 0)); } @@ -1538,13 +1538,13 @@ static int __initdata use_dma = 1; module_param(use_dma, bool, 0); MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); -void musb_dma_completion(struct musb *musb, u8 bLocalEnd, u8 bTransmit) +void musb_dma_completion(struct musb *musb, u8 epnum, u8 bTransmit) { u8 devctl = musb_readb(musb->mregs, MGC_O_HDRC_DEVCTL); /* called with controller lock already held */ - if (!bLocalEnd) { + if (!epnum) { #ifndef CONFIG_USB_TUSB_OMAP_DMA if (!is_cppi_enabled()) { /* endpoint 0 */ @@ -1559,19 +1559,19 @@ void musb_dma_completion(struct musb *musb, u8 bLocalEnd, u8 bTransmit) if (bTransmit) { if (devctl & MGC_M_DEVCTL_HM) { if (is_host_capable()) - musb_host_tx(musb, bLocalEnd); + musb_host_tx(musb, epnum); } else { if (is_peripheral_capable()) - musb_g_tx(musb, bLocalEnd); + musb_g_tx(musb, epnum); } } else { /* receive */ if (devctl & MGC_M_DEVCTL_HM) { if (is_host_capable()) - musb_host_rx(musb, bLocalEnd); + musb_host_rx(musb, epnum); } else { if (is_peripheral_capable()) - musb_g_rx(musb, bLocalEnd); + musb_g_rx(musb, epnum); } } } @@ -1776,7 +1776,7 @@ allocate_instance(struct device *dev, void __iomem *mbase) epnum++, ep++) { ep->musb = musb; - ep->bLocalEnd = epnum; + ep->epnum = epnum; } musb->controller = dev; --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -152,7 +152,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf) { void __iomem *ep_conf = hw_ep->conf; void __iomem *fifo = hw_ep->fifo; - u8 epnum = hw_ep->bLocalEnd; + u8 epnum = hw_ep->epnum; prefetch(buf); @@ -201,7 +201,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf) { void __iomem *ep_conf = hw_ep->conf; void __iomem *fifo = hw_ep->fifo; - u8 epnum = hw_ep->bLocalEnd; + u8 epnum = hw_ep->epnum; DBG(4, "%cX ep%d fifo %p count %d buf %p\n", 'R', epnum, fifo, len, buf); --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -508,13 +508,13 @@ tusb_omap_dma_allocate(struct dma_controller *c, reg = musb_readl(tusb_base, TUSB_DMA_INT_MASK); if (tx) - reg &= ~(1 << hw_ep->bLocalEnd); + reg &= ~(1 << hw_ep->epnum); else - reg &= ~(1 << (hw_ep->bLocalEnd + 15)); + reg &= ~(1 << (hw_ep->epnum + 15)); musb_writel(tusb_base, TUSB_DMA_INT_MASK, reg); /* REVISIT: Why does dmareq5 not work? */ - if (hw_ep->bLocalEnd == 0) { + if (hw_ep->epnum == 0) { DBG(3, "Not allowing DMA for ep0 %s\n", tx ? "tx" : "rx"); return NULL; } @@ -543,7 +543,7 @@ tusb_omap_dma_allocate(struct dma_controller *c, chdat->musb = tusb_dma->musb; chdat->tusb_base = tusb_dma->tusb_base; chdat->hw_ep = hw_ep; - chdat->epnum = hw_ep->bLocalEnd; + chdat->epnum = hw_ep->epnum; chdat->dmareq = -1; chdat->completed_len = 0; chdat->tusb_dma = tusb_dma; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints 2007-08-13 13:48 ` [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace aLocalEnd with endpoints Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 28 ++++++++++++++-------------- drivers/usb/musb/musb_gadget.c | 28 ++++++++++++++-------------- drivers/usb/musb/musb_host.c | 12 ++++++------ drivers/usb/musb/musb_procfs.c | 2 +- drivers/usb/musb/musbdefs.h | 6 +++--- drivers/usb/musb/plat_uds.c | 16 ++++++++-------- 6 files changed, 46 insertions(+), 46 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -41,8 +41,8 @@ #include "musbdefs.h" -/* ep0 is always musb->aLocalEnd[0].ep_in */ -#define next_ep0_request(musb) next_in_request(&(musb)->aLocalEnd[0]) +/* ep0 is always musb->endpoints[0].ep_in */ +#define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0]) /* * Locking note: we use only the controller lock, for simpler correctness. @@ -116,11 +116,11 @@ static int service_tx_status_request( is_in = bEnd & USB_DIR_IN; if (is_in) { bEnd &= 0x0f; - ep = &musb->aLocalEnd[bEnd].ep_in; + ep = &musb->endpoints[bEnd].ep_in; } else { - ep = &musb->aLocalEnd[bEnd].ep_out; + ep = &musb->endpoints[bEnd].ep_out; } - regs = musb->aLocalEnd[bEnd].regs; + regs = musb->endpoints[bEnd].regs; if (bEnd >= MUSB_C_NUM_EPS || !ep->desc) { handled = -EINVAL; @@ -151,7 +151,7 @@ static int service_tx_status_request( if (len > 2) len = 2; - musb_write_fifo(&musb->aLocalEnd[0], len, bResult); + musb_write_fifo(&musb->endpoints[0], len, bResult); } return handled; @@ -197,7 +197,7 @@ service_in_request(struct musb *musb, static void musb_g_ep0_giveback(struct musb *musb, struct usb_request *req) { musb->ep0_state = MGC_END0_STAGE_SETUP; - musb_g_giveback(&musb->aLocalEnd[0].ep_in, req, 0); + musb_g_giveback(&musb->endpoints[0].ep_in, req, 0); } /* @@ -266,9 +266,9 @@ __acquires(musb->Lock) break; if (pControlRequest->wIndex & USB_DIR_IN) - musb_ep = &musb->aLocalEnd[bEnd].ep_in; + musb_ep = &musb->endpoints[bEnd].ep_in; else - musb_ep = &musb->aLocalEnd[bEnd].ep_out; + musb_ep = &musb->endpoints[bEnd].ep_out; if (!musb_ep->desc) break; @@ -378,7 +378,7 @@ stall: != USB_ENDPOINT_HALT) break; - ep = musb->aLocalEnd + bEnd; + ep = musb->endpoints + bEnd; regs = ep->regs; is_in = pControlRequest->wIndex & USB_DIR_IN; if (is_in) @@ -454,7 +454,7 @@ static void ep0_rxstate(struct musb *this) req->status = -EOVERFLOW; tmp = len; } - musb_read_fifo(&this->aLocalEnd[0], tmp, buf); + musb_read_fifo(&this->endpoints[0], tmp, buf); req->actual += tmp; tmp = MGC_M_CSR0_P_SVDRXPKTRDY; if (tmp < 64 || req->actual == req->length) { @@ -499,7 +499,7 @@ static void ep0_txstate(struct musb *musb) pFifoSource = (u8 *) pRequest->buf + pRequest->actual; fifo_count = min((unsigned) MGC_END0_FIFOSIZE, pRequest->length - pRequest->actual); - musb_write_fifo(&musb->aLocalEnd[0], fifo_count, pFifoSource); + musb_write_fifo(&musb->endpoints[0], fifo_count, pFifoSource); pRequest->actual += fifo_count; /* update the flags */ @@ -534,7 +534,7 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) struct usb_request *r; void __iomem *regs = musb->control_ep->regs; - musb_read_fifo(&musb->aLocalEnd[0], sizeof *req, (u8 *)req); + musb_read_fifo(&musb->endpoints[0], sizeof *req, (u8 *)req); /* NOTE: earlier 2.6 versions changed setup packets to host * order, but now USB packets always stay in USB byte order. @@ -601,7 +601,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) u16 wCsrVal; u16 len; void __iomem *mbase = musb->mregs; - void __iomem *regs = musb->aLocalEnd[0].regs; + void __iomem *regs = musb->endpoints[0].regs; irqreturn_t retval = IRQ_NONE; MGC_SelectEnd(mbase, 0); /* select ep0 */ --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -159,7 +159,7 @@ __acquires(ep->musb->Lock) static void nuke(struct musb_ep *ep, const int status) { struct musb_request *req = NULL; - void __iomem *epio = ep->musb->aLocalEnd[ep->bEndNumber].regs; + void __iomem *epio = ep->musb->endpoints[ep->bEndNumber].regs; ep->busy = 1; @@ -254,7 +254,7 @@ static void txstate(struct musb *musb, struct musb_request *req) { u8 bEnd = req->bEnd; struct musb_ep *musb_ep; - void __iomem *epio = musb->aLocalEnd[bEnd].regs; + void __iomem *epio = musb->endpoints[bEnd].regs; struct usb_request *pRequest; u16 fifo_count = 0, wCsrVal; int use_dma = 0; @@ -407,8 +407,8 @@ void musb_g_tx(struct musb *musb, u8 bEnd) u16 wCsrVal; struct usb_request *pRequest; u8 __iomem *mbase = musb->mregs; - struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_in; - void __iomem *epio = musb->aLocalEnd[bEnd].regs; + struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_in; + void __iomem *epio = musb->endpoints[bEnd].regs; struct dma_channel *dma; MGC_SelectEnd(mbase, bEnd); @@ -575,8 +575,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) u16 wCsrVal = 0; const u8 bEnd = req->bEnd; struct usb_request *pRequest = &req->request; - struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; - void __iomem *epio = musb->aLocalEnd[bEnd].regs; + struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_out; + void __iomem *epio = musb->endpoints[bEnd].regs; u16 fifo_count = 0; u16 len = musb_ep->wPacketSize; @@ -737,8 +737,8 @@ void musb_g_rx(struct musb *musb, u8 bEnd) u16 wCsrVal; struct usb_request *pRequest; void __iomem *mbase = musb->mregs; - struct musb_ep *musb_ep = &musb->aLocalEnd[bEnd].ep_out; - void __iomem *epio = musb->aLocalEnd[bEnd].regs; + struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_out; + void __iomem *epio = musb->endpoints[bEnd].regs; struct dma_channel *dma; MGC_SelectEnd(mbase, bEnd); @@ -1007,7 +1007,7 @@ static int musb_gadget_disable(struct usb_ep *ep) musb_ep = to_musb_ep(ep); musb = musb_ep->musb; bEnd = musb_ep->bEndNumber; - epio = musb->aLocalEnd[bEnd].regs; + epio = musb->endpoints[bEnd].regs; spin_lock_irqsave(&musb->Lock, flags); MGC_SelectEnd(musb->mregs, bEnd); @@ -1231,7 +1231,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) struct musb_ep *musb_ep = to_musb_ep(ep); u8 bEnd = musb_ep->bEndNumber; struct musb *musb = musb_ep->musb; - void __iomem *epio = musb->aLocalEnd[bEnd].regs; + void __iomem *epio = musb->endpoints[bEnd].regs; void __iomem *mbase; unsigned long flags; u16 wCsr; @@ -1331,7 +1331,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) struct musb_ep *musb_ep = to_musb_ep(ep); struct musb *musb = musb_ep->musb; u8 nEnd = musb_ep->bEndNumber; - void __iomem *epio = musb->aLocalEnd[nEnd].regs; + void __iomem *epio = musb->endpoints[nEnd].regs; void __iomem *mbase; unsigned long flags; u16 wCsr, wIntrTxE; @@ -1557,7 +1557,7 @@ static void musb_gadget_release(struct device *dev) static void __init init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in) { - struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; memset(ep, 0, sizeof *ep); @@ -1600,7 +1600,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) /* intialize endpoint list just once */ INIT_LIST_HEAD(&(musb->g.ep_list)); - for (bEnd = 0, hw_ep = musb->aLocalEnd; + for (bEnd = 0, hw_ep = musb->endpoints; bEnd < musb->bEndCount; bEnd++, hw_ep++) { if (hw_ep->bIsSharedFifo /* || !bEnd */) { @@ -1796,7 +1796,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) * then report disconnect */ if (driver) { - for (i = 0, hw_ep = musb->aLocalEnd; + for (i = 0, hw_ep = musb->endpoints; i < musb->bEndCount; i++, hw_ep++) { MGC_SelectEnd(musb->mregs, i); --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -475,7 +475,7 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, u8 bDone = FALSE; u32 length; int do_flush = 0; - struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; int nPipe = pUrb->pipe; @@ -631,7 +631,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, struct dma_channel *pDmaChannel; u8 bDmaOk; void __iomem *mbase = musb->mregs; - struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; void __iomem *epio = hw_ep->regs; struct musb_qh *qh; u16 wPacketSize; @@ -1170,7 +1170,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) size_t wLength = 0; u8 *pBuffer = NULL; struct urb *pUrb; - struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->out_qh; u32 status = 0; @@ -1380,7 +1380,7 @@ finish: void musb_host_rx(struct musb *musb, u8 bEnd) { struct urb *pUrb; - struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; size_t xfer_len; @@ -1711,7 +1711,7 @@ static int musb_schedule( if (musb->periodic[nEnd]) continue; - hw_ep = &musb->aLocalEnd[nEnd]; + hw_ep = &musb->endpoints[nEnd]; if (hw_ep == musb->bulk_ep) continue; @@ -1729,7 +1729,7 @@ static int musb_schedule( return -ENOSPC; idle = 1; - hw_ep = musb->aLocalEnd + nBestEnd; + hw_ep = musb->endpoints + nBestEnd; musb->periodic[nBestEnd] = qh; DBG(4, "qh %p periodic slot %d\n", qh, nBestEnd); success: --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -237,7 +237,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) { int code = 0; char *buf = aBuffer; - struct musb_hw_ep *hw_ep = &musb->aLocalEnd[bEnd]; + struct musb_hw_ep *hw_ep = &musb->endpoints[bEnd]; do { MGC_SelectEnd(musb->mregs, bEnd); --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -282,7 +282,7 @@ struct musb_hw_ep { void __iomem *conf; #endif - /* index in musb->aLocalEnd[] */ + /* index in musb->endpoints[] */ u8 epnum; /* hardware configuration, possibly dynamic */ @@ -397,8 +397,8 @@ struct musb { int nIrq; - struct musb_hw_ep aLocalEnd[MUSB_C_NUM_EPS]; -#define control_ep aLocalEnd + struct musb_hw_ep endpoints[MUSB_C_NUM_EPS]; +#define control_ep endpoints #define VBUSERR_RETRY_COUNT 3 u16 vbuserr_retry; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -271,7 +271,7 @@ static const u8 musb_test_packet[53] = { void musb_load_testpacket(struct musb *musb) { - void __iomem *regs = musb->aLocalEnd[0].regs; + void __iomem *regs = musb->endpoints[0].regs; MGC_SelectEnd(musb->mregs, 0); musb_write_fifo(musb->control_ep, @@ -670,7 +670,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, /* start any periodic Tx transfers waiting for current frame */ wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME); - ep = musb->aLocalEnd; + ep = musb->endpoints; for (bEnd = 1; (bEnd < musb->bEndCount) && (musb->wEndMask >= (1 << bEnd)); bEnd++, ep++) { @@ -1099,7 +1099,7 @@ static int __init ep_config_from_table(struct musb *musb) const struct fifo_cfg *cfg; unsigned i, n; int offset; - struct musb_hw_ep *hw_ep = musb->aLocalEnd; + struct musb_hw_ep *hw_ep = musb->endpoints; switch (fifo_mode) { default: @@ -1188,7 +1188,7 @@ static int __init ep_config_from_hw(struct musb *musb) for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) { MGC_SelectEnd(mbase, bEnd); - hw_ep = musb->aLocalEnd + bEnd; + hw_ep = musb->endpoints + bEnd; /* read from core using indexed model */ reg = musb_readb(hw_ep->regs, 0x10 + MGC_O_HDRC_FIFOSIZE); @@ -1334,8 +1334,8 @@ static int __init musb_core_init(u16 wType, struct musb *musb) musb_driver_name, type, aRevision, aDate); /* configure ep0 */ - musb->aLocalEnd[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE; - musb->aLocalEnd[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; + musb->endpoints[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE; + musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; /* discover endpoint configuration */ musb->bEndCount = 1; @@ -1362,7 +1362,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) /* finish init, and print endpoint config */ for (i = 0; i < musb->bEndCount; i++) { - struct musb_hw_ep *hw_ep = musb->aLocalEnd + i; + struct musb_hw_ep *hw_ep = musb->endpoints + i; hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase; #ifdef CONFIG_USB_TUSB6010 @@ -1771,7 +1771,7 @@ allocate_instance(struct device *dev, void __iomem *mbase) musb->mregs = mbase; musb->ctrl_base = mbase; musb->nIrq = -ENODEV; - for (epnum = 0, ep = musb->aLocalEnd; + for (epnum = 0, ep = musb->endpoints; epnum < MUSB_C_NUM_EPS; epnum++, ep++) { -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints 2007-08-13 13:48 ` [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bEndCount with nr_endpoints Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_gadget.c | 4 ++-- drivers/usb/musb/musb_host.c | 2 +- drivers/usb/musb/musb_procfs.c | 4 ++-- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1601,7 +1601,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) INIT_LIST_HEAD(&(musb->g.ep_list)); for (bEnd = 0, hw_ep = musb->endpoints; - bEnd < musb->bEndCount; + bEnd < musb->nr_endpoints; bEnd++, hw_ep++) { if (hw_ep->bIsSharedFifo /* || !bEnd */) { init_peripheral_ep(musb, &hw_ep->ep_in, bEnd, 0); @@ -1797,7 +1797,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) */ if (driver) { for (i = 0, hw_ep = musb->endpoints; - i < musb->bEndCount; + i < musb->nr_endpoints; i++, hw_ep++) { MGC_SelectEnd(musb->mregs, i); if (hw_ep->bIsSharedFifo /* || !bEnd */) { --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -1706,7 +1706,7 @@ static int musb_schedule( wBestDiff = 4096; nBestEnd = -1; - for (nEnd = 1; nEnd < musb->bEndCount; nEnd++) { + for (nEnd = 1; nEnd < musb->nr_endpoints; nEnd++) { int diff; if (musb->periodic[nEnd]) --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -528,7 +528,7 @@ static int dump_header_stats(struct musb *musb, char *buffer) #endif ", debug=%d [eps=%d]\n", debug, - musb->bEndCount); + musb->nr_endpoints); if (code <= 0) goto done; count += code; @@ -802,7 +802,7 @@ static int musb_proc_read(char *page, char **start, /* generate the report for the end points */ // REVISIT ... not unless something's connected! - for (bEnd = 0; count >= 0 && bEnd < musb->bEndCount; + for (bEnd = 0; count >= 0 && bEnd < musb->nr_endpoints; bEnd++) { code = dump_end_info(musb, bEnd, buffer, count); if (code > 0) { --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -403,7 +403,7 @@ struct musb { #define VBUSERR_RETRY_COUNT 3 u16 vbuserr_retry; u16 wEndMask; - u8 bEndCount; + u8 nr_endpoints; u8 board_mode; /* enum musb_mode */ int (*board_set_power)(int state); --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -671,7 +671,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, /* start any periodic Tx transfers waiting for current frame */ wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME); ep = musb->endpoints; - for (bEnd = 1; (bEnd < musb->bEndCount) + for (bEnd = 1; (bEnd < musb->nr_endpoints) && (musb->wEndMask >= (1 << bEnd)); bEnd++, ep++) { // FIXME handle framecounter wraps (12 bits) @@ -1153,7 +1153,7 @@ static int __init ep_config_from_table(struct musb *musb) return -EINVAL; } epn++; - musb->bEndCount = max(epn, musb->bEndCount); + musb->nr_endpoints = max(epn, musb->nr_endpoints); } printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n", @@ -1196,7 +1196,7 @@ static int __init ep_config_from_hw(struct musb *musb) /* 0's returned when no more endpoints */ break; } - musb->bEndCount++; + musb->nr_endpoints++; musb->wEndMask |= (1 << bEnd); hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f); @@ -1338,7 +1338,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; /* discover endpoint configuration */ - musb->bEndCount = 1; + musb->nr_endpoints = 1; musb->wEndMask = 1; if (reg & MGC_M_CONFIGDATA_DYNFIFO) { @@ -1361,7 +1361,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) return status; /* finish init, and print endpoint config */ - for (i = 0; i < musb->bEndCount; i++) { + for (i = 0; i < musb->nr_endpoints; i++) { struct musb_hw_ep *hw_ep = musb->endpoints + i; hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum 2007-08-13 13:48 ` [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bEndNumber with current_epnum Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_gadget.c | 20 ++++++++++---------- drivers/usb/musb/musb_gadget.h | 2 +- drivers/usb/musb/musb_procfs.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -159,7 +159,7 @@ __acquires(ep->musb->Lock) static void nuke(struct musb_ep *ep, const int status) { struct musb_request *req = NULL; - void __iomem *epio = ep->musb->endpoints[ep->bEndNumber].regs; + void __iomem *epio = ep->musb->endpoints[ep->current_epnum].regs; ep->busy = 1; @@ -869,7 +869,7 @@ static int musb_gadget_enable(struct usb_ep *ep, regs = hw_ep->regs; musb = musb_ep->musb; mbase = musb->mregs; - bEnd = musb_ep->bEndNumber; + bEnd = musb_ep->current_epnum; spin_lock_irqsave(&musb->Lock, flags); @@ -1006,7 +1006,7 @@ static int musb_gadget_disable(struct usb_ep *ep) musb_ep = to_musb_ep(ep); musb = musb_ep->musb; - bEnd = musb_ep->bEndNumber; + bEnd = musb_ep->current_epnum; epio = musb->endpoints[bEnd].regs; spin_lock_irqsave(&musb->Lock, flags); @@ -1052,7 +1052,7 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) if (pRequest) { INIT_LIST_HEAD(&pRequest->request.list); pRequest->request.dma = DMA_ADDR_INVALID; - pRequest->bEnd = musb_ep->bEndNumber; + pRequest->bEnd = musb_ep->current_epnum; pRequest->ep = musb_ep; } @@ -1121,7 +1121,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, /* request is mine now... */ pRequest->request.actual = 0; pRequest->request.status = -EINPROGRESS; - pRequest->bEnd = musb_ep->bEndNumber; + pRequest->bEnd = musb_ep->current_epnum; pRequest->bTx = musb_ep->is_in; if (is_dma_capable() && musb_ep->dma) { @@ -1201,7 +1201,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) else if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; - MGC_SelectEnd(musb->mregs, musb_ep->bEndNumber); + MGC_SelectEnd(musb->mregs, musb_ep->current_epnum); if (c->channel_abort) status = c->channel_abort(musb_ep->dma); else @@ -1229,7 +1229,7 @@ done: int musb_gadget_set_halt(struct usb_ep *ep, int value) { struct musb_ep *musb_ep = to_musb_ep(ep); - u8 bEnd = musb_ep->bEndNumber; + u8 bEnd = musb_ep->current_epnum; struct musb *musb = musb_ep->musb; void __iomem *epio = musb->endpoints[bEnd].regs; void __iomem *mbase; @@ -1311,7 +1311,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) if (musb_ep->desc && !musb_ep->is_in) { struct musb *musb = musb_ep->musb; - int bEnd = musb_ep->bEndNumber; + int bEnd = musb_ep->current_epnum; void __iomem *mbase = musb->mregs; unsigned long flags; @@ -1330,7 +1330,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) { struct musb_ep *musb_ep = to_musb_ep(ep); struct musb *musb = musb_ep->musb; - u8 nEnd = musb_ep->bEndNumber; + u8 nEnd = musb_ep->current_epnum; void __iomem *epio = musb->endpoints[nEnd].regs; void __iomem *mbase; unsigned long flags; @@ -1561,7 +1561,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in) memset(ep, 0, sizeof *ep); - ep->bEndNumber = bEnd; + ep->current_epnum = bEnd; ep->musb = musb; ep->hw_ep = hw_ep; ep->is_in = is_in; --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -62,7 +62,7 @@ struct musb_ep { char name[12]; struct musb_hw_ep *hw_ep; struct musb *musb; - u8 bEndNumber; + u8 current_epnum; /* ... when enabled/disabled ... */ u8 type; --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -153,10 +153,10 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) code = snprintf(buf, max, "\n%s (hw%d): %s%s, csr %04x maxp %04x\n", - ep->name, ep->bEndNumber, + ep->name, ep->current_epnum, mode, ep->dma ? " dma" : "", musb_readw(regs, - (ep->is_in || !ep->bEndNumber) + (ep->is_in || !ep->current_epnum) ? MGC_O_HDRC_TXCSR : MGC_O_HDRC_RXCSR), musb_readw(regs, ep->is_in @@ -169,8 +169,8 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) buf += code; max -= code; - if (is_cppi_enabled() && ep->bEndNumber) { - unsigned cppi = ep->bEndNumber - 1; + if (is_cppi_enabled() && ep->current_epnum) { + unsigned cppi = ep->current_epnum - 1; void __iomem *base = ep->musb->ctrl_base; unsigned off1 = cppi << 2; void __iomem *ram = base; @@ -190,7 +190,7 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) "%08x %08x, %08x %08x; " "%08x %08x %08x .. %08x\n", ep->is_in ? 'T' : 'R', - ep->bEndNumber - 1, tmp, + ep->current_epnum - 1, tmp, musb_readl(ram, 0 * 4), musb_readl(ram, 1 * 4), musb_readl(ram, 2 * 4), -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage 2007-08-13 13:48 ` [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bEnd0Stage with ep0_stage Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_host.c | 20 ++++++++++---------- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -189,7 +189,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) /* control transfers always start with SETUP */ is_in = 0; hw_ep->out_qh = qh; - musb->bEnd0Stage = MGC_END0_START; + musb->ep0_stage = MGC_END0_START; pBuffer = urb->setup_packet; dwLength = 8; break; @@ -952,7 +952,7 @@ static int musb_h_ep0_continue(struct musb *musb, struct musb_qh *qh = hw_ep->in_qh; struct usb_ctrlrequest *pRequest; - switch (musb->bEnd0Stage) { + switch (musb->ep0_stage) { case MGC_END0_IN: pFifoDest = pUrb->transfer_buffer + pUrb->actual_length; fifo_count = min(len, ((u16) (pUrb->transfer_buffer_length @@ -979,12 +979,12 @@ static int musb_h_ep0_continue(struct musb *musb, break; } else if (pRequest->bRequestType & USB_DIR_IN) { DBG(4, "start IN-DATA\n"); - musb->bEnd0Stage = MGC_END0_IN; + musb->ep0_stage = MGC_END0_IN; bMore = TRUE; break; } else { DBG(4, "start OUT-DATA\n"); - musb->bEnd0Stage = MGC_END0_OUT; + musb->ep0_stage = MGC_END0_OUT; bMore = TRUE; } /* FALLTHROUGH */ @@ -1005,7 +1005,7 @@ static int musb_h_ep0_continue(struct musb *musb, } break; default: - ERR("bogus ep0 stage %d\n", musb->bEnd0Stage); + ERR("bogus ep0 stage %d\n", musb->ep0_stage); break; } @@ -1040,10 +1040,10 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) : 0; DBG(4, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d\n", - wCsrVal, qh, len, pUrb, musb->bEnd0Stage); + wCsrVal, qh, len, pUrb, musb->ep0_stage); /* if we just did status stage, we are done */ - if (MGC_END0_STATUS == musb->bEnd0Stage) { + if (MGC_END0_STATUS == musb->ep0_stage) { retval = IRQ_HANDLED; bComplete = TRUE; } @@ -1114,7 +1114,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* call common logic and prepare response */ if (musb_h_ep0_continue(musb, len, pUrb)) { /* more packets required */ - wCsrVal = (MGC_END0_IN == musb->bEnd0Stage) + wCsrVal = (MGC_END0_IN == musb->ep0_stage) ? MGC_M_CSR0_H_REQPKT : MGC_M_CSR0_TXPKTRDY; } else { /* data transfer complete; perform status phase */ @@ -1127,7 +1127,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) | MGC_M_CSR0_TXPKTRDY; /* flag status stage */ - musb->bEnd0Stage = MGC_END0_STATUS; + musb->ep0_stage = MGC_END0_STATUS; DBG(5, "ep0 STATUS, csr %04x\n", wCsrVal); @@ -1135,7 +1135,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); retval = IRQ_HANDLED; } else - musb->bEnd0Stage = MGC_END0_IDLE; + musb->ep0_stage = MGC_END0_IDLE; /* call completion handler if done */ if (bComplete) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -355,7 +355,7 @@ struct musb { u32 port1_status; unsigned long rh_timer; - enum musb_h_ep0_state bEnd0Stage; + enum musb_h_ep0_state ep0_stage; /* bulk traffic normally dedicates endpoint hardware, and each * direction has its own ring of host side endpoints. --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -467,7 +467,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, * a_wait_vrise_tmout triggers VBUS_ERROR transitions */ musb_writeb(mbase, MGC_O_HDRC_DEVCTL, MGC_M_DEVCTL_SESSION); - musb->bEnd0Stage = MGC_END0_START; + musb->ep0_stage = MGC_END0_START; musb->xceiv.state = OTG_STATE_A_IDLE; MUSB_HST_MODE(musb); musb_set_vbus(musb, 1); @@ -550,7 +550,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, musb->is_active = 1; set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); - musb->bEnd0Stage = MGC_END0_START; + musb->ep0_stage = MGC_END0_START; #ifdef CONFIG_USB_MUSB_OTG /* flush endpoints when transitioning from Device Mode */ -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum 2007-08-13 13:48 ` [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 18/52] musb_hdrc: Search and replace Lock with lock Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bEnd with epnum Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 40 +++++++------- drivers/usb/musb/musb_gadget.c | 110 ++++++++++++++++++++-------------------- drivers/usb/musb/musb_gadget.h | 6 +- drivers/usb/musb/musb_host.c | 106 +++++++++++++++++++------------------- drivers/usb/musb/musb_procfs.c | 54 ++++++++++---------- drivers/usb/musb/musbdefs.h | 10 ++-- drivers/usb/musb/musbhdrc.h | 12 ++-- drivers/usb/musb/musbhsdma.c | 22 ++++---- drivers/usb/musb/plat_uds.c | 24 ++++---- 9 files changed, 192 insertions(+), 192 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -76,7 +76,7 @@ static int service_tx_status_request( { void __iomem *mbase = musb->mregs; int handled = 1; - u8 bResult[2], bEnd = 0; + u8 bResult[2], epnum = 0; const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; bResult[1] = 0; @@ -107,27 +107,27 @@ static int service_tx_status_request( u16 tmp; void __iomem *regs; - bEnd = (u8) pControlRequest->wIndex; - if (!bEnd) { + epnum = (u8) pControlRequest->wIndex; + if (!epnum) { bResult[0] = 0; break; } - is_in = bEnd & USB_DIR_IN; + is_in = epnum & USB_DIR_IN; if (is_in) { - bEnd &= 0x0f; - ep = &musb->endpoints[bEnd].ep_in; + epnum &= 0x0f; + ep = &musb->endpoints[epnum].ep_in; } else { - ep = &musb->endpoints[bEnd].ep_out; + ep = &musb->endpoints[epnum].ep_out; } - regs = musb->endpoints[bEnd].regs; + regs = musb->endpoints[epnum].regs; - if (bEnd >= MUSB_C_NUM_EPS || !ep->desc) { + if (epnum >= MUSB_C_NUM_EPS || !ep->desc) { handled = -EINVAL; break; } - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); if (is_in) tmp = musb_readw(regs, MGC_O_HDRC_TXCSR) & MGC_M_TXCSR_P_SENDSTALL; @@ -256,19 +256,19 @@ __acquires(musb->Lock) case USB_RECIP_INTERFACE: break; case USB_RECIP_ENDPOINT:{ - const u8 bEnd = pControlRequest->wIndex & 0x0f; + const u8 epnum = pControlRequest->wIndex & 0x0f; struct musb_ep *musb_ep; - if (bEnd == 0 - || bEnd >= MUSB_C_NUM_EPS + if (epnum == 0 + || epnum >= MUSB_C_NUM_EPS || pControlRequest->wValue != USB_ENDPOINT_HALT) break; if (pControlRequest->wIndex & USB_DIR_IN) - musb_ep = &musb->endpoints[bEnd].ep_in; + musb_ep = &musb->endpoints[epnum].ep_in; else - musb_ep = &musb->endpoints[bEnd].ep_out; + musb_ep = &musb->endpoints[epnum].ep_out; if (!musb_ep->desc) break; @@ -364,7 +364,7 @@ stall: break; case USB_RECIP_ENDPOINT:{ - const u8 bEnd = + const u8 epnum = pControlRequest->wIndex & 0x0f; struct musb_ep *musb_ep; struct musb_hw_ep *ep; @@ -372,13 +372,13 @@ stall: int is_in; u16 csr; - if (bEnd == 0 - || bEnd >= MUSB_C_NUM_EPS + if (epnum == 0 + || epnum >= MUSB_C_NUM_EPS || pControlRequest->wValue != USB_ENDPOINT_HALT) break; - ep = musb->endpoints + bEnd; + ep = musb->endpoints + epnum; regs = ep->regs; is_in = pControlRequest->wIndex & USB_DIR_IN; if (is_in) @@ -388,7 +388,7 @@ stall: if (!musb_ep->desc) break; - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); if (is_in) { csr = musb_readw(regs, MGC_O_HDRC_TXCSR); --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -252,9 +252,9 @@ static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) */ static void txstate(struct musb *musb, struct musb_request *req) { - u8 bEnd = req->bEnd; + u8 epnum = req->epnum; struct musb_ep *musb_ep; - void __iomem *epio = musb->endpoints[bEnd].regs; + void __iomem *epio = musb->endpoints[epnum].regs; struct usb_request *pRequest; u16 fifo_count = 0, wCsrVal; int use_dma = 0; @@ -287,7 +287,7 @@ static void txstate(struct musb *musb, struct musb_request *req) } DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", - bEnd, musb_ep->wPacketSize, fifo_count, + epnum, musb_ep->wPacketSize, fifo_count, wCsrVal); #ifndef CONFIG_USB_INVENTRA_FIFO @@ -402,16 +402,16 @@ static void txstate(struct musb *musb, struct musb_request *req) * FIFO state update (e.g. data ready). * Called from IRQ, with controller locked. */ -void musb_g_tx(struct musb *musb, u8 bEnd) +void musb_g_tx(struct musb *musb, u8 epnum) { u16 wCsrVal; struct usb_request *pRequest; u8 __iomem *mbase = musb->mregs; - struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_in; - void __iomem *epio = musb->endpoints[bEnd].regs; + struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; + void __iomem *epio = musb->endpoints[epnum].regs; struct dma_channel *dma; - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); pRequest = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); @@ -443,7 +443,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) wCsrVal &= ~(MGC_M_TXCSR_P_UNDERRUN | MGC_M_TXCSR_TXPKTRDY); musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); - DBG(20, "underrun on ep%d, req %p\n", bEnd, pRequest); + DBG(20, "underrun on ep%d, req %p\n", epnum, pRequest); } if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { @@ -469,7 +469,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) pRequest->actual += musb_ep->dma->dwActualLength; DBG(4, "TXCSR%d %04x, dma off, " "len %Zd, req %p\n", - bEnd, wCsrVal, + epnum, wCsrVal, musb_ep->dma->dwActualLength, pRequest); } @@ -514,7 +514,7 @@ void musb_g_tx(struct musb *musb, u8 bEnd) * REVISIT for double buffering... * FIXME revisit for stalls too... */ - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsrVal & MGC_M_TXCSR_FIFONOTEMPTY) break; @@ -573,10 +573,10 @@ void musb_g_tx(struct musb *musb, u8 bEnd) static void rxstate(struct musb *musb, struct musb_request *req) { u16 wCsrVal = 0; - const u8 bEnd = req->bEnd; + const u8 epnum = req->epnum; struct usb_request *pRequest = &req->request; - struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_out; - void __iomem *epio = musb->endpoints[bEnd].regs; + struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; + void __iomem *epio = musb->endpoints[epnum].regs; u16 fifo_count = 0; u16 len = musb_ep->wPacketSize; @@ -732,16 +732,16 @@ static void rxstate(struct musb *musb, struct musb_request *req) /* * Data ready for a request; called from IRQ */ -void musb_g_rx(struct musb *musb, u8 bEnd) +void musb_g_rx(struct musb *musb, u8 epnum) { u16 wCsrVal; struct usb_request *pRequest; void __iomem *mbase = musb->mregs; - struct musb_ep *musb_ep = &musb->endpoints[bEnd].ep_out; - void __iomem *epio = musb->endpoints[bEnd].regs; + struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; + void __iomem *epio = musb->endpoints[epnum].regs; struct dma_channel *dma; - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); pRequest = next_request(musb_ep); @@ -799,7 +799,7 @@ void musb_g_rx(struct musb *musb, u8 bEnd) pRequest->actual += musb_ep->dma->dwActualLength; DBG(4, "RXCSR%d %04x, dma off, %04x, len %Zd, req %p\n", - bEnd, wCsrVal, + epnum, wCsrVal, musb_readw(epio, MGC_O_HDRC_RXCSR), musb_ep->dma->dwActualLength, pRequest); @@ -826,7 +826,7 @@ void musb_g_rx(struct musb *musb, u8 bEnd) goto done; /* don't start more i/o till the stall clears */ - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); if (wCsrVal & MGC_M_RXCSR_P_SENDSTALL) goto done; @@ -856,7 +856,7 @@ static int musb_gadget_enable(struct usb_ep *ep, void __iomem *regs; struct musb *musb; void __iomem *mbase; - u8 bEnd; + u8 epnum; u16 csr; unsigned tmp; int status = -EINVAL; @@ -869,7 +869,7 @@ static int musb_gadget_enable(struct usb_ep *ep, regs = hw_ep->regs; musb = musb_ep->musb; mbase = musb->mregs; - bEnd = musb_ep->current_epnum; + epnum = musb_ep->current_epnum; spin_lock_irqsave(&musb->Lock, flags); @@ -880,7 +880,7 @@ static int musb_gadget_enable(struct usb_ep *ep, musb_ep->type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; /* check direction and (later) maxpacket size against endpoint */ - if ((desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) != bEnd) + if ((desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) != epnum) goto fail; /* REVISIT this rules out high bandwidth periodic transfers */ @@ -892,7 +892,7 @@ static int musb_gadget_enable(struct usb_ep *ep, /* enable the interrupts for the endpoint, set the endpoint * packet size (or fail), set the mode, clear the fifo */ - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); if (desc->bEndpointAddress & USB_DIR_IN) { u16 wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); @@ -903,7 +903,7 @@ static int musb_gadget_enable(struct usb_ep *ep, if (tmp > hw_ep->wMaxPacketSizeTx) goto fail; - wIntrTxE |= (1 << bEnd); + wIntrTxE |= (1 << epnum); musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE); /* REVISIT if can_bulk_split(), use by updating "tmp"; @@ -933,7 +933,7 @@ static int musb_gadget_enable(struct usb_ep *ep, if (tmp > hw_ep->wMaxPacketSizeRx) goto fail; - wIntrRxE |= (1 << bEnd); + wIntrRxE |= (1 << epnum); musb_writew(mbase, MGC_O_HDRC_INTRRXE, wIntrRxE); /* REVISIT if can_bulk_combine() use by updating "tmp" @@ -999,28 +999,28 @@ static int musb_gadget_disable(struct usb_ep *ep) { unsigned long flags; struct musb *musb; - u8 bEnd; + u8 epnum; struct musb_ep *musb_ep; void __iomem *epio; int status = 0; musb_ep = to_musb_ep(ep); musb = musb_ep->musb; - bEnd = musb_ep->current_epnum; - epio = musb->endpoints[bEnd].regs; + epnum = musb_ep->current_epnum; + epio = musb->endpoints[epnum].regs; spin_lock_irqsave(&musb->Lock, flags); - MGC_SelectEnd(musb->mregs, bEnd); + MGC_SelectEnd(musb->mregs, epnum); /* zero the endpoint sizes */ if (musb_ep->is_in) { u16 wIntrTxE = musb_readw(musb->mregs, MGC_O_HDRC_INTRTXE); - wIntrTxE &= ~(1 << bEnd); + wIntrTxE &= ~(1 << epnum); musb_writew(musb->mregs, MGC_O_HDRC_INTRTXE, wIntrTxE); musb_writew(epio, MGC_O_HDRC_TXMAXP, 0); } else { u16 wIntrRxE = musb_readw(musb->mregs, MGC_O_HDRC_INTRRXE); - wIntrRxE &= ~(1 << bEnd); + wIntrRxE &= ~(1 << epnum); musb_writew(musb->mregs, MGC_O_HDRC_INTRRXE, wIntrRxE); musb_writew(epio, MGC_O_HDRC_RXMAXP, 0); } @@ -1052,7 +1052,7 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) if (pRequest) { INIT_LIST_HEAD(&pRequest->request.list); pRequest->request.dma = DMA_ADDR_INVALID; - pRequest->bEnd = musb_ep->current_epnum; + pRequest->epnum = musb_ep->current_epnum; pRequest->ep = musb_ep; } @@ -1084,9 +1084,9 @@ static void musb_ep_restart(struct musb *musb, struct musb_request *req) { DBG(3, "<== %s request %p len %u on hw_ep%d\n", req->bTx ? "TX/IN" : "RX/OUT", - &req->request, req->request.length, req->bEnd); + &req->request, req->request.length, req->epnum); - MGC_SelectEnd(musb->mregs, req->bEnd); + MGC_SelectEnd(musb->mregs, req->epnum); if (req->bTx) txstate(musb, req); else @@ -1121,7 +1121,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, /* request is mine now... */ pRequest->request.actual = 0; pRequest->request.status = -EINPROGRESS; - pRequest->bEnd = musb_ep->current_epnum; + pRequest->epnum = musb_ep->current_epnum; pRequest->bTx = musb_ep->is_in; if (is_dma_capable() && musb_ep->dma) { @@ -1229,9 +1229,9 @@ done: int musb_gadget_set_halt(struct usb_ep *ep, int value) { struct musb_ep *musb_ep = to_musb_ep(ep); - u8 bEnd = musb_ep->current_epnum; + u8 epnum = musb_ep->current_epnum; struct musb *musb = musb_ep->musb; - void __iomem *epio = musb->endpoints[bEnd].regs; + void __iomem *epio = musb->endpoints[epnum].regs; void __iomem *mbase; unsigned long flags; u16 wCsr; @@ -1249,7 +1249,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) goto done; } - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); /* cannot portably stall with non-empty FIFO */ pRequest = to_musb_request(next_request(musb_ep)); @@ -1311,13 +1311,13 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) if (musb_ep->desc && !musb_ep->is_in) { struct musb *musb = musb_ep->musb; - int bEnd = musb_ep->current_epnum; + int epnum = musb_ep->current_epnum; void __iomem *mbase = musb->mregs; unsigned long flags; spin_lock_irqsave(&musb->Lock, flags); - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); /* FIXME return zero unless RXPKTRDY is set */ retval = musb_readw(epio, MGC_O_HDRC_RXCOUNT); @@ -1555,25 +1555,25 @@ static void musb_gadget_release(struct device *dev) static void __init -init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in) +init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) { - struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + epnum; memset(ep, 0, sizeof *ep); - ep->current_epnum = bEnd; + ep->current_epnum = epnum; ep->musb = musb; ep->hw_ep = hw_ep; ep->is_in = is_in; INIT_LIST_HEAD(&ep->req_list); - sprintf(ep->name, "ep%d%s", bEnd, - (!bEnd || hw_ep->bIsSharedFifo) ? "" : ( + sprintf(ep->name, "ep%d%s", epnum, + (!epnum || hw_ep->bIsSharedFifo) ? "" : ( is_in ? "in" : "out")); ep->end_point.name = ep->name; INIT_LIST_HEAD(&ep->end_point.ep_list); - if (!bEnd) { + if (!epnum) { ep->end_point.maxpacket = 64; ep->end_point.ops = &musb_g_ep0_ops; musb->g.ep0 = &ep->end_point; @@ -1593,28 +1593,28 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in) */ static inline void __init musb_g_init_endpoints(struct musb *musb) { - u8 bEnd; + u8 epnum; struct musb_hw_ep *hw_ep; unsigned count = 0; /* intialize endpoint list just once */ INIT_LIST_HEAD(&(musb->g.ep_list)); - for (bEnd = 0, hw_ep = musb->endpoints; - bEnd < musb->nr_endpoints; - bEnd++, hw_ep++) { - if (hw_ep->bIsSharedFifo /* || !bEnd */) { - init_peripheral_ep(musb, &hw_ep->ep_in, bEnd, 0); + for (epnum = 0, hw_ep = musb->endpoints; + epnum < musb->nr_endpoints; + epnum++, hw_ep++) { + if (hw_ep->bIsSharedFifo /* || !epnum */) { + init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 0); count++; } else { if (hw_ep->wMaxPacketSizeTx) { init_peripheral_ep(musb, &hw_ep->ep_in, - bEnd, 1); + epnum, 1); count++; } if (hw_ep->wMaxPacketSizeRx) { init_peripheral_ep(musb, &hw_ep->ep_out, - bEnd, 0); + epnum, 0); count++; } } @@ -1800,7 +1800,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) i < musb->nr_endpoints; i++, hw_ep++) { MGC_SelectEnd(musb->mregs, i); - if (hw_ep->bIsSharedFifo /* || !bEnd */) { + if (hw_ep->bIsSharedFifo /* || !epnum */) { nuke(&hw_ep->ep_in, -ESHUTDOWN); } else { if (hw_ep->wMaxPacketSizeTx) --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -39,7 +39,7 @@ struct musb_request { struct musb_ep *ep; struct musb *musb; u8 bTx; /* endpoint direction */ - u8 bEnd; + u8 epnum; u8 mapped; }; @@ -92,8 +92,8 @@ static inline struct usb_request *next_request(struct musb_ep *ep) return container_of(queue->next, struct usb_request, list); } -extern void musb_g_tx(struct musb *musb, u8 bEnd); -extern void musb_g_rx(struct musb *musb, u8 bEnd); +extern void musb_g_tx(struct musb *musb, u8 epnum); +extern void musb_g_rx(struct musb *musb, u8 epnum); extern const struct usb_ep_ops musb_g_ep0_ops; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -103,7 +103,7 @@ /*************************** Forwards ***************************/ -static void musb_ep_program(struct musb *musb, u8 bEnd, +static void musb_ep_program(struct musb *musb, u8 epnum, struct urb *pUrb, unsigned int nOut, u8 * pBuffer, u32 dwLength); @@ -177,7 +177,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) struct musb_hw_ep *hw_ep = qh->hw_ep; unsigned nPipe = urb->pipe; u8 bAddress = usb_pipedevice(nPipe); - int bEnd = hw_ep->epnum; + int epnum = hw_ep->epnum; /* initialize software qh state */ qh->offset = 0; @@ -213,14 +213,14 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) case USB_ENDPOINT_XFER_ISOC: s = "-iso"; break; default: s = "-intr"; break; }; s;}), - bEnd, pBuffer, dwLength); + epnum, pBuffer, dwLength); /* Configure endpoint */ if (is_in || hw_ep->bIsSharedFifo) hw_ep->in_qh = qh; else hw_ep->out_qh = qh; - musb_ep_program(musb, bEnd, urb, !is_in, pBuffer, dwLength); + musb_ep_program(musb, epnum, urb, !is_in, pBuffer, dwLength); /* transmit may have more work: start it when it is time */ if (is_in) @@ -246,7 +246,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) } else { qh->frame = urb->start_frame; /* enable SOF interrupt so we can count down */ -DBG(1,"SOF for %d\n", bEnd); +DBG(1,"SOF for %d\n", epnum); #if 1 // ifndef CONFIG_ARCH_DAVINCI musb_writeb(mbase, MGC_O_HDRC_INTRUSBE, 0xff); #endif @@ -254,7 +254,7 @@ DBG(1,"SOF for %d\n", bEnd); break; default: start: - DBG(4, "Start TX%d %s\n", bEnd, + DBG(4, "Start TX%d %s\n", epnum, hw_ep->tx_channel ? "dma" : "pio"); if (!hw_ep->tx_channel) @@ -467,7 +467,7 @@ static inline u16 musb_h_flush_rxfifo(struct musb_hw_ep *hw_ep, u16 csr) * PIO RX for a packet (or part of it). */ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, - u8 bEnd, u8 bIsochError) + u8 epnum, u8 bIsochError) { u16 wRxCount; u8 *pBuffer; @@ -475,15 +475,15 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, u8 bDone = FALSE; u32 length; int do_flush = 0; - struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + epnum; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; int nPipe = pUrb->pipe; void *buffer = pUrb->transfer_buffer; - // MGC_SelectEnd(mbase, bEnd); + // MGC_SelectEnd(mbase, epnum); wRxCount = musb_readw(epio, MGC_O_HDRC_RXCOUNT); - DBG(3, "RX%d count %d, buffer %p len %d/%d\n", bEnd, wRxCount, + DBG(3, "RX%d count %d, buffer %p len %d/%d\n", epnum, wRxCount, pUrb->transfer_buffer, qh->offset, pUrb->transfer_buffer_length); @@ -623,7 +623,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) * Program an HDRC endpoint as per the given URB * Context: irqs blocked, controller lock held */ -static void musb_ep_program(struct musb *musb, u8 bEnd, +static void musb_ep_program(struct musb *musb, u8 epnum, struct urb *pUrb, unsigned int is_out, u8 * pBuffer, u32 dwLength) { @@ -631,7 +631,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, struct dma_channel *pDmaChannel; u8 bDmaOk; void __iomem *mbase = musb->mregs; - struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + epnum; void __iomem *epio = hw_ep->regs; struct musb_qh *qh; u16 wPacketSize; @@ -646,16 +646,16 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, DBG(3, "%s hw%d urb %p spd%d dev%d ep%d%s " "h_addr%02x h_port%02x bytes %d\n", is_out ? "-->" : "<--", - bEnd, pUrb, pUrb->dev->speed, + epnum, pUrb, pUrb->dev->speed, qh->addr_reg, qh->epnum, is_out ? "out" : "in", qh->h_addr_reg, qh->h_port_reg, dwLength); - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); /* candidate for DMA? */ pDmaController = musb->pDmaController; - if (is_dma_capable() && bEnd && pDmaController) { + if (is_dma_capable() && epnum && pDmaController) { pDmaChannel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel; if (!pDmaChannel) { pDmaChannel = pDmaController->channel_alloc( @@ -680,10 +680,10 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* disable interrupt in case we flush */ wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); - musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE & ~(1 << bEnd)); + musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE & ~(1 << epnum)); /* general endpoint setup */ - if (bEnd) { + if (epnum) { u16 csr = wCsr; /* ASSERT: TXCSR_DMAENAB was already cleared */ @@ -722,20 +722,20 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* target addr and (for multipoint) hub addr/port */ if (musb->bIsMultipoint) { musb_writeb(mbase, - MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXFUNCADDR), + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXFUNCADDR), qh->addr_reg); musb_writeb(mbase, - MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBADDR), + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXHUBADDR), qh->h_addr_reg); musb_writeb(mbase, - MGC_BUSCTL_OFFSET(bEnd, MGC_O_HDRC_TXHUBPORT), + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXHUBPORT), qh->h_port_reg); -/* FIXME if !bEnd, do the same for RX ... */ +/* FIXME if !epnum, do the same for RX ... */ } else musb_writeb(mbase, MGC_O_HDRC_FADDR, qh->addr_reg); /* protocol/endpoint/interval/NAKlimit */ - if (bEnd) { + if (epnum) { musb_writeb(epio, MGC_O_HDRC_TXTYPE, qh->type_reg); if (can_bulk_split(musb, qh->type)) musb_writew(epio, MGC_O_HDRC_TXMAXP, @@ -863,7 +863,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, /* write CSR */ wCsr |= MGC_M_TXCSR_MODE; - if (bEnd) + if (epnum) musb_writew(epio, MGC_O_HDRC_TXCSR, wCsr); } @@ -931,7 +931,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, } csr |= MGC_M_RXCSR_H_REQPKT; - DBG(7, "RXCSR%d := %04x\n", bEnd, csr); + DBG(7, "RXCSR%d := %04x\n", epnum, csr); musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, csr); csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); } @@ -1162,7 +1162,7 @@ done: #endif /* Service a Tx-Available or dma completion irq for the endpoint */ -void musb_host_tx(struct musb *musb, u8 bEnd) +void musb_host_tx(struct musb *musb, u8 epnum) { int nPipe; u8 bDone = FALSE; @@ -1170,7 +1170,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) size_t wLength = 0; u8 *pBuffer = NULL; struct urb *pUrb; - struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + epnum; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->out_qh; u32 status = 0; @@ -1179,36 +1179,36 @@ void musb_host_tx(struct musb *musb, u8 bEnd) pUrb = next_urb(qh); - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); wTxCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); /* with CPPI, DMA sometimes triggers "extra" irqs */ if (!pUrb) { - DBG(4, "extra TX%d ready, csr %04x\n", bEnd, wTxCsrVal); + DBG(4, "extra TX%d ready, csr %04x\n", epnum, wTxCsrVal); goto finish; } nPipe = pUrb->pipe; dma = is_dma_capable() ? hw_ep->tx_channel : NULL; - DBG(4, "OUT/TX%d end, csr %04x%s\n", bEnd, wTxCsrVal, + DBG(4, "OUT/TX%d end, csr %04x%s\n", epnum, wTxCsrVal, dma ? ", dma" : ""); /* check for errors */ if (wTxCsrVal & MGC_M_TXCSR_H_RXSTALL) { /* dma was disabled, fifo flushed */ - DBG(3, "TX end %d stall\n", bEnd); + DBG(3, "TX end %d stall\n", epnum); /* stall; record URB status */ status = -EPIPE; } else if (wTxCsrVal & MGC_M_TXCSR_H_ERROR) { /* (NON-ISO) dma was disabled, fifo flushed */ - DBG(3, "TX 3strikes on ep=%d\n", bEnd); + DBG(3, "TX 3strikes on ep=%d\n", epnum); status = -ETIMEDOUT; } else if (wTxCsrVal & MGC_M_TXCSR_H_NAKTIMEOUT) { - DBG(6, "TX end=%d device not responding\n", bEnd); + DBG(6, "TX end=%d device not responding\n", epnum); /* NOTE: this code path would be a good place to PAUSE a * transfer, if there's some other (nonperiodic) tx urb @@ -1217,7 +1217,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) * if (bulk && qh->ring.next != &musb->out_bulk), then * we have a candidate... NAKing is *NOT* an error */ - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); musb_writew(epio, MGC_O_HDRC_CSR0, MGC_M_TXCSR_H_WZC_BITS | MGC_M_TXCSR_TXPKTRDY); @@ -1241,7 +1241,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) | MGC_M_TXCSR_H_NAKTIMEOUT ); - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); musb_writew(epio, MGC_O_HDRC_TXCSR, wTxCsrVal); /* REVISIT may need to clear FLUSHFIFO ... */ musb_writew(epio, MGC_O_HDRC_TXCSR, wTxCsrVal); @@ -1252,7 +1252,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) /* second cppi case */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { - DBG(4, "extra TX%d ready, csr %04x\n", bEnd, wTxCsrVal); + DBG(4, "extra TX%d ready, csr %04x\n", epnum, wTxCsrVal); goto finish; } @@ -1323,7 +1323,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) musb_write_fifo(hw_ep, wLength, pBuffer); qh->segsize = wLength; - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); musb_writew(epio, MGC_O_HDRC_TXCSR, MGC_M_TXCSR_H_WZC_BITS | MGC_M_TXCSR_TXPKTRDY); } else @@ -1377,10 +1377,10 @@ finish: * Service an RX interrupt for the given IN endpoint; docs cover bulk, iso, * and high-bandwidth IN transfer cases. */ -void musb_host_rx(struct musb *musb, u8 bEnd) +void musb_host_rx(struct musb *musb, u8 epnum) { struct urb *pUrb; - struct musb_hw_ep *hw_ep = musb->endpoints + bEnd; + struct musb_hw_ep *hw_ep = musb->endpoints + epnum; void __iomem *epio = hw_ep->regs; struct musb_qh *qh = hw_ep->in_qh; size_t xfer_len; @@ -1392,7 +1392,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) u32 status; struct dma_channel *dma; - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); pUrb = next_urb(qh); dma = is_dma_capable() ? hw_ep->rx_channel : NULL; @@ -1406,7 +1406,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) * usbtest #11 (unlinks) triggers it regularly, sometimes * with fifo full. (Only with DMA??) */ - DBG(3, "BOGUS RX%d ready, csr %04x, count %d\n", bEnd, wVal, + DBG(3, "BOGUS RX%d ready, csr %04x, count %d\n", epnum, wVal, musb_readw(epio, MGC_O_HDRC_RXCOUNT)); musb_h_flush_rxfifo(hw_ep, MGC_M_RXCSR_CLRDATATOG); return; @@ -1415,19 +1415,19 @@ void musb_host_rx(struct musb *musb, u8 bEnd) nPipe = pUrb->pipe; DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zd)\n", - bEnd, wRxCsrVal, pUrb->actual_length, + epnum, wRxCsrVal, pUrb->actual_length, dma ? dma->dwActualLength : 0); /* check for errors, concurrent stall & unlink is not really * handled yet! */ if (wRxCsrVal & MGC_M_RXCSR_H_RXSTALL) { - DBG(3, "RX end %d STALL\n", bEnd); + DBG(3, "RX end %d STALL\n", epnum); /* stall; record URB status */ status = -EPIPE; } else if (wRxCsrVal & MGC_M_RXCSR_H_ERROR) { - DBG(3, "end %d RX proto error\n", bEnd); + DBG(3, "end %d RX proto error\n", epnum); status = -EPROTO; musb_writeb(epio, MGC_O_HDRC_RXINTERVAL, 0); @@ -1442,15 +1442,15 @@ void musb_host_rx(struct musb *musb, u8 bEnd) * if (bulk && qh->ring.next != &musb->in_bulk), then * we have a candidate... NAKing is *NOT* an error */ - DBG(6, "RX end %d NAK timeout\n", bEnd); - MGC_SelectEnd(mbase, bEnd); + DBG(6, "RX end %d NAK timeout\n", epnum); + MGC_SelectEnd(mbase, epnum); musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | MGC_M_RXCSR_H_REQPKT); goto finish; } else { - DBG(4, "RX end %d ISO data error\n", bEnd); + DBG(4, "RX end %d ISO data error\n", epnum); /* packet error reported later */ bIsochError = TRUE; } @@ -1472,7 +1472,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) if (unlikely(dma_channel_status(dma) == MGC_DMA_STATUS_BUSY)) { /* SHOULD NEVER HAPPEN ... but at least DaVinci has done it */ - ERR("RX%d dma busy, csr %04x\n", bEnd, wRxCsrVal); + ERR("RX%d dma busy, csr %04x\n", epnum, wRxCsrVal); goto finish; } @@ -1497,11 +1497,11 @@ void musb_host_rx(struct musb *musb, u8 bEnd) bDone = TRUE; } - DBG(2, "RXCSR%d %04x, reqpkt, len %zd%s\n", bEnd, wRxCsrVal, + DBG(2, "RXCSR%d %04x, reqpkt, len %zd%s\n", epnum, wRxCsrVal, xfer_len, dma ? ", dma" : ""); wRxCsrVal &= ~MGC_M_RXCSR_H_REQPKT; - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | wRxCsrVal); } @@ -1528,7 +1528,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) MGC_M_RXCSR_H_WZC_BITS | wVal); } - DBG(4, "ep %d dma %s, rxcsr %04x, rxcount %d\n", bEnd, + DBG(4, "ep %d dma %s, rxcsr %04x, rxcount %d\n", epnum, bDone ? "off" : "reset", musb_readw(epio, MGC_O_HDRC_RXCSR), musb_readw(epio, MGC_O_HDRC_RXCOUNT)); @@ -1545,7 +1545,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) // SCRUB (RX) /* do the proper sequence to abort the transfer */ - MGC_SelectEnd(mbase, bEnd); + MGC_SelectEnd(mbase, epnum); wVal &= ~MGC_M_RXCSR_H_REQPKT; musb_writew(epio, MGC_O_HDRC_RXCSR, wVal); goto finish; @@ -1561,7 +1561,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) wRxCount = musb_readw(epio, MGC_O_HDRC_RXCOUNT); DBG(2, "RX%d count %d, buffer 0x%x len %d/%d\n", - bEnd, wRxCount, + epnum, wRxCount, pUrb->transfer_dma + pUrb->actual_length, qh->offset, @@ -1634,7 +1634,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) if (!dma) { bDone = musb_host_packet_rx(musb, pUrb, - bEnd, bIsochError); + epnum, bIsochError); DBG(6, "read %spacket\n", bDone ? "last " : ""); } } --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -233,14 +233,14 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) #endif static int -dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) +dump_end_info(struct musb *musb, u8 epnum, char *aBuffer, unsigned max) { int code = 0; char *buf = aBuffer; - struct musb_hw_ep *hw_ep = &musb->endpoints[bEnd]; + struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; do { - MGC_SelectEnd(musb->mregs, bEnd); + MGC_SelectEnd(musb->mregs, epnum); #ifdef CONFIG_USB_MUSB_HDRC_HCD if (is_host_active(musb)) { int dump_rx, dump_tx; @@ -249,7 +249,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) /* TEMPORARY (!) until we have a real periodic * schedule tree ... */ - if (!bEnd) { + if (!epnum) { /* control is shared, uses RX queue * but (mostly) shadowed tx registers */ @@ -258,10 +258,10 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) } else if (hw_ep == musb->bulk_ep) { dump_tx = !list_empty(&musb->out_bulk); dump_rx = !list_empty(&musb->in_bulk); - } else if (musb->periodic[bEnd]) { + } else if (musb->periodic[epnum]) { struct usb_host_endpoint *hep; - hep = musb->periodic[bEnd]->hep; + hep = musb->periodic[epnum]->hep; dump_rx = hep->desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK; dump_tx = !dump_rx; @@ -276,7 +276,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) "max %04x type %02x; " "dev %d hub %d port %d" "\n", - bEnd, + epnum, hw_ep->rx_double_buffered ? "2buf" : "1buf", musb_readw(regs, MGC_O_HDRC_RXCSR), @@ -285,13 +285,13 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) musb_readb(regs, MGC_O_HDRC_RXTYPE), /* FIXME: assumes multipoint */ musb_readb(musb->mregs, - MGC_BUSCTL_OFFSET(bEnd, + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_RXFUNCADDR)), musb_readb(musb->mregs, - MGC_BUSCTL_OFFSET(bEnd, + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_RXHUBADDR)), musb_readb(musb->mregs, - MGC_BUSCTL_OFFSET(bEnd, + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_RXHUBPORT)) ); if (code <= 0) @@ -301,9 +301,9 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) max -= code; if (is_cppi_enabled() - && bEnd + && epnum && hw_ep->rx_channel) { - unsigned cppi = bEnd - 1; + unsigned cppi = epnum - 1; unsigned off1 = cppi << 2; void __iomem *base; void __iomem *ram; @@ -347,8 +347,8 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) code = min(code, (int) max); buf += code; max -= code; - } else if (musb->periodic[bEnd]) { - code = dump_qh(musb->periodic[bEnd], + } else if (musb->periodic[epnum]) { + code = dump_qh(musb->periodic[epnum], buf, max); if (code <= 0) break; @@ -364,7 +364,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) "max %04x type %02x; " "dev %d hub %d port %d" "\n", - bEnd, + epnum, hw_ep->tx_double_buffered ? "2buf" : "1buf", musb_readw(regs, MGC_O_HDRC_TXCSR), @@ -373,13 +373,13 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) musb_readb(regs, MGC_O_HDRC_TXTYPE), /* FIXME: assumes multipoint */ musb_readb(musb->mregs, - MGC_BUSCTL_OFFSET(bEnd, + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXFUNCADDR)), musb_readb(musb->mregs, - MGC_BUSCTL_OFFSET(bEnd, + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXHUBADDR)), musb_readb(musb->mregs, - MGC_BUSCTL_OFFSET(bEnd, + MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXHUBPORT)) ); if (code <= 0) @@ -389,9 +389,9 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) max -= code; if (is_cppi_enabled() - && bEnd + && epnum && hw_ep->tx_channel) { - unsigned cppi = bEnd - 1; + unsigned cppi = epnum - 1; void __iomem *base; void __iomem *ram; @@ -438,8 +438,8 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) code = min(code, (int) max); buf += code; max -= code; - } else if (musb->periodic[bEnd]) { - code = dump_qh(musb->periodic[bEnd], + } else if (musb->periodic[epnum]) { + code = dump_qh(musb->periodic[epnum], buf, max); if (code <= 0) break; @@ -454,7 +454,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) if (is_peripheral_active(musb)) { code = 0; - if (hw_ep->ep_in.desc || !bEnd) { + if (hw_ep->ep_in.desc || !epnum) { code = dump_ep(&hw_ep->ep_in, buf, max); if (code <= 0) break; @@ -785,7 +785,7 @@ static int musb_proc_read(char *page, char **start, int code = 0; unsigned long flags; struct musb *musb = data; - unsigned bEnd; + unsigned epnum; count -= off; count -= 1; /* for NUL at end */ @@ -802,9 +802,9 @@ static int musb_proc_read(char *page, char **start, /* generate the report for the end points */ // REVISIT ... not unless something's connected! - for (bEnd = 0; count >= 0 && bEnd < musb->nr_endpoints; - bEnd++) { - code = dump_end_info(musb, bEnd, buffer, count); + for (epnum = 0; count >= 0 && epnum < musb->nr_endpoints; + epnum++) { + code = dump_end_info(musb, epnum, buffer, count); if (code > 0) { buffer += code; count -= code; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -218,19 +218,19 @@ enum musb_g_ep0_state { /* TUSB mapping: "flat" plus ep0 special cases */ #if defined(CONFIG_USB_TUSB6010) -#define MGC_SelectEnd(_mbase, _bEnd) \ - musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_bEnd)) +#define MGC_SelectEnd(_mbase, _epnum) \ + musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_epnum)) #define MGC_END_OFFSET MGC_TUSB_OFFSET /* "flat" mapping: each endpoint has its own i/o address */ #elif defined(MUSB_FLAT_REG) -#define MGC_SelectEnd(_mbase, _bEnd) (((void)(_mbase)),((void)(_bEnd))) +#define MGC_SelectEnd(_mbase, _epnum) (((void)(_mbase)),((void)(_epnum))) #define MGC_END_OFFSET MGC_FLAT_OFFSET /* "indexed" mapping: INDEX register controls register bank select */ #else -#define MGC_SelectEnd(_mbase, _bEnd) \ - musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_bEnd)) +#define MGC_SelectEnd(_mbase, _epnum) \ + musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_epnum)) #define MGC_END_OFFSET MGC_INDEXED_OFFSET #endif --- a/drivers/usb/musb/musbhdrc.h +++ b/drivers/usb/musb/musbhdrc.h @@ -107,16 +107,16 @@ #define MGC_O_HDRC_CONFIGDATA MGC_O_HDRC_FIFOSIZE /* re-used for EP0 */ /* offsets to endpoint registers in indexed model (using INDEX register) */ -#define MGC_INDEXED_OFFSET(_bEnd, _bOffset) \ +#define MGC_INDEXED_OFFSET(_epnum, _bOffset) \ (0x10 + (_bOffset)) /* offsets to endpoint registers in flat models */ -#define MGC_FLAT_OFFSET(_bEnd, _bOffset) \ - (0x100 + (0x10*(_bEnd)) + (_bOffset)) +#define MGC_FLAT_OFFSET(_epnum, _bOffset) \ + (0x100 + (0x10*(_epnum)) + (_bOffset)) #ifdef CONFIG_USB_TUSB6010 /* TUSB6010 EP0 configuration register is special */ -#define MGC_TUSB_OFFSET(_bEnd, _bOffset) \ +#define MGC_TUSB_OFFSET(_epnum, _bOffset) \ (0x10 + _bOffset) #include "tusb6010.h" /* needed "only" for TUSB_EP0_CONF */ #endif @@ -130,8 +130,8 @@ #define MGC_O_HDRC_RXHUBADDR 0x06 #define MGC_O_HDRC_RXHUBPORT 0x07 -#define MGC_BUSCTL_OFFSET(_bEnd, _bOffset) \ - (0x80 + (8*(_bEnd)) + (_bOffset)) +#define MGC_BUSCTL_OFFSET(_epnum, _bOffset) \ + (0x80 + (8*(_epnum)) + (_bOffset)) /* * MUSBHDRC Register bit masks --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -78,7 +78,7 @@ struct musb_dma_channel { u32 len; u16 wMaxPacketSize; u8 bIndex; - u8 bEnd; + u8 epnum; u8 bTransmit; }; @@ -140,7 +140,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pImplChannel = &(pController->aChannel[bBit]); pImplChannel->pController = pController; pImplChannel->bIndex = bBit; - pImplChannel->bEnd = hw_ep->epnum; + pImplChannel->epnum = hw_ep->epnum; pImplChannel->bTransmit = bTransmit; pChannel = &(pImplChannel->Channel); pChannel->pPrivateData = pImplChannel; @@ -201,7 +201,7 @@ static void configure_channel(struct dma_channel *pChannel, } } - wCsr |= (pImplChannel->bEnd << MGC_S_HSDMA_ENDPOINT) + wCsr |= (pImplChannel->epnum << MGC_S_HSDMA_ENDPOINT) | (1 << MGC_S_HSDMA_ENABLE) | (1 << MGC_S_HSDMA_IRQENABLE) | (pImplChannel->bTransmit ? (1 << MGC_S_HSDMA_TRANSMIT) : 0); @@ -228,7 +228,7 @@ static int dma_channel_program(struct dma_channel * pChannel, (struct musb_dma_channel *) pChannel->pPrivateData; DBG(2, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n", - pImplChannel->bEnd, + pImplChannel->epnum, pImplChannel->bTransmit ? "Tx" : "Rx", wPacketSize, dma_addr, dwLength, bMode); @@ -263,22 +263,22 @@ static int dma_channel_abort(struct dma_channel *pChannel) if (pImplChannel->bTransmit) { csr = musb_readw(mbase, - MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_TXCSR)); + MGC_END_OFFSET(pImplChannel->epnum,MGC_O_HDRC_TXCSR)); csr &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_DMAMODE); musb_writew(mbase, - MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_TXCSR), + MGC_END_OFFSET(pImplChannel->epnum,MGC_O_HDRC_TXCSR), csr); } else { csr = musb_readw(mbase, - MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_RXCSR)); + MGC_END_OFFSET(pImplChannel->epnum,MGC_O_HDRC_RXCSR)); csr &= ~(MGC_M_RXCSR_AUTOCLEAR | MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_DMAMODE); musb_writew(mbase, - MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_RXCSR), + MGC_END_OFFSET(pImplChannel->epnum,MGC_O_HDRC_RXCSR), csr); } @@ -354,14 +354,14 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) ) { /* Send out the packet */ MGC_SelectEnd(mbase, - pImplChannel->bEnd); + pImplChannel->epnum); musb_writew(mbase, - MGC_END_OFFSET(pImplChannel->bEnd,MGC_O_HDRC_TXCSR), + MGC_END_OFFSET(pImplChannel->epnum,MGC_O_HDRC_TXCSR), MGC_M_TXCSR_TXPKTRDY); } else musb_dma_completion( pController->pDmaPrivate, - pImplChannel->bEnd, + pImplChannel->epnum, pImplChannel->bTransmit); } } --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -662,7 +662,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, if (bIntrUSB & MGC_M_INTR_SOF) { void __iomem *mbase = musb->mregs; struct musb_hw_ep *ep; - u8 bEnd; + u8 epnum; u16 wFrame; DBG(6, "START_OF_FRAME\n"); @@ -671,20 +671,20 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, /* start any periodic Tx transfers waiting for current frame */ wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME); ep = musb->endpoints; - for (bEnd = 1; (bEnd < musb->nr_endpoints) - && (musb->wEndMask >= (1 << bEnd)); - bEnd++, ep++) { + for (epnum = 1; (epnum < musb->nr_endpoints) + && (musb->wEndMask >= (1 << epnum)); + epnum++, ep++) { // FIXME handle framecounter wraps (12 bits) // eliminate duplicated StartUrb logic if (ep->dwWaitFrame >= wFrame) { ep->dwWaitFrame = 0; printk("SOF --> periodic TX%s on %d\n", ep->tx_channel ? " DMA" : "", - bEnd); + epnum); if (!ep->tx_channel) - musb_h_tx_start(musb, bEnd); + musb_h_tx_start(musb, epnum); else - cppi_hostdma_start(musb, bEnd); + cppi_hostdma_start(musb, epnum); } } /* end of for loop */ } @@ -1178,7 +1178,7 @@ static int __init ep_config_from_table(struct musb *musb) */ static int __init ep_config_from_hw(struct musb *musb) { - u8 bEnd = 0, reg; + u8 epnum = 0, reg; struct musb_hw_ep *hw_ep; void *mbase = musb->mregs; @@ -1186,9 +1186,9 @@ static int __init ep_config_from_hw(struct musb *musb) /* FIXME pick up ep0 maxpacket size */ - for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) { - MGC_SelectEnd(mbase, bEnd); - hw_ep = musb->endpoints + bEnd; + for (epnum = 1; epnum < MUSB_C_NUM_EPS; epnum++) { + MGC_SelectEnd(mbase, epnum); + hw_ep = musb->endpoints + epnum; /* read from core using indexed model */ reg = musb_readb(hw_ep->regs, 0x10 + MGC_O_HDRC_FIFOSIZE); @@ -1197,7 +1197,7 @@ static int __init ep_config_from_hw(struct musb *musb) break; } musb->nr_endpoints++; - musb->wEndMask |= (1 << bEnd); + musb->wEndMask |= (1 << epnum); hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f); -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 18/52] musb_hdrc: Search and replace Lock with lock 2007-08-13 13:48 ` [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace Lock with lock Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/davinci.c | 8 ++-- drivers/usb/musb/g_ep0.c | 26 ++++++------ drivers/usb/musb/musb_gadget.c | 86 +++++++++++++++++++------------------- drivers/usb/musb/musb_host.c | 20 ++++---- drivers/usb/musb/musb_procfs.c | 4 +- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 46 ++++++++++---------- drivers/usb/musb/tusb6010.c | 14 +++--- drivers/usb/musb/tusb6010_omap.c | 4 +- drivers/usb/musb/virthub.c | 4 +- 10 files changed, 107 insertions(+), 107 deletions(-) --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -210,7 +210,7 @@ static void otg_timer(unsigned long _musb) devctl = musb_readb(mregs, MGC_O_HDRC_DEVCTL); DBG(7, "poll devctl %02x (%s)\n", devctl, otg_state_string(musb)); - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); switch (musb->xceiv.state) { case OTG_STATE_A_WAIT_VFALL: /* Wait till VBUS falls below SessionEnd (~0.2V); the 1.3 RTL @@ -252,7 +252,7 @@ static void otg_timer(unsigned long _musb) default: break; } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } static irqreturn_t davinci_interrupt(int irq, void *__hci) @@ -263,7 +263,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) void *__iomem tibase = musb->ctrl_base; u32 tmp; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through * the Mentor registers (except for setup), use the TI ones and EOI. @@ -366,7 +366,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) && musb->xceiv.state == OTG_STATE_B_IDLE) mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); /* REVISIT we sometimes get unhandled IRQs * (e.g. ep0). not clear why... --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -45,7 +45,7 @@ #define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0]) /* - * Locking note: we use only the controller lock, for simpler correctness. + * locking note: we use only the controller lock, for simpler correctness. * It's always held with IRQs blocked. * * It protects the ep0 request queue as well as ep0_state, not just the @@ -226,8 +226,8 @@ static inline void musb_try_b_hnp_enable(struct musb *musb) static int service_zero_data_request(struct musb *musb, struct usb_ctrlrequest *pControlRequest) -__releases(musb->Lock) -__acquires(musb->Lock) +__releases(musb->lock) +__acquires(musb->lock) { int handled = -EINVAL; void __iomem *mbase = musb->mregs; @@ -273,9 +273,9 @@ __acquires(musb->Lock) break; /* REVISIT do it directly, no locking games */ - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); musb_gadget_set_halt(&musb_ep->end_point, 0); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); /* select ep0 again */ MGC_SelectEnd(mbase, 0); @@ -579,15 +579,15 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) static int forward_to_driver(struct musb *musb, const struct usb_ctrlrequest *pControlRequest) -__releases(musb->Lock) -__acquires(musb->Lock) +__releases(musb->lock) +__acquires(musb->lock) { int retval; if (!musb->pGadgetDriver) return -EOPNOTSUPP; - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); retval = musb->pGadgetDriver->setup(&musb->g, pControlRequest); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); return retval; } @@ -837,7 +837,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) req->request.status = -EINPROGRESS; req->bTx = ep->is_in; - spin_lock_irqsave(&musb->Lock, lockflags); + spin_lock_irqsave(&musb->lock, lockflags); if (!list_empty(&ep->req_list)) { status = -EBUSY; @@ -892,7 +892,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) } cleanup: - spin_unlock_irqrestore(&musb->Lock, lockflags); + spin_unlock_irqrestore(&musb->lock, lockflags); return status; } @@ -920,7 +920,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) base = musb->mregs; regs = musb->control_ep->regs; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (!list_empty(&ep->req_list)) { status = -EBUSY; @@ -945,7 +945,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) } cleanup: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return status; } --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -102,8 +102,8 @@ void musb_g_giveback( struct musb_ep *ep, struct usb_request *pRequest, int status) -__releases(ep->musb->Lock) -__acquires(ep->musb->Lock) +__releases(ep->musb->lock) +__acquires(ep->musb->lock) { struct musb_request *req; struct musb *musb; @@ -117,7 +117,7 @@ __acquires(ep->musb->Lock) musb = req->musb; ep->busy = 1; - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); if (is_dma_capable()) { if (req->mapped) { dma_unmap_single(musb->controller, @@ -146,7 +146,7 @@ __acquires(ep->musb->Lock) req->request.actual, req->request.length, pRequest->status); req->request.complete(&req->ep->end_point, &req->request); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); ep->busy = busy; } @@ -871,7 +871,7 @@ static int musb_gadget_enable(struct usb_ep *ep, mbase = musb->mregs; epnum = musb_ep->current_epnum; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (musb_ep->desc) { status = -EBUSY; @@ -988,7 +988,7 @@ static int musb_gadget_enable(struct usb_ep *ep, schedule_work(&musb->irq_work); fail: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return status; } @@ -1009,7 +1009,7 @@ static int musb_gadget_disable(struct usb_ep *ep) epnum = musb_ep->current_epnum; epio = musb->endpoints[epnum].regs; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); MGC_SelectEnd(musb->mregs, epnum); /* zero the endpoint sizes */ @@ -1032,7 +1032,7 @@ static int musb_gadget_disable(struct usb_ep *ep) schedule_work(&musb->irq_work); - spin_unlock_irqrestore(&(musb->Lock), flags); + spin_unlock_irqrestore(&(musb->lock), flags); DBG(2, "%s\n", musb_ep->end_point.name); @@ -1148,7 +1148,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, } else pRequest->mapped = 0; - spin_lock_irqsave(&musb->Lock, lockflags); + spin_lock_irqsave(&musb->lock, lockflags); /* don't queue if the ep is down */ if (!musb_ep->desc) { @@ -1166,7 +1166,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, musb_ep_restart(musb, pRequest); cleanup: - spin_unlock_irqrestore(&musb->Lock, lockflags); + spin_unlock_irqrestore(&musb->lock, lockflags); return status; } @@ -1181,7 +1181,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) if (!ep || !pRequest || to_musb_request(pRequest)->ep != musb_ep) return -EINVAL; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); list_for_each_entry(r, &musb_ep->req_list, list) { if (r == pRequest) @@ -1216,7 +1216,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) } done: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return status; } @@ -1242,7 +1242,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) return -EINVAL; mbase = musb->mregs; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if ((USB_ENDPOINT_XFER_ISOC == musb_ep->type)) { status = -EINVAL; @@ -1257,7 +1257,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsr & MGC_M_TXCSR_FIFONOTEMPTY) { DBG(3, "%s fifo busy, cannot halt\n", ep->name); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return -EAGAIN; } @@ -1299,7 +1299,7 @@ done: musb_ep_restart(musb, pRequest); } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return status; } @@ -1315,13 +1315,13 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) void __iomem *mbase = musb->mregs; unsigned long flags; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); MGC_SelectEnd(mbase, epnum); /* FIXME return zero unless RXPKTRDY is set */ retval = musb_readw(epio, MGC_O_HDRC_RXCOUNT); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } return retval; } @@ -1338,7 +1338,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) mbase = musb->mregs; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); MGC_SelectEnd(mbase, (u8) nEnd); /* disable interrupts */ @@ -1362,7 +1362,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) /* re-enable interrupt */ musb_writew(mbase, MGC_O_HDRC_INTRTXE, wIntrTxE); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } static const struct usb_ep_ops musb_ep_ops = { @@ -1395,7 +1395,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) u8 power, devctl; int retries; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); switch (musb->xceiv.state) { case OTG_STATE_B_PERIPHERAL: @@ -1450,7 +1450,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) power &= ~MGC_M_POWER_RESUME; musb_writeb(mregs, MGC_O_HDRC_POWER, power); done: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return status; } @@ -1519,12 +1519,12 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) /* NOTE: this assumes we are sensing vbus; we'd rather * not pullup unless the B-session is active. */ - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (is_on != musb->softconnect) { musb->softconnect = is_on; musb_pullup(musb, is_on); } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return 0; } @@ -1701,7 +1701,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) } DBG(3, "registering driver %s\n", driver->function); - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (musb->pGadgetDriver) { DBG(1, "%s is already bound to %s\n", @@ -1716,7 +1716,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) retval = 0; } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); if (retval == 0) retval = driver->bind(&musb->g); @@ -1729,7 +1729,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) /* start peripheral and/or OTG engines */ if (retval == 0) { - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); /* REVISIT always use otg_set_peripheral(), handling * issues including the root hub one below ... @@ -1747,7 +1747,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) if (!is_otg_enabled(musb)) musb_start(musb); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); if (is_otg_enabled(musb)) { DBG(3, "OTG startup...\n"); @@ -1759,12 +1759,12 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) retval = usb_add_hcd(musb_to_hcd(musb), -1, 0); if (retval < 0) { DBG(1, "add_hcd failed, %d\n", retval); - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); musb->xceiv.gadget = NULL; musb->xceiv.state = OTG_STATE_UNDEFINED; musb->pGadgetDriver = NULL; musb->g.dev.driver = NULL; - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } } } @@ -1810,9 +1810,9 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) } } - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); driver->disconnect (&musb->g); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); } } @@ -1835,7 +1835,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) * this needs to shut down the OTG engine. */ - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); #ifdef CONFIG_USB_MUSB_OTG musb_hnp_stop(musb); @@ -1846,9 +1846,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) stop_activity(musb, driver); DBG(3, "unregistering driver %s\n", driver->function); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); driver->unbind(&musb->g); - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); musb->pGadgetDriver = NULL; musb->g.dev.driver = NULL; @@ -1857,7 +1857,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) musb_platform_try_idle(musb, 0); } else retval = -EINVAL; - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); if (is_otg_enabled(musb) && retval == 0) { usb_remove_hcd(musb_to_hcd(musb)); @@ -1886,9 +1886,9 @@ void musb_g_resume(struct musb *musb) case OTG_STATE_B_PERIPHERAL: musb->is_active = 1; if (musb->pGadgetDriver && musb->pGadgetDriver->resume) { - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); musb->pGadgetDriver->resume(&musb->g); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); } break; default: @@ -1913,9 +1913,9 @@ void musb_g_suspend(struct musb *musb) case OTG_STATE_B_PERIPHERAL: musb->is_suspended = 1; if (musb->pGadgetDriver && musb->pGadgetDriver->suspend) { - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); musb->pGadgetDriver->suspend(&musb->g); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); } break; default: @@ -1949,9 +1949,9 @@ void musb_g_disconnect(struct musb *musb) musb->g.speed = USB_SPEED_UNKNOWN; if (musb->pGadgetDriver && musb->pGadgetDriver->disconnect) { - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); musb->pGadgetDriver->disconnect(&musb->g); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); } switch (musb->xceiv.state) { @@ -1976,8 +1976,8 @@ void musb_g_disconnect(struct musb *musb) } void musb_g_reset(struct musb *musb) -__releases(musb->Lock) -__acquires(musb->Lock) +__releases(musb->lock) +__acquires(musb->lock) { void __iomem *mbase = musb->mregs; u8 devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -267,8 +267,8 @@ start: /* caller owns controller lock, irqs are blocked */ static void __musb_giveback(struct musb *musb, struct urb *urb, int status) -__releases(musb->Lock) -__acquires(musb->Lock) +__releases(musb->lock) +__acquires(musb->lock) { if ((urb->transfer_flags & URB_SHORT_NOT_OK) && (urb->actual_length < urb->transfer_buffer_length) @@ -305,9 +305,9 @@ __acquires(musb->Lock) urb->actual_length, urb->transfer_buffer_length ); - spin_unlock(&musb->Lock); + spin_unlock(&musb->lock); usb_hcd_giveback_urb(musb_to_hcd(musb), urb); - spin_lock(&musb->Lock); + spin_lock(&musb->lock); } /* for bulk/interrupt endpoints only */ @@ -1868,7 +1868,7 @@ static int musb_urb_enqueue( * until we get real dma queues (with an entry for each urb/buffer), * we only have work to do in the former case. */ - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (hep->hcpriv) { /* some concurrent activity submitted another urb to hep... * odd, rare, error prone, but legal. @@ -1885,7 +1885,7 @@ static int musb_urb_enqueue( * musb_start_urb(), but otherwise only konicawc cares ... */ } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); done: if (status != 0) @@ -1968,7 +1968,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) usb_pipeendpoint(urb->pipe), usb_pipein(urb->pipe) ? "in" : "out"); - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); /* make sure the urb is still queued and not completed */ spin_lock(&urb->lock); @@ -2039,7 +2039,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) } else status = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); done: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return status; } @@ -2058,7 +2058,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) if (!qh) return; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); switch (qh->type) { case USB_ENDPOINT_XFER_CONTROL: @@ -2100,7 +2100,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list) musb_giveback(qh, urb, -ESHUTDOWN); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } static int musb_h_get_frame_number(struct usb_hcd *hcd) --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -792,7 +792,7 @@ static int musb_proc_read(char *page, char **start, if (count <= 0) return -EINVAL; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); code = dump_header_stats(musb, buffer); if (code > 0) { @@ -813,7 +813,7 @@ static int musb_proc_read(char *page, char **start, musb_platform_try_idle(musb, 0); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); *eof = 1; return buffer - page; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -342,7 +342,7 @@ static inline struct usb_request *next_out_request(struct musb_hw_ep *hw_ep) * struct musb - Driver instance data. */ struct musb { - spinlock_t Lock; + spinlock_t lock; struct clk *clock; irqreturn_t (*isr)(int, void *); struct work_struct irq_work; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -297,14 +297,14 @@ void musb_otg_timer_func(unsigned long data) struct musb *musb = (struct musb *)data; unsigned long flags; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (musb->xceiv.state == OTG_STATE_B_WAIT_ACON) { DBG(1, "HNP: B_WAIT_ACON timeout, going back to B_PERIPHERAL\n"); musb_g_disconnect(musb); musb->xceiv.state = OTG_STATE_B_PERIPHERAL; musb->is_active = 0; } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } static DEFINE_TIMER(musb_otg_timer, musb_otg_timer_func, 0, 0); @@ -882,14 +882,14 @@ static void musb_shutdown(struct platform_device *pdev) struct musb *musb = dev_to_musb(&pdev->dev); unsigned long flags; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); musb_platform_disable(musb); musb_generic_disable(musb); if (musb->clock) { clk_put(musb->clock); musb->clock = NULL; } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); /* FIXME power down */ } @@ -1419,7 +1419,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci) irqreturn_t retval = IRQ_NONE; struct musb *musb = __hci; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); musb->int_usb = musb_readb(musb->mregs, MGC_O_HDRC_INTRUSB); musb->int_tx = musb_readw(musb->mregs, MGC_O_HDRC_INTRTX); @@ -1428,7 +1428,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci) if (musb->int_usb || musb->int_tx || musb->int_rx) retval = musb_interrupt(musb); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); /* REVISIT we sometimes get spurious IRQs on g_ep0 * not clear why... @@ -1592,9 +1592,9 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf) unsigned long flags; int ret = -EINVAL; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); ret = sprintf(buf, "%s\n", otg_state_string(musb)); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return ret; } @@ -1606,14 +1606,14 @@ musb_mode_store(struct device *dev, struct device_attribute *attr, struct musb *musb = dev_to_musb(dev); unsigned long flags; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (!strncmp(buf, "host", 4)) musb_platform_set_mode(musb, MUSB_HOST); if (!strncmp(buf, "peripheral", 10)) musb_platform_set_mode(musb, MUSB_PERIPHERAL); if (!strncmp(buf, "otg", 3)) musb_platform_set_mode(musb, MUSB_OTG); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return n; } @@ -1627,7 +1627,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf) unsigned long flags; int vbus; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); #if defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_USB_MUSB_OTG) /* REVISIT: connect-A != connect-B ... */ vbus = musb_platform_get_vbus_status(musb); @@ -1659,7 +1659,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf) v2 = "disconnected"; #endif musb_platform_try_idle(musb, 0); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return sprintf(buf, "%s%s\n", v1, v2); } @@ -1673,7 +1673,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr, unsigned long flags; unsigned long val; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (sscanf(buf, "%lu", &val) < 1) { printk(KERN_ERR "Invalid VBUS timeout ms value\n"); return -EINVAL; @@ -1682,7 +1682,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr, if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON) musb->is_active = 0; musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val)); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return n; } @@ -1694,9 +1694,9 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) unsigned long flags; unsigned long val; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); val = musb->a_wait_bcon; - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return sprintf(buf, "%lu\n", val); } @@ -1716,10 +1716,10 @@ musb_srp_store(struct device *dev, struct device_attribute *attr, return -EINVAL; } - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (srp == 1) musb_g_wakeup(musb); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return n; } @@ -1881,7 +1881,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (!musb) return -ENOMEM; - spin_lock_init(&musb->Lock); + spin_lock_init(&musb->lock); musb->board_mode = plat->mode; musb->board_set_power = plat->set_power; musb->set_clock = plat->set_clock; @@ -2108,7 +2108,7 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) if (!musb->clock) return 0; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (is_peripheral_active(musb)) { /* FIXME force disconnect unless we know USB will wake @@ -2124,7 +2124,7 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) musb->set_clock(musb->clock, 0); else clk_disable(musb->clock); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return 0; } @@ -2136,7 +2136,7 @@ static int musb_resume(struct platform_device *pdev) if (!musb->clock) return 0; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (musb->set_clock) musb->set_clock(musb->clock, 1); @@ -2147,7 +2147,7 @@ static int musb_resume(struct platform_device *pdev) * unless for some reason the whole soc powered down and we're * not treating that as a whole-system restart (e.g. swsusp) */ - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return 0; } --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -394,7 +394,7 @@ static void musb_do_idle(unsigned long _musb) struct musb *musb = (void *)_musb; unsigned long flags; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); switch (musb->xceiv.state) { case OTG_STATE_A_WAIT_BCON: @@ -437,7 +437,7 @@ static void musb_do_idle(unsigned long _musb) tusb_allow_idle(musb, wakeups); } done: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } /* @@ -771,7 +771,7 @@ static irqreturn_t tusb_interrupt(int irq, void *__hci) unsigned long flags, idle_timeout = 0; u32 int_mask, int_src; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); /* Mask all interrupts to allow using both edge and level GPIO irq */ int_mask = musb_readl(base, TUSB_INT_MASK); @@ -869,7 +869,7 @@ static irqreturn_t tusb_interrupt(int irq, void *__hci) musb_platform_try_idle(musb, idle_timeout); musb_writel(base, TUSB_INT_MASK, int_mask); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return IRQ_HANDLED; } @@ -991,7 +991,7 @@ static int __init tusb_start(struct musb *musb) return ret; } - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (musb_readl(base, TUSB_PROD_TEST_RESET) != TUSB_PROD_TEST_RESET_VAL) { @@ -1033,12 +1033,12 @@ static int __init tusb_start(struct musb *musb) reg |= TUSB_PHY_OTG_CTRL_WRPROTECT | TUSB_PHY_OTG_CTRL_OTG_ID_PULLUP; musb_writel(base, TUSB_PHY_OTG_CTRL, reg); - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return 0; err: - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); if (musb->board_set_power) musb->board_set_power(0); --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -149,7 +149,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) unsigned long remaining, flags, pio; int ch; - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); if (dmareq_works()) ch = chdat->ch; @@ -230,7 +230,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) } } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); } static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, --- a/drivers/usb/musb/virthub.c +++ b/drivers/usb/musb/virthub.c @@ -233,7 +233,7 @@ int musb_hub_control( * port features: reported, sometimes updated when host is active * no indicators */ - spin_lock_irqsave(&musb->Lock, flags); + spin_lock_irqsave(&musb->lock, flags); switch (typeReq) { case ClearHubFeature: case SetHubFeature: @@ -411,6 +411,6 @@ error: /* "protocol stall" on error */ retval = -EPIPE; } - spin_unlock_irqrestore(&musb->Lock, flags); + spin_unlock_irqrestore(&musb->lock, flags); return retval; } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select 2007-08-13 13:48 ` [PATCH 18/52] musb_hdrc: Search and replace Lock with lock Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace MGC_SelectEnd with musb_ep_select Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 8 ++++---- drivers/usb/musb/g_ep0.c | 18 +++++++++--------- drivers/usb/musb/musb_gadget.c | 24 ++++++++++++------------ drivers/usb/musb/musb_host.c | 24 ++++++++++++------------ drivers/usb/musb/musb_procfs.c | 2 +- drivers/usb/musb/musbdefs.h | 6 +++--- drivers/usb/musb/musbhsdma.c | 2 +- drivers/usb/musb/plat_uds.c | 10 +++++----- drivers/usb/musb/tusb6010_omap.c | 6 +++--- 9 files changed, 50 insertions(+), 50 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -357,7 +357,7 @@ cppi_dump_rx(int level, struct cppi_channel *c, const char *tag) { void *__iomem base = c->pController->pCoreBase; - MGC_SelectEnd(base, c->chNo + 1); + musb_ep_select(base, c->chNo + 1); DBG(level, "RX DMA%d%s: %d left, csr %04x, " "%08x H%08x S%08x C%08x, " @@ -386,7 +386,7 @@ cppi_dump_tx(int level, struct cppi_channel *c, const char *tag) { void *__iomem base = c->pController->pCoreBase; - MGC_SelectEnd(base, c->chNo + 1); + musb_ep_select(base, c->chNo + 1); DBG(level, "TX DMA%d%s: csr %04x, " "H%08x S%08x C%08x %08x, " @@ -1094,7 +1094,7 @@ static int cppi_rx_scan(struct cppi *cppi, unsigned ch) */ WARN_ON(rx->activeQueueHead); } - MGC_SelectEnd(cppi->pCoreBase, rx->chNo + 1); + musb_ep_select(cppi->pCoreBase, rx->chNo + 1); csr = musb_readw(regs, MGC_O_HDRC_RXCSR); if (csr & MGC_M_RXCSR_DMAENAB) { DBG(4, "list%d %p/%p, last %08x%s, csr %04x\n", @@ -1404,7 +1404,7 @@ static int cppi_channel_abort(struct dma_channel *channel) * and caller should rely on us not changing it. * peripheral code is safe ... check host too. */ - MGC_SelectEnd(mbase, chNum + 1); + musb_ep_select(mbase, chNum + 1); if (otgCh->bTransmit) { struct cppi_tx_stateram *__iomem txState; --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -127,14 +127,14 @@ static int service_tx_status_request( break; } - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); if (is_in) tmp = musb_readw(regs, MGC_O_HDRC_TXCSR) & MGC_M_TXCSR_P_SENDSTALL; else tmp = musb_readw(regs, MGC_O_HDRC_RXCSR) & MGC_M_RXCSR_P_SENDSTALL; - MGC_SelectEnd(mbase, 0); + musb_ep_select(mbase, 0); bResult[0] = tmp ? 1 : 0; } break; @@ -278,7 +278,7 @@ __acquires(musb->lock) spin_lock(&musb->lock); /* select ep0 again */ - MGC_SelectEnd(mbase, 0); + musb_ep_select(mbase, 0); handled = 1; } break; default: @@ -388,7 +388,7 @@ stall: if (!musb_ep->desc) break; - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); if (is_in) { csr = musb_readw(regs, MGC_O_HDRC_TXCSR); @@ -411,7 +411,7 @@ stall: } /* select ep0 again */ - MGC_SelectEnd(mbase, 0); + musb_ep_select(mbase, 0); handled = 1; } break; @@ -604,7 +604,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) void __iomem *regs = musb->endpoints[0].regs; irqreturn_t retval = IRQ_NONE; - MGC_SelectEnd(mbase, 0); /* select ep0 */ + musb_ep_select(mbase, 0); /* select ep0 */ wCsrVal = musb_readw(regs, MGC_O_HDRC_CSR0); len = musb_readb(regs, MGC_O_HDRC_COUNT0); @@ -769,7 +769,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) handled = forward_to_driver(musb, &setup); if (handled < 0) { - MGC_SelectEnd(mbase, 0); + musb_ep_select(mbase, 0); stall: DBG(3, "stall (%d)\n", handled); musb->ackpend |= MGC_M_CSR0_P_SENDSTALL; @@ -864,7 +864,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) ep->name, ep->is_in ? "IN/TX" : "OUT/RX", req->request.length); - MGC_SelectEnd(musb->mregs, 0); + musb_ep_select(musb->mregs, 0); /* sequence #1, IN ... start writing the data */ if (musb->ep0_state == MGC_END0_STAGE_TX) @@ -933,7 +933,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) case MGC_END0_STAGE_RX: /* control-OUT data */ status = 0; - MGC_SelectEnd(base, 0); + musb_ep_select(base, 0); csr = musb_readw(regs, MGC_O_HDRC_CSR0); csr |= MGC_M_CSR0_P_SENDSTALL; musb_writew(regs, MGC_O_HDRC_CSR0, csr); --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -411,7 +411,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) void __iomem *epio = musb->endpoints[epnum].regs; struct dma_channel *dma; - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); pRequest = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); @@ -514,7 +514,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) * REVISIT for double buffering... * FIXME revisit for stalls too... */ - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsrVal & MGC_M_TXCSR_FIFONOTEMPTY) break; @@ -741,7 +741,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) void __iomem *epio = musb->endpoints[epnum].regs; struct dma_channel *dma; - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); pRequest = next_request(musb_ep); @@ -826,7 +826,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) goto done; /* don't start more i/o till the stall clears */ - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); if (wCsrVal & MGC_M_RXCSR_P_SENDSTALL) goto done; @@ -892,7 +892,7 @@ static int musb_gadget_enable(struct usb_ep *ep, /* enable the interrupts for the endpoint, set the endpoint * packet size (or fail), set the mode, clear the fifo */ - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); if (desc->bEndpointAddress & USB_DIR_IN) { u16 wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); @@ -1010,7 +1010,7 @@ static int musb_gadget_disable(struct usb_ep *ep) epio = musb->endpoints[epnum].regs; spin_lock_irqsave(&musb->lock, flags); - MGC_SelectEnd(musb->mregs, epnum); + musb_ep_select(musb->mregs, epnum); /* zero the endpoint sizes */ if (musb_ep->is_in) { @@ -1086,7 +1086,7 @@ static void musb_ep_restart(struct musb *musb, struct musb_request *req) req->bTx ? "TX/IN" : "RX/OUT", &req->request, req->request.length, req->epnum); - MGC_SelectEnd(musb->mregs, req->epnum); + musb_ep_select(musb->mregs, req->epnum); if (req->bTx) txstate(musb, req); else @@ -1201,7 +1201,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) else if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c = musb->pDmaController; - MGC_SelectEnd(musb->mregs, musb_ep->current_epnum); + musb_ep_select(musb->mregs, musb_ep->current_epnum); if (c->channel_abort) status = c->channel_abort(musb_ep->dma); else @@ -1249,7 +1249,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) goto done; } - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); /* cannot portably stall with non-empty FIFO */ pRequest = to_musb_request(next_request(musb_ep)); @@ -1317,7 +1317,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) spin_lock_irqsave(&musb->lock, flags); - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); /* FIXME return zero unless RXPKTRDY is set */ retval = musb_readw(epio, MGC_O_HDRC_RXCOUNT); @@ -1339,7 +1339,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) mbase = musb->mregs; spin_lock_irqsave(&musb->lock, flags); - MGC_SelectEnd(mbase, (u8) nEnd); + musb_ep_select(mbase, (u8) nEnd); /* disable interrupts */ wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); @@ -1799,7 +1799,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) for (i = 0, hw_ep = musb->endpoints; i < musb->nr_endpoints; i++, hw_ep++) { - MGC_SelectEnd(musb->mregs, i); + musb_ep_select(musb->mregs, i); if (hw_ep->bIsSharedFifo /* || !epnum */) { nuke(&hw_ep->ep_in, -ESHUTDOWN); } else { --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -481,7 +481,7 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, int nPipe = pUrb->pipe; void *buffer = pUrb->transfer_buffer; - // MGC_SelectEnd(mbase, epnum); + // musb_ep_select(mbase, epnum); wRxCount = musb_readw(epio, MGC_O_HDRC_RXCOUNT); DBG(3, "RX%d count %d, buffer %p len %d/%d\n", epnum, wRxCount, pUrb->transfer_buffer, qh->offset, @@ -651,7 +651,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, qh->h_addr_reg, qh->h_port_reg, dwLength); - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); /* candidate for DMA? */ pDmaController = musb->pDmaController; @@ -1033,7 +1033,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* ep0 only has one queue, "in" */ pUrb = next_urb(qh); - MGC_SelectEnd(mbase, 0); + musb_ep_select(mbase, 0); wCsrVal = musb_readw(epio, MGC_O_HDRC_CSR0); len = (wCsrVal & MGC_M_CSR0_RXPKTRDY) ? musb_readb(epio, MGC_O_HDRC_COUNT0) @@ -1179,7 +1179,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) pUrb = next_urb(qh); - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); wTxCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); /* with CPPI, DMA sometimes triggers "extra" irqs */ @@ -1217,7 +1217,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) * if (bulk && qh->ring.next != &musb->out_bulk), then * we have a candidate... NAKing is *NOT* an error */ - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); musb_writew(epio, MGC_O_HDRC_CSR0, MGC_M_TXCSR_H_WZC_BITS | MGC_M_TXCSR_TXPKTRDY); @@ -1241,7 +1241,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) | MGC_M_TXCSR_H_NAKTIMEOUT ); - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); musb_writew(epio, MGC_O_HDRC_TXCSR, wTxCsrVal); /* REVISIT may need to clear FLUSHFIFO ... */ musb_writew(epio, MGC_O_HDRC_TXCSR, wTxCsrVal); @@ -1323,7 +1323,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) musb_write_fifo(hw_ep, wLength, pBuffer); qh->segsize = wLength; - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); musb_writew(epio, MGC_O_HDRC_TXCSR, MGC_M_TXCSR_H_WZC_BITS | MGC_M_TXCSR_TXPKTRDY); } else @@ -1392,7 +1392,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) u32 status; struct dma_channel *dma; - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); pUrb = next_urb(qh); dma = is_dma_capable() ? hw_ep->rx_channel : NULL; @@ -1443,7 +1443,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) * we have a candidate... NAKing is *NOT* an error */ DBG(6, "RX end %d NAK timeout\n", epnum); - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | MGC_M_RXCSR_H_REQPKT); @@ -1501,7 +1501,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) xfer_len, dma ? ", dma" : ""); wRxCsrVal &= ~MGC_M_RXCSR_H_REQPKT; - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_H_WZC_BITS | wRxCsrVal); } @@ -1545,7 +1545,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) // SCRUB (RX) /* do the proper sequence to abort the transfer */ - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); wVal &= ~MGC_M_RXCSR_H_REQPKT; musb_writew(epio, MGC_O_HDRC_RXCSR, wVal); goto finish; @@ -1908,7 +1908,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in) u16 csr; int status = 0; - MGC_SelectEnd(regs, hw_end); + musb_ep_select(regs, hw_end); if (is_dma_capable()) { struct dma_channel *dma; --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -240,7 +240,7 @@ dump_end_info(struct musb *musb, u8 epnum, char *aBuffer, unsigned max) struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; do { - MGC_SelectEnd(musb->mregs, epnum); + musb_ep_select(musb->mregs, epnum); #ifdef CONFIG_USB_MUSB_HDRC_HCD if (is_host_active(musb)) { int dump_rx, dump_tx; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -218,18 +218,18 @@ enum musb_g_ep0_state { /* TUSB mapping: "flat" plus ep0 special cases */ #if defined(CONFIG_USB_TUSB6010) -#define MGC_SelectEnd(_mbase, _epnum) \ +#define musb_ep_select(_mbase, _epnum) \ musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_epnum)) #define MGC_END_OFFSET MGC_TUSB_OFFSET /* "flat" mapping: each endpoint has its own i/o address */ #elif defined(MUSB_FLAT_REG) -#define MGC_SelectEnd(_mbase, _epnum) (((void)(_mbase)),((void)(_epnum))) +#define musb_ep_select(_mbase, _epnum) (((void)(_mbase)),((void)(_epnum))) #define MGC_END_OFFSET MGC_FLAT_OFFSET /* "indexed" mapping: INDEX register controls register bank select */ #else -#define MGC_SelectEnd(_mbase, _epnum) \ +#define musb_ep_select(_mbase, _epnum) \ musb_writeb((_mbase), MGC_O_HDRC_INDEX, (_epnum)) #define MGC_END_OFFSET MGC_INDEXED_OFFSET #endif --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -353,7 +353,7 @@ static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) (pImplChannel->wMaxPacketSize - 1))) ) { /* Send out the packet */ - MGC_SelectEnd(mbase, + musb_ep_select(mbase, pImplChannel->epnum); musb_writew(mbase, MGC_END_OFFSET(pImplChannel->epnum,MGC_O_HDRC_TXCSR), --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -273,7 +273,7 @@ void musb_load_testpacket(struct musb *musb) { void __iomem *regs = musb->endpoints[0].regs; - MGC_SelectEnd(musb->mregs, 0); + musb_ep_select(musb->mregs, 0); musb_write_fifo(musb->control_ep, sizeof(musb_test_packet), musb_test_packet); musb_writew(regs, MGC_O_HDRC_CSR0, MGC_M_CSR0_TXPKTRDY); @@ -1187,7 +1187,7 @@ static int __init ep_config_from_hw(struct musb *musb) /* FIXME pick up ep0 maxpacket size */ for (epnum = 1; epnum < MUSB_C_NUM_EPS; epnum++) { - MGC_SelectEnd(mbase, epnum); + musb_ep_select(mbase, epnum); hw_ep = musb->endpoints + epnum; /* read from core using indexed model */ @@ -1257,7 +1257,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) int i; /* log core options (read using indexed model) */ - MGC_SelectEnd(mbase, 0); + musb_ep_select(mbase, 0); reg = musb_readb(mbase, 0x10 + MGC_O_HDRC_CONFIGDATA); strcpy(aInfo, (reg & MGC_M_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8"); @@ -1486,7 +1486,7 @@ irqreturn_t musb_interrupt(struct musb *musb) ep_num = 1; while (reg) { if (reg & 1) { - // MGC_SelectEnd(musb->mregs, ep_num); + // musb_ep_select(musb->mregs, ep_num); /* REVISIT just retval = ep->rx_irq(...) */ retval = IRQ_HANDLED; if (devctl & MGC_M_DEVCTL_HM) { @@ -1507,7 +1507,7 @@ irqreturn_t musb_interrupt(struct musb *musb) ep_num = 1; while (reg) { if (reg & 1) { - // MGC_SelectEnd(musb->mregs, ep_num); + // musb_ep_select(musb->mregs, ep_num); /* REVISIT just retval |= ep->tx_irq(...) */ retval = IRQ_HANDLED; if (devctl & MGC_M_DEVCTL_HM) { --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -222,7 +222,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) if (chdat->tx) { DBG(2, "terminating short tx packet\n"); - MGC_SelectEnd(musb_base, chdat->epnum); + musb_ep_select(musb_base, chdat->epnum); csr = musb_readw(hw_ep->regs, MGC_O_HDRC_TXCSR); csr |= MGC_M_TXCSR_MODE | MGC_M_TXCSR_TXPKTRDY | MGC_M_TXCSR_P_WZC_BITS; @@ -375,14 +375,14 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, * Prepare MUSB for DMA transfer */ if (chdat->tx) { - MGC_SelectEnd(musb_base, chdat->epnum); + musb_ep_select(musb_base, chdat->epnum); csr = musb_readw(hw_ep->regs, MGC_O_HDRC_TXCSR); csr |= (MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_MODE); csr &= ~MGC_M_TXCSR_P_UNDERRUN; musb_writew(hw_ep->regs, MGC_O_HDRC_TXCSR, csr); } else { - MGC_SelectEnd(musb_base, chdat->epnum); + musb_ep_select(musb_base, chdat->epnum); csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); csr |= MGC_M_RXCSR_DMAENAB; csr &= ~(MGC_M_RXCSR_AUTOCLEAR | MGC_M_RXCSR_DMAMODE); -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb 2007-08-13 13:48 ` [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace _pthis with musb Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -236,10 +236,10 @@ enum musb_g_ep0_state { /****************************** FUNCTIONS ********************************/ -#define MUSB_HST_MODE(_pthis)\ - { (_pthis)->bIsHost=TRUE; } -#define MUSB_DEV_MODE(_pthis) \ - { (_pthis)->bIsHost=FALSE; } +#define MUSB_HST_MODE(_musb)\ + { (_musb)->bIsHost=TRUE; } +#define MUSB_DEV_MODE(_musb) \ + { (_musb)->bIsHost=FALSE; } #define test_devctl_hst_mode(_x) \ (musb_readb((_x)->mregs, MGC_O_HDRC_DEVCTL)&MGC_M_DEVCTL_HM) -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host 2007-08-13 13:48 ` [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bIsHost with is_host Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -85,8 +85,8 @@ struct musb_ep; /* NOTE: otg and peripheral-only state machines start at B_IDLE. * OTG or host-only go to A_IDLE when ID is sensed. */ -#define is_peripheral_active(m) (!(m)->bIsHost) -#define is_host_active(m) ((m)->bIsHost) +#define is_peripheral_active(m) (!(m)->is_host) +#define is_host_active(m) ((m)->is_host) #else #define is_peripheral_enabled(musb) is_peripheral_capable() @@ -237,14 +237,14 @@ enum musb_g_ep0_state { /****************************** FUNCTIONS ********************************/ #define MUSB_HST_MODE(_musb)\ - { (_musb)->bIsHost=TRUE; } + { (_musb)->is_host=TRUE; } #define MUSB_DEV_MODE(_musb) \ - { (_musb)->bIsHost=FALSE; } + { (_musb)->is_host=FALSE; } #define test_devctl_hst_mode(_x) \ (musb_readb((_x)->mregs, MGC_O_HDRC_DEVCTL)&MGC_M_DEVCTL_HM) -#define MUSB_MODE(musb) ((musb)->bIsHost ? "Host" : "Peripheral") +#define MUSB_MODE(musb) ((musb)->is_host ? "Host" : "Peripheral") /************************** Ep Configuration ********************************/ @@ -416,7 +416,7 @@ struct musb { unsigned is_active:1; unsigned bIsMultipoint:1; - unsigned bIsHost:1; + unsigned is_host:1; unsigned bIgnoreDisconnect:1; /* during bus resets */ int a_wait_bcon; /* VBUS timeout in msecs */ -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor 2007-08-13 13:48 ` [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Get rid of old unused MUSB_EpFifoDescriptor Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 20 -------------------- 1 files changed, 0 insertions(+), 20 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -246,26 +246,6 @@ enum musb_g_ep0_state { #define MUSB_MODE(musb) ((musb)->is_host ? "Host" : "Peripheral") -/************************** Ep Configuration ********************************/ - -/** The End point descriptor */ -struct MUSB_EpFifoDescriptor { - u8 bType; /* 0 for autoconfig, CNTR, ISOC, BULK, INTR */ - u8 bDir; /* 0 for autoconfig, INOUT, IN, OUT */ - int wSize; /* 0 for autoconfig, or the size */ -}; - -#define MUSB_EPD_AUTOCONFIG 0 - -#define MUSB_EPD_T_CNTRL 1 -#define MUSB_EPD_T_ISOC 2 -#define MUSB_EPD_T_BULK 3 -#define MUSB_EPD_T_INTR 4 - -#define MUSB_EPD_D_INOUT 0 -#define MUSB_EPD_D_TX 1 -#define MUSB_EPD_D_RX 2 - /******************************** TYPES *************************************/ /* -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo 2007-08-13 13:48 ` [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:48 ` [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace bIsSharedFifo with is_shared_fifo Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_gadget.c | 12 ++++++------ drivers/usb/musb/musb_host.c | 14 +++++++------- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -896,7 +896,7 @@ static int musb_gadget_enable(struct usb_ep *ep, if (desc->bEndpointAddress & USB_DIR_IN) { u16 wIntrTxE = musb_readw(mbase, MGC_O_HDRC_INTRTXE); - if (hw_ep->bIsSharedFifo) + if (hw_ep->is_shared_fifo) musb_ep->is_in = 1; if (!musb_ep->is_in) goto fail; @@ -926,7 +926,7 @@ static int musb_gadget_enable(struct usb_ep *ep, } else { u16 wIntrRxE = musb_readw(mbase, MGC_O_HDRC_INTRRXE); - if (hw_ep->bIsSharedFifo) + if (hw_ep->is_shared_fifo) musb_ep->is_in = 0; if (musb_ep->is_in) goto fail; @@ -942,7 +942,7 @@ static int musb_gadget_enable(struct usb_ep *ep, musb_writew(regs, MGC_O_HDRC_RXMAXP, tmp); /* force shared fifo to OUT-only mode */ - if (hw_ep->bIsSharedFifo) { + if (hw_ep->is_shared_fifo) { csr = musb_readw(regs, MGC_O_HDRC_TXCSR); csr &= ~(MGC_M_TXCSR_MODE | MGC_M_TXCSR_TXPKTRDY); musb_writew(regs, MGC_O_HDRC_TXCSR, csr); @@ -1569,7 +1569,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) INIT_LIST_HEAD(&ep->req_list); sprintf(ep->name, "ep%d%s", epnum, - (!epnum || hw_ep->bIsSharedFifo) ? "" : ( + (!epnum || hw_ep->is_shared_fifo) ? "" : ( is_in ? "in" : "out")); ep->end_point.name = ep->name; INIT_LIST_HEAD(&ep->end_point.ep_list); @@ -1603,7 +1603,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) for (epnum = 0, hw_ep = musb->endpoints; epnum < musb->nr_endpoints; epnum++, hw_ep++) { - if (hw_ep->bIsSharedFifo /* || !epnum */) { + if (hw_ep->is_shared_fifo /* || !epnum */) { init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 0); count++; } else { @@ -1800,7 +1800,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) i < musb->nr_endpoints; i++, hw_ep++) { musb_ep_select(musb->mregs, i); - if (hw_ep->bIsSharedFifo /* || !epnum */) { + if (hw_ep->is_shared_fifo /* || !epnum */) { nuke(&hw_ep->ep_in, -ESHUTDOWN); } else { if (hw_ep->wMaxPacketSizeTx) --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -216,7 +216,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) epnum, pBuffer, dwLength); /* Configure endpoint */ - if (is_in || hw_ep->bIsSharedFifo) + if (is_in || hw_ep->is_shared_fifo) hw_ep->in_qh = qh; else hw_ep->out_qh = qh; @@ -322,7 +322,7 @@ static inline void musb_save_toggle(struct musb_hw_ep *ep, int is_in, struct urb * problems getting toggle correct. */ - if (is_in || ep->bIsSharedFifo) + if (is_in || ep->is_shared_fifo) qh = ep->in_qh; else qh = ep->out_qh; @@ -349,7 +349,7 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) struct musb *musb = ep->musb; int ready = qh->is_ready; - if (ep->bIsSharedFifo) + if (ep->is_shared_fifo) is_in = 1; else is_in = usb_pipein(urb->pipe); @@ -382,7 +382,7 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) ep->tx_reinit = 1; /* clobber old pointers to this qh */ - if (is_in || ep->bIsSharedFifo) + if (is_in || ep->is_shared_fifo) ep->in_qh = NULL; else ep->out_qh = NULL; @@ -429,7 +429,7 @@ musb_advance_schedule(struct musb *musb, struct urb *urb, { struct musb_qh *qh; - if (is_in || hw_ep->bIsSharedFifo) + if (is_in || hw_ep->is_shared_fifo) qh = hw_ep->in_qh; else qh = hw_ep->out_qh; @@ -578,7 +578,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) */ /* if programmed for Tx, put it in RX mode */ - if (ep->bIsSharedFifo) { + if (ep->is_shared_fifo) { csr = musb_readw(ep->regs, MGC_O_HDRC_TXCSR); if (csr & MGC_M_TXCSR_MODE) { musb_h_tx_flush_fifo(ep); @@ -636,7 +636,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, struct musb_qh *qh; u16 wPacketSize; - if (!is_out || hw_ep->bIsSharedFifo) + if (!is_out || hw_ep->is_shared_fifo) qh = hw_ep->in_qh; else qh = hw_ep->out_qh; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -266,7 +266,7 @@ struct musb_hw_ep { u8 epnum; /* hardware configuration, possibly dynamic */ - u8 bIsSharedFifo; + u8 is_shared_fifo; u8 tx_double_buffered; u8 rx_double_buffered; u16 wMaxPacketSizeTx; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1078,7 +1078,7 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, hw_ep->tx_double_buffered = hw_ep->rx_double_buffered; hw_ep->wMaxPacketSizeTx = maxpacket; - hw_ep->bIsSharedFifo = TRUE; + hw_ep->is_shared_fifo = TRUE; break; } @@ -1204,11 +1204,11 @@ static int __init ep_config_from_hw(struct musb *musb) /* shared TX/RX FIFO? */ if ((reg & 0xf0) == 0xf0) { hw_ep->wMaxPacketSizeRx = hw_ep->wMaxPacketSizeTx; - hw_ep->bIsSharedFifo = TRUE; + hw_ep->is_shared_fifo = TRUE; continue; } else { hw_ep->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); - hw_ep->bIsSharedFifo = FALSE; + hw_ep->is_shared_fifo = FALSE; } /* FIXME set up hw_ep->{rx,tx}_double_buffered */ @@ -1388,12 +1388,12 @@ static int __init musb_core_init(u16 wType, struct musb *musb) printk(KERN_DEBUG "%s: hw_ep %d%s, %smax %d\n", musb_driver_name, i, - hw_ep->bIsSharedFifo ? "shared" : "tx", + hw_ep->is_shared_fifo ? "shared" : "tx", hw_ep->tx_double_buffered ? "doublebuffer, " : "", hw_ep->wMaxPacketSizeTx); } - if (hw_ep->wMaxPacketSizeRx && !hw_ep->bIsSharedFifo) { + if (hw_ep->wMaxPacketSizeRx && !hw_ep->is_shared_fifo) { printk(KERN_DEBUG "%s: hw_ep %d%s, %smax %d\n", musb_driver_name, i, -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx 2007-08-13 13:48 ` [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo Tony Lindgren @ 2007-08-13 13:48 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:48 UTC (permalink / raw) To: linux-omap-open-source Search and replace wMaxPacketSizeTx with max_packet_sz_tx Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_gadget.c | 10 +++++----- drivers/usb/musb/musb_host.c | 6 +++--- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -203,7 +203,7 @@ static void nuke(struct musb_ep *ep, const int status) static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) { if (can_bulk_split(musb, ep->type)) - return ep->hw_ep->wMaxPacketSizeTx; + return ep->hw_ep->max_packet_sz_tx; else return ep->wPacketSize; } @@ -900,7 +900,7 @@ static int musb_gadget_enable(struct usb_ep *ep, musb_ep->is_in = 1; if (!musb_ep->is_in) goto fail; - if (tmp > hw_ep->wMaxPacketSizeTx) + if (tmp > hw_ep->max_packet_sz_tx) goto fail; wIntrTxE |= (1 << epnum); @@ -1579,7 +1579,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) musb->g.ep0 = &ep->end_point; } else { if (is_in) - ep->end_point.maxpacket = hw_ep->wMaxPacketSizeTx; + ep->end_point.maxpacket = hw_ep->max_packet_sz_tx; else ep->end_point.maxpacket = hw_ep->wMaxPacketSizeRx; ep->end_point.ops = &musb_ep_ops; @@ -1607,7 +1607,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 0); count++; } else { - if (hw_ep->wMaxPacketSizeTx) { + if (hw_ep->max_packet_sz_tx) { init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 1); count++; @@ -1803,7 +1803,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) if (hw_ep->is_shared_fifo /* || !epnum */) { nuke(&hw_ep->ep_in, -ESHUTDOWN); } else { - if (hw_ep->wMaxPacketSizeTx) + if (hw_ep->max_packet_sz_tx) nuke(&hw_ep->ep_in, -ESHUTDOWN); if (hw_ep->wMaxPacketSizeRx) nuke(&hw_ep->ep_out, -ESHUTDOWN); --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -740,7 +740,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, if (can_bulk_split(musb, qh->type)) musb_writew(epio, MGC_O_HDRC_TXMAXP, wPacketSize - | ((hw_ep->wMaxPacketSizeTx / + | ((hw_ep->max_packet_sz_tx / wPacketSize) - 1) << 11); else musb_writew(epio, MGC_O_HDRC_TXMAXP, @@ -754,7 +754,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, } if (can_bulk_split(musb, qh->type)) - wLoadCount = min((u32) hw_ep->wMaxPacketSizeTx, + wLoadCount = min((u32) hw_ep->max_packet_sz_tx, dwLength); else wLoadCount = min((u32) wPacketSize, dwLength); @@ -1718,7 +1718,7 @@ static int musb_schedule( if (is_in) diff = hw_ep->wMaxPacketSizeRx - qh->maxpacket; else - diff = hw_ep->wMaxPacketSizeTx - qh->maxpacket; + diff = hw_ep->max_packet_sz_tx - qh->maxpacket; if (diff > 0 && wBestDiff > diff) { wBestDiff = diff; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -269,7 +269,7 @@ struct musb_hw_ep { u8 is_shared_fifo; u8 tx_double_buffered; u8 rx_double_buffered; - u16 wMaxPacketSizeTx; + u16 max_packet_sz_tx; u16 wMaxPacketSizeRx; struct dma_channel *tx_channel; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1059,7 +1059,7 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, musb_writeb(mbase, MGC_O_HDRC_TXFIFOSZ, c_size); musb_writew(mbase, MGC_O_HDRC_TXFIFOADD, c_off); hw_ep->tx_double_buffered = !!(c_size & MGC_M_FIFOSZ_DPB); - hw_ep->wMaxPacketSizeTx = maxpacket; + hw_ep->max_packet_sz_tx = maxpacket; break; case FIFO_RX: musb_writeb(mbase, MGC_O_HDRC_RXFIFOSZ, c_size); @@ -1076,7 +1076,7 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, musb_writeb(mbase, MGC_O_HDRC_RXFIFOSZ, c_size); musb_writew(mbase, MGC_O_HDRC_RXFIFOADD, c_off); hw_ep->tx_double_buffered = hw_ep->rx_double_buffered; - hw_ep->wMaxPacketSizeTx = maxpacket; + hw_ep->max_packet_sz_tx = maxpacket; hw_ep->is_shared_fifo = TRUE; break; @@ -1199,11 +1199,11 @@ static int __init ep_config_from_hw(struct musb *musb) musb->nr_endpoints++; musb->wEndMask |= (1 << epnum); - hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f); + hw_ep->max_packet_sz_tx = 1 << (reg & 0x0f); /* shared TX/RX FIFO? */ if ((reg & 0xf0) == 0xf0) { - hw_ep->wMaxPacketSizeRx = hw_ep->wMaxPacketSizeTx; + hw_ep->wMaxPacketSizeRx = hw_ep->max_packet_sz_tx; hw_ep->is_shared_fifo = TRUE; continue; } else { @@ -1215,7 +1215,7 @@ static int __init ep_config_from_hw(struct musb *musb) #ifdef CONFIG_USB_MUSB_HDRC_HCD /* pick an RX/TX endpoint for bulk */ - if (hw_ep->wMaxPacketSizeTx < 512 + if (hw_ep->max_packet_sz_tx < 512 || hw_ep->wMaxPacketSizeRx < 512) continue; @@ -1334,7 +1334,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) musb_driver_name, type, aRevision, aDate); /* configure ep0 */ - musb->endpoints[0].wMaxPacketSizeTx = MGC_END0_FIFOSIZE; + musb->endpoints[0].max_packet_sz_tx = MGC_END0_FIFOSIZE; musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; /* discover endpoint configuration */ @@ -1384,14 +1384,14 @@ static int __init musb_core_init(u16 wType, struct musb *musb) hw_ep->tx_reinit = 1; #endif - if (hw_ep->wMaxPacketSizeTx) { + if (hw_ep->max_packet_sz_tx) { printk(KERN_DEBUG "%s: hw_ep %d%s, %smax %d\n", musb_driver_name, i, hw_ep->is_shared_fifo ? "shared" : "tx", hw_ep->tx_double_buffered ? "doublebuffer, " : "", - hw_ep->wMaxPacketSizeTx); + hw_ep->max_packet_sz_tx); } if (hw_ep->wMaxPacketSizeRx && !hw_ep->is_shared_fifo) { printk(KERN_DEBUG @@ -1402,7 +1402,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) ? "doublebuffer, " : "", hw_ep->wMaxPacketSizeRx); } - if (!(hw_ep->wMaxPacketSizeTx || hw_ep->wMaxPacketSizeRx)) + if (!(hw_ep->max_packet_sz_tx || hw_ep->wMaxPacketSizeRx)) DBG(1, "hw_ep %d not configured\n", i); } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx 2007-08-13 13:48 ` [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace wMaxPacketSizeRx with max_packet_sz_rx Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_gadget.c | 8 ++++---- drivers/usb/musb/musb_host.c | 2 +- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 18 +++++++++--------- 4 files changed, 15 insertions(+), 15 deletions(-) --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -930,7 +930,7 @@ static int musb_gadget_enable(struct usb_ep *ep, musb_ep->is_in = 0; if (musb_ep->is_in) goto fail; - if (tmp > hw_ep->wMaxPacketSizeRx) + if (tmp > hw_ep->max_packet_sz_rx) goto fail; wIntrRxE |= (1 << epnum); @@ -1581,7 +1581,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) if (is_in) ep->end_point.maxpacket = hw_ep->max_packet_sz_tx; else - ep->end_point.maxpacket = hw_ep->wMaxPacketSizeRx; + ep->end_point.maxpacket = hw_ep->max_packet_sz_rx; ep->end_point.ops = &musb_ep_ops; list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); } @@ -1612,7 +1612,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) epnum, 1); count++; } - if (hw_ep->wMaxPacketSizeRx) { + if (hw_ep->max_packet_sz_rx) { init_peripheral_ep(musb, &hw_ep->ep_out, epnum, 0); count++; @@ -1805,7 +1805,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) } else { if (hw_ep->max_packet_sz_tx) nuke(&hw_ep->ep_in, -ESHUTDOWN); - if (hw_ep->wMaxPacketSizeRx) + if (hw_ep->max_packet_sz_rx) nuke(&hw_ep->ep_out, -ESHUTDOWN); } } --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -1716,7 +1716,7 @@ static int musb_schedule( continue; if (is_in) - diff = hw_ep->wMaxPacketSizeRx - qh->maxpacket; + diff = hw_ep->max_packet_sz_rx - qh->maxpacket; else diff = hw_ep->max_packet_sz_tx - qh->maxpacket; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -270,7 +270,7 @@ struct musb_hw_ep { u8 tx_double_buffered; u8 rx_double_buffered; u16 max_packet_sz_tx; - u16 wMaxPacketSizeRx; + u16 max_packet_sz_rx; struct dma_channel *tx_channel; struct dma_channel *rx_channel; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1065,13 +1065,13 @@ fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, musb_writeb(mbase, MGC_O_HDRC_RXFIFOSZ, c_size); musb_writew(mbase, MGC_O_HDRC_RXFIFOADD, c_off); hw_ep->rx_double_buffered = !!(c_size & MGC_M_FIFOSZ_DPB); - hw_ep->wMaxPacketSizeRx = maxpacket; + hw_ep->max_packet_sz_rx = maxpacket; break; case FIFO_RXTX: musb_writeb(mbase, MGC_O_HDRC_TXFIFOSZ, c_size); musb_writew(mbase, MGC_O_HDRC_TXFIFOADD, c_off); hw_ep->rx_double_buffered = !!(c_size & MGC_M_FIFOSZ_DPB); - hw_ep->wMaxPacketSizeRx = maxpacket; + hw_ep->max_packet_sz_rx = maxpacket; musb_writeb(mbase, MGC_O_HDRC_RXFIFOSZ, c_size); musb_writew(mbase, MGC_O_HDRC_RXFIFOADD, c_off); @@ -1203,11 +1203,11 @@ static int __init ep_config_from_hw(struct musb *musb) /* shared TX/RX FIFO? */ if ((reg & 0xf0) == 0xf0) { - hw_ep->wMaxPacketSizeRx = hw_ep->max_packet_sz_tx; + hw_ep->max_packet_sz_rx = hw_ep->max_packet_sz_tx; hw_ep->is_shared_fifo = TRUE; continue; } else { - hw_ep->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); + hw_ep->max_packet_sz_rx = 1 << ((reg & 0xf0) >> 4); hw_ep->is_shared_fifo = FALSE; } @@ -1216,7 +1216,7 @@ static int __init ep_config_from_hw(struct musb *musb) #ifdef CONFIG_USB_MUSB_HDRC_HCD /* pick an RX/TX endpoint for bulk */ if (hw_ep->max_packet_sz_tx < 512 - || hw_ep->wMaxPacketSizeRx < 512) + || hw_ep->max_packet_sz_rx < 512) continue; /* REVISIT: this algorithm is lazy, we should at least @@ -1335,7 +1335,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) /* configure ep0 */ musb->endpoints[0].max_packet_sz_tx = MGC_END0_FIFOSIZE; - musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; + musb->endpoints[0].max_packet_sz_rx = MGC_END0_FIFOSIZE; /* discover endpoint configuration */ musb->nr_endpoints = 1; @@ -1393,16 +1393,16 @@ static int __init musb_core_init(u16 wType, struct musb *musb) ? "doublebuffer, " : "", hw_ep->max_packet_sz_tx); } - if (hw_ep->wMaxPacketSizeRx && !hw_ep->is_shared_fifo) { + if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) { printk(KERN_DEBUG "%s: hw_ep %d%s, %smax %d\n", musb_driver_name, i, "rx", hw_ep->rx_double_buffered ? "doublebuffer, " : "", - hw_ep->wMaxPacketSizeRx); + hw_ep->max_packet_sz_rx); } - if (!(hw_ep->max_packet_sz_tx || hw_ep->wMaxPacketSizeRx)) + if (!(hw_ep->max_packet_sz_tx || hw_ep->max_packet_sz_rx)) DBG(1, "hw_ep %d not configured\n", i); } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller 2007-08-13 13:49 ` [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace pDmaController with dma_controller Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 2 +- drivers/usb/musb/musb_gadget.c | 20 ++++++++++---------- drivers/usb/musb/musb_host.c | 32 ++++++++++++++++---------------- drivers/usb/musb/musb_procfs.c | 2 +- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 10 +++++----- 6 files changed, 34 insertions(+), 34 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -1143,7 +1143,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) struct cppi_descriptor *bdPtr; struct musb_hw_ep *hw_ep = NULL; - cppi = container_of(musb->pDmaController, struct cppi, Controller); + cppi = container_of(musb->dma_controller, struct cppi, Controller); regBase = musb->ctrl_base; --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -164,7 +164,7 @@ static void nuke(struct musb_ep *ep, const int status) ep->busy = 1; if (is_dma_capable() && ep->dma) { - struct dma_controller *c = ep->musb->pDmaController; + struct dma_controller *c = ep->musb->dma_controller; int value; if (ep->is_in) { musb_writew(epio, MGC_O_HDRC_TXCSR, @@ -292,7 +292,7 @@ static void txstate(struct musb *musb, struct musb_request *req) #ifndef CONFIG_USB_INVENTRA_FIFO if (is_dma_capable() && musb_ep->dma) { - struct dma_controller *c = musb->pDmaController; + struct dma_controller *c = musb->dma_controller; use_dma = (pRequest->dma != DMA_ADDR_INVALID); @@ -428,7 +428,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - musb->pDmaController->channel_abort(dma); + musb->dma_controller->channel_abort(dma); } if (pRequest) @@ -583,7 +583,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); if (is_cppi_enabled() && musb_ep->dma) { - struct dma_controller *c = musb->pDmaController; + struct dma_controller *c = musb->dma_controller; struct dma_channel *channel = musb_ep->dma; /* NOTE: CPPI won't actually stop advancing the DMA @@ -618,7 +618,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) struct dma_channel *channel; int use_dma = 0; - c = musb->pDmaController; + c = musb->dma_controller; channel = musb_ep->dma; /* We use DMA Req mode 0 in RxCsr, and DMA controller operates in @@ -694,7 +694,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) #ifdef CONFIG_USB_TUSB_OMAP_DMA if (tusb_dma_omap() && musb_ep->dma) { - struct dma_controller *c = musb->pDmaController; + struct dma_controller *c = musb->dma_controller; struct dma_channel *channel = musb_ep->dma; u32 dma_addr = pRequest->dma + pRequest->actual; int ret; @@ -754,7 +754,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) if (wCsrVal & MGC_M_RXCSR_P_SENTSTALL) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) musb->pDmaController->channel_abort(dma); + (void) musb->dma_controller->channel_abort(dma); pRequest->actual += musb_ep->dma->dwActualLength; } @@ -962,8 +962,8 @@ static int musb_gadget_enable(struct usb_ep *ep, /* NOTE: all the I/O code _should_ work fine without DMA, in case * for some reason you run out of channels here. */ - if (is_dma_capable() && musb->pDmaController) { - struct dma_controller *c = musb->pDmaController; + if (is_dma_capable() && musb->dma_controller) { + struct dma_controller *c = musb->dma_controller; musb_ep->dma = c->channel_alloc(c, hw_ep, (desc->bEndpointAddress & USB_DIR_IN)); @@ -1199,7 +1199,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) /* ... else abort the dma transfer ... */ else if (is_dma_capable() && musb_ep->dma) { - struct dma_controller *c = musb->pDmaController; + struct dma_controller *c = musb->dma_controller; musb_ep_select(musb->mregs, musb_ep->current_epnum); if (c->channel_abort) --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -627,7 +627,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, struct urb *pUrb, unsigned int is_out, u8 * pBuffer, u32 dwLength) { - struct dma_controller *pDmaController; + struct dma_controller *dma_controller; struct dma_channel *pDmaChannel; u8 bDmaOk; void __iomem *mbase = musb->mregs; @@ -654,12 +654,12 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_ep_select(mbase, epnum); /* candidate for DMA? */ - pDmaController = musb->pDmaController; - if (is_dma_capable() && epnum && pDmaController) { + dma_controller = musb->dma_controller; + if (is_dma_capable() && epnum && dma_controller) { pDmaChannel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel; if (!pDmaChannel) { - pDmaChannel = pDmaController->channel_alloc( - pDmaController, hw_ep, is_out); + pDmaChannel = dma_controller->channel_alloc( + dma_controller, hw_ep, is_out); if (is_out) hw_ep->tx_channel = pDmaChannel; else @@ -791,7 +791,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_writew(epio, MGC_O_HDRC_TXCSR, wCsr); - bDmaOk = pDmaController->channel_program( + bDmaOk = dma_controller->channel_program( pDmaChannel, wPacketSize, pDmaChannel->bDesiredMode, pUrb->transfer_dma, @@ -799,7 +799,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, if (bDmaOk) { wLoadCount = 0; } else { - pDmaController->channel_release(pDmaChannel); + dma_controller->channel_release(pDmaChannel); if (is_out) hw_ep->tx_channel = NULL; else @@ -830,7 +830,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, /* TX uses "rndis" mode automatically, but needs help * to identify the zero-length-final-packet case. */ - bDmaOk = pDmaController->channel_program( + bDmaOk = dma_controller->channel_program( pDmaChannel, wPacketSize, (pUrb->transfer_flags & URB_ZERO_PACKET) @@ -840,7 +840,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, if (bDmaOk) { wLoadCount = 0; } else { - pDmaController->channel_release(pDmaChannel); + dma_controller->channel_release(pDmaChannel); pDmaChannel = hw_ep->tx_channel = NULL; /* REVISIT there's an error path here that @@ -915,14 +915,14 @@ static void musb_ep_program(struct musb *musb, u8 epnum, /* unless caller treats short rx transfers as * errors, we dare not queue multiple transfers. */ - bDmaOk = pDmaController->channel_program( + bDmaOk = dma_controller->channel_program( pDmaChannel, wPacketSize, !(pUrb->transfer_flags & URB_SHORT_NOT_OK), pUrb->transfer_dma, qh->segsize); if (!bDmaOk) { - pDmaController->channel_release( + dma_controller->channel_release( pDmaChannel); pDmaChannel = hw_ep->rx_channel = NULL; } else @@ -1227,7 +1227,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) if (status) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) musb->pDmaController->channel_abort(dma); + (void) musb->dma_controller->channel_abort(dma); } /* do the proper sequence to abort the transfer in the @@ -1461,7 +1461,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) /* clean up dma and collect transfer count */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) musb->pDmaController->channel_abort(dma); + (void) musb->dma_controller->channel_abort(dma); xfer_len = dma->dwActualLength; } musb_h_flush_rxfifo(hw_ep, 0); @@ -1492,7 +1492,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; - (void) musb->pDmaController->channel_abort(dma); + (void) musb->dma_controller->channel_abort(dma); xfer_len = dma->dwActualLength; bDone = TRUE; } @@ -1567,7 +1567,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) qh->offset, pUrb->transfer_buffer_length); - c = musb->pDmaController; + c = musb->dma_controller; dma->bDesiredMode = 0; #ifdef USE_MODE1 @@ -1915,7 +1915,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in) dma = is_in ? ep->rx_channel : ep->tx_channel; if (dma) { - status = ep->musb->pDmaController->channel_abort(dma); + status = ep->musb->dma_controller->channel_abort(dma); DBG(status ? 1 : 3, "abort %cX%d DMA for urb %p --> %d\n", is_in ? 'R' : 'T', ep->epnum, --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -593,7 +593,7 @@ static int dump_header_stats(struct musb *musb, char *buffer) buffer += code; #endif /* DAVINCI */ - if (is_cppi_enabled() && musb->pDmaController) { + if (is_cppi_enabled() && musb->dma_controller) { code = sprintf(buffer, "CPPI: txcr=%d txsrc=%01x txena=%01x; " "rxcr=%d rxsrc=%01x rxena=%01x " --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -356,7 +356,7 @@ struct musb { */ void (*board_set_vbus)(struct musb *, int is_on); - struct dma_controller *pDmaController; + struct dma_controller *dma_controller; struct device *controller; void __iomem *ctrl_base; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1807,8 +1807,8 @@ static void musb_free(struct musb *musb) disable_irq_wake(musb->nIrq); free_irq(musb->nIrq, musb); } - if (is_dma_capable() && musb->pDmaController) { - struct dma_controller *c = musb->pDmaController; + if (is_dma_capable() && musb->dma_controller) { + struct dma_controller *c = musb->dma_controller; (void) c->stop(c->pPrivateData); dma_controller_destroy(c); @@ -1921,13 +1921,13 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) struct dma_controller *c; c = dma_controller_create(musb, musb->mregs); - musb->pDmaController = c; + musb->dma_controller = c; if (c) (void) c->start(c->pPrivateData); } #endif /* ideally this would be abstracted in platform setup */ - if (!is_dma_capable() || !musb->pDmaController) + if (!is_dma_capable() || !musb->dma_controller) dev->dma_mask = NULL; /* be sure interrupts are disabled before connecting ISR */ @@ -1961,7 +1961,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) default: s = "OTG"; break; }; s; }), ctrl, - (is_dma_capable() && musb->pDmaController) + (is_dma_capable() && musb->dma_controller) ? "DMA" : "PIO", musb->nIrq); -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint 2007-08-13 13:49 ` [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bIsMultipoint with is_multipoint Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_host.c | 8 ++++---- drivers/usb/musb/musb_procfs.c | 2 +- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -599,7 +599,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) } /* target addr and (for multipoint) hub addr/port */ - if (musb->bIsMultipoint) { + if (musb->is_multipoint) { musb_writeb(ep->target_regs, MGC_O_HDRC_RXFUNCADDR, qh->addr_reg); musb_writeb(ep->target_regs, MGC_O_HDRC_RXHUBADDR, @@ -720,7 +720,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, } /* target addr and (for multipoint) hub addr/port */ - if (musb->bIsMultipoint) { + if (musb->is_multipoint) { musb_writeb(mbase, MGC_BUSCTL_OFFSET(epnum, MGC_O_HDRC_TXFUNCADDR), qh->addr_reg); @@ -748,7 +748,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_writeb(epio, MGC_O_HDRC_TXINTERVAL, qh->intv_reg); } else { musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, qh->intv_reg); - if (musb->bIsMultipoint) + if (musb->is_multipoint) musb_writeb(epio, MGC_O_HDRC_TYPE0, qh->type_reg); } @@ -1850,7 +1850,7 @@ static int musb_urb_enqueue( qh->intv_reg = interval; /* precompute addressing for external hub/tt ports */ - if (musb->bIsMultipoint) { + if (musb->is_multipoint) { struct usb_device *parent = urb->dev->parent; if (parent != hcd->self.root_hub) { --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -490,7 +490,7 @@ static int dump_header_stats(struct musb *musb, char *buffer) *buffer = 0; count = sprintf(buffer, "Status: %sHDRC, Mode=%s " "(Power=%02x, DevCtl=%02x)\n", - (musb->bIsMultipoint ? "M" : ""), MUSB_MODE(musb), + (musb->is_multipoint ? "M" : ""), MUSB_MODE(musb), musb_readb(mbase, MGC_O_HDRC_POWER), musb_readb(mbase, MGC_O_HDRC_DEVCTL)); if (count <= 0) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -395,7 +395,7 @@ struct musb { /* active means connected and not suspended */ unsigned is_active:1; - unsigned bIsMultipoint:1; + unsigned is_multipoint:1; unsigned is_host:1; unsigned bIgnoreDisconnect:1; /* during bus resets */ --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1310,10 +1310,10 @@ static int __init musb_core_init(u16 wType, struct musb *musb) aDate[0] = 0; #endif if (MUSB_CONTROLLER_MHDRC == wType) { - musb->bIsMultipoint = 1; + musb->is_multipoint = 1; type = "M"; } else { - musb->bIsMultipoint = 0; + musb->is_multipoint = 0; type = ""; #ifdef CONFIG_USB_MUSB_HDRC_HCD #ifndef CONFIG_USB_OTG_BLACKLIST_HUB -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect 2007-08-13 13:49 ` [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bIgnoreDisconnect with ignore_disconnect Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 2 +- drivers/usb/musb/virthub.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -397,7 +397,7 @@ struct musb { unsigned is_multipoint:1; unsigned is_host:1; - unsigned bIgnoreDisconnect:1; /* during bus resets */ + unsigned ignore_disconnect:1; /* during bus resets */ int a_wait_bcon; /* VBUS timeout in msecs */ unsigned long idle_timeout; /* Next timeout in jiffies */ --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -690,7 +690,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, } #endif - if ((bIntrUSB & MGC_M_INTR_DISCONNECT) && !musb->bIgnoreDisconnect) { + if ((bIntrUSB & MGC_M_INTR_DISCONNECT) && !musb->ignore_disconnect) { DBG(1, "DISCONNECT (%s) as %s, devctl %02x\n", otg_state_string(musb), MUSB_MODE(musb), devctl); --- a/drivers/usb/musb/virthub.c +++ b/drivers/usb/musb/virthub.c @@ -145,7 +145,7 @@ static void musb_port_reset(struct musb *musb, u8 bReset) msleep(1); } - musb->bIgnoreDisconnect = TRUE; + musb->ignore_disconnect = TRUE; power &= 0xf0; musb_writeb(mbase, MGC_O_HDRC_POWER, power | MGC_M_POWER_RESET); @@ -158,7 +158,7 @@ static void musb_port_reset(struct musb *musb, u8 bReset) musb_writeb(mbase, MGC_O_HDRC_POWER, power & ~MGC_M_POWER_RESET); - musb->bIgnoreDisconnect = FALSE; + musb->ignore_disconnect = FALSE; power = musb_readb(mbase, MGC_O_HDRC_POWER); if (power & MGC_M_POWER_HSMODE) { -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split 2007-08-13 13:49 ` [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bBulkSplit with bulk_split Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 4 ++-- drivers/usb/musb/plat_uds.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -403,9 +403,9 @@ struct musb { unsigned long idle_timeout; /* Next timeout in jiffies */ #ifdef C_MP_TX - unsigned bBulkSplit:1; + unsigned bulk_split:1; #define can_bulk_split(musb,type) \ - (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bBulkSplit) + (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split) #else #define can_bulk_split(musb,type) 0 #endif --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1275,7 +1275,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) if (reg & MGC_M_CONFIGDATA_MPTXE) { strcat(aInfo, ", bulk split"); #ifdef C_MP_TX - musb->bBulkSplit = TRUE; + musb->bulk_split = TRUE; #else strcat(aInfo, " (X)"); /* no driver support */ #endif -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine 2007-08-13 13:49 ` [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 31/52] musb_hdrc: Search and replace bAddress with address Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bBulkCombine with bulk_combine Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 4 ++-- drivers/usb/musb/plat_uds.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -411,11 +411,11 @@ struct musb { #endif #ifdef C_MP_RX - unsigned bBulkCombine:1; + unsigned bulk_combine:1; /* REVISIT allegedly doesn't work reliably */ #if 0 #define can_bulk_combine(musb,type) \ - (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bBulkCombine) + (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine) #else #define can_bulk_combine(musb,type) 0 #endif --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1267,7 +1267,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) if (reg & MGC_M_CONFIGDATA_MPRXE) { strcat(aInfo, ", bulk combine"); #ifdef C_MP_RX - musb->bBulkCombine = TRUE; + musb->bulk_combine = TRUE; #else strcat(aInfo, " (X)"); /* no driver support */ #endif -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 31/52] musb_hdrc: Search and replace bAddress with address 2007-08-13 13:49 ` [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bAddress with address Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 4 ++-- drivers/usb/musb/musb_gadget.c | 2 +- drivers/usb/musb/musb_host.c | 4 ++-- drivers/usb/musb/musbdefs.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -240,7 +240,7 @@ __acquires(musb->lock) case USB_REQ_SET_ADDRESS: /* change it after the status stage */ musb->bSetAddress = TRUE; - musb->bAddress = (u8) (pControlRequest->wValue & 0x7f); + musb->address = (u8) (pControlRequest->wValue & 0x7f); handled = 1; break; @@ -663,7 +663,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) */ if (musb->bSetAddress) { musb->bSetAddress = FALSE; - musb_writeb(mbase, MGC_O_HDRC_FADDR, musb->bAddress); + musb_writeb(mbase, MGC_O_HDRC_FADDR, musb->address); } /* enter test mode if needed (exit by reset) */ --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -2010,7 +2010,7 @@ __acquires(musb->lock) musb->is_active = 1; musb->is_suspended = 0; MUSB_DEV_MODE(musb); - musb->bAddress = 0; + musb->address = 0; musb->ep0_state = MGC_END0_STAGE_SETUP; musb->may_wakeup = 0; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -176,7 +176,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) struct urb *urb = next_urb(qh); struct musb_hw_ep *hw_ep = qh->hw_ep; unsigned nPipe = urb->pipe; - u8 bAddress = usb_pipedevice(nPipe); + u8 address = usb_pipedevice(nPipe); int epnum = hw_ep->epnum; /* initialize software qh state */ @@ -205,7 +205,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) } DBG(4, "qh %p urb %p dev%d ep%d%s%s, hw_ep %d, %p/%d\n", - qh, urb, bAddress, qh->epnum, + qh, urb, address, qh->epnum, is_in ? "in" : "out", ({char *s; switch (qh->type) { case USB_ENDPOINT_XFER_CONTROL: s = ""; break; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -442,7 +442,7 @@ struct musb { unsigned softconnect:1; enum musb_g_ep0_state ep0_state; - u8 bAddress; + u8 address; u8 bTestModeValue; u16 ackpend; /* ep0 */ struct usb_gadget g; /* the gadget */ -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr 2007-08-13 13:49 ` [PATCH 31/52] musb_hdrc: Search and replace bAddress with address Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bTestModeValue with test_mode_nr Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 12 ++++++------ drivers/usb/musb/musbdefs.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -306,25 +306,25 @@ __acquires(musb->lock) case 1: pr_debug("TEST_J\n"); /* TEST_J */ - musb->bTestModeValue = + musb->test_mode_nr = MGC_M_TEST_J; break; case 2: /* TEST_K */ pr_debug("TEST_K\n"); - musb->bTestModeValue = + musb->test_mode_nr = MGC_M_TEST_K; break; case 3: /* TEST_SE0_NAK */ pr_debug("TEST_SE0_NAK\n"); - musb->bTestModeValue = + musb->test_mode_nr = MGC_M_TEST_SE0_NAK; break; case 4: /* TEST_PACKET */ pr_debug("TEST_PACKET\n"); - musb->bTestModeValue = + musb->test_mode_nr = MGC_M_TEST_PACKET; break; default: @@ -670,11 +670,11 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) else if (musb->bTestMode) { DBG(1, "entering TESTMODE\n"); - if (MGC_M_TEST_PACKET == musb->bTestModeValue) + if (MGC_M_TEST_PACKET == musb->test_mode_nr) musb_load_testpacket(musb); musb_writeb(mbase, MGC_O_HDRC_TESTMODE, - musb->bTestModeValue); + musb->test_mode_nr); } /* FALLTHROUGH */ --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -443,7 +443,7 @@ struct musb { enum musb_g_ep0_state ep0_state; u8 address; - u8 bTestModeValue; + u8 test_mode_nr; u16 ackpend; /* ep0 */ struct usb_gadget g; /* the gadget */ struct usb_gadget_driver *pGadgetDriver; /* its driver */ -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode 2007-08-13 13:49 ` [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bTestMode with test_mode Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 4 ++-- drivers/usb/musb/musbdefs.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -333,7 +333,7 @@ __acquires(musb->lock) /* enter test mode after irq */ if (handled > 0) - musb->bTestMode = TRUE; + musb->test_mode = TRUE; break; #ifdef CONFIG_USB_MUSB_OTG case USB_DEVICE_B_HNP_ENABLE: @@ -667,7 +667,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) } /* enter test mode if needed (exit by reset) */ - else if (musb->bTestMode) { + else if (musb->test_mode) { DBG(1, "entering TESTMODE\n"); if (MGC_M_TEST_PACKET == musb->test_mode_nr) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -438,7 +438,7 @@ struct musb { unsigned is_bus_powered:1; unsigned bSetAddress:1; - unsigned bTestMode:1; + unsigned test_mode:1; unsigned softconnect:1; enum musb_g_ep0_state ep0_state; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver 2007-08-13 13:49 ` [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace pGadgetDriver with gadget_driver Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 4 ++-- drivers/usb/musb/musb_gadget.c | 32 ++++++++++++++++---------------- drivers/usb/musb/musb_procfs.c | 4 ++-- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/tusb6010.c | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -583,10 +583,10 @@ __releases(musb->lock) __acquires(musb->lock) { int retval; - if (!musb->pGadgetDriver) + if (!musb->gadget_driver) return -EOPNOTSUPP; spin_unlock(&musb->lock); - retval = musb->pGadgetDriver->setup(&musb->g, pControlRequest); + retval = musb->gadget_driver->setup(&musb->g, pControlRequest); spin_lock(&musb->lock); return retval; } --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1476,7 +1476,7 @@ static void musb_pullup(struct musb *musb, int is_on) /* FIXME if on, HdrcStart; if off, HdrcStop */ DBG(3, "gadget %s D+ pullup %s\n", - musb->pGadgetDriver->function, is_on ? "on" : "off"); + musb->gadget_driver->function, is_on ? "on" : "off"); musb_writeb(musb->mregs, MGC_O_HDRC_POWER, power); } @@ -1703,13 +1703,13 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) DBG(3, "registering driver %s\n", driver->function); spin_lock_irqsave(&musb->lock, flags); - if (musb->pGadgetDriver) { + if (musb->gadget_driver) { DBG(1, "%s is already bound to %s\n", musb_driver_name, - musb->pGadgetDriver->driver.name); + musb->gadget_driver->driver.name); retval = -EBUSY; } else { - musb->pGadgetDriver = driver; + musb->gadget_driver = driver; musb->g.dev.driver = &driver->driver; driver->driver.bus = NULL; musb->softconnect = 1; @@ -1723,7 +1723,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) if (retval != 0) { DBG(3, "bind to driver %s failed --> %d\n", driver->driver.name, retval); - musb->pGadgetDriver = NULL; + musb->gadget_driver = NULL; musb->g.dev.driver = NULL; } @@ -1762,7 +1762,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) spin_lock_irqsave(&musb->lock, flags); musb->xceiv.gadget = NULL; musb->xceiv.state = OTG_STATE_UNDEFINED; - musb->pGadgetDriver = NULL; + musb->gadget_driver = NULL; musb->g.dev.driver = NULL; spin_unlock_irqrestore(&musb->lock, flags); } @@ -1841,7 +1841,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) musb_hnp_stop(musb); #endif - if (musb->pGadgetDriver == driver) { + if (musb->gadget_driver == driver) { musb->xceiv.state = OTG_STATE_UNDEFINED; stop_activity(musb, driver); @@ -1850,7 +1850,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) driver->unbind(&musb->g); spin_lock_irqsave(&musb->lock, flags); - musb->pGadgetDriver = NULL; + musb->gadget_driver = NULL; musb->g.dev.driver = NULL; musb->is_active = 0; @@ -1885,9 +1885,9 @@ void musb_g_resume(struct musb *musb) case OTG_STATE_B_WAIT_ACON: case OTG_STATE_B_PERIPHERAL: musb->is_active = 1; - if (musb->pGadgetDriver && musb->pGadgetDriver->resume) { + if (musb->gadget_driver && musb->gadget_driver->resume) { spin_unlock(&musb->lock); - musb->pGadgetDriver->resume(&musb->g); + musb->gadget_driver->resume(&musb->g); spin_lock(&musb->lock); } break; @@ -1912,9 +1912,9 @@ void musb_g_suspend(struct musb *musb) break; case OTG_STATE_B_PERIPHERAL: musb->is_suspended = 1; - if (musb->pGadgetDriver && musb->pGadgetDriver->suspend) { + if (musb->gadget_driver && musb->gadget_driver->suspend) { spin_unlock(&musb->lock); - musb->pGadgetDriver->suspend(&musb->g); + musb->gadget_driver->suspend(&musb->g); spin_lock(&musb->lock); } break; @@ -1948,9 +1948,9 @@ void musb_g_disconnect(struct musb *musb) (void) musb_gadget_vbus_draw(&musb->g, 0); musb->g.speed = USB_SPEED_UNKNOWN; - if (musb->pGadgetDriver && musb->pGadgetDriver->disconnect) { + if (musb->gadget_driver && musb->gadget_driver->disconnect) { spin_unlock(&musb->lock); - musb->pGadgetDriver->disconnect(&musb->g); + musb->gadget_driver->disconnect(&musb->g); spin_lock(&musb->lock); } @@ -1987,8 +1987,8 @@ __acquires(musb->lock) (devctl & MGC_M_DEVCTL_BDEVICE) ? "B-Device" : "A-Device", musb_readb(mbase, MGC_O_HDRC_FADDR), - musb->pGadgetDriver - ? musb->pGadgetDriver->driver.name + musb->gadget_driver + ? musb->gadget_driver->driver.name : NULL ); --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -619,8 +619,8 @@ static int dump_header_stats(struct musb *musb, char *buffer) #ifdef CONFIG_USB_GADGET_MUSB_HDRC if (is_peripheral_enabled(musb)) { code = sprintf(buffer, "Gadget driver: %s\n", - musb->pGadgetDriver - ? musb->pGadgetDriver->driver.name + musb->gadget_driver + ? musb->gadget_driver->driver.name : "(none)"); if (code <= 0) goto done; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -446,7 +446,7 @@ struct musb { u8 test_mode_nr; u16 ackpend; /* ep0 */ struct usb_gadget g; /* the gadget */ - struct usb_gadget_driver *pGadgetDriver; /* its driver */ + struct usb_gadget_driver *gadget_driver; /* its driver */ #endif #ifdef CONFIG_USB_MUSB_OTG --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -422,7 +422,7 @@ static void musb_do_idle(unsigned long _musb) #endif #ifdef CONFIG_USB_GADGET_MUSB_HDRC - if (is_peripheral_enabled(musb) && !musb->pGadgetDriver) + if (is_peripheral_enabled(musb) && !musb->gadget_driver) wakeups = 0; else { wakeups = TUSB_PRCM_WHOSTDISCON -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off 2007-08-13 13:49 ` [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bDelayPortPowerOff with delay_port_power_off Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musbdefs.h | 2 +- drivers/usb/musb/plat_uds.c | 2 +- drivers/usb/musb/virthub.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -451,7 +451,7 @@ struct musb { #ifdef CONFIG_USB_MUSB_OTG /* FIXME this can't be OTG-specific ... ? */ - u8 bDelayPortPowerOff; + u8 delay_port_power_off; #endif #ifdef MUSB_CONFIG_PROC_FS --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -557,7 +557,7 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 bIntrUSB, if (is_peripheral_active(musb)) { // REVISIT HNP; just force disconnect } - musb->bDelayPortPowerOff = FALSE; + musb->delay_port_power_off = FALSE; musb_writew(mbase, MGC_O_HDRC_INTRTXE, musb->wEndMask); musb_writew(mbase, MGC_O_HDRC_INTRRXE, musb->wEndMask & 0xfffe); musb_writeb(mbase, MGC_O_HDRC_INTRUSBE, 0xf7); --- a/drivers/usb/musb/virthub.c +++ b/drivers/usb/musb/virthub.c @@ -116,7 +116,7 @@ static void musb_port_reset(struct musb *musb, u8 bReset) /* REVISIT this looks wrong for HNP */ u8 devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); - if (musb->bDelayPortPowerOff || !(devctl & MGC_M_DEVCTL_HM)) { + if (musb->delay_port_power_off || !(devctl & MGC_M_DEVCTL_HM)) { return; } #endif -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry 2007-08-13 13:49 ` [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace pProcEntry with proc_entry Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_procfs.c | 4 ++-- drivers/usb/musb/musbdefs.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/musb/musb_procfs.c +++ b/drivers/usb/musb/musb_procfs.c @@ -821,7 +821,7 @@ static int musb_proc_read(char *page, char **start, void __devexit musb_debug_delete(char *name, struct musb *musb) { - if (musb->pProcEntry) + if (musb->proc_entry) remove_proc_entry(name, NULL); } @@ -835,7 +835,7 @@ musb_debug_create(char *name, struct musb *data) if (!name) return NULL; - data->pProcEntry = pde = create_proc_entry(name, + data->proc_entry = pde = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, NULL); if (pde) { pde->data = data; --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -455,7 +455,7 @@ struct musb { #endif #ifdef MUSB_CONFIG_PROC_FS - struct proc_dir_entry *pProcEntry; + struct proc_dir_entry *proc_entry; #endif }; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data 2007-08-13 13:49 ` [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace pPrivateData with private_data Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 8 ++++---- drivers/usb/musb/dma.h | 8 ++++---- drivers/usb/musb/musbhsdma.c | 20 ++++++++++---------- drivers/usb/musb/plat_uds.c | 4 ++-- drivers/usb/musb/tusb6010_omap.c | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -102,7 +102,7 @@ static void __init cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) c->Channel.bStatus = MGC_DMA_STATUS_UNKNOWN; c->pController = cppi; c->bLastModeRndis = 0; - c->Channel.pPrivateData = c; + c->Channel.private_data = c; c->bdPoolHead = NULL; /* build the BD Free list for the channel */ @@ -325,7 +325,7 @@ cppi_channel_allocate(struct dma_controller *c, otgCh->Channel.bStatus = MGC_DMA_STATUS_FREE; DBG(4, "Allocate CPPI%d %cX\n", chNum, bTransmit ? 'T' : 'R'); - otgCh->Channel.pPrivateData = otgCh; + otgCh->Channel.private_data = otgCh; return &otgCh->Channel; } @@ -953,7 +953,7 @@ static int cppi_channel_program(struct dma_channel *pChannel, u16 wPacketSz, u8 mode, dma_addr_t dma_addr, u32 dwLength) { - struct cppi_channel *otgChannel = pChannel->pPrivateData; + struct cppi_channel *otgChannel = pChannel->private_data; struct cppi *pController = otgChannel->pController; struct musb *musb = pController->musb; @@ -1316,7 +1316,7 @@ dma_controller_create(struct musb *musb, void __iomem *pCoreBase) /* Initialize the Cppi DmaController structure */ pController->pCoreBase = pCoreBase; pController->musb = musb; - pController->Controller.pPrivateData = pController; + pController->Controller.private_data = pController; pController->Controller.start = cppi_controller_start; pController->Controller.stop = cppi_controller_stop; pController->Controller.channel_alloc = cppi_channel_allocate; --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -100,7 +100,7 @@ struct dma_controller; /** * struct dma_channel - A DMA channel. - * @pPrivateData: channel-private data + * @private_data: channel-private data * @wMaxLength: the maximum number of bytes the channel can move in one * transaction (typically representing many USB maximum-sized packets) * @dwActualLength: how many bytes have been transferred @@ -111,7 +111,7 @@ struct dma_controller; * one usb transfer. */ struct dma_channel { - void *pPrivateData; + void *private_data; // FIXME not void* private_data, but a dma_controller * size_t dwMaxLength; size_t dwActualLength; @@ -156,7 +156,7 @@ dma_channel_status(struct dma_channel *c) /** * struct dma_controller - A DMA Controller. - * @pPrivateData: controller-private data; + * @private_data: controller-private data; * @start: call this to start a DMA controller; * return 0 on success, else negative errno * @stop: call this to stop a DMA controller @@ -169,7 +169,7 @@ dma_channel_status(struct dma_channel *c) * Controllers manage dma channels. */ struct dma_controller { - void *pPrivateData; + void *private_data; int (*start)(struct dma_controller *); int (*stop)(struct dma_controller *); struct dma_channel *(*channel_alloc)(struct dma_controller *, --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -143,7 +143,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pImplChannel->epnum = hw_ep->epnum; pImplChannel->bTransmit = bTransmit; pChannel = &(pImplChannel->Channel); - pChannel->pPrivateData = pImplChannel; + pChannel->private_data = pImplChannel; pChannel->bStatus = MGC_DMA_STATUS_FREE; pChannel->dwMaxLength = 0x10000; /* Tx => mode 1; Rx => mode 0 */ @@ -158,7 +158,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, static void dma_channel_release(struct dma_channel *pChannel) { struct musb_dma_channel *pImplChannel = - (struct musb_dma_channel *) pChannel->pPrivateData; + (struct musb_dma_channel *) pChannel->private_data; pChannel->dwActualLength = 0; pImplChannel->dwStartAddress = 0; @@ -175,7 +175,7 @@ static void configure_channel(struct dma_channel *pChannel, dma_addr_t dma_addr, u32 dwLength) { struct musb_dma_channel *pImplChannel = - (struct musb_dma_channel *) pChannel->pPrivateData; + (struct musb_dma_channel *) pChannel->private_data; struct musb_dma_controller *pController = pImplChannel->pController; u8 *mbase = pController->pCoreBase; u8 bChannel = pImplChannel->bIndex; @@ -225,7 +225,7 @@ static int dma_channel_program(struct dma_channel * pChannel, dma_addr_t dma_addr, u32 dwLength) { struct musb_dma_channel *pImplChannel = - (struct musb_dma_channel *) pChannel->pPrivateData; + (struct musb_dma_channel *) pChannel->private_data; DBG(2, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n", pImplChannel->epnum, @@ -254,7 +254,7 @@ static int dma_channel_program(struct dma_channel * pChannel, static int dma_channel_abort(struct dma_channel *pChannel) { struct musb_dma_channel *pImplChannel = - (struct musb_dma_channel *) pChannel->pPrivateData; + (struct musb_dma_channel *) pChannel->private_data; u8 bChannel = pImplChannel->bIndex; u8 *mbase = pImplChannel->pController->pCoreBase; u16 csr; @@ -294,10 +294,10 @@ static int dma_channel_abort(struct dma_channel *pChannel) return 0; } -static irqreturn_t dma_controller_irq(int irq, void *pPrivateData) +static irqreturn_t dma_controller_irq(int irq, void *private_data) { struct musb_dma_controller *pController = - (struct musb_dma_controller *)pPrivateData; + (struct musb_dma_controller *)private_data; struct musb_dma_channel *pImplChannel; u8 *mbase = pController->pCoreBase; struct dma_channel *pChannel; @@ -374,7 +374,7 @@ done: void dma_controller_destroy(struct dma_controller *c) { struct musb_dma_controller *pController = - (struct musb_dma_controller *) c->pPrivateData; + (struct musb_dma_controller *) c->private_data; if (!pController) return; @@ -383,7 +383,7 @@ void dma_controller_destroy(struct dma_controller *c) free_irq(pController->irq, c); kfree(pController); - c->pPrivateData = NULL; + c->private_data = NULL; } struct dma_controller *__init @@ -407,7 +407,7 @@ dma_controller_create(struct musb *musb, void __iomem *pCoreBase) pController->pDmaPrivate = musb; pController->pCoreBase = pCoreBase; - pController->Controller.pPrivateData = pController; + pController->Controller.private_data = pController; pController->Controller.start = dma_controller_start; pController->Controller.stop = dma_controller_stop; pController->Controller.channel_alloc = dma_channel_allocate; --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1810,7 +1810,7 @@ static void musb_free(struct musb *musb) if (is_dma_capable() && musb->dma_controller) { struct dma_controller *c = musb->dma_controller; - (void) c->stop(c->pPrivateData); + (void) c->stop(c->private_data); dma_controller_destroy(c); } @@ -1923,7 +1923,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) c = dma_controller_create(musb, musb->mregs); musb->dma_controller = c; if (c) - (void) c->start(c->pPrivateData); + (void) c->start(c->private_data); } #endif /* ideally this would be abstracted in platform setup */ --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -32,7 +32,7 @@ #define dmareq_works() 1 #endif -#define to_chdat(c) (struct tusb_omap_dma_ch *)(c)->pPrivateData +#define to_chdat(c) (struct tusb_omap_dma_ch *)(c)->private_data #define MAX_DMAREQ 5 /* REVISIT: Really 6, but req5 not OK */ @@ -524,7 +524,7 @@ tusb_omap_dma_allocate(struct dma_controller *c, if (ch->bStatus == MGC_DMA_STATUS_UNKNOWN) { ch->bStatus = MGC_DMA_STATUS_FREE; channel = ch; - chdat = ch->pPrivateData; + chdat = ch->private_data; break; } } @@ -640,8 +640,8 @@ void dma_controller_destroy(struct dma_controller *c) for (i = 0; i < MAX_DMAREQ; i++) { struct dma_channel *ch = dma_channel_pool[i]; if (ch) { - if (ch->pPrivateData) - kfree(ch->pPrivateData); + if (ch->private_data) + kfree(ch->private_data); kfree(ch); } } @@ -686,7 +686,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) tusb_dma->controller.channel_release = tusb_omap_dma_release; tusb_dma->controller.channel_program = tusb_omap_dma_program; tusb_dma->controller.channel_abort = tusb_omap_dma_abort; - tusb_dma->controller.pPrivateData = tusb_dma; + tusb_dma->controller.private_data = tusb_dma; for (i = 0; i < MAX_DMAREQ; i++) { struct dma_channel *ch; @@ -703,7 +703,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) goto cleanup; ch->bStatus = MGC_DMA_STATUS_UNKNOWN; - ch->pPrivateData = chdat; + ch->private_data = chdat; } return &tusb_dma->controller; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len 2007-08-13 13:49 ` [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace dwMaxLength with max_len Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/dma.h | 4 ++-- drivers/usb/musb/musb_gadget.c | 4 ++-- drivers/usb/musb/musb_host.c | 2 +- drivers/usb/musb/musbhsdma.c | 2 +- drivers/usb/musb/tusb6010_omap.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -113,7 +113,7 @@ struct dma_controller; struct dma_channel { void *private_data; // FIXME not void* private_data, but a dma_controller * - size_t dwMaxLength; + size_t max_len; size_t dwActualLength; enum dma_channel_status bStatus; u8 bDesiredMode; @@ -129,7 +129,7 @@ struct dma_channel { * @bMode: TRUE if mode 1; FALSE if mode 0 * @dma_addr: base address of data (in DMA space) * @length: the number of bytes to transfer; no larger than the channel's - * reported dwMaxLength + * reported max_len * * Returns TRUE on success, else FALSE */ --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -304,7 +304,7 @@ static void txstate(struct musb *musb, struct musb_request *req) /* setup DMA, then program endpoint CSR */ request_size = min(pRequest->length, - musb_ep->dma->dwMaxLength); + musb_ep->dma->max_len); if (request_size <= musb_ep->wPacketSize) musb_ep->dma->bDesiredMode = 0; else @@ -661,7 +661,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) int transfer_size = 0; #ifdef USE_MODE1 transfer_size = min(pRequest->length, - channel->dwMaxLength); + channel->max_len); #else transfer_size = len; #endif --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -771,7 +771,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_writew(epio, MGC_O_HDRC_TXCSR, wCsr | MGC_M_TXCSR_MODE); - qh->segsize = min(dwLength, pDmaChannel->dwMaxLength); + qh->segsize = min(dwLength, pDmaChannel->max_len); if (qh->segsize <= wPacketSize) pDmaChannel->bDesiredMode = 0; --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -145,7 +145,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pChannel = &(pImplChannel->Channel); pChannel->private_data = pImplChannel; pChannel->bStatus = MGC_DMA_STATUS_FREE; - pChannel->dwMaxLength = 0x10000; + pChannel->max_len = 0x10000; /* Tx => mode 1; Rx => mode 0 */ pChannel->bDesiredMode = bTransmit; pChannel->dwActualLength = 0; --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -548,7 +548,7 @@ tusb_omap_dma_allocate(struct dma_controller *c, chdat->completed_len = 0; chdat->tusb_dma = tusb_dma; - channel->dwMaxLength = 0x7fffffff; + channel->max_len = 0x7fffffff; channel->bDesiredMode = 0; channel->dwActualLength = 0; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len 2007-08-13 13:49 ` [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 40/52] musb_hdrc: Search and replace bStatus with status Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace dwActualLength with actual_len Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 4 ++-- drivers/usb/musb/dma.h | 4 ++-- drivers/usb/musb/musb_gadget.c | 14 +++++++------- drivers/usb/musb/musb_host.c | 18 +++++++++--------- drivers/usb/musb/musbhsdma.c | 14 +++++++------- drivers/usb/musb/tusb6010_omap.c | 10 +++++----- 6 files changed, 32 insertions(+), 32 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -1229,7 +1229,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) hw_ep = txChannel->hw_ep; - txChannel->Channel.dwActualLength = + txChannel->Channel.actual_len = txChannel->actualLen; /* Peripheral role never repurposes the @@ -1292,7 +1292,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) hw_ep = rxChannel->hw_ep; - rxChannel->Channel.dwActualLength = + rxChannel->Channel.actual_len = rxChannel->actualLen; core_rxirq_disable(regBase, chanNum + 1); musb_dma_completion(musb, chanNum + 1, 0); --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -103,7 +103,7 @@ struct dma_controller; * @private_data: channel-private data * @wMaxLength: the maximum number of bytes the channel can move in one * transaction (typically representing many USB maximum-sized packets) - * @dwActualLength: how many bytes have been transferred + * @actual_len: how many bytes have been transferred * @bStatus: current channel status (updated e.g. on interrupt) * @bDesiredMode: TRUE if mode 1 is desired; FALSE if mode 0 is desired * @@ -114,7 +114,7 @@ struct dma_channel { void *private_data; // FIXME not void* private_data, but a dma_controller * size_t max_len; - size_t dwActualLength; + size_t actual_len; enum dma_channel_status bStatus; u8 bDesiredMode; }; --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -466,11 +466,11 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); /* ensure writebuffer is empty */ wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - pRequest->actual += musb_ep->dma->dwActualLength; + pRequest->actual += musb_ep->dma->actual_len; DBG(4, "TXCSR%d %04x, dma off, " "len %Zd, req %p\n", epnum, wCsrVal, - musb_ep->dma->dwActualLength, + musb_ep->dma->actual_len, pRequest); } @@ -755,7 +755,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); - pRequest->actual += musb_ep->dma->dwActualLength; + pRequest->actual += musb_ep->dma->actual_len; } wCsrVal |= MGC_M_RXCSR_P_WZC_BITS; @@ -796,17 +796,17 @@ void musb_g_rx(struct musb *musb, u8 epnum) musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_P_WZC_BITS | wCsrVal); - pRequest->actual += musb_ep->dma->dwActualLength; + pRequest->actual += musb_ep->dma->actual_len; DBG(4, "RXCSR%d %04x, dma off, %04x, len %Zd, req %p\n", epnum, wCsrVal, musb_readw(epio, MGC_O_HDRC_RXCSR), - musb_ep->dma->dwActualLength, pRequest); + musb_ep->dma->actual_len, pRequest); #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_TUSB_OMAP_DMA) /* Autoclear doesn't clear RxPktRdy for short packets */ if ((dma->bDesiredMode == 0) - || (dma->dwActualLength + || (dma->actual_len & (musb_ep->wPacketSize - 1))) { /* ack the read! */ wCsrVal &= ~MGC_M_RXCSR_RXPKTRDY; @@ -815,7 +815,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) /* incomplete, and not short? wait for next IN packet */ if ((pRequest->actual < pRequest->length) - && (musb_ep->dma->dwActualLength + && (musb_ep->dma->actual_len == musb_ep->wPacketSize)) goto done; #endif --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -824,7 +824,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_writew(epio, MGC_O_HDRC_TXCSR, wCsr | MGC_M_TXCSR_MODE); - pDmaChannel->dwActualLength = 0L; + pDmaChannel->actual_len = 0L; qh->segsize = dwLength; /* TX uses "rndis" mode automatically, but needs help @@ -904,7 +904,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, if ((is_cppi_enabled() || tusb_dma_omap()) && pDmaChannel) { /* candidate for DMA */ if (pDmaChannel) { - pDmaChannel->dwActualLength = 0L; + pDmaChannel->actual_len = 0L; qh->segsize = dwLength; /* AUTOREQ is in a DMA register */ @@ -1260,7 +1260,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) /* REVISIT this looks wrong... */ if (!status || dma || usb_pipeisoc(nPipe)) { if (dma) - wLength = dma->dwActualLength; + wLength = dma->actual_len; else wLength = qh->segsize; qh->offset += wLength; @@ -1416,7 +1416,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zd)\n", epnum, wRxCsrVal, pUrb->actual_length, - dma ? dma->dwActualLength : 0); + dma ? dma->actual_len : 0); /* check for errors, concurrent stall & unlink is not really * handled yet! */ @@ -1462,7 +1462,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); - xfer_len = dma->dwActualLength; + xfer_len = dma->actual_len; } musb_h_flush_rxfifo(hw_ep, 0); musb_writeb(epio, MGC_O_HDRC_RXINTERVAL, 0); @@ -1493,7 +1493,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); - xfer_len = dma->dwActualLength; + xfer_len = dma->actual_len; bDone = TRUE; } @@ -1507,7 +1507,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) } #endif if (dma && (wRxCsrVal & MGC_M_RXCSR_DMAENAB)) { - xfer_len = dma->dwActualLength; + xfer_len = dma->actual_len; wVal &= ~(MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_H_AUTOREQ @@ -1519,7 +1519,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) /* bDone if pUrb buffer is full or short packet is recd */ bDone = ((pUrb->actual_length + xfer_len) >= pUrb->transfer_buffer_length) - || (dma->dwActualLength & (qh->maxpacket - 1)); + || (dma->actual_len & (qh->maxpacket - 1)); /* send IN token for next packet, without AUTOREQ */ if (!bDone) { @@ -1920,7 +1920,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh, int is_in) "abort %cX%d DMA for urb %p --> %d\n", is_in ? 'R' : 'T', ep->epnum, urb, status); - urb->actual_length += dma->dwActualLength; + urb->actual_length += dma->actual_len; } } --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -148,7 +148,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pChannel->max_len = 0x10000; /* Tx => mode 1; Rx => mode 0 */ pChannel->bDesiredMode = bTransmit; - pChannel->dwActualLength = 0; + pChannel->actual_len = 0; break; } } @@ -160,7 +160,7 @@ static void dma_channel_release(struct dma_channel *pChannel) struct musb_dma_channel *pImplChannel = (struct musb_dma_channel *) pChannel->private_data; - pChannel->dwActualLength = 0; + pChannel->actual_len = 0; pImplChannel->dwStartAddress = 0; pImplChannel->len = 0; @@ -235,7 +235,7 @@ static int dma_channel_program(struct dma_channel * pChannel, BUG_ON(pChannel->bStatus == MGC_DMA_STATUS_UNKNOWN || pChannel->bStatus == MGC_DMA_STATUS_BUSY); - pChannel->dwActualLength = 0; + pChannel->actual_len = 0; pImplChannel->dwStartAddress = dma_addr; pImplChannel->len = dwLength; pImplChannel->wMaxPacketSize = wPacketSize; @@ -329,14 +329,14 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) MGC_HSDMA_CHANNEL_OFFSET( bChannel, MGC_O_HSDMA_ADDRESS)); - pChannel->dwActualLength = + pChannel->actual_len = dwAddress - pImplChannel->dwStartAddress; DBG(2, "ch %p, 0x%x -> 0x%x (%d / %d) %s\n", pChannel, pImplChannel->dwStartAddress, - dwAddress, pChannel->dwActualLength, + dwAddress, pChannel->actual_len, pImplChannel->len, - (pChannel->dwActualLength < + (pChannel->actual_len < pImplChannel->len) ? "=> reconfig 0": "=> complete"); @@ -349,7 +349,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) if ((devctl & MGC_M_DEVCTL_HM) && (pImplChannel->bTransmit) && ((pChannel->bDesiredMode == 0) - || (pChannel->dwActualLength & + || (pChannel->actual_len & (pImplChannel->wMaxPacketSize - 1))) ) { /* Send out the packet */ --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -176,8 +176,8 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) remaining = 0; } - channel->dwActualLength = chdat->transfer_len - remaining; - pio = chdat->len - channel->dwActualLength; + channel->actual_len = chdat->transfer_len - remaining; + pio = chdat->len - channel->actual_len; DBG(2, "DMA remaining %lu/%u\n", remaining, chdat->transfer_len); @@ -196,7 +196,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) consistent_sync(phys_to_virt((u32)chdat->dma_addr), chdat->transfer_len, DMA_FROM_DEVICE); } - channel->dwActualLength += pio; + channel->actual_len += pio; } if (!dmareq_works()) @@ -294,7 +294,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, chdat->packet_sz = packet_sz; chdat->len = len; - channel->dwActualLength = 0; + channel->actual_len = 0; chdat->dma_addr = (void __iomem *)dma_addr; channel->bStatus = MGC_DMA_STATUS_BUSY; @@ -550,7 +550,7 @@ tusb_omap_dma_allocate(struct dma_controller *c, channel->max_len = 0x7fffffff; channel->bDesiredMode = 0; - channel->dwActualLength = 0; + channel->actual_len = 0; if (dmareq_works()) { ret = tusb_omap_dma_allocate_dmareq(chdat); -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 40/52] musb_hdrc: Search and replace bStatus with status 2007-08-13 13:49 ` [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bStatus with status Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/cppi_dma.c | 22 +++++++++++----------- drivers/usb/musb/dma.h | 6 +++--- drivers/usb/musb/musb_gadget.c | 4 ++-- drivers/usb/musb/musb_host.c | 6 +++--- drivers/usb/musb/musbhsdma.c | 18 +++++++++--------- drivers/usb/musb/tusb6010_omap.c | 16 ++++++++-------- 6 files changed, 36 insertions(+), 36 deletions(-) --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c @@ -99,7 +99,7 @@ static void __init cppi_pool_init(struct cppi *cppi, struct cppi_channel *c) c->activeQueueHead = NULL; c->activeQueueTail = NULL; c->lastHwBDProcessed = NULL; - c->Channel.bStatus = MGC_DMA_STATUS_UNKNOWN; + c->Channel.status = MGC_DMA_STATUS_UNKNOWN; c->pController = cppi; c->bLastModeRndis = 0; c->Channel.private_data = c; @@ -124,7 +124,7 @@ static void cppi_pool_free(struct cppi_channel *c) struct cppi_descriptor *bd; (void) cppi_channel_abort(&c->Channel); - c->Channel.bStatus = MGC_DMA_STATUS_UNKNOWN; + c->Channel.status = MGC_DMA_STATUS_UNKNOWN; c->pController = NULL; /* free all its bds */ @@ -322,7 +322,7 @@ cppi_channel_allocate(struct dma_controller *c, DBG(1, "re-allocating DMA%d %cX channel %p\n", chNum, bTransmit ? 'T' : 'R', otgCh); otgCh->hw_ep = ep; - otgCh->Channel.bStatus = MGC_DMA_STATUS_FREE; + otgCh->Channel.status = MGC_DMA_STATUS_FREE; DBG(4, "Allocate CPPI%d %cX\n", chNum, bTransmit ? 'T' : 'R'); otgCh->Channel.private_data = otgCh; @@ -348,7 +348,7 @@ static void cppi_channel_release(struct dma_channel *channel) /* for now, leave its cppi IRQ enabled (we won't trigger it) */ c->hw_ep = NULL; - channel->bStatus = MGC_DMA_STATUS_UNKNOWN; + channel->status = MGC_DMA_STATUS_UNKNOWN; } /* Context: controller irqlocked */ @@ -957,7 +957,7 @@ static int cppi_channel_program(struct dma_channel *pChannel, struct cppi *pController = otgChannel->pController; struct musb *musb = pController->musb; - switch (pChannel->bStatus) { + switch (pChannel->status) { case MGC_DMA_STATUS_BUS_ABORT: case MGC_DMA_STATUS_CORE_ABORT: /* fault irq handler should have handled cleanup */ @@ -981,7 +981,7 @@ static int cppi_channel_program(struct dma_channel *pChannel, break; } - pChannel->bStatus = MGC_DMA_STATUS_BUSY; + pChannel->status = MGC_DMA_STATUS_BUSY; /* set transfer parameters, then queue up its first segment */ otgChannel->startAddr = dma_addr; @@ -1224,7 +1224,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) >= txChannel->transferSize) { txChannel->activeQueueHead = NULL; txChannel->activeQueueTail = NULL; - txChannel->Channel.bStatus = + txChannel->Channel.status = MGC_DMA_STATUS_FREE; hw_ep = txChannel->hw_ep; @@ -1288,7 +1288,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) } /* all segments completed! */ - rxChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; + rxChannel->Channel.status = MGC_DMA_STATUS_FREE; hw_ep = rxChannel->hw_ep; @@ -1375,7 +1375,7 @@ static int cppi_channel_abort(struct dma_channel *channel) pController = otgCh->pController; chNum = otgCh->chNo; - switch (channel->bStatus) { + switch (channel->status) { case MGC_DMA_STATUS_BUS_ABORT: case MGC_DMA_STATUS_CORE_ABORT: /* from RX or TX fault irq handler */ @@ -1515,7 +1515,7 @@ static int cppi_channel_abort(struct dma_channel *channel) * refers to an entire "DMA packet" not just emptying the * current fifo; most segments need multiple usb packets. */ - if (channel->bStatus == MGC_DMA_STATUS_BUSY) + if (channel->status == MGC_DMA_STATUS_BUSY) udelay(50); /* scan the current list, reporting any data that was @@ -1552,7 +1552,7 @@ static int cppi_channel_abort(struct dma_channel *channel) } } - channel->bStatus = MGC_DMA_STATUS_FREE; + channel->status = MGC_DMA_STATUS_FREE; otgCh->startAddr = 0; otgCh->currOffset = 0; otgCh->transferSize = 0; --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -104,7 +104,7 @@ struct dma_controller; * @wMaxLength: the maximum number of bytes the channel can move in one * transaction (typically representing many USB maximum-sized packets) * @actual_len: how many bytes have been transferred - * @bStatus: 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 * * channels are associated with an endpoint for the duration of at least @@ -115,7 +115,7 @@ struct dma_channel { // FIXME not void* private_data, but a dma_controller * size_t max_len; size_t actual_len; - enum dma_channel_status bStatus; + enum dma_channel_status status; u8 bDesiredMode; }; @@ -151,7 +151,7 @@ typedef int (*MGC_pfDmaProgramChannel) ( static inline enum dma_channel_status dma_channel_status(struct dma_channel *c) { - return (is_dma_capable() && c) ? c->bStatus : MGC_DMA_STATUS_UNKNOWN; + return (is_dma_capable() && c) ? c->status : MGC_DMA_STATUS_UNKNOWN; } /** --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -427,7 +427,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) wCsrVal &= ~MGC_M_TXCSR_P_SENTSTALL; musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { - dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; + dma->status = MGC_DMA_STATUS_CORE_ABORT; musb->dma_controller->channel_abort(dma); } @@ -753,7 +753,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) if (wCsrVal & MGC_M_RXCSR_P_SENTSTALL) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { - dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; + dma->status = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); pRequest->actual += musb_ep->dma->actual_len; } --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -1226,7 +1226,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) if (status) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { - dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; + dma->status = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); } @@ -1460,7 +1460,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) if (status) { /* clean up dma and collect transfer count */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { - dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; + dma->status = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); xfer_len = dma->actual_len; } @@ -1491,7 +1491,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) * shouldn't this be the "half full" double buffer case? */ if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { - dma->bStatus = MGC_DMA_STATUS_CORE_ABORT; + dma->status = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); xfer_len = dma->actual_len; bDone = TRUE; --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -144,7 +144,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pImplChannel->bTransmit = bTransmit; pChannel = &(pImplChannel->Channel); pChannel->private_data = pImplChannel; - pChannel->bStatus = MGC_DMA_STATUS_FREE; + pChannel->status = MGC_DMA_STATUS_FREE; pChannel->max_len = 0x10000; /* Tx => mode 1; Rx => mode 0 */ pChannel->bDesiredMode = bTransmit; @@ -167,7 +167,7 @@ static void dma_channel_release(struct dma_channel *pChannel) pImplChannel->pController->bmUsedChannels &= ~(1 << pImplChannel->bIndex); - pChannel->bStatus = MGC_DMA_STATUS_UNKNOWN; + pChannel->status = MGC_DMA_STATUS_UNKNOWN; } static void configure_channel(struct dma_channel *pChannel, @@ -232,14 +232,14 @@ static int dma_channel_program(struct dma_channel * pChannel, pImplChannel->bTransmit ? "Tx" : "Rx", wPacketSize, dma_addr, dwLength, bMode); - BUG_ON(pChannel->bStatus == MGC_DMA_STATUS_UNKNOWN || - pChannel->bStatus == MGC_DMA_STATUS_BUSY); + BUG_ON(pChannel->status == MGC_DMA_STATUS_UNKNOWN || + pChannel->status == MGC_DMA_STATUS_BUSY); pChannel->actual_len = 0; pImplChannel->dwStartAddress = dma_addr; pImplChannel->len = dwLength; pImplChannel->wMaxPacketSize = wPacketSize; - pChannel->bStatus = MGC_DMA_STATUS_BUSY; + pChannel->status = MGC_DMA_STATUS_BUSY; if ((bMode == 1) && (dwLength >= wPacketSize)) { configure_channel(pChannel, wPacketSize, 1, dma_addr, @@ -259,7 +259,7 @@ static int dma_channel_abort(struct dma_channel *pChannel) u8 *mbase = pImplChannel->pController->pCoreBase; u16 csr; - if (pChannel->bStatus == MGC_DMA_STATUS_BUSY) { + if (pChannel->status == MGC_DMA_STATUS_BUSY) { if (pImplChannel->bTransmit) { csr = musb_readw(mbase, @@ -289,7 +289,7 @@ static int dma_channel_abort(struct dma_channel *pChannel) musb_writel(mbase, MGC_HSDMA_CHANNEL_OFFSET(bChannel, MGC_O_HSDMA_COUNT), 0); - pChannel->bStatus = MGC_DMA_STATUS_FREE; + pChannel->status = MGC_DMA_STATUS_FREE; } return 0; } @@ -322,7 +322,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) MGC_O_HSDMA_CONTROL)); if (wCsr & (1 << MGC_S_HSDMA_BUSERROR)) { - pImplChannel->Channel.bStatus = + pImplChannel->Channel.status = MGC_DMA_STATUS_BUS_ABORT; } else { dwAddress = musb_readl(mbase, @@ -343,7 +343,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) u8 devctl = musb_readb(mbase, MGC_O_HDRC_DEVCTL); - pChannel->bStatus = MGC_DMA_STATUS_FREE; + pChannel->status = MGC_DMA_STATUS_FREE; /* completed */ if ((devctl & MGC_M_DEVCTL_HM) --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -202,7 +202,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) if (!dmareq_works()) tusb_omap_free_shared_dmareq(chdat); - channel->bStatus = MGC_DMA_STATUS_FREE; + channel->status = MGC_DMA_STATUS_FREE; /* Handle only RX callbacks here. TX callbacks musb be handled based * on the TUSB DMA status interrupt. @@ -296,7 +296,7 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, chdat->len = len; channel->actual_len = 0; chdat->dma_addr = (void __iomem *)dma_addr; - channel->bStatus = MGC_DMA_STATUS_BUSY; + channel->status = MGC_DMA_STATUS_BUSY; /* Since we're recycling dma areas, we need to clean or invalidate */ if (chdat->tx) { @@ -430,7 +430,7 @@ static int tusb_omap_dma_abort(struct dma_channel *channel) tusb_dma->sync_dev = -1; } - channel->bStatus = MGC_DMA_STATUS_FREE; + channel->status = MGC_DMA_STATUS_FREE; return 0; } @@ -521,8 +521,8 @@ tusb_omap_dma_allocate(struct dma_controller *c, for (i = 0; i < MAX_DMAREQ; i++) { struct dma_channel *ch = dma_channel_pool[i]; - if (ch->bStatus == MGC_DMA_STATUS_UNKNOWN) { - ch->bStatus = MGC_DMA_STATUS_FREE; + if (ch->status == MGC_DMA_STATUS_UNKNOWN) { + ch->status = MGC_DMA_STATUS_FREE; channel = ch; chdat = ch->private_data; break; @@ -589,7 +589,7 @@ free_dmareq: tusb_omap_dma_free_dmareq(chdat); DBG(3, "ep%i: Could not get a DMA channel\n", chdat->epnum); - channel->bStatus = MGC_DMA_STATUS_UNKNOWN; + channel->status = MGC_DMA_STATUS_UNKNOWN; return NULL; } @@ -617,7 +617,7 @@ static void tusb_omap_dma_release(struct dma_channel *channel) reg |= (1 << (chdat->epnum + 15)); musb_writel(tusb_base, TUSB_DMA_INT_CLEAR, reg); - channel->bStatus = MGC_DMA_STATUS_UNKNOWN; + channel->status = MGC_DMA_STATUS_UNKNOWN; if (chdat->ch >= 0) { omap_stop_dma(chdat->ch); @@ -702,7 +702,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) if (!chdat) goto cleanup; - ch->bStatus = MGC_DMA_STATUS_UNKNOWN; + ch->status = MGC_DMA_STATUS_UNKNOWN; ch->private_data = chdat; } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode 2007-08-13 13:49 ` [PATCH 40/52] musb_hdrc: Search and replace bStatus with status Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 42/52] musb_hdrc: Search and replace bMode with mode Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bDesiredMode with desired_mode Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/dma.h | 4 ++-- drivers/usb/musb/musb_gadget.c | 20 ++++++++++---------- drivers/usb/musb/musb_host.c | 18 +++++++++--------- drivers/usb/musb/musbhsdma.c | 4 ++-- drivers/usb/musb/tusb6010_omap.c | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -105,7 +105,7 @@ struct dma_controller; * transaction (typically representing many USB maximum-sized packets) * @actual_len: how many bytes have been transferred * @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 * one usb transfer. @@ -116,7 +116,7 @@ struct dma_channel { size_t max_len; size_t actual_len; enum dma_channel_status status; - u8 bDesiredMode; + u8 desired_mode; }; /* --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -306,16 +306,16 @@ static void txstate(struct musb *musb, struct musb_request *req) request_size = min(pRequest->length, musb_ep->dma->max_len); if (request_size <= musb_ep->wPacketSize) - musb_ep->dma->bDesiredMode = 0; + musb_ep->dma->desired_mode = 0; else - musb_ep->dma->bDesiredMode = 1; + musb_ep->dma->desired_mode = 1; use_dma = use_dma && c->channel_program( musb_ep->dma, musb_ep->wPacketSize, - musb_ep->dma->bDesiredMode, + musb_ep->dma->desired_mode, pRequest->dma, request_size); if (use_dma) { - if (musb_ep->dma->bDesiredMode == 0) { + if (musb_ep->dma->desired_mode == 0) { /* ASSERT: DMAENAB is clear */ wCsrVal &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAMODE); @@ -487,7 +487,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) == 0) #ifdef CONFIG_USB_INVENTRA_DMA || (is_dma && - ((!dma->bDesiredMode) || + ((!dma->desired_mode) || (pRequest->actual & (musb_ep->wPacketSize - 1)))) #endif @@ -666,14 +666,14 @@ static void rxstate(struct musb *musb, struct musb_request *req) transfer_size = len; #endif if (transfer_size <= musb_ep->wPacketSize) - musb_ep->dma->bDesiredMode = 0; + musb_ep->dma->desired_mode = 0; else - musb_ep->dma->bDesiredMode = 1; + musb_ep->dma->desired_mode = 1; use_dma = c->channel_program( channel, musb_ep->wPacketSize, - channel->bDesiredMode, + channel->desired_mode, pRequest->dma + pRequest->actual, transfer_size); @@ -701,7 +701,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) ret = c->channel_program(channel, musb_ep->wPacketSize, - channel->bDesiredMode, + channel->desired_mode, dma_addr, fifo_count); if (ret == TRUE) @@ -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) /* Autoclear doesn't clear RxPktRdy for short packets */ - if ((dma->bDesiredMode == 0) + if ((dma->desired_mode == 0) || (dma->actual_len & (musb_ep->wPacketSize - 1))) { /* ack the read! */ --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -774,12 +774,12 @@ static void musb_ep_program(struct musb *musb, u8 epnum, qh->segsize = min(dwLength, pDmaChannel->max_len); if (qh->segsize <= wPacketSize) - pDmaChannel->bDesiredMode = 0; + pDmaChannel->desired_mode = 0; else - pDmaChannel->bDesiredMode = 1; + pDmaChannel->desired_mode = 1; - if (pDmaChannel->bDesiredMode == 0) { + if (pDmaChannel->desired_mode == 0) { wCsr &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAMODE); wCsr |= (MGC_M_TXCSR_DMAENAB); @@ -793,7 +793,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, bDmaOk = dma_controller->channel_program( pDmaChannel, wPacketSize, - pDmaChannel->bDesiredMode, + pDmaChannel->desired_mode, pUrb->transfer_dma, qh->segsize); if (bDmaOk) { @@ -1569,7 +1569,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) c = musb->dma_controller; - dma->bDesiredMode = 0; + dma->desired_mode = 0; #ifdef USE_MODE1 /* because of the issue below, mode 1 will * only rarely behave with correct semantics. @@ -1579,7 +1579,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) && (pUrb->transfer_buffer_length - pUrb->actual_length) > qh->maxpacket) - dma->bDesiredMode = 1; + dma->desired_mode = 1; #endif /* Disadvantage of using mode 1: @@ -1602,7 +1602,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) wVal = musb_readw(epio, MGC_O_HDRC_RXCSR); wVal &= ~MGC_M_RXCSR_H_REQPKT; - if (dma->bDesiredMode == 0) + if (dma->desired_mode == 0) wVal &= ~MGC_M_RXCSR_H_AUTOREQ; else wVal |= MGC_M_RXCSR_H_AUTOREQ; @@ -1617,10 +1617,10 @@ void musb_host_rx(struct musb *musb, u8 epnum) */ status = c->channel_program( dma, qh->maxpacket, - dma->bDesiredMode, + dma->desired_mode, pUrb->transfer_dma + pUrb->actual_length, - (dma->bDesiredMode == 0) + (dma->desired_mode == 0) ? wRxCount : pUrb->transfer_buffer_length); --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -147,7 +147,7 @@ static struct dma_channel* dma_channel_allocate(struct dma_controller *c, pChannel->status = MGC_DMA_STATUS_FREE; pChannel->max_len = 0x10000; /* Tx => mode 1; Rx => mode 0 */ - pChannel->bDesiredMode = bTransmit; + pChannel->desired_mode = bTransmit; pChannel->actual_len = 0; break; } @@ -348,7 +348,7 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) /* completed */ if ((devctl & MGC_M_DEVCTL_HM) && (pImplChannel->bTransmit) - && ((pChannel->bDesiredMode == 0) + && ((pChannel->desired_mode == 0) || (pChannel->actual_len & (pImplChannel->wMaxPacketSize - 1))) ) { --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -549,7 +549,7 @@ tusb_omap_dma_allocate(struct dma_controller *c, chdat->tusb_dma = tusb_dma; channel->max_len = 0x7fffffff; - channel->bDesiredMode = 0; + channel->desired_mode = 0; channel->actual_len = 0; if (dmareq_works()) { -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 42/52] musb_hdrc: Search and replace bMode with mode 2007-08-13 13:49 ` [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bMode with mode Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/dma.h | 4 ++-- drivers/usb/musb/musbhsdma.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -126,7 +126,7 @@ struct dma_channel { * * @channel: pointer to a channel obtained by channel_alloc * @maxpacket: the maximum packet size - * @bMode: TRUE if mode 1; FALSE if mode 0 + * @mode: TRUE if mode 1; FALSE if mode 0 * @dma_addr: base address of data (in DMA space) * @length: the number of bytes to transfer; no larger than the channel's * reported max_len @@ -136,7 +136,7 @@ struct dma_channel { typedef int (*MGC_pfDmaProgramChannel) ( struct dma_channel *channel, u16 maxpacket, - u8 bMode, + u8 mode, dma_addr_t dma_addr, u32 length); --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -171,7 +171,7 @@ static void dma_channel_release(struct dma_channel *pChannel) } static void configure_channel(struct dma_channel *pChannel, - u16 wPacketSize, u8 bMode, + u16 wPacketSize, u8 mode, dma_addr_t dma_addr, u32 dwLength) { struct musb_dma_channel *pImplChannel = @@ -182,9 +182,9 @@ static void configure_channel(struct dma_channel *pChannel, u16 wCsr = 0; DBG(4, "%p, pkt_sz %d, addr 0x%x, len %d, mode %d\n", - pChannel, wPacketSize, dma_addr, dwLength, bMode); + pChannel, wPacketSize, dma_addr, dwLength, mode); - if (bMode) { + if (mode) { wCsr |= 1 << MGC_S_HSDMA_MODE1; if (dwLength < wPacketSize) { return FALSE; @@ -221,7 +221,7 @@ static void configure_channel(struct dma_channel *pChannel, } static int dma_channel_program(struct dma_channel * pChannel, - u16 wPacketSize, u8 bMode, + u16 wPacketSize, u8 mode, dma_addr_t dma_addr, u32 dwLength) { struct musb_dma_channel *pImplChannel = @@ -230,7 +230,7 @@ static int dma_channel_program(struct dma_channel * pChannel, DBG(2, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n", pImplChannel->epnum, pImplChannel->bTransmit ? "Tx" : "Rx", - wPacketSize, dma_addr, dwLength, bMode); + wPacketSize, dma_addr, dwLength, mode); BUG_ON(pChannel->status == MGC_DMA_STATUS_UNKNOWN || pChannel->status == MGC_DMA_STATUS_BUSY); @@ -241,7 +241,7 @@ static int dma_channel_program(struct dma_channel * pChannel, pImplChannel->wMaxPacketSize = wPacketSize; pChannel->status = MGC_DMA_STATUS_BUSY; - if ((bMode == 1) && (dwLength >= wPacketSize)) { + if ((mode == 1) && (dwLength >= wPacketSize)) { configure_channel(pChannel, wPacketSize, 1, dma_addr, dwLength); } else -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel 2007-08-13 13:49 ` [PATCH 42/52] musb_hdrc: Search and replace bMode with mode Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace MGC_pfDmaProgramChannel with dma_program_channel Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/dma.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/musb/dma.h +++ b/drivers/usb/musb/dma.h @@ -133,7 +133,7 @@ struct dma_channel { * * Returns TRUE on success, else FALSE */ -typedef int (*MGC_pfDmaProgramChannel) ( +typedef int (*dma_program_channel) ( struct dma_channel *channel, u16 maxpacket, u8 mode, @@ -175,7 +175,7 @@ struct dma_controller { struct dma_channel *(*channel_alloc)(struct dma_controller *, struct musb_hw_ep *, u8 is_tx); void (*channel_release)(struct dma_channel *); - MGC_pfDmaProgramChannel channel_program; + dma_program_channel channel_program; int (*channel_abort)(struct dma_channel *); }; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest 2007-08-13 13:49 ` [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 45/52] musb_hdrc: Search and replace bResult with result Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace pControlRequest with ctrlrequest Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 50 +++++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 25 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -72,12 +72,12 @@ static char *decode_ep0stage(u8 stage) */ static int service_tx_status_request( struct musb *musb, - const struct usb_ctrlrequest *pControlRequest) + const struct usb_ctrlrequest *ctrlrequest) { void __iomem *mbase = musb->mregs; int handled = 1; u8 bResult[2], epnum = 0; - const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; + const u8 bRecip = ctrlrequest->bRequestType & USB_RECIP_MASK; bResult[1] = 0; @@ -107,7 +107,7 @@ static int service_tx_status_request( u16 tmp; void __iomem *regs; - epnum = (u8) pControlRequest->wIndex; + epnum = (u8) ctrlrequest->wIndex; if (!epnum) { bResult[0] = 0; break; @@ -147,7 +147,7 @@ static int service_tx_status_request( /* fill up the fifo; caller updates csr0 */ if (handled > 0) { - u16 len = le16_to_cpu(pControlRequest->wLength); + u16 len = le16_to_cpu(ctrlrequest->wLength); if (len > 2) len = 2; @@ -170,16 +170,16 @@ static int service_tx_status_request( */ static int service_in_request(struct musb *musb, - const struct usb_ctrlrequest *pControlRequest) + const struct usb_ctrlrequest *ctrlrequest) { int handled = 0; /* not handled */ - if ((pControlRequest->bRequestType & USB_TYPE_MASK) + if ((ctrlrequest->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) { - switch (pControlRequest->bRequest) { + switch (ctrlrequest->bRequest) { case USB_REQ_GET_STATUS: handled = service_tx_status_request(musb, - pControlRequest); + ctrlrequest); break; /* case USB_REQ_SYNC_FRAME: */ @@ -225,29 +225,29 @@ static inline void musb_try_b_hnp_enable(struct musb *musb) */ static int service_zero_data_request(struct musb *musb, - struct usb_ctrlrequest *pControlRequest) + struct usb_ctrlrequest *ctrlrequest) __releases(musb->lock) __acquires(musb->lock) { int handled = -EINVAL; void __iomem *mbase = musb->mregs; - const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK; + const u8 bRecip = ctrlrequest->bRequestType & USB_RECIP_MASK; /* the gadget driver handles everything except what we MUST handle */ - if ((pControlRequest->bRequestType & USB_TYPE_MASK) + if ((ctrlrequest->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) { - switch (pControlRequest->bRequest) { + switch (ctrlrequest->bRequest) { case USB_REQ_SET_ADDRESS: /* change it after the status stage */ musb->bSetAddress = TRUE; - musb->address = (u8) (pControlRequest->wValue & 0x7f); + musb->address = (u8) (ctrlrequest->wValue & 0x7f); handled = 1; break; case USB_REQ_CLEAR_FEATURE: switch (bRecip) { case USB_RECIP_DEVICE: - if (pControlRequest->wValue + if (ctrlrequest->wValue != USB_DEVICE_REMOTE_WAKEUP) break; musb->may_wakeup = 0; @@ -256,16 +256,16 @@ __acquires(musb->lock) case USB_RECIP_INTERFACE: break; case USB_RECIP_ENDPOINT:{ - const u8 epnum = pControlRequest->wIndex & 0x0f; + const u8 epnum = ctrlrequest->wIndex & 0x0f; struct musb_ep *musb_ep; if (epnum == 0 || epnum >= MUSB_C_NUM_EPS - || pControlRequest->wValue + || ctrlrequest->wValue != USB_ENDPOINT_HALT) break; - if (pControlRequest->wIndex & USB_DIR_IN) + if (ctrlrequest->wIndex & USB_DIR_IN) musb_ep = &musb->endpoints[epnum].ep_in; else musb_ep = &musb->endpoints[epnum].ep_out; @@ -292,17 +292,17 @@ __acquires(musb->lock) switch (bRecip) { case USB_RECIP_DEVICE: handled = 1; - switch (pControlRequest->wValue) { + switch (ctrlrequest->wValue) { case USB_DEVICE_REMOTE_WAKEUP: musb->may_wakeup = 1; break; case USB_DEVICE_TEST_MODE: if (musb->g.speed != USB_SPEED_HIGH) goto stall; - if (pControlRequest->wIndex & 0xff) + if (ctrlrequest->wIndex & 0xff) goto stall; - switch (pControlRequest->wIndex >> 8) { + switch (ctrlrequest->wIndex >> 8) { case 1: pr_debug("TEST_J\n"); /* TEST_J */ @@ -365,7 +365,7 @@ stall: case USB_RECIP_ENDPOINT:{ const u8 epnum = - pControlRequest->wIndex & 0x0f; + ctrlrequest->wIndex & 0x0f; struct musb_ep *musb_ep; struct musb_hw_ep *ep; void __iomem *regs; @@ -374,13 +374,13 @@ stall: if (epnum == 0 || epnum >= MUSB_C_NUM_EPS - || pControlRequest->wValue + || ctrlrequest->wValue != USB_ENDPOINT_HALT) break; ep = musb->endpoints + epnum; regs = ep->regs; - is_in = pControlRequest->wIndex & USB_DIR_IN; + is_in = ctrlrequest->wIndex & USB_DIR_IN; if (is_in) musb_ep = &ep->ep_in; else @@ -578,7 +578,7 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) static int forward_to_driver(struct musb *musb, - const struct usb_ctrlrequest *pControlRequest) + const struct usb_ctrlrequest *ctrlrequest) __releases(musb->lock) __acquires(musb->lock) { @@ -586,7 +586,7 @@ __acquires(musb->lock) if (!musb->gadget_driver) return -EOPNOTSUPP; spin_unlock(&musb->lock); - retval = musb->gadget_driver->setup(&musb->g, pControlRequest); + retval = musb->gadget_driver->setup(&musb->g, ctrlrequest); spin_lock(&musb->lock); return retval; } -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 45/52] musb_hdrc: Search and replace bResult with result 2007-08-13 13:49 ` [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bResult with result Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -76,29 +76,29 @@ static int service_tx_status_request( { void __iomem *mbase = musb->mregs; int handled = 1; - u8 bResult[2], epnum = 0; + u8 result[2], epnum = 0; const u8 bRecip = ctrlrequest->bRequestType & USB_RECIP_MASK; - bResult[1] = 0; + result[1] = 0; switch (bRecip) { case USB_RECIP_DEVICE: - bResult[0] = musb->is_self_powered << USB_DEVICE_SELF_POWERED; - bResult[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP; + result[0] = musb->is_self_powered << USB_DEVICE_SELF_POWERED; + result[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP; #ifdef CONFIG_USB_MUSB_OTG if (musb->g.is_otg) { - bResult[0] |= musb->g.b_hnp_enable + result[0] |= musb->g.b_hnp_enable << USB_DEVICE_B_HNP_ENABLE; - bResult[0] |= musb->g.a_alt_hnp_support + result[0] |= musb->g.a_alt_hnp_support << USB_DEVICE_A_ALT_HNP_SUPPORT; - bResult[0] |= musb->g.a_hnp_support + result[0] |= musb->g.a_hnp_support << USB_DEVICE_A_HNP_SUPPORT; } #endif break; case USB_RECIP_INTERFACE: - bResult[0] = 0; + result[0] = 0; break; case USB_RECIP_ENDPOINT: { @@ -109,7 +109,7 @@ static int service_tx_status_request( epnum = (u8) ctrlrequest->wIndex; if (!epnum) { - bResult[0] = 0; + result[0] = 0; break; } @@ -136,7 +136,7 @@ static int service_tx_status_request( & MGC_M_RXCSR_P_SENDSTALL; musb_ep_select(mbase, 0); - bResult[0] = tmp ? 1 : 0; + result[0] = tmp ? 1 : 0; } break; default: @@ -151,7 +151,7 @@ static int service_tx_status_request( if (len > 2) len = 2; - musb_write_fifo(&musb->endpoints[0], len, bResult); + musb_write_fifo(&musb->endpoints[0], len, result); } return handled; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address 2007-08-13 13:49 ` [PATCH 45/52] musb_hdrc: Search and replace bResult with result Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bSetAddress with set_address Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 8 ++++---- drivers/usb/musb/musbdefs.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -239,7 +239,7 @@ __acquires(musb->lock) switch (ctrlrequest->bRequest) { case USB_REQ_SET_ADDRESS: /* change it after the status stage */ - musb->bSetAddress = TRUE; + musb->set_address = TRUE; musb->address = (u8) (ctrlrequest->wValue & 0x7f); handled = 1; break; @@ -559,7 +559,7 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) * the TX FIFO right away, and give the controller a moment * to switch modes... */ - musb->bSetAddress = FALSE; + musb->set_address = FALSE; musb->ackpend = MGC_M_CSR0_P_SVDRXPKTRDY; if (req->wLength == 0) { if (req->bRequestType & USB_DIR_IN) @@ -661,8 +661,8 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) * we get 10 msec to receive this irq... until this * is done we won't see the next packet. */ - if (musb->bSetAddress) { - musb->bSetAddress = FALSE; + if (musb->set_address) { + musb->set_address = FALSE; musb_writeb(mbase, MGC_O_HDRC_FADDR, musb->address); } --- a/drivers/usb/musb/musbdefs.h +++ b/drivers/usb/musb/musbdefs.h @@ -437,7 +437,7 @@ struct musb { unsigned is_self_powered:1; unsigned is_bus_powered:1; - unsigned bSetAddress:1; + unsigned set_address:1; unsigned test_mode:1; unsigned softconnect:1; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip 2007-08-13 13:49 ` [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 48/52] musb_hdrc: Search and replace pRequest with request Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bRecip with recip Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -77,11 +77,11 @@ static int service_tx_status_request( void __iomem *mbase = musb->mregs; int handled = 1; u8 result[2], epnum = 0; - const u8 bRecip = ctrlrequest->bRequestType & USB_RECIP_MASK; + const u8 recip = ctrlrequest->bRequestType & USB_RECIP_MASK; result[1] = 0; - switch (bRecip) { + switch (recip) { case USB_RECIP_DEVICE: result[0] = musb->is_self_powered << USB_DEVICE_SELF_POWERED; result[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP; @@ -231,7 +231,7 @@ __acquires(musb->lock) { int handled = -EINVAL; void __iomem *mbase = musb->mregs; - const u8 bRecip = ctrlrequest->bRequestType & USB_RECIP_MASK; + const u8 recip = ctrlrequest->bRequestType & USB_RECIP_MASK; /* the gadget driver handles everything except what we MUST handle */ if ((ctrlrequest->bRequestType & USB_TYPE_MASK) @@ -245,7 +245,7 @@ __acquires(musb->lock) break; case USB_REQ_CLEAR_FEATURE: - switch (bRecip) { + switch (recip) { case USB_RECIP_DEVICE: if (ctrlrequest->wValue != USB_DEVICE_REMOTE_WAKEUP) @@ -289,7 +289,7 @@ __acquires(musb->lock) break; case USB_REQ_SET_FEATURE: - switch (bRecip) { + switch (recip) { case USB_RECIP_DEVICE: handled = 1; switch (ctrlrequest->wValue) { -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 48/52] musb_hdrc: Search and replace pRequest with request 2007-08-13 13:49 ` [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace pRequest with request Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 18 ++-- drivers/usb/musb/musb_gadget.c | 234 ++++++++++++++++++++-------------------- drivers/usb/musb/musb_host.c | 8 +- 3 files changed, 130 insertions(+), 130 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -484,31 +484,31 @@ static void ep0_rxstate(struct musb *this) static void ep0_txstate(struct musb *musb) { void __iomem *regs = musb->control_ep->regs; - struct usb_request *pRequest = next_ep0_request(musb); + struct usb_request *request = next_ep0_request(musb); u16 wCsrVal = MGC_M_CSR0_TXPKTRDY; u8 *pFifoSource; u8 fifo_count; - if (!pRequest) { + if (!request) { // WARN_ON(1); DBG(2, "odd; csr0 %04x\n", musb_readw(regs, MGC_O_HDRC_CSR0)); return; } /* load the data */ - pFifoSource = (u8 *) pRequest->buf + pRequest->actual; + pFifoSource = (u8 *) request->buf + request->actual; fifo_count = min((unsigned) MGC_END0_FIFOSIZE, - pRequest->length - pRequest->actual); + request->length - request->actual); musb_write_fifo(&musb->endpoints[0], fifo_count, pFifoSource); - pRequest->actual += fifo_count; + request->actual += fifo_count; /* update the flags */ if (fifo_count < MUSB_MAX_END0_PACKET - || pRequest->actual == pRequest->length) { + || request->actual == request->length) { musb->ep0_state = MGC_END0_STAGE_STATUSOUT; wCsrVal |= MGC_M_CSR0_P_DATAEND; } else - pRequest = NULL; + request = NULL; /* send it out, triggering a "txpktrdy cleared" irq */ musb_writew(regs, MGC_O_HDRC_CSR0, wCsrVal); @@ -518,8 +518,8 @@ static void ep0_txstate(struct musb *musb) * very precise fault reporting, needed by USB TMC; possible with * this hardware, but not usable from portable gadget drivers.) */ - if (pRequest) - musb_g_ep0_giveback(musb, pRequest); + if (request) + musb_g_ep0_giveback(musb, request); } /* --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -94,13 +94,13 @@ Handling completion /* * Immediately complete a request. * - * @param pRequest the request to complete + * @param request the request to complete * @param status the status to complete the request with * Context: controller locked, IRQs blocked. */ void musb_g_giveback( struct musb_ep *ep, - struct usb_request *pRequest, + struct usb_request *request, int status) __releases(ep->musb->lock) __acquires(ep->musb->lock) @@ -109,9 +109,9 @@ __acquires(ep->musb->lock) struct musb *musb; int busy = ep->busy; - req = to_musb_request(pRequest); + req = to_musb_request(request); - list_del(&pRequest->list); + list_del(&request->list); if (req->request.status == -EINPROGRESS) req->request.status = status; musb = req->musb; @@ -136,15 +136,15 @@ __acquires(ep->musb->lock) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); } - if (pRequest->status == 0) + if (request->status == 0) DBG(5, "%s done request %p, %d/%d\n", - ep->end_point.name, pRequest, + ep->end_point.name, request, req->request.actual, req->request.length); else DBG(2, "%s request %p, %d/%d fault %d\n", - ep->end_point.name, pRequest, + ep->end_point.name, request, req->request.actual, req->request.length, - pRequest->status); + request->status); req->request.complete(&req->ep->end_point, &req->request); spin_lock(&musb->lock); ep->busy = busy; @@ -255,7 +255,7 @@ static void txstate(struct musb *musb, struct musb_request *req) u8 epnum = req->epnum; struct musb_ep *musb_ep; void __iomem *epio = musb->endpoints[epnum].regs; - struct usb_request *pRequest; + struct usb_request *request; u16 fifo_count = 0, wCsrVal; int use_dma = 0; @@ -270,9 +270,9 @@ static void txstate(struct musb *musb, struct musb_request *req) /* read TXCSR before */ wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - pRequest = &req->request; + request = &req->request; fifo_count = min(max_ep_writesize(musb, musb_ep), - (int)(pRequest->length - pRequest->actual)); + (int)(request->length - request->actual)); if (wCsrVal & MGC_M_TXCSR_TXPKTRDY) { DBG(5, "%s old packet still ready , txcsr %03x\n", @@ -294,7 +294,7 @@ static void txstate(struct musb *musb, struct musb_request *req) if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c = musb->dma_controller; - use_dma = (pRequest->dma != DMA_ADDR_INVALID); + use_dma = (request->dma != DMA_ADDR_INVALID); /* MGC_M_TXCSR_P_ISO is still set correctly */ @@ -303,7 +303,7 @@ static void txstate(struct musb *musb, struct musb_request *req) size_t request_size; /* setup DMA, then program endpoint CSR */ - request_size = min(pRequest->length, + request_size = min(request->length, musb_ep->dma->max_len); if (request_size <= musb_ep->wPacketSize) musb_ep->dma->desired_mode = 0; @@ -313,7 +313,7 @@ static void txstate(struct musb *musb, struct musb_request *req) use_dma = use_dma && c->channel_program( musb_ep->dma, musb_ep->wPacketSize, musb_ep->dma->desired_mode, - pRequest->dma, request_size); + request->dma, request_size); if (use_dma) { if (musb_ep->dma->desired_mode == 0) { /* ASSERT: DMAENAB is clear */ @@ -361,8 +361,8 @@ static void txstate(struct musb *musb, struct musb_request *req) use_dma = use_dma && c->channel_program( musb_ep->dma, musb_ep->wPacketSize, 0, - pRequest->dma, - pRequest->length); + request->dma, + request->length); if (!use_dma) { c->channel_release(musb_ep->dma); musb_ep->dma = NULL; @@ -373,17 +373,17 @@ static void txstate(struct musb *musb, struct musb_request *req) #elif defined(CONFIG_USB_TUSB_OMAP_DMA) use_dma = use_dma && c->channel_program( musb_ep->dma, musb_ep->wPacketSize, - pRequest->zero, - pRequest->dma, - pRequest->length); + request->zero, + request->dma, + request->length); #endif } #endif if (!use_dma) { musb_write_fifo(musb_ep->hw_ep, fifo_count, - (u8 *) (pRequest->buf + pRequest->actual)); - pRequest->actual += fifo_count; + (u8 *) (request->buf + request->actual)); + request->actual += fifo_count; wCsrVal |= MGC_M_TXCSR_TXPKTRDY; wCsrVal &= ~MGC_M_TXCSR_P_UNDERRUN; musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); @@ -392,7 +392,7 @@ static void txstate(struct musb *musb, struct musb_request *req) /* host may already have the data when this message shows... */ DBG(3, "%s TX/IN %s len %d/%d, txcsr %04x, fifo %d/%d\n", musb_ep->end_point.name, use_dma ? "dma" : "pio", - pRequest->actual, pRequest->length, + request->actual, request->length, musb_readw(epio, MGC_O_HDRC_TXCSR), fifo_count, musb_readw(epio, MGC_O_HDRC_TXMAXP)); @@ -405,14 +405,14 @@ static void txstate(struct musb *musb, struct musb_request *req) void musb_g_tx(struct musb *musb, u8 epnum) { u16 wCsrVal; - struct usb_request *pRequest; + struct usb_request *request; u8 __iomem *mbase = musb->mregs; struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; void __iomem *epio = musb->endpoints[epnum].regs; struct dma_channel *dma; musb_ep_select(mbase, epnum); - pRequest = next_request(musb_ep); + request = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); DBG(4, "<== %s, txcsr %04x\n", musb_ep->end_point.name, wCsrVal); @@ -431,8 +431,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb->dma_controller->channel_abort(dma); } - if (pRequest) - musb_g_giveback(musb_ep, pRequest, -EPIPE); + if (request) + musb_g_giveback(musb_ep, request, -EPIPE); break; } @@ -443,7 +443,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) wCsrVal &= ~(MGC_M_TXCSR_P_UNDERRUN | MGC_M_TXCSR_TXPKTRDY); musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); - DBG(20, "underrun on ep%d, req %p\n", epnum, pRequest); + DBG(20, "underrun on ep%d, req %p\n", epnum, request); } if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { @@ -454,7 +454,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) break; } - if (pRequest) { + if (request) { u8 is_dma = 0; if (dma && (wCsrVal & MGC_M_TXCSR_DMAENAB)) { @@ -466,29 +466,29 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); /* ensure writebuffer is empty */ wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - pRequest->actual += musb_ep->dma->actual_len; + request->actual += musb_ep->dma->actual_len; DBG(4, "TXCSR%d %04x, dma off, " "len %Zd, req %p\n", epnum, wCsrVal, musb_ep->dma->actual_len, - pRequest); + request); } - if (is_dma || pRequest->actual == pRequest->length) { + if (is_dma || request->actual == request->length) { /* First, maybe a terminating short packet. * Some DMA engines might handle this by * themselves. */ - if ((pRequest->zero - && pRequest->length - && (pRequest->length + if ((request->zero + && request->length + && (request->length % musb_ep->wPacketSize) == 0) #ifdef CONFIG_USB_INVENTRA_DMA || (is_dma && ((!dma->desired_mode) || - (pRequest->actual & + (request->actual & (musb_ep->wPacketSize - 1)))) #endif ) { @@ -502,11 +502,11 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb_writew(epio, MGC_O_HDRC_TXCSR, MGC_M_TXCSR_MODE | MGC_M_TXCSR_TXPKTRDY); - pRequest->zero = 0; + request->zero = 0; } /* ... or if not, then complete it */ - musb_g_giveback(musb_ep, pRequest, 0); + musb_g_giveback(musb_ep, request, 0); /* kickstart next transfer if appropriate; * the packet that just completed might not @@ -518,17 +518,17 @@ void musb_g_tx(struct musb *musb, u8 epnum) wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsrVal & MGC_M_TXCSR_FIFONOTEMPTY) break; - pRequest = musb_ep->desc + request = musb_ep->desc ? next_request(musb_ep) : NULL; - if (!pRequest) { + if (!request) { DBG(4, "%s idle now\n", musb_ep->end_point.name); break; } } - txstate(musb, to_musb_request(pRequest)); + txstate(musb, to_musb_request(request)); } } while (0); @@ -574,7 +574,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) { u16 wCsrVal = 0; const u8 epnum = req->epnum; - struct usb_request *pRequest = &req->request; + struct usb_request *request = &req->request; struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; void __iomem *epio = musb->endpoints[epnum].regs; u16 fifo_count = 0; @@ -593,9 +593,9 @@ static void rxstate(struct musb *musb, struct musb_request *req) */ if (c->channel_program(channel, musb_ep->wPacketSize, - !pRequest->short_not_ok, - pRequest->dma + pRequest->actual, - pRequest->length - pRequest->actual)) { + !request->short_not_ok, + request->dma + request->actual, + request->length - request->actual)) { /* make sure that if an rxpkt arrived after the irq, * the cppi engine will be ready to take it as soon @@ -611,7 +611,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) if (wCsrVal & MGC_M_RXCSR_RXPKTRDY) { len = musb_readw(epio, MGC_O_HDRC_RXCOUNT); - if (pRequest->actual < pRequest->length) { + if (request->actual < request->length) { #ifdef CONFIG_USB_INVENTRA_DMA if (is_dma_capable() && musb_ep->dma) { struct dma_controller *c; @@ -657,10 +657,10 @@ static void rxstate(struct musb *musb, struct musb_request *req) musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); - if (pRequest->actual < pRequest->length) { + if (request->actual < request->length) { int transfer_size = 0; #ifdef USE_MODE1 - transfer_size = min(pRequest->length, + transfer_size = min(request->length, channel->max_len); #else transfer_size = len; @@ -674,8 +674,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) channel, musb_ep->wPacketSize, channel->desired_mode, - pRequest->dma - + pRequest->actual, + request->dma + + request->actual, transfer_size); } @@ -684,7 +684,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) } #endif /* Mentor's USB */ - fifo_count = pRequest->length - pRequest->actual; + fifo_count = request->length - request->actual; DBG(3, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n", musb_ep->end_point.name, len, fifo_count, @@ -696,7 +696,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) if (tusb_dma_omap() && musb_ep->dma) { struct dma_controller *c = musb->dma_controller; struct dma_channel *channel = musb_ep->dma; - u32 dma_addr = pRequest->dma + pRequest->actual; + u32 dma_addr = request->dma + request->actual; int ret; ret = c->channel_program(channel, @@ -710,8 +710,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) #endif musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) - (pRequest->buf + pRequest->actual)); - pRequest->actual += fifo_count; + (request->buf + request->actual)); + request->actual += fifo_count; /* REVISIT if we left anything in the fifo, flush * it and report -EOVERFLOW @@ -725,8 +725,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) } /* reach the end or short packet detected */ - if (pRequest->actual == pRequest->length || len < musb_ep->wPacketSize) - musb_g_giveback(musb_ep, pRequest, 0); + if (request->actual == request->length || len < musb_ep->wPacketSize) + musb_g_giveback(musb_ep, request, 0); } /* @@ -735,7 +735,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) void musb_g_rx(struct musb *musb, u8 epnum) { u16 wCsrVal; - struct usb_request *pRequest; + struct usb_request *request; void __iomem *mbase = musb->mregs; struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; void __iomem *epio = musb->endpoints[epnum].regs; @@ -743,27 +743,27 @@ void musb_g_rx(struct musb *musb, u8 epnum) musb_ep_select(mbase, epnum); - pRequest = next_request(musb_ep); + request = next_request(musb_ep); wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); dma = is_dma_capable() ? musb_ep->dma : NULL; DBG(4, "<== %s, rxcsr %04x%s %p\n", musb_ep->end_point.name, - wCsrVal, dma ? " (dma)" : "", pRequest); + wCsrVal, dma ? " (dma)" : "", request); if (wCsrVal & MGC_M_RXCSR_P_SENTSTALL) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->status = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); - pRequest->actual += musb_ep->dma->actual_len; + request->actual += musb_ep->dma->actual_len; } wCsrVal |= MGC_M_RXCSR_P_WZC_BITS; wCsrVal &= ~MGC_M_RXCSR_P_SENTSTALL; musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); - if (pRequest) - musb_g_giveback(musb_ep, pRequest, -EPIPE); + if (request) + musb_g_giveback(musb_ep, request, -EPIPE); goto done; } @@ -772,9 +772,9 @@ void musb_g_rx(struct musb *musb, u8 epnum) wCsrVal &= ~MGC_M_RXCSR_P_OVERRUN; musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); - DBG(3, "%s iso overrun on %p\n", musb_ep->name, pRequest); - if (pRequest && pRequest->status == -EINPROGRESS) - pRequest->status = -EOVERFLOW; + DBG(3, "%s iso overrun on %p\n", musb_ep->name, request); + if (request && request->status == -EINPROGRESS) + request->status = -EOVERFLOW; } if (wCsrVal & MGC_M_RXCSR_INCOMPRX) { /* REVISIT not necessarily an error */ @@ -796,12 +796,12 @@ void musb_g_rx(struct musb *musb, u8 epnum) musb_writew(epio, MGC_O_HDRC_RXCSR, MGC_M_RXCSR_P_WZC_BITS | wCsrVal); - pRequest->actual += musb_ep->dma->actual_len; + request->actual += musb_ep->dma->actual_len; DBG(4, "RXCSR%d %04x, dma off, %04x, len %Zd, req %p\n", epnum, wCsrVal, musb_readw(epio, MGC_O_HDRC_RXCSR), - musb_ep->dma->actual_len, pRequest); + musb_ep->dma->actual_len, request); #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_TUSB_OMAP_DMA) /* Autoclear doesn't clear RxPktRdy for short packets */ @@ -814,15 +814,15 @@ void musb_g_rx(struct musb *musb, u8 epnum) } /* incomplete, and not short? wait for next IN packet */ - if ((pRequest->actual < pRequest->length) + if ((request->actual < request->length) && (musb_ep->dma->actual_len == musb_ep->wPacketSize)) goto done; #endif - musb_g_giveback(musb_ep, pRequest, 0); + musb_g_giveback(musb_ep, request, 0); - pRequest = next_request(musb_ep); - if (!pRequest) + request = next_request(musb_ep); + if (!request) goto done; /* don't start more i/o till the stall clears */ @@ -834,8 +834,8 @@ void musb_g_rx(struct musb *musb, u8 epnum) /* analyze request if the ep is hot */ - if (pRequest) - rxstate(musb, to_musb_request(pRequest)); + if (request) + rxstate(musb, to_musb_request(request)); else DBG(3, "packet waiting for %s%s request\n", musb_ep->desc ? "" : "inactive ", @@ -1046,17 +1046,17 @@ static int musb_gadget_disable(struct usb_ep *ep) struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) { struct musb_ep *musb_ep = to_musb_ep(ep); - struct musb_request *pRequest = NULL; - - pRequest = kzalloc(sizeof *pRequest, gfp_flags); - if (pRequest) { - INIT_LIST_HEAD(&pRequest->request.list); - pRequest->request.dma = DMA_ADDR_INVALID; - pRequest->epnum = musb_ep->current_epnum; - pRequest->ep = musb_ep; + struct musb_request *request = NULL; + + request = kzalloc(sizeof *request, gfp_flags); + if (request) { + INIT_LIST_HEAD(&request->request.list); + request->request.dma = DMA_ADDR_INVALID; + request->epnum = musb_ep->current_epnum; + request->ep = musb_ep; } - return &pRequest->request; + return &request->request; } /* @@ -1097,7 +1097,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) { struct musb_ep *musb_ep; - struct musb_request *pRequest; + struct musb_request *request; struct musb *musb; int status = 0; unsigned long lockflags; @@ -1110,43 +1110,43 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, musb_ep = to_musb_ep(ep); musb = musb_ep->musb; - pRequest = to_musb_request(req); - pRequest->musb = musb; + request = to_musb_request(req); + request->musb = musb; - if (pRequest->ep != musb_ep) + if (request->ep != musb_ep) return -EINVAL; DBG(4, "<== to %s request=%p\n", ep->name, req); /* request is mine now... */ - pRequest->request.actual = 0; - pRequest->request.status = -EINPROGRESS; - pRequest->epnum = musb_ep->current_epnum; - pRequest->bTx = musb_ep->is_in; + request->request.actual = 0; + request->request.status = -EINPROGRESS; + request->epnum = musb_ep->current_epnum; + request->bTx = musb_ep->is_in; if (is_dma_capable() && musb_ep->dma) { - if (pRequest->request.dma == DMA_ADDR_INVALID) { - pRequest->request.dma = dma_map_single( + if (request->request.dma == DMA_ADDR_INVALID) { + request->request.dma = dma_map_single( musb->controller, - pRequest->request.buf, - pRequest->request.length, - pRequest->bTx + request->request.buf, + request->request.length, + request->bTx ? DMA_TO_DEVICE : DMA_FROM_DEVICE); - pRequest->mapped = 1; + request->mapped = 1; } else { dma_sync_single_for_device(musb->controller, - pRequest->request.dma, - pRequest->request.length, - pRequest->bTx + request->request.dma, + request->request.length, + request->bTx ? DMA_TO_DEVICE : DMA_FROM_DEVICE); - pRequest->mapped = 0; + request->mapped = 0; } } else if (!req->buf) { return -ENODATA; } else - pRequest->mapped = 0; + request->mapped = 0; spin_lock_irqsave(&musb->lock, lockflags); @@ -1158,19 +1158,19 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, goto cleanup; } - /* add pRequest to the list */ - list_add_tail(&(pRequest->request.list), &(musb_ep->req_list)); + /* add request to the list */ + list_add_tail(&(request->request.list), &(musb_ep->req_list)); /* it this is the head of the queue, start i/o ... */ - if (!musb_ep->busy && &pRequest->request.list == musb_ep->req_list.next) - musb_ep_restart(musb, pRequest); + if (!musb_ep->busy && &request->request.list == musb_ep->req_list.next) + musb_ep_restart(musb, request); cleanup: spin_unlock_irqrestore(&musb->lock, lockflags); return status; } -static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) +static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request) { struct musb_ep *musb_ep = to_musb_ep(ep); struct usb_request *r; @@ -1178,24 +1178,24 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) int status = 0; struct musb *musb = musb_ep->musb; - if (!ep || !pRequest || to_musb_request(pRequest)->ep != musb_ep) + if (!ep || !request || to_musb_request(request)->ep != musb_ep) return -EINVAL; spin_lock_irqsave(&musb->lock, flags); list_for_each_entry(r, &musb_ep->req_list, list) { - if (r == pRequest) + if (r == request) break; } - if (r != pRequest) { - DBG(3, "request %p not queued to %s\n", pRequest, ep->name); + if (r != request) { + DBG(3, "request %p not queued to %s\n", request, ep->name); status = -EINVAL; goto done; } /* if the hardware doesn't have the request, easy ... */ - if (musb_ep->req_list.next != &pRequest->list || musb_ep->busy) - musb_g_giveback(musb_ep, pRequest, -ECONNRESET); + if (musb_ep->req_list.next != &request->list || musb_ep->busy) + musb_g_giveback(musb_ep, request, -ECONNRESET); /* ... else abort the dma transfer ... */ else if (is_dma_capable() && musb_ep->dma) { @@ -1207,12 +1207,12 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) else status = -EBUSY; if (status == 0) - musb_g_giveback(musb_ep, pRequest, -ECONNRESET); + musb_g_giveback(musb_ep, request, -ECONNRESET); } else { /* NOTE: by sticking to easily tested hardware/driver states, * we leave counting of in-flight packets imprecise. */ - musb_g_giveback(musb_ep, pRequest, -ECONNRESET); + musb_g_giveback(musb_ep, request, -ECONNRESET); } done: @@ -1235,7 +1235,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) void __iomem *mbase; unsigned long flags; u16 wCsr; - struct musb_request *pRequest = NULL; + struct musb_request *request = NULL; int status = 0; if (!ep) @@ -1252,7 +1252,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) musb_ep_select(mbase, epnum); /* cannot portably stall with non-empty FIFO */ - pRequest = to_musb_request(next_request(musb_ep)); + request = to_musb_request(next_request(musb_ep)); if (value && musb_ep->is_in) { wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); if (wCsr & MGC_M_TXCSR_FIFONOTEMPTY) { @@ -1294,9 +1294,9 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value) done: /* maybe start the first request in the queue */ - if (!musb_ep->busy && !value && pRequest) { + if (!musb_ep->busy && !value && request) { DBG(3, "restarting the request\n"); - musb_ep_restart(musb, pRequest); + musb_ep_restart(musb, request); } spin_unlock_irqrestore(&musb->lock, flags); --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -950,7 +950,7 @@ static int musb_h_ep0_continue(struct musb *musb, u16 fifo_count = 0; struct musb_hw_ep *hw_ep = musb->control_ep; struct musb_qh *qh = hw_ep->in_qh; - struct usb_ctrlrequest *pRequest; + struct usb_ctrlrequest *request; switch (musb->ep0_stage) { case MGC_END0_IN: @@ -972,12 +972,12 @@ static int musb_h_ep0_continue(struct musb *musb, bMore = TRUE; break; case MGC_END0_START: - pRequest = (struct usb_ctrlrequest *) pUrb->setup_packet; + request = (struct usb_ctrlrequest *) pUrb->setup_packet; - if (!pRequest->wLength) { + if (!request->wLength) { DBG(4, "start no-DATA\n"); break; - } else if (pRequest->bRequestType & USB_DIR_IN) { + } else if (request->bRequestType & USB_DIR_IN) { DBG(4, "start IN-DATA\n"); musb->ep0_stage = MGC_END0_IN; bMore = TRUE; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr 2007-08-13 13:49 ` [PATCH 48/52] musb_hdrc: Search and replace pRequest with request Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 50/52] musb_hdrc: Search and replace bTx with tx Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace wCsrVal with csr Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 30 ++++---- drivers/usb/musb/musb_gadget.c | 152 ++++++++++++++++++++-------------------- drivers/usb/musb/musb_host.c | 46 ++++++------ 3 files changed, 114 insertions(+), 114 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -485,7 +485,7 @@ static void ep0_txstate(struct musb *musb) { void __iomem *regs = musb->control_ep->regs; struct usb_request *request = next_ep0_request(musb); - u16 wCsrVal = MGC_M_CSR0_TXPKTRDY; + u16 csr = MGC_M_CSR0_TXPKTRDY; u8 *pFifoSource; u8 fifo_count; @@ -506,12 +506,12 @@ static void ep0_txstate(struct musb *musb) if (fifo_count < MUSB_MAX_END0_PACKET || request->actual == request->length) { musb->ep0_state = MGC_END0_STAGE_STATUSOUT; - wCsrVal |= MGC_M_CSR0_P_DATAEND; + csr |= MGC_M_CSR0_P_DATAEND; } else request = NULL; /* send it out, triggering a "txpktrdy cleared" irq */ - musb_writew(regs, MGC_O_HDRC_CSR0, wCsrVal); + musb_writew(regs, MGC_O_HDRC_CSR0, csr); /* report completions as soon as the fifo's loaded; there's no * win in waiting till this last packet gets acked. (other than @@ -598,36 +598,36 @@ __acquires(musb->lock) */ irqreturn_t musb_g_ep0_irq(struct musb *musb) { - u16 wCsrVal; + u16 csr; u16 len; void __iomem *mbase = musb->mregs; void __iomem *regs = musb->endpoints[0].regs; irqreturn_t retval = IRQ_NONE; musb_ep_select(mbase, 0); /* select ep0 */ - wCsrVal = musb_readw(regs, MGC_O_HDRC_CSR0); + csr = musb_readw(regs, MGC_O_HDRC_CSR0); len = musb_readb(regs, MGC_O_HDRC_COUNT0); DBG(4, "csr %04x, count %d, myaddr %d, ep0stage %s\n", - wCsrVal, len, + csr, len, musb_readb(mbase, MGC_O_HDRC_FADDR), decode_ep0stage(musb->ep0_state)); /* I sent a stall.. need to acknowledge it now.. */ - if (wCsrVal & MGC_M_CSR0_P_SENTSTALL) { + if (csr & MGC_M_CSR0_P_SENTSTALL) { musb_writew(regs, MGC_O_HDRC_CSR0, - wCsrVal & ~MGC_M_CSR0_P_SENTSTALL); + csr & ~MGC_M_CSR0_P_SENTSTALL); retval = IRQ_HANDLED; musb->ep0_state = MGC_END0_STAGE_SETUP; - wCsrVal = musb_readw(regs, MGC_O_HDRC_CSR0); + csr = musb_readw(regs, MGC_O_HDRC_CSR0); } /* request ended "early" */ - if (wCsrVal & MGC_M_CSR0_P_SETUPEND) { + if (csr & MGC_M_CSR0_P_SETUPEND) { musb_writew(regs, MGC_O_HDRC_CSR0, MGC_M_CSR0_P_SVDSETUPEND); retval = IRQ_HANDLED; musb->ep0_state = MGC_END0_STAGE_SETUP; - wCsrVal = musb_readw(regs, MGC_O_HDRC_CSR0); + csr = musb_readw(regs, MGC_O_HDRC_CSR0); /* NOTE: request may need completion */ } @@ -639,7 +639,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) case MGC_END0_STAGE_TX: /* irq on clearing txpktrdy */ - if ((wCsrVal & MGC_M_CSR0_TXPKTRDY) == 0) { + if ((csr & MGC_M_CSR0_TXPKTRDY) == 0) { ep0_txstate(musb); retval = IRQ_HANDLED; } @@ -647,7 +647,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) case MGC_END0_STAGE_RX: /* irq on set rxpktrdy */ - if (wCsrVal & MGC_M_CSR0_RXPKTRDY) { + if (csr & MGC_M_CSR0_RXPKTRDY) { ep0_rxstate(musb); retval = IRQ_HANDLED; } @@ -692,7 +692,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) /* FALLTHROUGH */ case MGC_END0_STAGE_SETUP: - if (wCsrVal & MGC_M_CSR0_RXPKTRDY) { + if (csr & MGC_M_CSR0_RXPKTRDY) { struct usb_ctrlrequest setup; int handled = 0; @@ -755,7 +755,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) } DBG(3, "handled %d, csr %04x, ep0stage %s\n", - handled, wCsrVal, + handled, csr, decode_ep0stage(musb->ep0_state)); /* unless we need to delegate this to the gadget --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -256,7 +256,7 @@ static void txstate(struct musb *musb, struct musb_request *req) struct musb_ep *musb_ep; void __iomem *epio = musb->endpoints[epnum].regs; struct usb_request *request; - u16 fifo_count = 0, wCsrVal; + u16 fifo_count = 0, csr; int use_dma = 0; musb_ep = req->ep; @@ -268,27 +268,27 @@ static void txstate(struct musb *musb, struct musb_request *req) } /* read TXCSR before */ - wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); + csr = musb_readw(epio, MGC_O_HDRC_TXCSR); request = &req->request; fifo_count = min(max_ep_writesize(musb, musb_ep), (int)(request->length - request->actual)); - if (wCsrVal & MGC_M_TXCSR_TXPKTRDY) { + if (csr & MGC_M_TXCSR_TXPKTRDY) { DBG(5, "%s old packet still ready , txcsr %03x\n", - musb_ep->end_point.name, wCsrVal); + musb_ep->end_point.name, csr); return; } - if (wCsrVal & MGC_M_TXCSR_P_SENDSTALL) { + if (csr & MGC_M_TXCSR_P_SENDSTALL) { DBG(5, "%s stalling, txcsr %03x\n", - musb_ep->end_point.name, wCsrVal); + musb_ep->end_point.name, csr); return; } DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", epnum, musb_ep->wPacketSize, fifo_count, - wCsrVal); + csr); #ifndef CONFIG_USB_INVENTRA_FIFO if (is_dma_capable() && musb_ep->dma) { @@ -317,36 +317,36 @@ static void txstate(struct musb *musb, struct musb_request *req) if (use_dma) { if (musb_ep->dma->desired_mode == 0) { /* ASSERT: DMAENAB is clear */ - wCsrVal &= ~(MGC_M_TXCSR_AUTOSET | + csr &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAMODE); - wCsrVal |= (MGC_M_TXCSR_DMAENAB | + csr |= (MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_MODE); // against programming guide } else - wCsrVal |= (MGC_M_TXCSR_AUTOSET + csr |= (MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_MODE); - wCsrVal &= ~MGC_M_TXCSR_P_UNDERRUN; - musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); + csr &= ~MGC_M_TXCSR_P_UNDERRUN; + musb_writew(epio, MGC_O_HDRC_TXCSR, csr); } } #elif defined(CONFIG_USB_TI_CPPI_DMA) /* program endpoint CSR first, then setup DMA */ - wCsrVal &= ~(MGC_M_TXCSR_AUTOSET + csr &= ~(MGC_M_TXCSR_AUTOSET | MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_P_UNDERRUN | MGC_M_TXCSR_TXPKTRDY); - wCsrVal |= MGC_M_TXCSR_MODE | MGC_M_TXCSR_DMAENAB; + csr |= MGC_M_TXCSR_MODE | MGC_M_TXCSR_DMAENAB; musb_writew(epio, MGC_O_HDRC_TXCSR, (MGC_M_TXCSR_P_WZC_BITS & ~MGC_M_TXCSR_P_UNDERRUN) - | wCsrVal); + | csr); /* ensure writebuffer is empty */ - wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); + csr = musb_readw(epio, MGC_O_HDRC_TXCSR); /* NOTE host side sets DMAENAB later than this; both are * OK since the transfer dma glue (between CPPI and Mentor @@ -367,7 +367,7 @@ static void txstate(struct musb *musb, struct musb_request *req) c->channel_release(musb_ep->dma); musb_ep->dma = NULL; /* ASSERT: DMAENAB clear */ - wCsrVal &= ~(MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_MODE); + csr &= ~(MGC_M_TXCSR_DMAMODE | MGC_M_TXCSR_MODE); /* invariant: prequest->buf is non-null */ } #elif defined(CONFIG_USB_TUSB_OMAP_DMA) @@ -384,9 +384,9 @@ static void txstate(struct musb *musb, struct musb_request *req) musb_write_fifo(musb_ep->hw_ep, fifo_count, (u8 *) (request->buf + request->actual)); request->actual += fifo_count; - wCsrVal |= MGC_M_TXCSR_TXPKTRDY; - wCsrVal &= ~MGC_M_TXCSR_P_UNDERRUN; - musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); + csr |= MGC_M_TXCSR_TXPKTRDY; + csr &= ~MGC_M_TXCSR_P_UNDERRUN; + musb_writew(epio, MGC_O_HDRC_TXCSR, csr); } /* host may already have the data when this message shows... */ @@ -404,7 +404,7 @@ static void txstate(struct musb *musb, struct musb_request *req) */ void musb_g_tx(struct musb *musb, u8 epnum) { - u16 wCsrVal; + u16 csr; struct usb_request *request; u8 __iomem *mbase = musb->mregs; struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; @@ -414,18 +414,18 @@ void musb_g_tx(struct musb *musb, u8 epnum) musb_ep_select(mbase, epnum); request = next_request(musb_ep); - wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - DBG(4, "<== %s, txcsr %04x\n", musb_ep->end_point.name, wCsrVal); + csr = musb_readw(epio, MGC_O_HDRC_TXCSR); + DBG(4, "<== %s, txcsr %04x\n", musb_ep->end_point.name, csr); dma = is_dma_capable() ? musb_ep->dma : NULL; do { /* REVISIT for high bandwidth, MGC_M_TXCSR_P_INCOMPTX * probably rates reporting as a host error */ - if (wCsrVal & MGC_M_TXCSR_P_SENTSTALL) { - wCsrVal |= MGC_M_TXCSR_P_WZC_BITS; - wCsrVal &= ~MGC_M_TXCSR_P_SENTSTALL; - musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); + if (csr & MGC_M_TXCSR_P_SENTSTALL) { + csr |= MGC_M_TXCSR_P_WZC_BITS; + csr &= ~MGC_M_TXCSR_P_SENTSTALL; + musb_writew(epio, MGC_O_HDRC_TXCSR, csr); if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->status = MGC_DMA_STATUS_CORE_ABORT; musb->dma_controller->channel_abort(dma); @@ -437,12 +437,12 @@ void musb_g_tx(struct musb *musb, u8 epnum) break; } - if (wCsrVal & MGC_M_TXCSR_P_UNDERRUN) { + if (csr & MGC_M_TXCSR_P_UNDERRUN) { /* we NAKed, no big deal ... little reason to care */ - wCsrVal |= MGC_M_TXCSR_P_WZC_BITS; - wCsrVal &= ~(MGC_M_TXCSR_P_UNDERRUN + csr |= MGC_M_TXCSR_P_WZC_BITS; + csr &= ~(MGC_M_TXCSR_P_UNDERRUN | MGC_M_TXCSR_TXPKTRDY); - musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); + musb_writew(epio, MGC_O_HDRC_TXCSR, csr); DBG(20, "underrun on ep%d, req %p\n", epnum, request); } @@ -457,19 +457,19 @@ void musb_g_tx(struct musb *musb, u8 epnum) if (request) { u8 is_dma = 0; - if (dma && (wCsrVal & MGC_M_TXCSR_DMAENAB)) { + if (dma && (csr & MGC_M_TXCSR_DMAENAB)) { is_dma = 1; - wCsrVal |= MGC_M_TXCSR_P_WZC_BITS; - wCsrVal &= ~(MGC_M_TXCSR_DMAENAB + csr |= MGC_M_TXCSR_P_WZC_BITS; + csr &= ~(MGC_M_TXCSR_DMAENAB | MGC_M_TXCSR_P_UNDERRUN | MGC_M_TXCSR_TXPKTRDY); - musb_writew(epio, MGC_O_HDRC_TXCSR, wCsrVal); + musb_writew(epio, MGC_O_HDRC_TXCSR, csr); /* ensure writebuffer is empty */ - wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); + csr = musb_readw(epio, MGC_O_HDRC_TXCSR); request->actual += musb_ep->dma->actual_len; DBG(4, "TXCSR%d %04x, dma off, " "len %Zd, req %p\n", - epnum, wCsrVal, + epnum, csr, musb_ep->dma->actual_len, request); } @@ -495,7 +495,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) /* on dma completion, fifo may not * be available yet ... */ - if (wCsrVal & MGC_M_TXCSR_TXPKTRDY) + if (csr & MGC_M_TXCSR_TXPKTRDY) break; DBG(4, "sending zero pkt\n"); @@ -515,8 +515,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) * FIXME revisit for stalls too... */ musb_ep_select(mbase, epnum); - wCsrVal = musb_readw(epio, MGC_O_HDRC_TXCSR); - if (wCsrVal & MGC_M_TXCSR_FIFONOTEMPTY) + csr = musb_readw(epio, MGC_O_HDRC_TXCSR); + if (csr & MGC_M_TXCSR_FIFONOTEMPTY) break; request = musb_ep->desc ? next_request(musb_ep) @@ -572,7 +572,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) */ static void rxstate(struct musb *musb, struct musb_request *req) { - u16 wCsrVal = 0; + u16 csr = 0; const u8 epnum = req->epnum; struct usb_request *request = &req->request; struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; @@ -580,7 +580,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) u16 fifo_count = 0; u16 len = musb_ep->wPacketSize; - wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); + csr = musb_readw(epio, MGC_O_HDRC_RXCSR); if (is_cppi_enabled() && musb_ep->dma) { struct dma_controller *c = musb->dma_controller; @@ -601,15 +601,15 @@ static void rxstate(struct musb *musb, struct musb_request *req) * the cppi engine will be ready to take it as soon * as DMA is enabled */ - wCsrVal &= ~(MGC_M_RXCSR_AUTOCLEAR + csr &= ~(MGC_M_RXCSR_AUTOCLEAR | MGC_M_RXCSR_DMAMODE); - wCsrVal |= MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_P_WZC_BITS; - musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); + csr |= MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_P_WZC_BITS; + musb_writew(epio, MGC_O_HDRC_RXCSR, csr); return; } } - if (wCsrVal & MGC_M_RXCSR_RXPKTRDY) { + if (csr & MGC_M_RXCSR_RXPKTRDY) { len = musb_readw(epio, MGC_O_HDRC_RXCOUNT); if (request->actual < request->length) { #ifdef CONFIG_USB_INVENTRA_DMA @@ -642,20 +642,20 @@ static void rxstate(struct musb *musb, struct musb_request *req) * then becomes usable as a runtime "use mode 1" hint... */ - wCsrVal |= MGC_M_RXCSR_DMAENAB; + csr |= MGC_M_RXCSR_DMAENAB; #ifdef USE_MODE1 - wCsrVal |= MGC_M_RXCSR_AUTOCLEAR; -// wCsrVal |= MGC_M_RXCSR_DMAMODE; + csr |= MGC_M_RXCSR_AUTOCLEAR; +// csr |= MGC_M_RXCSR_DMAMODE; /* this special sequence (enabling and then disabling MGC_M_RXCSR_DMAMODE) is required to get DMAReq to activate */ musb_writew(epio, MGC_O_HDRC_RXCSR, - wCsrVal | MGC_M_RXCSR_DMAMODE); + csr | MGC_M_RXCSR_DMAMODE); #endif musb_writew(epio, MGC_O_HDRC_RXCSR, - wCsrVal); + csr); if (request->actual < request->length) { int transfer_size = 0; @@ -718,9 +718,9 @@ static void rxstate(struct musb *musb, struct musb_request *req) */ /* ack the read! */ - wCsrVal |= MGC_M_RXCSR_P_WZC_BITS; - wCsrVal &= ~MGC_M_RXCSR_RXPKTRDY; - musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); + csr |= MGC_M_RXCSR_P_WZC_BITS; + csr &= ~MGC_M_RXCSR_RXPKTRDY; + musb_writew(epio, MGC_O_HDRC_RXCSR, csr); } } @@ -734,7 +734,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) */ void musb_g_rx(struct musb *musb, u8 epnum) { - u16 wCsrVal; + u16 csr; struct usb_request *request; void __iomem *mbase = musb->mregs; struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; @@ -745,61 +745,61 @@ void musb_g_rx(struct musb *musb, u8 epnum) request = next_request(musb_ep); - wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); + csr = musb_readw(epio, MGC_O_HDRC_RXCSR); dma = is_dma_capable() ? musb_ep->dma : NULL; DBG(4, "<== %s, rxcsr %04x%s %p\n", musb_ep->end_point.name, - wCsrVal, dma ? " (dma)" : "", request); + csr, dma ? " (dma)" : "", request); - if (wCsrVal & MGC_M_RXCSR_P_SENTSTALL) { + if (csr & MGC_M_RXCSR_P_SENTSTALL) { if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { dma->status = MGC_DMA_STATUS_CORE_ABORT; (void) musb->dma_controller->channel_abort(dma); request->actual += musb_ep->dma->actual_len; } - wCsrVal |= MGC_M_RXCSR_P_WZC_BITS; - wCsrVal &= ~MGC_M_RXCSR_P_SENTSTALL; - musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); + csr |= MGC_M_RXCSR_P_WZC_BITS; + csr &= ~MGC_M_RXCSR_P_SENTSTALL; + musb_writew(epio, MGC_O_HDRC_RXCSR, csr); if (request) musb_g_giveback(musb_ep, request, -EPIPE); goto done; } - if (wCsrVal & MGC_M_RXCSR_P_OVERRUN) { - // wCsrVal |= MGC_M_RXCSR_P_WZC_BITS; - wCsrVal &= ~MGC_M_RXCSR_P_OVERRUN; - musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); + if (csr & MGC_M_RXCSR_P_OVERRUN) { + // csr |= MGC_M_RXCSR_P_WZC_BITS; + csr &= ~MGC_M_RXCSR_P_OVERRUN; + musb_writew(epio, MGC_O_HDRC_RXCSR, csr); DBG(3, "%s iso overrun on %p\n", musb_ep->name, request); if (request && request->status == -EINPROGRESS) request->status = -EOVERFLOW; } - if (wCsrVal & MGC_M_RXCSR_INCOMPRX) { + if (csr & MGC_M_RXCSR_INCOMPRX) { /* REVISIT not necessarily an error */ DBG(4, "%s, incomprx\n", musb_ep->end_point.name); } if (dma_channel_status(dma) == MGC_DMA_STATUS_BUSY) { /* "should not happen"; likely RXPKTRDY pending for DMA */ - DBG((wCsrVal & MGC_M_RXCSR_DMAENAB) ? 4 : 1, + DBG((csr & MGC_M_RXCSR_DMAENAB) ? 4 : 1, "%s busy, csr %04x\n", - musb_ep->end_point.name, wCsrVal); + musb_ep->end_point.name, csr); goto done; } - if (dma && (wCsrVal & MGC_M_RXCSR_DMAENAB)) { - wCsrVal &= ~(MGC_M_RXCSR_AUTOCLEAR + if (dma && (csr & MGC_M_RXCSR_DMAENAB)) { + csr &= ~(MGC_M_RXCSR_AUTOCLEAR | MGC_M_RXCSR_DMAENAB | MGC_M_RXCSR_DMAMODE); musb_writew(epio, MGC_O_HDRC_RXCSR, - MGC_M_RXCSR_P_WZC_BITS | wCsrVal); + MGC_M_RXCSR_P_WZC_BITS | csr); request->actual += musb_ep->dma->actual_len; DBG(4, "RXCSR%d %04x, dma off, %04x, len %Zd, req %p\n", - epnum, wCsrVal, + epnum, csr, musb_readw(epio, MGC_O_HDRC_RXCSR), musb_ep->dma->actual_len, request); @@ -809,8 +809,8 @@ void musb_g_rx(struct musb *musb, u8 epnum) || (dma->actual_len & (musb_ep->wPacketSize - 1))) { /* ack the read! */ - wCsrVal &= ~MGC_M_RXCSR_RXPKTRDY; - musb_writew(epio, MGC_O_HDRC_RXCSR, wCsrVal); + csr &= ~MGC_M_RXCSR_RXPKTRDY; + musb_writew(epio, MGC_O_HDRC_RXCSR, csr); } /* incomplete, and not short? wait for next IN packet */ @@ -827,8 +827,8 @@ void musb_g_rx(struct musb *musb, u8 epnum) /* don't start more i/o till the stall clears */ musb_ep_select(mbase, epnum); - wCsrVal = musb_readw(epio, MGC_O_HDRC_RXCSR); - if (wCsrVal & MGC_M_RXCSR_P_SENDSTALL) + csr = musb_readw(epio, MGC_O_HDRC_RXCSR); + if (csr & MGC_M_RXCSR_P_SENDSTALL) goto done; } --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -1021,7 +1021,7 @@ static int musb_h_ep0_continue(struct musb *musb, irqreturn_t musb_h_ep0_irq(struct musb *musb) { struct urb *pUrb; - u16 wCsrVal, len; + u16 csr, len; int status = 0; void __iomem *mbase = musb->mregs; struct musb_hw_ep *hw_ep = musb->control_ep; @@ -1034,13 +1034,13 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) pUrb = next_urb(qh); musb_ep_select(mbase, 0); - wCsrVal = musb_readw(epio, MGC_O_HDRC_CSR0); - len = (wCsrVal & MGC_M_CSR0_RXPKTRDY) + csr = musb_readw(epio, MGC_O_HDRC_CSR0); + len = (csr & MGC_M_CSR0_RXPKTRDY) ? musb_readb(epio, MGC_O_HDRC_COUNT0) : 0; DBG(4, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d\n", - wCsrVal, qh, len, pUrb, musb->ep0_stage); + csr, qh, len, pUrb, musb->ep0_stage); /* if we just did status stage, we are done */ if (MGC_END0_STATUS == musb->ep0_stage) { @@ -1049,15 +1049,15 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) } /* prepare status */ - if (wCsrVal & MGC_M_CSR0_H_RXSTALL) { + if (csr & MGC_M_CSR0_H_RXSTALL) { DBG(6, "STALLING ENDPOINT\n"); status = -EPIPE; - } else if (wCsrVal & MGC_M_CSR0_H_ERROR) { - DBG(2, "no response, csr0 %04x\n", wCsrVal); + } else if (csr & MGC_M_CSR0_H_ERROR) { + DBG(2, "no response, csr0 %04x\n", csr); status = -EPROTO; - } else if (wCsrVal & MGC_M_CSR0_H_NAKTIMEOUT) { + } else if (csr & MGC_M_CSR0_H_NAKTIMEOUT) { DBG(2, "control NAK timeout\n"); /* NOTE: this code path would be a good place to PAUSE a @@ -1079,17 +1079,17 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) bComplete = TRUE; /* use the proper sequence to abort the transfer */ - if (wCsrVal & MGC_M_CSR0_H_REQPKT) { - wCsrVal &= ~MGC_M_CSR0_H_REQPKT; - musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); - wCsrVal &= ~MGC_M_CSR0_H_NAKTIMEOUT; - musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); + if (csr & MGC_M_CSR0_H_REQPKT) { + csr &= ~MGC_M_CSR0_H_REQPKT; + musb_writew(epio, MGC_O_HDRC_CSR0, csr); + csr &= ~MGC_M_CSR0_H_NAKTIMEOUT; + musb_writew(epio, MGC_O_HDRC_CSR0, csr); } else { - wCsrVal |= MGC_M_CSR0_FLUSHFIFO; - musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); - musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); - wCsrVal &= ~MGC_M_CSR0_H_NAKTIMEOUT; - musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); + csr |= MGC_M_CSR0_FLUSHFIFO; + musb_writew(epio, MGC_O_HDRC_CSR0, csr); + musb_writew(epio, MGC_O_HDRC_CSR0, csr); + csr &= ~MGC_M_CSR0_H_NAKTIMEOUT; + musb_writew(epio, MGC_O_HDRC_CSR0, csr); } musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, 0); @@ -1114,25 +1114,25 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) /* call common logic and prepare response */ if (musb_h_ep0_continue(musb, len, pUrb)) { /* more packets required */ - wCsrVal = (MGC_END0_IN == musb->ep0_stage) + csr = (MGC_END0_IN == musb->ep0_stage) ? MGC_M_CSR0_H_REQPKT : MGC_M_CSR0_TXPKTRDY; } else { /* data transfer complete; perform status phase */ if (usb_pipeout(pUrb->pipe) || !pUrb->transfer_buffer_length) - wCsrVal = MGC_M_CSR0_H_STATUSPKT + csr = MGC_M_CSR0_H_STATUSPKT | MGC_M_CSR0_H_REQPKT; else - wCsrVal = MGC_M_CSR0_H_STATUSPKT + csr = MGC_M_CSR0_H_STATUSPKT | MGC_M_CSR0_TXPKTRDY; /* flag status stage */ musb->ep0_stage = MGC_END0_STATUS; - DBG(5, "ep0 STATUS, csr %04x\n", wCsrVal); + DBG(5, "ep0 STATUS, csr %04x\n", csr); } - musb_writew(epio, MGC_O_HDRC_CSR0, wCsrVal); + musb_writew(epio, MGC_O_HDRC_CSR0, csr); retval = IRQ_HANDLED; } else musb->ep0_stage = MGC_END0_IDLE; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 50/52] musb_hdrc: Search and replace bTx with tx 2007-08-13 13:49 ` [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace bTx with tx Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/g_ep0.c | 2 +- drivers/usb/musb/musb_gadget.c | 14 +++++++------- drivers/usb/musb/musb_gadget.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) --- a/drivers/usb/musb/g_ep0.c +++ b/drivers/usb/musb/g_ep0.c @@ -835,7 +835,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) req->musb = musb; req->request.actual = 0; req->request.status = -EINPROGRESS; - req->bTx = ep->is_in; + req->tx = ep->is_in; spin_lock_irqsave(&musb->lock, lockflags); --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -123,7 +123,7 @@ __acquires(ep->musb->lock) dma_unmap_single(musb->controller, req->request.dma, req->request.length, - req->bTx + req->tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE); req->request.dma = DMA_ADDR_INVALID; @@ -132,7 +132,7 @@ __acquires(ep->musb->lock) dma_sync_single_for_cpu(musb->controller, req->request.dma, req->request.length, - req->bTx + req->tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE); } @@ -1083,11 +1083,11 @@ struct free_record { static void musb_ep_restart(struct musb *musb, struct musb_request *req) { DBG(3, "<== %s request %p len %u on hw_ep%d\n", - req->bTx ? "TX/IN" : "RX/OUT", + req->tx ? "TX/IN" : "RX/OUT", &req->request, req->request.length, req->epnum); musb_ep_select(musb->mregs, req->epnum); - if (req->bTx) + if (req->tx) txstate(musb, req); else rxstate(musb, req); @@ -1122,7 +1122,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, request->request.actual = 0; request->request.status = -EINPROGRESS; request->epnum = musb_ep->current_epnum; - request->bTx = musb_ep->is_in; + request->tx = musb_ep->is_in; if (is_dma_capable() && musb_ep->dma) { if (request->request.dma == DMA_ADDR_INVALID) { @@ -1130,7 +1130,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, musb->controller, request->request.buf, request->request.length, - request->bTx + request->tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE); request->mapped = 1; @@ -1138,7 +1138,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, dma_sync_single_for_device(musb->controller, request->request.dma, request->request.length, - request->bTx + request->tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE); request->mapped = 0; --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -38,7 +38,7 @@ struct musb_request { struct usb_request request; struct musb_ep *ep; struct musb *musb; - u8 bTx; /* endpoint direction */ + u8 tx; /* endpoint direction */ u8 epnum; u8 mapped; }; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz 2007-08-13 13:49 ` [PATCH 50/52] musb_hdrc: Search and replace bTx with tx Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 2007-08-13 13:49 ` [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum Tony Lindgren 0 siblings, 1 reply; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace wPacketSize with packet_sz Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/musb_gadget.c | 38 +++++++++++++++++++------------------- drivers/usb/musb/musb_gadget.h | 2 +- drivers/usb/musb/musb_host.c | 20 ++++++++++---------- drivers/usb/musb/musbhsdma.c | 24 ++++++++++++------------ 4 files changed, 42 insertions(+), 42 deletions(-) --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -205,7 +205,7 @@ static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) if (can_bulk_split(musb, ep->type)) return ep->hw_ep->max_packet_sz_tx; else - return ep->wPacketSize; + return ep->packet_sz; } @@ -287,7 +287,7 @@ static void txstate(struct musb *musb, struct musb_request *req) } DBG(4, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x\n", - epnum, musb_ep->wPacketSize, fifo_count, + epnum, musb_ep->packet_sz, fifo_count, csr); #ifndef CONFIG_USB_INVENTRA_FIFO @@ -305,13 +305,13 @@ static void txstate(struct musb *musb, struct musb_request *req) /* setup DMA, then program endpoint CSR */ request_size = min(request->length, musb_ep->dma->max_len); - if (request_size <= musb_ep->wPacketSize) + if (request_size <= musb_ep->packet_sz) musb_ep->dma->desired_mode = 0; else musb_ep->dma->desired_mode = 1; use_dma = use_dma && c->channel_program( - musb_ep->dma, musb_ep->wPacketSize, + musb_ep->dma, musb_ep->packet_sz, musb_ep->dma->desired_mode, request->dma, request_size); if (use_dma) { @@ -359,7 +359,7 @@ static void txstate(struct musb *musb, struct musb_request *req) * except for the last-packet-is-already-short case. */ use_dma = use_dma && c->channel_program( - musb_ep->dma, musb_ep->wPacketSize, + musb_ep->dma, musb_ep->packet_sz, 0, request->dma, request->length); @@ -372,7 +372,7 @@ static void txstate(struct musb *musb, struct musb_request *req) } #elif defined(CONFIG_USB_TUSB_OMAP_DMA) use_dma = use_dma && c->channel_program( - musb_ep->dma, musb_ep->wPacketSize, + musb_ep->dma, musb_ep->packet_sz, request->zero, request->dma, request->length); @@ -483,13 +483,13 @@ void musb_g_tx(struct musb *musb, u8 epnum) if ((request->zero && request->length && (request->length - % musb_ep->wPacketSize) + % musb_ep->packet_sz) == 0) #ifdef CONFIG_USB_INVENTRA_DMA || (is_dma && ((!dma->desired_mode) || (request->actual & - (musb_ep->wPacketSize - 1)))) + (musb_ep->packet_sz - 1)))) #endif ) { /* on dma completion, fifo may not @@ -578,7 +578,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; void __iomem *epio = musb->endpoints[epnum].regs; u16 fifo_count = 0; - u16 len = musb_ep->wPacketSize; + u16 len = musb_ep->packet_sz; csr = musb_readw(epio, MGC_O_HDRC_RXCSR); @@ -592,7 +592,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) * faults will be handled correctly. */ if (c->channel_program(channel, - musb_ep->wPacketSize, + musb_ep->packet_sz, !request->short_not_ok, request->dma + request->actual, request->length - request->actual)) { @@ -665,14 +665,14 @@ static void rxstate(struct musb *musb, struct musb_request *req) #else transfer_size = len; #endif - if (transfer_size <= musb_ep->wPacketSize) + if (transfer_size <= musb_ep->packet_sz) musb_ep->dma->desired_mode = 0; else musb_ep->dma->desired_mode = 1; use_dma = c->channel_program( channel, - musb_ep->wPacketSize, + musb_ep->packet_sz, channel->desired_mode, request->dma + request->actual, @@ -688,7 +688,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) DBG(3, "%s OUT/RX pio fifo %d/%d, maxpacket %d\n", musb_ep->end_point.name, len, fifo_count, - musb_ep->wPacketSize); + musb_ep->packet_sz); fifo_count = min(len, fifo_count); @@ -700,7 +700,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) int ret; ret = c->channel_program(channel, - musb_ep->wPacketSize, + musb_ep->packet_sz, channel->desired_mode, dma_addr, fifo_count); @@ -725,7 +725,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) } /* reach the end or short packet detected */ - if (request->actual == request->length || len < musb_ep->wPacketSize) + if (request->actual == request->length || len < musb_ep->packet_sz) musb_g_giveback(musb_ep, request, 0); } @@ -807,7 +807,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) /* Autoclear doesn't clear RxPktRdy for short packets */ if ((dma->desired_mode == 0) || (dma->actual_len - & (musb_ep->wPacketSize - 1))) { + & (musb_ep->packet_sz - 1))) { /* ack the read! */ csr &= ~MGC_M_RXCSR_RXPKTRDY; musb_writew(epio, MGC_O_HDRC_RXCSR, csr); @@ -816,7 +816,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) /* incomplete, and not short? wait for next IN packet */ if ((request->actual < request->length) && (musb_ep->dma->actual_len - == musb_ep->wPacketSize)) + == musb_ep->packet_sz)) goto done; #endif musb_g_giveback(musb_ep, request, 0); @@ -887,7 +887,7 @@ static int musb_gadget_enable(struct usb_ep *ep, tmp = le16_to_cpu(desc->wMaxPacketSize); if (tmp & ~0x07ff) goto fail; - musb_ep->wPacketSize = tmp; + musb_ep->packet_sz = tmp; /* enable the interrupts for the endpoint, set the endpoint * packet size (or fail), set the mode, clear the fifo @@ -983,7 +983,7 @@ static int musb_gadget_enable(struct usb_ep *ep, }; s; }), musb_ep->is_in ? "IN" : "OUT", musb_ep->dma ? "dma, " : "", - musb_ep->wPacketSize); + musb_ep->packet_sz); schedule_work(&musb->irq_work); --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -67,7 +67,7 @@ struct musb_ep { /* ... when enabled/disabled ... */ u8 type; u8 is_in; - u16 wPacketSize; + u16 packet_sz; const struct usb_endpoint_descriptor *desc; struct dma_channel *dma; --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -634,14 +634,14 @@ static void musb_ep_program(struct musb *musb, u8 epnum, struct musb_hw_ep *hw_ep = musb->endpoints + epnum; void __iomem *epio = hw_ep->regs; struct musb_qh *qh; - u16 wPacketSize; + u16 packet_sz; if (!is_out || hw_ep->is_shared_fifo) qh = hw_ep->in_qh; else qh = hw_ep->out_qh; - wPacketSize = qh->maxpacket; + packet_sz = qh->maxpacket; DBG(3, "%s hw%d urb %p spd%d dev%d ep%d%s " "h_addr%02x h_port%02x bytes %d\n", @@ -739,12 +739,12 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_writeb(epio, MGC_O_HDRC_TXTYPE, qh->type_reg); if (can_bulk_split(musb, qh->type)) musb_writew(epio, MGC_O_HDRC_TXMAXP, - wPacketSize + packet_sz | ((hw_ep->max_packet_sz_tx / - wPacketSize) - 1) << 11); + packet_sz) - 1) << 11); else musb_writew(epio, MGC_O_HDRC_TXMAXP, - wPacketSize); + packet_sz); musb_writeb(epio, MGC_O_HDRC_TXINTERVAL, qh->intv_reg); } else { musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, qh->intv_reg); @@ -757,7 +757,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, wLoadCount = min((u32) hw_ep->max_packet_sz_tx, dwLength); else - wLoadCount = min((u32) wPacketSize, dwLength); + wLoadCount = min((u32) packet_sz, dwLength); #ifdef CONFIG_USB_INVENTRA_DMA if (pDmaChannel) { @@ -773,7 +773,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, qh->segsize = min(dwLength, pDmaChannel->max_len); - if (qh->segsize <= wPacketSize) + if (qh->segsize <= packet_sz) pDmaChannel->desired_mode = 0; else pDmaChannel->desired_mode = 1; @@ -792,7 +792,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, musb_writew(epio, MGC_O_HDRC_TXCSR, wCsr); bDmaOk = dma_controller->channel_program( - pDmaChannel, wPacketSize, + pDmaChannel, packet_sz, pDmaChannel->desired_mode, pUrb->transfer_dma, qh->segsize); @@ -831,7 +831,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, * to identify the zero-length-final-packet case. */ bDmaOk = dma_controller->channel_program( - pDmaChannel, wPacketSize, + pDmaChannel, packet_sz, (pUrb->transfer_flags & URB_ZERO_PACKET) == URB_ZERO_PACKET, @@ -916,7 +916,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum, * errors, we dare not queue multiple transfers. */ bDmaOk = dma_controller->channel_program( - pDmaChannel, wPacketSize, + pDmaChannel, packet_sz, !(pUrb->transfer_flags & URB_SHORT_NOT_OK), pUrb->transfer_dma, --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c @@ -171,7 +171,7 @@ static void dma_channel_release(struct dma_channel *pChannel) } static void configure_channel(struct dma_channel *pChannel, - u16 wPacketSize, u8 mode, + u16 packet_sz, u8 mode, dma_addr_t dma_addr, u32 dwLength) { struct musb_dma_channel *pImplChannel = @@ -182,20 +182,20 @@ static void configure_channel(struct dma_channel *pChannel, u16 wCsr = 0; DBG(4, "%p, pkt_sz %d, addr 0x%x, len %d, mode %d\n", - pChannel, wPacketSize, dma_addr, dwLength, mode); + pChannel, packet_sz, dma_addr, dwLength, mode); if (mode) { wCsr |= 1 << MGC_S_HSDMA_MODE1; - if (dwLength < wPacketSize) { + if (dwLength < packet_sz) { return FALSE; } - if (wPacketSize >= 64) { + if (packet_sz >= 64) { wCsr |= MGC_HSDMA_BURSTMODE_INCR16 << MGC_S_HSDMA_BURSTMODE; - } else if (wPacketSize >= 32) { + } else if (packet_sz >= 32) { wCsr |= MGC_HSDMA_BURSTMODE_INCR8 << MGC_S_HSDMA_BURSTMODE; - } else if (wPacketSize >= 16) { + } else if (packet_sz >= 16) { wCsr |= MGC_HSDMA_BURSTMODE_INCR4 << MGC_S_HSDMA_BURSTMODE; } @@ -221,7 +221,7 @@ static void configure_channel(struct dma_channel *pChannel, } static int dma_channel_program(struct dma_channel * pChannel, - u16 wPacketSize, u8 mode, + u16 packet_sz, u8 mode, dma_addr_t dma_addr, u32 dwLength) { struct musb_dma_channel *pImplChannel = @@ -230,7 +230,7 @@ static int dma_channel_program(struct dma_channel * pChannel, DBG(2, "ep%d-%s pkt_sz %d, dma_addr 0x%x length %d, mode %d\n", pImplChannel->epnum, pImplChannel->bTransmit ? "Tx" : "Rx", - wPacketSize, dma_addr, dwLength, mode); + packet_sz, dma_addr, dwLength, mode); BUG_ON(pChannel->status == MGC_DMA_STATUS_UNKNOWN || pChannel->status == MGC_DMA_STATUS_BUSY); @@ -238,14 +238,14 @@ static int dma_channel_program(struct dma_channel * pChannel, pChannel->actual_len = 0; pImplChannel->dwStartAddress = dma_addr; pImplChannel->len = dwLength; - pImplChannel->wMaxPacketSize = wPacketSize; + pImplChannel->wMaxPacketSize = packet_sz; pChannel->status = MGC_DMA_STATUS_BUSY; - if ((mode == 1) && (dwLength >= wPacketSize)) { - configure_channel(pChannel, wPacketSize, 1, dma_addr, + if ((mode == 1) && (dwLength >= packet_sz)) { + configure_channel(pChannel, packet_sz, 1, dma_addr, dwLength); } else - configure_channel(pChannel, wPacketSize, 0, dma_addr, + configure_channel(pChannel, packet_sz, 0, dma_addr, dwLength); return TRUE; -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum 2007-08-13 13:49 ` [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz Tony Lindgren @ 2007-08-13 13:49 ` Tony Lindgren 0 siblings, 0 replies; 57+ messages in thread From: Tony Lindgren @ 2007-08-13 13:49 UTC (permalink / raw) To: linux-omap-open-source Search and replace channelNum with chnum Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/usb/musb/davinci.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/musb/davinci.h +++ b/drivers/usb/musb/davinci.h @@ -64,10 +64,10 @@ /* CPPI state RAM entries */ #define DAVINCI_CPPI_STATERAM_BASE_OFFSET 0x100 -#define DAVINCI_TXCPPI_STATERAM_OFFSET(channelNum) \ - (DAVINCI_CPPI_STATERAM_BASE_OFFSET + ((channelNum)* 0x40)) -#define DAVINCI_RXCPPI_STATERAM_OFFSET(channelNum) \ - (DAVINCI_CPPI_STATERAM_BASE_OFFSET + 0x20 +((channelNum)* 0x40)) +#define DAVINCI_TXCPPI_STATERAM_OFFSET(chnum) \ + (DAVINCI_CPPI_STATERAM_BASE_OFFSET + ((chnum)* 0x40)) +#define DAVINCI_RXCPPI_STATERAM_OFFSET(chnum) \ + (DAVINCI_CPPI_STATERAM_BASE_OFFSET + 0x20 +((chnum)* 0x40)) /* CPPI masks */ #define DAVINCI_DMA_CTRL_ENABLE 1 -- 1.5.2.3 ^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep 2007-08-13 13:48 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren 2007-08-13 13:48 ` [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs Tony Lindgren @ 2007-08-14 9:23 ` Tony Lindgren 1 sibling, 0 replies; 57+ messages in thread From: Tony Lindgren @ 2007-08-14 9:23 UTC (permalink / raw) To: linux-omap-open-source * Tony Lindgren <tony@atomide.com> [070813 06:49]: > Search and replace pEnd with musb_ep when struct musb_hw_ep This should actually say search and replace pEnd with hw_ep when struct musb_hw_ep. The patch does the right thing though. Tony > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > drivers/usb/musb/cppi_dma.c | 8 +- > drivers/usb/musb/musb_host.c | 140 ++++++++++++++++++++-------------------- > drivers/usb/musb/musb_procfs.c | 28 ++++---- > drivers/usb/musb/plat_uds.c | 24 ++++---- > 4 files changed, 100 insertions(+), 100 deletions(-) > > --- a/drivers/usb/musb/cppi_dma.c > +++ b/drivers/usb/musb/cppi_dma.c > @@ -1141,7 +1141,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) > u8 bReqComplete; > struct cppi *cppi; > struct cppi_descriptor *bdPtr; > - struct musb_hw_ep *pEnd = NULL; > + struct musb_hw_ep *hw_ep = NULL; > > cppi = container_of(musb->pDmaController, struct cppi, Controller); > > @@ -1227,7 +1227,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) > txChannel->Channel.bStatus = > MGC_DMA_STATUS_FREE; > > - pEnd = txChannel->hw_ep; > + hw_ep = txChannel->hw_ep; > > txChannel->Channel.dwActualLength = > txChannel->actualLen; > @@ -1245,7 +1245,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) > */ > int csr; > > - csr = musb_readw(pEnd->regs, > + csr = musb_readw(hw_ep->regs, > MGC_O_HDRC_TXCSR); > if (csr & MGC_M_TXCSR_TXPKTRDY) > #endif > @@ -1290,7 +1290,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) > /* all segments completed! */ > rxChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; > > - pEnd = rxChannel->hw_ep; > + hw_ep = rxChannel->hw_ep; > > rxChannel->Channel.dwActualLength = > rxChannel->actualLen; > --- a/drivers/usb/musb/musb_host.c > +++ b/drivers/usb/musb/musb_host.c > @@ -174,10 +174,10 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) > void *pBuffer; > void __iomem *pBase = musb->pRegs; > struct urb *urb = next_urb(qh); > - struct musb_hw_ep *pEnd = qh->hw_ep; > + struct musb_hw_ep *hw_ep = qh->hw_ep; > unsigned nPipe = urb->pipe; > u8 bAddress = usb_pipedevice(nPipe); > - int bEnd = pEnd->bLocalEnd; > + int bEnd = hw_ep->bLocalEnd; > > /* initialize software qh state */ > qh->offset = 0; > @@ -188,7 +188,7 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) > case USB_ENDPOINT_XFER_CONTROL: > /* control transfers always start with SETUP */ > is_in = 0; > - pEnd->out_qh = qh; > + hw_ep->out_qh = qh; > musb->bEnd0Stage = MGC_END0_START; > pBuffer = urb->setup_packet; > dwLength = 8; > @@ -216,10 +216,10 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) > bEnd, pBuffer, dwLength); > > /* Configure endpoint */ > - if (is_in || pEnd->bIsSharedFifo) > - pEnd->in_qh = qh; > + if (is_in || hw_ep->bIsSharedFifo) > + hw_ep->in_qh = qh; > else > - pEnd->out_qh = qh; > + hw_ep->out_qh = qh; > musb_ep_program(musb, bEnd, urb, !is_in, pBuffer, dwLength); > > /* transmit may have more work: start it when it is time */ > @@ -255,12 +255,12 @@ DBG(1,"SOF for %d\n", bEnd); > default: > start: > DBG(4, "Start TX%d %s\n", bEnd, > - pEnd->tx_channel ? "dma" : "pio"); > + hw_ep->tx_channel ? "dma" : "pio"); > > - if (!pEnd->tx_channel) > - musb_h_tx_start(pEnd); > + if (!hw_ep->tx_channel) > + musb_h_tx_start(hw_ep); > else if (is_cppi_enabled() || tusb_dma_omap()) > - cppi_host_txdma_start(pEnd); > + cppi_host_txdma_start(hw_ep); > } > } > > @@ -425,19 +425,19 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) > */ > static void > musb_advance_schedule(struct musb *musb, struct urb *urb, > - struct musb_hw_ep *pEnd, int is_in) > + struct musb_hw_ep *hw_ep, int is_in) > { > struct musb_qh *qh; > > - if (is_in || pEnd->bIsSharedFifo) > - qh = pEnd->in_qh; > + if (is_in || hw_ep->bIsSharedFifo) > + qh = hw_ep->in_qh; > else > - qh = pEnd->out_qh; > + qh = hw_ep->out_qh; > qh = musb_giveback(qh, urb, 0); > > if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) { > DBG(4, "... next ep%d %cX urb %p\n", > - pEnd->bLocalEnd, is_in ? 'R' : 'T', > + hw_ep->bLocalEnd, is_in ? 'R' : 'T', > next_urb(qh)); > musb_start_urb(musb, is_in, qh); > } > @@ -475,9 +475,9 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, > u8 bDone = FALSE; > u32 length; > int do_flush = 0; > - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; > - void __iomem *epio = pEnd->regs; > - struct musb_qh *qh = pEnd->in_qh; > + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; > + void __iomem *epio = hw_ep->regs; > + struct musb_qh *qh = hw_ep->in_qh; > int nPipe = pUrb->pipe; > void *buffer = pUrb->transfer_buffer; > > @@ -542,12 +542,12 @@ static u8 musb_host_packet_rx(struct musb *musb, struct urb *pUrb, > pUrb->status = -EREMOTEIO; > } > > - musb_read_fifo(pEnd, length, pBuffer); > + musb_read_fifo(hw_ep, length, pBuffer); > > wCsr = musb_readw(epio, MGC_O_HDRC_RXCSR); > wCsr |= MGC_M_RXCSR_H_WZC_BITS; > if (unlikely(do_flush)) > - musb_h_flush_rxfifo(pEnd, wCsr); > + musb_h_flush_rxfifo(hw_ep, wCsr); > else { > /* REVISIT this assumes AUTOCLEAR is never set */ > wCsr &= ~(MGC_M_RXCSR_RXPKTRDY | MGC_M_RXCSR_H_REQPKT); > @@ -631,15 +631,15 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > struct dma_channel *pDmaChannel; > u8 bDmaOk; > void __iomem *pBase = musb->pRegs; > - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; > - void __iomem *epio = pEnd->regs; > + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; > + void __iomem *epio = hw_ep->regs; > struct musb_qh *qh; > u16 wPacketSize; > > - if (!is_out || pEnd->bIsSharedFifo) > - qh = pEnd->in_qh; > + if (!is_out || hw_ep->bIsSharedFifo) > + qh = hw_ep->in_qh; > else > - qh = pEnd->out_qh; > + qh = hw_ep->out_qh; > > wPacketSize = qh->maxpacket; > > @@ -656,14 +656,14 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > /* candidate for DMA? */ > pDmaController = musb->pDmaController; > if (is_dma_capable() && bEnd && pDmaController) { > - pDmaChannel = is_out ? pEnd->tx_channel : pEnd->rx_channel; > + pDmaChannel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel; > if (!pDmaChannel) { > pDmaChannel = pDmaController->channel_alloc( > - pDmaController, pEnd, is_out); > + pDmaController, hw_ep, is_out); > if (is_out) > - pEnd->tx_channel = pDmaChannel; > + hw_ep->tx_channel = pDmaChannel; > else > - pEnd->rx_channel = pDmaChannel; > + hw_ep->rx_channel = pDmaChannel; > } > } else > pDmaChannel = NULL; > @@ -689,7 +689,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > /* ASSERT: TXCSR_DMAENAB was already cleared */ > > /* flush all old state, set default */ > - musb_h_tx_flush_fifo(pEnd); > + musb_h_tx_flush_fifo(hw_ep); > csr &= ~(MGC_M_TXCSR_H_NAKTIMEOUT > | MGC_M_TXCSR_DMAMODE > | MGC_M_TXCSR_FRCDATATOG > @@ -740,7 +740,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > if (can_bulk_split(musb, qh->type)) > musb_writew(epio, MGC_O_HDRC_TXMAXP, > wPacketSize > - | ((pEnd->wMaxPacketSizeTx / > + | ((hw_ep->wMaxPacketSizeTx / > wPacketSize) - 1) << 11); > else > musb_writew(epio, MGC_O_HDRC_TXMAXP, > @@ -754,7 +754,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > } > > if (can_bulk_split(musb, qh->type)) > - wLoadCount = min((u32) pEnd->wMaxPacketSizeTx, > + wLoadCount = min((u32) hw_ep->wMaxPacketSizeTx, > dwLength); > else > wLoadCount = min((u32) wPacketSize, dwLength); > @@ -801,9 +801,9 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > } else { > pDmaController->channel_release(pDmaChannel); > if (is_out) > - pEnd->tx_channel = NULL; > + hw_ep->tx_channel = NULL; > else > - pEnd->rx_channel = NULL; > + hw_ep->rx_channel = NULL; > pDmaChannel = NULL; > } > } > @@ -841,7 +841,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > wLoadCount = 0; > } else { > pDmaController->channel_release(pDmaChannel); > - pDmaChannel = pEnd->tx_channel = NULL; > + pDmaChannel = hw_ep->tx_channel = NULL; > > /* REVISIT there's an error path here that > * needs handling: can't do dma, but > @@ -855,7 +855,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > > /* PIO to load FIFO */ > qh->segsize = wLoadCount; > - musb_write_fifo(pEnd, wLoadCount, pBuffer); > + musb_write_fifo(hw_ep, wLoadCount, pBuffer); > wCsr = musb_readw(epio, MGC_O_HDRC_TXCSR); > wCsr &= ~(MGC_M_TXCSR_DMAENAB > | MGC_M_TXCSR_DMAMODE > @@ -874,8 +874,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > } else { > u16 csr; > > - if (pEnd->rx_reinit) { > - musb_rx_reinit(musb, qh, pEnd); > + if (hw_ep->rx_reinit) { > + musb_rx_reinit(musb, qh, hw_ep); > > /* init new state: toggle and NYET, maybe DMA later */ > if (usb_gettoggle(pUrb->dev, qh->epnum, 0)) > @@ -887,13 +887,13 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > csr |= MGC_M_RXCSR_DISNYET; > > } else { > - csr = musb_readw(pEnd->regs, MGC_O_HDRC_RXCSR); > + csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); > > if (csr & (MGC_M_RXCSR_RXPKTRDY > | MGC_M_RXCSR_DMAENAB > | MGC_M_RXCSR_H_REQPKT)) > ERR("broken !rx_reinit, ep%d csr %04x\n", > - pEnd->bLocalEnd, csr); > + hw_ep->bLocalEnd, csr); > > /* scrub any stale state, leaving toggle alone */ > csr &= MGC_M_RXCSR_DISNYET; > @@ -908,8 +908,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > qh->segsize = dwLength; > > /* AUTOREQ is in a DMA register */ > - musb_writew(pEnd->regs, MGC_O_HDRC_RXCSR, csr); > - csr = musb_readw(pEnd->regs, > + musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, csr); > + csr = musb_readw(hw_ep->regs, > MGC_O_HDRC_RXCSR); > > /* unless caller treats short rx transfers as > @@ -924,7 +924,7 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > if (!bDmaOk) { > pDmaController->channel_release( > pDmaChannel); > - pDmaChannel = pEnd->rx_channel = NULL; > + pDmaChannel = hw_ep->rx_channel = NULL; > } else > csr |= MGC_M_RXCSR_DMAENAB; > } > @@ -932,8 +932,8 @@ static void musb_ep_program(struct musb *musb, u8 bEnd, > > csr |= MGC_M_RXCSR_H_REQPKT; > DBG(7, "RXCSR%d := %04x\n", bEnd, csr); > - musb_writew(pEnd->regs, MGC_O_HDRC_RXCSR, csr); > - csr = musb_readw(pEnd->regs, MGC_O_HDRC_RXCSR); > + musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, csr); > + csr = musb_readw(hw_ep->regs, MGC_O_HDRC_RXCSR); > } > } > > @@ -948,8 +948,8 @@ static int musb_h_ep0_continue(struct musb *musb, > int bMore = FALSE; > u8 *pFifoDest = NULL; > u16 wFifoCount = 0; > - struct musb_hw_ep *pEnd = musb->control_ep; > - struct musb_qh *qh = pEnd->in_qh; > + struct musb_hw_ep *hw_ep = musb->control_ep; > + struct musb_qh *qh = hw_ep->in_qh; > struct usb_ctrlrequest *pRequest; > > switch (musb->bEnd0Stage) { > @@ -960,7 +960,7 @@ static int musb_h_ep0_continue(struct musb *musb, > if (wFifoCount < wCount) > pUrb->status = -EOVERFLOW; > > - musb_read_fifo(pEnd, wFifoCount, pFifoDest); > + musb_read_fifo(hw_ep, wFifoCount, pFifoDest); > > pUrb->actual_length += wFifoCount; > if (wCount < qh->maxpacket) { > @@ -998,7 +998,7 @@ static int musb_h_ep0_continue(struct musb *musb, > + pUrb->actual_length); > DBG(3, "Sending %d bytes to %p\n", > wFifoCount, pFifoDest); > - musb_write_fifo(pEnd, wFifoCount, pFifoDest); > + musb_write_fifo(hw_ep, wFifoCount, pFifoDest); > > pUrb->actual_length += wFifoCount; > bMore = TRUE; > @@ -1024,9 +1024,9 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) > u16 wCsrVal, wCount; > int status = 0; > void __iomem *pBase = musb->pRegs; > - struct musb_hw_ep *pEnd = musb->control_ep; > - void __iomem *epio = pEnd->regs; > - struct musb_qh *qh = pEnd->in_qh; > + struct musb_hw_ep *hw_ep = musb->control_ep; > + void __iomem *epio = hw_ep->regs; > + struct musb_qh *qh = hw_ep->in_qh; > u8 bComplete = FALSE; > irqreturn_t retval = IRQ_NONE; > > @@ -1139,7 +1139,7 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) > > /* call completion handler if done */ > if (bComplete) > - musb_advance_schedule(musb, pUrb, pEnd, 1); > + musb_advance_schedule(musb, pUrb, hw_ep, 1); > done: > return retval; > } > @@ -1170,9 +1170,9 @@ void musb_host_tx(struct musb *musb, u8 bEnd) > size_t wLength = 0; > u8 *pBuffer = NULL; > struct urb *pUrb; > - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; > - void __iomem *epio = pEnd->regs; > - struct musb_qh *qh = pEnd->out_qh; > + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; > + void __iomem *epio = hw_ep->regs; > + struct musb_qh *qh = hw_ep->out_qh; > u32 status = 0; > void __iomem *pBase = musb->pRegs; > struct dma_channel *dma; > @@ -1189,7 +1189,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) > } > > nPipe = pUrb->pipe; > - dma = is_dma_capable() ? pEnd->tx_channel : NULL; > + dma = is_dma_capable() ? hw_ep->tx_channel : NULL; > DBG(4, "OUT/TX%d end, csr %04x%s\n", bEnd, wTxCsrVal, > dma ? ", dma" : ""); > > @@ -1233,7 +1233,7 @@ void musb_host_tx(struct musb *musb, u8 bEnd) > /* do the proper sequence to abort the transfer in the > * usb core; the dma engine should already be stopped. > */ > - musb_h_tx_flush_fifo(pEnd); > + musb_h_tx_flush_fifo(hw_ep); > wTxCsrVal &= ~(MGC_M_TXCSR_AUTOSET > | MGC_M_TXCSR_DMAENAB > | MGC_M_TXCSR_H_ERROR > @@ -1309,18 +1309,18 @@ void musb_host_tx(struct musb *musb, u8 bEnd) > /* set status */ > pUrb->status = status; > pUrb->actual_length = qh->offset; > - musb_advance_schedule(musb, pUrb, pEnd, USB_DIR_OUT); > + musb_advance_schedule(musb, pUrb, hw_ep, USB_DIR_OUT); > > } else if (!(wTxCsrVal & MGC_M_TXCSR_DMAENAB)) { > // WARN_ON(!pBuffer); > > - /* REVISIT: some docs say that when pEnd->tx_double_buffered, > + /* REVISIT: some docs say that when hw_ep->tx_double_buffered, > * (and presumably, fifo is not half-full) we should write TWO > * packets before updating TXCSR ... other docs disagree ... > */ > /* PIO: start next packet in this URB */ > wLength = min(qh->maxpacket, (u16) wLength); > - musb_write_fifo(pEnd, wLength, pBuffer); > + musb_write_fifo(hw_ep, wLength, pBuffer); > qh->segsize = wLength; > > MGC_SelectEnd(pBase, bEnd); > @@ -1380,9 +1380,9 @@ finish: > void musb_host_rx(struct musb *musb, u8 bEnd) > { > struct urb *pUrb; > - struct musb_hw_ep *pEnd = musb->aLocalEnd + bEnd; > - void __iomem *epio = pEnd->regs; > - struct musb_qh *qh = pEnd->in_qh; > + struct musb_hw_ep *hw_ep = musb->aLocalEnd + bEnd; > + void __iomem *epio = hw_ep->regs; > + struct musb_qh *qh = hw_ep->in_qh; > size_t xfer_len; > void __iomem *pBase = musb->pRegs; > int nPipe; > @@ -1395,7 +1395,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) > MGC_SelectEnd(pBase, bEnd); > > pUrb = next_urb(qh); > - dma = is_dma_capable() ? pEnd->rx_channel : NULL; > + dma = is_dma_capable() ? hw_ep->rx_channel : NULL; > status = 0; > xfer_len = 0; > > @@ -1408,7 +1408,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) > */ > DBG(3, "BOGUS RX%d ready, csr %04x, count %d\n", bEnd, wVal, > musb_readw(epio, MGC_O_HDRC_RXCOUNT)); > - musb_h_flush_rxfifo(pEnd, MGC_M_RXCSR_CLRDATATOG); > + musb_h_flush_rxfifo(hw_ep, MGC_M_RXCSR_CLRDATATOG); > return; > } > > @@ -1464,7 +1464,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) > (void) musb->pDmaController->channel_abort(dma); > xfer_len = dma->dwActualLength; > } > - musb_h_flush_rxfifo(pEnd, 0); > + musb_h_flush_rxfifo(hw_ep, 0); > musb_writeb(epio, MGC_O_HDRC_RXINTERVAL, 0); > bDone = TRUE; > goto finish; > @@ -1513,7 +1513,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) > | MGC_M_RXCSR_H_AUTOREQ > | MGC_M_RXCSR_AUTOCLEAR > | MGC_M_RXCSR_RXPKTRDY); > - musb_writew(pEnd->regs, MGC_O_HDRC_RXCSR, wVal); > + musb_writew(hw_ep->regs, MGC_O_HDRC_RXCSR, wVal); > > #ifdef CONFIG_USB_INVENTRA_DMA > /* bDone if pUrb buffer is full or short packet is recd */ > @@ -1626,7 +1626,7 @@ void musb_host_rx(struct musb *musb, u8 bEnd) > > if (!status) { > c->channel_release(dma); > - dma = pEnd->rx_channel = NULL; > + dma = hw_ep->rx_channel = NULL; > /* REVISIT reset CSR */ > } > } > @@ -1645,7 +1645,7 @@ finish: > if (bDone) { > if (pUrb->status == -EINPROGRESS) > pUrb->status = status; > - musb_advance_schedule(musb, pUrb, pEnd, USB_DIR_IN); > + musb_advance_schedule(musb, pUrb, hw_ep, USB_DIR_IN); > } > } > > --- a/drivers/usb/musb/musb_procfs.c > +++ b/drivers/usb/musb/musb_procfs.c > @@ -237,14 +237,14 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > { > int code = 0; > char *buf = aBuffer; > - struct musb_hw_ep *pEnd = &musb->aLocalEnd[bEnd]; > + struct musb_hw_ep *hw_ep = &musb->aLocalEnd[bEnd]; > > do { > MGC_SelectEnd(musb->pRegs, bEnd); > #ifdef CONFIG_USB_MUSB_HDRC_HCD > if (is_host_active(musb)) { > int dump_rx, dump_tx; > - void __iomem *regs = pEnd->regs; > + void __iomem *regs = hw_ep->regs; > > /* TEMPORARY (!) until we have a real periodic > * schedule tree ... > @@ -255,7 +255,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > */ > dump_tx = !list_empty(&musb->control); > dump_rx = 0; > - } else if (pEnd == musb->bulk_ep) { > + } else if (hw_ep == musb->bulk_ep) { > dump_tx = !list_empty(&musb->out_bulk); > dump_rx = !list_empty(&musb->in_bulk); > } else if (musb->periodic[bEnd]) { > @@ -277,7 +277,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > "dev %d hub %d port %d" > "\n", > bEnd, > - pEnd->rx_double_buffered > + hw_ep->rx_double_buffered > ? "2buf" : "1buf", > musb_readw(regs, MGC_O_HDRC_RXCSR), > musb_readb(regs, MGC_O_HDRC_RXINTERVAL), > @@ -302,7 +302,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > > if (is_cppi_enabled() > && bEnd > - && pEnd->rx_channel) { > + && hw_ep->rx_channel) { > unsigned cppi = bEnd - 1; > unsigned off1 = cppi << 2; > void __iomem *base; > @@ -337,7 +337,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > max -= code; > } > > - if (pEnd == musb->bulk_ep > + if (hw_ep == musb->bulk_ep > && !list_empty( > &musb->in_bulk)) { > code = dump_queue(&musb->in_bulk, > @@ -365,7 +365,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > "dev %d hub %d port %d" > "\n", > bEnd, > - pEnd->tx_double_buffered > + hw_ep->tx_double_buffered > ? "2buf" : "1buf", > musb_readw(regs, MGC_O_HDRC_TXCSR), > musb_readb(regs, MGC_O_HDRC_TXINTERVAL), > @@ -390,7 +390,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > > if (is_cppi_enabled() > && bEnd > - && pEnd->tx_channel) { > + && hw_ep->tx_channel) { > unsigned cppi = bEnd - 1; > void __iomem *base; > void __iomem *ram; > @@ -418,7 +418,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > max -= code; > } > > - if (pEnd == musb->control_ep > + if (hw_ep == musb->control_ep > && !list_empty( > &musb->control)) { > code = dump_queue(&musb->control, > @@ -428,7 +428,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > code = min(code, (int) max); > buf += code; > max -= code; > - } else if (pEnd == musb->bulk_ep > + } else if (hw_ep == musb->bulk_ep > && !list_empty( > &musb->out_bulk)) { > code = dump_queue(&musb->out_bulk, > @@ -454,16 +454,16 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) > if (is_peripheral_active(musb)) { > code = 0; > > - if (pEnd->ep_in.desc || !bEnd) { > - code = dump_ep(&pEnd->ep_in, buf, max); > + if (hw_ep->ep_in.desc || !bEnd) { > + code = dump_ep(&hw_ep->ep_in, buf, max); > if (code <= 0) > break; > code = min(code, (int) max); > buf += code; > max -= code; > } > - if (pEnd->ep_out.desc) { > - code = dump_ep(&pEnd->ep_out, buf, max); > + if (hw_ep->ep_out.desc) { > + code = dump_ep(&hw_ep->ep_out, buf, max); > if (code <= 0) > break; > code = min(code, (int) max); > --- a/drivers/usb/musb/plat_uds.c > +++ b/drivers/usb/musb/plat_uds.c > @@ -1179,7 +1179,7 @@ static int __init ep_config_from_table(struct musb *musb) > static int __init ep_config_from_hw(struct musb *musb) > { > u8 bEnd = 0, reg; > - struct musb_hw_ep *pEnd; > + struct musb_hw_ep *hw_ep; > void *pBase = musb->pRegs; > > DBG(2, "<== static silicon ep config\n"); > @@ -1188,10 +1188,10 @@ static int __init ep_config_from_hw(struct musb *musb) > > for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) { > MGC_SelectEnd(pBase, bEnd); > - pEnd = musb->aLocalEnd + bEnd; > + hw_ep = musb->aLocalEnd + bEnd; > > /* read from core using indexed model */ > - reg = musb_readb(pEnd->regs, 0x10 + MGC_O_HDRC_FIFOSIZE); > + reg = musb_readb(hw_ep->regs, 0x10 + MGC_O_HDRC_FIFOSIZE); > if (!reg) { > /* 0's returned when no more endpoints */ > break; > @@ -1199,24 +1199,24 @@ static int __init ep_config_from_hw(struct musb *musb) > musb->bEndCount++; > musb->wEndMask |= (1 << bEnd); > > - pEnd->wMaxPacketSizeTx = 1 << (reg & 0x0f); > + hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f); > > /* shared TX/RX FIFO? */ > if ((reg & 0xf0) == 0xf0) { > - pEnd->wMaxPacketSizeRx = pEnd->wMaxPacketSizeTx; > - pEnd->bIsSharedFifo = TRUE; > + hw_ep->wMaxPacketSizeRx = hw_ep->wMaxPacketSizeTx; > + hw_ep->bIsSharedFifo = TRUE; > continue; > } else { > - pEnd->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); > - pEnd->bIsSharedFifo = FALSE; > + hw_ep->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); > + hw_ep->bIsSharedFifo = FALSE; > } > > - /* FIXME set up pEnd->{rx,tx}_double_buffered */ > + /* FIXME set up hw_ep->{rx,tx}_double_buffered */ > > #ifdef CONFIG_USB_MUSB_HDRC_HCD > /* pick an RX/TX endpoint for bulk */ > - if (pEnd->wMaxPacketSizeTx < 512 > - || pEnd->wMaxPacketSizeRx < 512) > + if (hw_ep->wMaxPacketSizeTx < 512 > + || hw_ep->wMaxPacketSizeRx < 512) > continue; > > /* REVISIT: this algorithm is lazy, we should at least > @@ -1224,7 +1224,7 @@ static int __init ep_config_from_hw(struct musb *musb) > */ > if (musb->bulk_ep) > continue; > - musb->bulk_ep = pEnd; > + musb->bulk_ep = hw_ep; > #endif > } > > -- > 1.5.2.3 > ^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: (no subject) 2007-08-13 13:48 (no subject) Tony Lindgren 2007-08-13 13:48 ` [PATCH 1/52] musb_hdrc: Search and replace pThis with musb Tony Lindgren @ 2007-08-13 13:58 ` Felipe Balbi 2007-08-14 8:06 ` musb CaMeLcAsEnOmOre (was: (no subject)) David Brownell 2 siblings, 0 replies; 57+ messages in thread From: Felipe Balbi @ 2007-08-13 13:58 UTC (permalink / raw) To: Tony Lindgren; +Cc: linux-omap-open-source Hi Tony, On 8/13/07, Tony Lindgren <tony@atomide.com> wrote: > As the musb/tusb code now mostly works for host and peripheral, > I'm planning to push a series of search and replace patches > to start converting the musb/tusb driver into something that > follows CodingStyle. > > Following is a list of changes I've done. I haven't gone through > DaVinci or 2430 specific code, as I cannot test them right now. > No functional changes should be included. Code has been tested > with tusb6010. Thanks a lot for your patch series... I was planning to do such cleanup a while ago but got stuck on some activities and this has gone to less priority queue. Anyway, I'll try to get a time to test this patches and I'll report you any trouble I find. :-) > > Regards, > > Tony > > [PATCH 1/52] musb_hdrc: Search and replace pThis with musb > [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep > [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep > [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep > [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs > [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase > [PATCH 7/52] musb_hdrc: Search and replace pSource with src > [PATCH 8/52] musb_hdrc: Search and replace pDest with dst > [PATCH 9/52] musb_hdrc: Search and replace dwCount with len > [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count > [PATCH 11/52] musb_hdrc: Search and replace wCount with len > [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum > [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints > [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints > [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum > [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage > [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum > [PATCH 18/52] musb_hdrc: Search and replace Lock with lock > [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select > [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb > [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host > [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor > [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo > [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx > [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx > [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller > [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint > [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect > [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split > [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine > [PATCH 31/52] musb_hdrc: Search and replace bAddress with address > [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr > [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode > [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver > [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off > [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry > [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data > [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len > [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len > [PATCH 40/52] musb_hdrc: Search and replace bStatus with status > [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode > [PATCH 42/52] musb_hdrc: Search and replace bMode with mode > [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel > [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest > [PATCH 45/52] musb_hdrc: Search and replace bResult with result > [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address > [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip > [PATCH 48/52] musb_hdrc: Search and replace pRequest with request > [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr > [PATCH 50/52] musb_hdrc: Search and replace bTx with tx > [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz > [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum > _______________________________________________ > Linux-omap-open-source mailing list > Linux-omap-open-source@linux.omap.com > http://linux.omap.com/mailman/listinfo/linux-omap-open-source > -- Best Regards, Felipe Balbi felipebalbi@users.sourceforge.net ^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: musb CaMeLcAsEnOmOre (was: (no subject)) 2007-08-13 13:48 (no subject) Tony Lindgren 2007-08-13 13:48 ` [PATCH 1/52] musb_hdrc: Search and replace pThis with musb Tony Lindgren 2007-08-13 13:58 ` (no subject) Felipe Balbi @ 2007-08-14 8:06 ` David Brownell 2007-08-14 8:55 ` Tony Lindgren 2 siblings, 1 reply; 57+ messages in thread From: David Brownell @ 2007-08-14 8:06 UTC (permalink / raw) To: linux-omap-open-source On Monday 13 August 2007, Tony Lindgren wrote: > As the musb/tusb code now mostly works for host and peripheral, > I'm planning to push a series of search and replace patches > to start converting the musb/tusb driver into something that > follows CodingStyle. This is pretty much for *variables* now not types, yes? I thought the types were mostly changed already. And some of the variables (and struct members) but not all. Sounds OK to me. > Following is a list of changes I've done. I haven't gone through > DaVinci or 2430 specific code, as I cannot test them right now. > No functional changes should be included. Code has been tested > with tusb6010. > > Regards, > > Tony > > [PATCH 1/52] musb_hdrc: Search and replace pThis with musb > [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep > [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep > [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep > [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs > [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase > [PATCH 7/52] musb_hdrc: Search and replace pSource with src > [PATCH 8/52] musb_hdrc: Search and replace pDest with dst > [PATCH 9/52] musb_hdrc: Search and replace dwCount with len > [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count > [PATCH 11/52] musb_hdrc: Search and replace wCount with len > [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum > [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints > [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints > [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum > [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage > [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum > [PATCH 18/52] musb_hdrc: Search and replace Lock with lock > [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select > [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb > [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host > [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor > [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo > [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx > [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx > [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller > [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint > [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect > [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split > [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine > [PATCH 31/52] musb_hdrc: Search and replace bAddress with address > [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr > [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode > [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver > [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off > [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry > [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data > [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len > [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len > [PATCH 40/52] musb_hdrc: Search and replace bStatus with status > [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode > [PATCH 42/52] musb_hdrc: Search and replace bMode with mode > [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel > [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest > [PATCH 45/52] musb_hdrc: Search and replace bResult with result > [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address > [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip > [PATCH 48/52] musb_hdrc: Search and replace pRequest with request > [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr > [PATCH 50/52] musb_hdrc: Search and replace bTx with tx > [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz > [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum > _______________________________________________ ^ permalink raw reply [flat|nested] 57+ messages in thread
* Re: musb CaMeLcAsEnOmOre (was: (no subject)) 2007-08-14 8:06 ` musb CaMeLcAsEnOmOre (was: (no subject)) David Brownell @ 2007-08-14 8:55 ` Tony Lindgren 0 siblings, 0 replies; 57+ messages in thread From: Tony Lindgren @ 2007-08-14 8:55 UTC (permalink / raw) To: David Brownell; +Cc: linux-omap-open-source * David Brownell <david-b@pacbell.net> [070814 01:06]: > On Monday 13 August 2007, Tony Lindgren wrote: > > As the musb/tusb code now mostly works for host and peripheral, > > I'm planning to push a series of search and replace patches > > to start converting the musb/tusb driver into something that > > follows CodingStyle. > > This is pretty much for *variables* now not types, yes? Yeah. I mostly went through the musb common .h files and got rid of the camelCasingThere. > I thought the types were mostly changed already. And some of > the variables (and struct members) but not all. Yes, some DMA types needed converting still. There's still some more search and replace left to do. > Sounds OK to me. Will push them today then. If anybody has pending musb patches, it should be trivial to search and replace in the patch. Tony ^ permalink raw reply [flat|nested] 57+ messages in thread
end of thread, other threads:[~2007-08-14 9:23 UTC | newest] Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-08-13 13:48 (no subject) Tony Lindgren 2007-08-13 13:48 ` [PATCH 1/52] musb_hdrc: Search and replace pThis with musb Tony Lindgren 2007-08-13 13:48 ` [PATCH 2/52] musb_hdrc: Search and replace pEndPt with hw_ep Tony Lindgren 2007-08-13 13:48 ` [PATCH 3/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_ep Tony Lindgren 2007-08-13 13:48 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren 2007-08-13 13:48 ` [PATCH 5/52] musb_hdrc: Search and replace pRegs with mregs Tony Lindgren 2007-08-13 13:48 ` [PATCH 6/52] musb_hdrc: Search and replace pBase with mbase Tony Lindgren 2007-08-13 13:48 ` [PATCH 7/52] musb_hdrc: Search and replace pSource with src Tony Lindgren 2007-08-13 13:48 ` [PATCH 8/52] musb_hdrc: Search and replace pDest with dst Tony Lindgren 2007-08-13 13:48 ` [PATCH 9/52] musb_hdrc: Search and replace dwCount with len Tony Lindgren 2007-08-13 13:48 ` [PATCH 10/52] musb_hdrc: Search and replace wFifoCount with fifo_count Tony Lindgren 2007-08-13 13:48 ` [PATCH 11/52] musb_hdrc: Search and replace wCount with len Tony Lindgren 2007-08-13 13:48 ` [PATCH 12/52] musb_hdrc: Search and replace bLocalEnd with epnum Tony Lindgren 2007-08-13 13:48 ` [PATCH 13/52] musb_hdrc: Search and replace aLocalEnd with endpoints Tony Lindgren 2007-08-13 13:48 ` [PATCH 14/52] musb_hdrc: Search and replace bEndCount with nr_endpoints Tony Lindgren 2007-08-13 13:48 ` [PATCH 15/52] musb_hdrc: Search and replace bEndNumber with current_epnum Tony Lindgren 2007-08-13 13:48 ` [PATCH 16/52] musb_hdrc: Search and replace bEnd0Stage with ep0_stage Tony Lindgren 2007-08-13 13:48 ` [PATCH 17/52] musb_hdrc: Search and replace bEnd with epnum Tony Lindgren 2007-08-13 13:48 ` [PATCH 18/52] musb_hdrc: Search and replace Lock with lock Tony Lindgren 2007-08-13 13:48 ` [PATCH 19/52] musb_hdrc: Search and replace MGC_SelectEnd with musb_ep_select Tony Lindgren 2007-08-13 13:48 ` [PATCH 20/52] musb_hdrc: Search and replace _pthis with _musb Tony Lindgren 2007-08-13 13:48 ` [PATCH 21/52] musb_hdrc: Search and replace bIsHost with is_host Tony Lindgren 2007-08-13 13:48 ` [PATCH 22/52] musb_hdrc: Get rid of old unused MUSB_EpFifoDescriptor Tony Lindgren 2007-08-13 13:48 ` [PATCH 23/52] musb_hdrc: Search and replace bIsSharedFifo with is_shared_fifo Tony Lindgren 2007-08-13 13:48 ` [PATCH 24/52] musb_hdrc: Search and replace wMaxPacketSizeTx with max_packet_sz_tx Tony Lindgren 2007-08-13 13:49 ` [PATCH 25/52] musb_hdrc: Search and replace wMaxPacketSizeRx with max_packet_sz_rx Tony Lindgren 2007-08-13 13:49 ` [PATCH 26/52] musb_hdrc: Search and replace pDmaController with dma_controller Tony Lindgren 2007-08-13 13:49 ` [PATCH 27/52] musb_hdrc: Search and replace bIsMultipoint with is_multipoint Tony Lindgren 2007-08-13 13:49 ` [PATCH 28/52] musb_hdrc: Search and replace bIgnoreDisconnect with ignore_disconnect Tony Lindgren 2007-08-13 13:49 ` [PATCH 29/52] musb_hdrc: Search and replace bBulkSplit with bulk_split Tony Lindgren 2007-08-13 13:49 ` [PATCH 30/52] musb_hdrc: Search and replace bBulkCombine with bulk_combine Tony Lindgren 2007-08-13 13:49 ` [PATCH 31/52] musb_hdrc: Search and replace bAddress with address Tony Lindgren 2007-08-13 13:49 ` [PATCH 32/52] musb_hdrc: Search and replace bTestModeValue with test_mode_nr Tony Lindgren 2007-08-13 13:49 ` [PATCH 33/52] musb_hdrc: Search and replace bTestMode with test_mode Tony Lindgren 2007-08-13 13:49 ` [PATCH 34/52] musb_hdrc: Search and replace pGadgetDriver with gadget_driver Tony Lindgren 2007-08-13 13:49 ` [PATCH 35/52] musb_hdrc: Search and replace bDelayPortPowerOff with delay_port_power_off Tony Lindgren 2007-08-13 13:49 ` [PATCH 36/52] musb_hdrc: Search and replace pProcEntry with proc_entry Tony Lindgren 2007-08-13 13:49 ` [PATCH 37/52] musb_hdrc: Search and replace pPrivateData with private_data Tony Lindgren 2007-08-13 13:49 ` [PATCH 38/52] musb_hdrc: Search and replace dwMaxLength with max_len Tony Lindgren 2007-08-13 13:49 ` [PATCH 39/52] musb_hdrc: Search and replace dwActualLength with actual_len Tony Lindgren 2007-08-13 13:49 ` [PATCH 40/52] musb_hdrc: Search and replace bStatus with status Tony Lindgren 2007-08-13 13:49 ` [PATCH 41/52] musb_hdrc: Search and replace bDesiredMode with desired_mode Tony Lindgren 2007-08-13 13:49 ` [PATCH 42/52] musb_hdrc: Search and replace bMode with mode Tony Lindgren 2007-08-13 13:49 ` [PATCH 43/52] musb_hdrc: Search and replace MGC_pfDmaProgramChannel with dma_program_channel Tony Lindgren 2007-08-13 13:49 ` [PATCH 44/52] musb_hdrc: Search and replace pControlRequest with ctrlrequest Tony Lindgren 2007-08-13 13:49 ` [PATCH 45/52] musb_hdrc: Search and replace bResult with result Tony Lindgren 2007-08-13 13:49 ` [PATCH 46/52] musb_hdrc: Search and replace bSetAddress with set_address Tony Lindgren 2007-08-13 13:49 ` [PATCH 47/52] musb_hdrc: Search and replace bRecip with recip Tony Lindgren 2007-08-13 13:49 ` [PATCH 48/52] musb_hdrc: Search and replace pRequest with request Tony Lindgren 2007-08-13 13:49 ` [PATCH 49/52] musb_hdrc: Search and replace wCsrVal with csr Tony Lindgren 2007-08-13 13:49 ` [PATCH 50/52] musb_hdrc: Search and replace bTx with tx Tony Lindgren 2007-08-13 13:49 ` [PATCH 51/52] musb_hdrc: Search and replace wPacketSize with packet_sz Tony Lindgren 2007-08-13 13:49 ` [PATCH 52/52] musb_hdrc: Search and replace channelNum with chnum Tony Lindgren 2007-08-14 9:23 ` [PATCH 4/52] musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep Tony Lindgren 2007-08-13 13:58 ` (no subject) Felipe Balbi 2007-08-14 8:06 ` musb CaMeLcAsEnOmOre (was: (no subject)) David Brownell 2007-08-14 8:55 ` Tony Lindgren
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.