Commit a04d46d0 authored by Felipe Balbi's avatar Felipe Balbi

usb: musb: drop is_host_capable() and is_peripheral_capable()

those two were defined to 1 anyway, quite useless.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 032ec49f
...@@ -791,7 +791,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -791,7 +791,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
*/ */
if (int_usb & MUSB_INTR_RESET) { if (int_usb & MUSB_INTR_RESET) {
handled = IRQ_HANDLED; handled = IRQ_HANDLED;
if (is_host_capable() && (devctl & MUSB_DEVCTL_HM) != 0) { if ((devctl & MUSB_DEVCTL_HM) != 0) {
/* /*
* Looks like non-HS BABBLE can be ignored, but * Looks like non-HS BABBLE can be ignored, but
* HS BABBLE is an error condition. For HS the solution * HS BABBLE is an error condition. For HS the solution
...@@ -805,7 +805,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -805,7 +805,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
ERR("Stopping host session -- babble\n"); ERR("Stopping host session -- babble\n");
musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
} }
} else if (is_peripheral_capable()) { } else {
dev_dbg(musb->controller, "BUS RESET as %s\n", dev_dbg(musb->controller, "BUS RESET as %s\n",
otg_state_string(musb->xceiv->state)); otg_state_string(musb->xceiv->state));
switch (musb->xceiv->state) { switch (musb->xceiv->state) {
...@@ -1564,14 +1564,11 @@ irqreturn_t musb_interrupt(struct musb *musb) ...@@ -1564,14 +1564,11 @@ irqreturn_t musb_interrupt(struct musb *musb)
/* musb_ep_select(musb->mregs, ep_num); */ /* musb_ep_select(musb->mregs, ep_num); */
/* REVISIT just retval = ep->rx_irq(...) */ /* REVISIT just retval = ep->rx_irq(...) */
retval = IRQ_HANDLED; retval = IRQ_HANDLED;
if (devctl & MUSB_DEVCTL_HM) { if (devctl & MUSB_DEVCTL_HM)
if (is_host_capable())
musb_host_rx(musb, ep_num); musb_host_rx(musb, ep_num);
} else { else
if (is_peripheral_capable())
musb_g_rx(musb, ep_num); musb_g_rx(musb, ep_num);
} }
}
reg >>= 1; reg >>= 1;
ep_num++; ep_num++;
...@@ -1585,14 +1582,11 @@ irqreturn_t musb_interrupt(struct musb *musb) ...@@ -1585,14 +1582,11 @@ irqreturn_t musb_interrupt(struct musb *musb)
/* musb_ep_select(musb->mregs, ep_num); */ /* musb_ep_select(musb->mregs, ep_num); */
/* REVISIT just retval |= ep->tx_irq(...) */ /* REVISIT just retval |= ep->tx_irq(...) */
retval = IRQ_HANDLED; retval = IRQ_HANDLED;
if (devctl & MUSB_DEVCTL_HM) { if (devctl & MUSB_DEVCTL_HM)
if (is_host_capable())
musb_host_tx(musb, ep_num); musb_host_tx(musb, ep_num);
} else { else
if (is_peripheral_capable())
musb_g_tx(musb, ep_num); musb_g_tx(musb, ep_num);
} }
}
reg >>= 1; reg >>= 1;
ep_num++; ep_num++;
} }
...@@ -1627,24 +1621,18 @@ void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit) ...@@ -1627,24 +1621,18 @@ void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit)
} else { } else {
/* endpoints 1..15 */ /* endpoints 1..15 */
if (transmit) { if (transmit) {
if (devctl & MUSB_DEVCTL_HM) { if (devctl & MUSB_DEVCTL_HM)
if (is_host_capable())
musb_host_tx(musb, epnum); musb_host_tx(musb, epnum);
} else { else
if (is_peripheral_capable())
musb_g_tx(musb, epnum); musb_g_tx(musb, epnum);
}
} else { } else {
/* receive */ /* receive */
if (devctl & MUSB_DEVCTL_HM) { if (devctl & MUSB_DEVCTL_HM)
if (is_host_capable())
musb_host_rx(musb, epnum); musb_host_rx(musb, epnum);
} else { else
if (is_peripheral_capable())
musb_g_rx(musb, epnum); musb_g_rx(musb, epnum);
} }
} }
}
} }
EXPORT_SYMBOL_GPL(musb_dma_completion); EXPORT_SYMBOL_GPL(musb_dma_completion);
......
...@@ -84,8 +84,6 @@ struct musb_ep; ...@@ -84,8 +84,6 @@ struct musb_ep;
/****************************** PERIPHERAL ROLE *****************************/ /****************************** PERIPHERAL ROLE *****************************/
#define is_peripheral_capable() (1)
extern irqreturn_t musb_g_ep0_irq(struct musb *); extern irqreturn_t musb_g_ep0_irq(struct musb *);
extern void musb_g_tx(struct musb *, u8); extern void musb_g_tx(struct musb *, u8);
extern void musb_g_rx(struct musb *, u8); extern void musb_g_rx(struct musb *, u8);
...@@ -97,8 +95,6 @@ extern void musb_g_disconnect(struct musb *); ...@@ -97,8 +95,6 @@ extern void musb_g_disconnect(struct musb *);
/****************************** HOST ROLE ***********************************/ /****************************** HOST ROLE ***********************************/
#define is_host_capable() (1)
extern irqreturn_t musb_h_ep0_irq(struct musb *); extern irqreturn_t musb_h_ep0_irq(struct musb *);
extern void musb_host_tx(struct musb *, u8); extern void musb_host_tx(struct musb *, u8);
extern void musb_host_rx(struct musb *, u8); extern void musb_host_rx(struct musb *, u8);
......
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