Commit 5b895a5c authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Search and replace pEnd with musb_ep when struct musb_hw_ep

Search and replace pEnd with musb_ep when struct musb_hw_ep
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 95c6ac3e
...@@ -1141,7 +1141,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) ...@@ -1141,7 +1141,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx)
u8 bReqComplete; u8 bReqComplete;
struct cppi *cppi; struct cppi *cppi;
struct cppi_descriptor *bdPtr; 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); cppi = container_of(musb->pDmaController, struct cppi, Controller);
...@@ -1227,7 +1227,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) ...@@ -1227,7 +1227,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx)
txChannel->Channel.bStatus = txChannel->Channel.bStatus =
MGC_DMA_STATUS_FREE; MGC_DMA_STATUS_FREE;
pEnd = txChannel->hw_ep; hw_ep = txChannel->hw_ep;
txChannel->Channel.dwActualLength = txChannel->Channel.dwActualLength =
txChannel->actualLen; txChannel->actualLen;
...@@ -1245,7 +1245,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) ...@@ -1245,7 +1245,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx)
*/ */
int csr; int csr;
csr = musb_readw(pEnd->regs, csr = musb_readw(hw_ep->regs,
MGC_O_HDRC_TXCSR); MGC_O_HDRC_TXCSR);
if (csr & MGC_M_TXCSR_TXPKTRDY) if (csr & MGC_M_TXCSR_TXPKTRDY)
#endif #endif
...@@ -1290,7 +1290,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx) ...@@ -1290,7 +1290,7 @@ void cppi_completion(struct musb *musb, u32 rx, u32 tx)
/* all segments completed! */ /* all segments completed! */
rxChannel->Channel.bStatus = MGC_DMA_STATUS_FREE; rxChannel->Channel.bStatus = MGC_DMA_STATUS_FREE;
pEnd = rxChannel->hw_ep; hw_ep = rxChannel->hw_ep;
rxChannel->Channel.dwActualLength = rxChannel->Channel.dwActualLength =
rxChannel->actualLen; rxChannel->actualLen;
......
This diff is collapsed.
...@@ -237,14 +237,14 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -237,14 +237,14 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
{ {
int code = 0; int code = 0;
char *buf = aBuffer; char *buf = aBuffer;
struct musb_hw_ep *pEnd = &musb->aLocalEnd[bEnd]; struct musb_hw_ep *hw_ep = &musb->aLocalEnd[bEnd];
do { do {
MGC_SelectEnd(musb->pRegs, bEnd); MGC_SelectEnd(musb->pRegs, bEnd);
#ifdef CONFIG_USB_MUSB_HDRC_HCD #ifdef CONFIG_USB_MUSB_HDRC_HCD
if (is_host_active(musb)) { if (is_host_active(musb)) {
int dump_rx, dump_tx; int dump_rx, dump_tx;
void __iomem *regs = pEnd->regs; void __iomem *regs = hw_ep->regs;
/* TEMPORARY (!) until we have a real periodic /* TEMPORARY (!) until we have a real periodic
* schedule tree ... * schedule tree ...
...@@ -255,7 +255,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -255,7 +255,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
*/ */
dump_tx = !list_empty(&musb->control); dump_tx = !list_empty(&musb->control);
dump_rx = 0; dump_rx = 0;
} else if (pEnd == musb->bulk_ep) { } else if (hw_ep == musb->bulk_ep) {
dump_tx = !list_empty(&musb->out_bulk); dump_tx = !list_empty(&musb->out_bulk);
dump_rx = !list_empty(&musb->in_bulk); dump_rx = !list_empty(&musb->in_bulk);
} else if (musb->periodic[bEnd]) { } else if (musb->periodic[bEnd]) {
...@@ -277,7 +277,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -277,7 +277,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
"dev %d hub %d port %d" "dev %d hub %d port %d"
"\n", "\n",
bEnd, bEnd,
pEnd->rx_double_buffered hw_ep->rx_double_buffered
? "2buf" : "1buf", ? "2buf" : "1buf",
musb_readw(regs, MGC_O_HDRC_RXCSR), musb_readw(regs, MGC_O_HDRC_RXCSR),
musb_readb(regs, MGC_O_HDRC_RXINTERVAL), musb_readb(regs, MGC_O_HDRC_RXINTERVAL),
...@@ -302,7 +302,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -302,7 +302,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
if (is_cppi_enabled() if (is_cppi_enabled()
&& bEnd && bEnd
&& pEnd->rx_channel) { && hw_ep->rx_channel) {
unsigned cppi = bEnd - 1; unsigned cppi = bEnd - 1;
unsigned off1 = cppi << 2; unsigned off1 = cppi << 2;
void __iomem *base; void __iomem *base;
...@@ -337,7 +337,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -337,7 +337,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
max -= code; max -= code;
} }
if (pEnd == musb->bulk_ep if (hw_ep == musb->bulk_ep
&& !list_empty( && !list_empty(
&musb->in_bulk)) { &musb->in_bulk)) {
code = dump_queue(&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) ...@@ -365,7 +365,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
"dev %d hub %d port %d" "dev %d hub %d port %d"
"\n", "\n",
bEnd, bEnd,
pEnd->tx_double_buffered hw_ep->tx_double_buffered
? "2buf" : "1buf", ? "2buf" : "1buf",
musb_readw(regs, MGC_O_HDRC_TXCSR), musb_readw(regs, MGC_O_HDRC_TXCSR),
musb_readb(regs, MGC_O_HDRC_TXINTERVAL), musb_readb(regs, MGC_O_HDRC_TXINTERVAL),
...@@ -390,7 +390,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -390,7 +390,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
if (is_cppi_enabled() if (is_cppi_enabled()
&& bEnd && bEnd
&& pEnd->tx_channel) { && hw_ep->tx_channel) {
unsigned cppi = bEnd - 1; unsigned cppi = bEnd - 1;
void __iomem *base; void __iomem *base;
void __iomem *ram; void __iomem *ram;
...@@ -418,7 +418,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -418,7 +418,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
max -= code; max -= code;
} }
if (pEnd == musb->control_ep if (hw_ep == musb->control_ep
&& !list_empty( && !list_empty(
&musb->control)) { &musb->control)) {
code = dump_queue(&musb->control, code = dump_queue(&musb->control,
...@@ -428,7 +428,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max) ...@@ -428,7 +428,7 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
code = min(code, (int) max); code = min(code, (int) max);
buf += code; buf += code;
max -= code; max -= code;
} else if (pEnd == musb->bulk_ep } else if (hw_ep == musb->bulk_ep
&& !list_empty( && !list_empty(
&musb->out_bulk)) { &musb->out_bulk)) {
code = dump_queue(&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) ...@@ -454,16 +454,16 @@ dump_end_info(struct musb *musb, u8 bEnd, char *aBuffer, unsigned max)
if (is_peripheral_active(musb)) { if (is_peripheral_active(musb)) {
code = 0; code = 0;
if (pEnd->ep_in.desc || !bEnd) { if (hw_ep->ep_in.desc || !bEnd) {
code = dump_ep(&pEnd->ep_in, buf, max); code = dump_ep(&hw_ep->ep_in, buf, max);
if (code <= 0) if (code <= 0)
break; break;
code = min(code, (int) max); code = min(code, (int) max);
buf += code; buf += code;
max -= code; max -= code;
} }
if (pEnd->ep_out.desc) { if (hw_ep->ep_out.desc) {
code = dump_ep(&pEnd->ep_out, buf, max); code = dump_ep(&hw_ep->ep_out, buf, max);
if (code <= 0) if (code <= 0)
break; break;
code = min(code, (int) max); code = min(code, (int) max);
......
...@@ -1179,7 +1179,7 @@ static int __init ep_config_from_table(struct musb *musb) ...@@ -1179,7 +1179,7 @@ static int __init ep_config_from_table(struct musb *musb)
static int __init ep_config_from_hw(struct musb *musb) static int __init ep_config_from_hw(struct musb *musb)
{ {
u8 bEnd = 0, reg; u8 bEnd = 0, reg;
struct musb_hw_ep *pEnd; struct musb_hw_ep *hw_ep;
void *pBase = musb->pRegs; void *pBase = musb->pRegs;
DBG(2, "<== static silicon ep config\n"); DBG(2, "<== static silicon ep config\n");
...@@ -1188,10 +1188,10 @@ static int __init ep_config_from_hw(struct musb *musb) ...@@ -1188,10 +1188,10 @@ static int __init ep_config_from_hw(struct musb *musb)
for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) { for (bEnd = 1; bEnd < MUSB_C_NUM_EPS; bEnd++) {
MGC_SelectEnd(pBase, bEnd); MGC_SelectEnd(pBase, bEnd);
pEnd = musb->aLocalEnd + bEnd; hw_ep = musb->aLocalEnd + bEnd;
/* read from core using indexed model */ /* 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) { if (!reg) {
/* 0's returned when no more endpoints */ /* 0's returned when no more endpoints */
break; break;
...@@ -1199,24 +1199,24 @@ static int __init ep_config_from_hw(struct musb *musb) ...@@ -1199,24 +1199,24 @@ static int __init ep_config_from_hw(struct musb *musb)
musb->bEndCount++; musb->bEndCount++;
musb->wEndMask |= (1 << bEnd); musb->wEndMask |= (1 << bEnd);
pEnd->wMaxPacketSizeTx = 1 << (reg & 0x0f); hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f);
/* shared TX/RX FIFO? */ /* shared TX/RX FIFO? */
if ((reg & 0xf0) == 0xf0) { if ((reg & 0xf0) == 0xf0) {
pEnd->wMaxPacketSizeRx = pEnd->wMaxPacketSizeTx; hw_ep->wMaxPacketSizeRx = hw_ep->wMaxPacketSizeTx;
pEnd->bIsSharedFifo = TRUE; hw_ep->bIsSharedFifo = TRUE;
continue; continue;
} else { } else {
pEnd->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4); hw_ep->wMaxPacketSizeRx = 1 << ((reg & 0xf0) >> 4);
pEnd->bIsSharedFifo = FALSE; 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 #ifdef CONFIG_USB_MUSB_HDRC_HCD
/* pick an RX/TX endpoint for bulk */ /* pick an RX/TX endpoint for bulk */
if (pEnd->wMaxPacketSizeTx < 512 if (hw_ep->wMaxPacketSizeTx < 512
|| pEnd->wMaxPacketSizeRx < 512) || hw_ep->wMaxPacketSizeRx < 512)
continue; continue;
/* REVISIT: this algorithm is lazy, we should at least /* REVISIT: this algorithm is lazy, we should at least
...@@ -1224,7 +1224,7 @@ static int __init ep_config_from_hw(struct musb *musb) ...@@ -1224,7 +1224,7 @@ static int __init ep_config_from_hw(struct musb *musb)
*/ */
if (musb->bulk_ep) if (musb->bulk_ep)
continue; continue;
musb->bulk_ep = pEnd; musb->bulk_ep = hw_ep;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment