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)
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;
......
This diff is collapsed.
......@@ -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);
......
......@@ -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
}
......
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