diff options
author | Felipe Balbi <balbi@ti.com> | 2011-11-24 08:46:27 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-08-09 05:34:46 -0400 |
commit | a04d46d02e0c511dabb3c0a29286811a00d12b10 (patch) | |
tree | c673b5cb1704e1a5ed9301284cdefac4ba8069e1 /drivers/usb/musb | |
parent | 032ec49f5351e9cb242b1a1c367d14415043ab95 (diff) |
usb: musb: drop is_host_capable() and is_peripheral_capable()
those two were defined to 1 anyway, quite useless.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 48 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.h | 4 |
2 files changed, 18 insertions, 34 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3d9b64707ba3..4bc2ad8352a7 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -791,7 +791,7 @@ b_host: | |||
791 | */ | 791 | */ |
792 | if (int_usb & MUSB_INTR_RESET) { | 792 | if (int_usb & MUSB_INTR_RESET) { |
793 | handled = IRQ_HANDLED; | 793 | handled = IRQ_HANDLED; |
794 | if (is_host_capable() && (devctl & MUSB_DEVCTL_HM) != 0) { | 794 | if ((devctl & MUSB_DEVCTL_HM) != 0) { |
795 | /* | 795 | /* |
796 | * Looks like non-HS BABBLE can be ignored, but | 796 | * Looks like non-HS BABBLE can be ignored, but |
797 | * HS BABBLE is an error condition. For HS the solution | 797 | * HS BABBLE is an error condition. For HS the solution |
@@ -805,7 +805,7 @@ b_host: | |||
805 | ERR("Stopping host session -- babble\n"); | 805 | ERR("Stopping host session -- babble\n"); |
806 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); | 806 | musb_writeb(musb->mregs, MUSB_DEVCTL, 0); |
807 | } | 807 | } |
808 | } else if (is_peripheral_capable()) { | 808 | } else { |
809 | dev_dbg(musb->controller, "BUS RESET as %s\n", | 809 | dev_dbg(musb->controller, "BUS RESET as %s\n", |
810 | otg_state_string(musb->xceiv->state)); | 810 | otg_state_string(musb->xceiv->state)); |
811 | switch (musb->xceiv->state) { | 811 | switch (musb->xceiv->state) { |
@@ -1564,13 +1564,10 @@ irqreturn_t musb_interrupt(struct musb *musb) | |||
1564 | /* musb_ep_select(musb->mregs, ep_num); */ | 1564 | /* musb_ep_select(musb->mregs, ep_num); */ |
1565 | /* REVISIT just retval = ep->rx_irq(...) */ | 1565 | /* REVISIT just retval = ep->rx_irq(...) */ |
1566 | retval = IRQ_HANDLED; | 1566 | retval = IRQ_HANDLED; |
1567 | if (devctl & MUSB_DEVCTL_HM) { | 1567 | if (devctl & MUSB_DEVCTL_HM) |
1568 | if (is_host_capable()) | 1568 | musb_host_rx(musb, ep_num); |
1569 | musb_host_rx(musb, ep_num); | 1569 | else |
1570 | } else { | 1570 | musb_g_rx(musb, ep_num); |
1571 | if (is_peripheral_capable()) | ||
1572 | musb_g_rx(musb, ep_num); | ||
1573 | } | ||
1574 | } | 1571 | } |
1575 | 1572 | ||
1576 | reg >>= 1; | 1573 | reg >>= 1; |
@@ -1585,13 +1582,10 @@ irqreturn_t musb_interrupt(struct musb *musb) | |||
1585 | /* musb_ep_select(musb->mregs, ep_num); */ | 1582 | /* musb_ep_select(musb->mregs, ep_num); */ |
1586 | /* REVISIT just retval |= ep->tx_irq(...) */ | 1583 | /* REVISIT just retval |= ep->tx_irq(...) */ |
1587 | retval = IRQ_HANDLED; | 1584 | retval = IRQ_HANDLED; |
1588 | if (devctl & MUSB_DEVCTL_HM) { | 1585 | if (devctl & MUSB_DEVCTL_HM) |
1589 | if (is_host_capable()) | 1586 | musb_host_tx(musb, ep_num); |
1590 | musb_host_tx(musb, ep_num); | 1587 | else |
1591 | } else { | 1588 | musb_g_tx(musb, ep_num); |
1592 | if (is_peripheral_capable()) | ||
1593 | musb_g_tx(musb, ep_num); | ||
1594 | } | ||
1595 | } | 1589 | } |
1596 | reg >>= 1; | 1590 | reg >>= 1; |
1597 | ep_num++; | 1591 | ep_num++; |
@@ -1627,22 +1621,16 @@ void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit) | |||
1627 | } else { | 1621 | } else { |
1628 | /* endpoints 1..15 */ | 1622 | /* endpoints 1..15 */ |
1629 | if (transmit) { | 1623 | if (transmit) { |
1630 | if (devctl & MUSB_DEVCTL_HM) { | 1624 | if (devctl & MUSB_DEVCTL_HM) |
1631 | if (is_host_capable()) | 1625 | musb_host_tx(musb, epnum); |
1632 | musb_host_tx(musb, epnum); | 1626 | else |
1633 | } else { | 1627 | musb_g_tx(musb, epnum); |
1634 | if (is_peripheral_capable()) | ||
1635 | musb_g_tx(musb, epnum); | ||
1636 | } | ||
1637 | } else { | 1628 | } else { |
1638 | /* receive */ | 1629 | /* receive */ |
1639 | if (devctl & MUSB_DEVCTL_HM) { | 1630 | if (devctl & MUSB_DEVCTL_HM) |
1640 | if (is_host_capable()) | 1631 | musb_host_rx(musb, epnum); |
1641 | musb_host_rx(musb, epnum); | 1632 | else |
1642 | } else { | 1633 | musb_g_rx(musb, epnum); |
1643 | if (is_peripheral_capable()) | ||
1644 | musb_g_rx(musb, epnum); | ||
1645 | } | ||
1646 | } | 1634 | } |
1647 | } | 1635 | } |
1648 | } | 1636 | } |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 5dab2daddf7f..a1a32c6601c7 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -84,8 +84,6 @@ struct musb_ep; | |||
84 | 84 | ||
85 | /****************************** PERIPHERAL ROLE *****************************/ | 85 | /****************************** PERIPHERAL ROLE *****************************/ |
86 | 86 | ||
87 | #define is_peripheral_capable() (1) | ||
88 | |||
89 | extern irqreturn_t musb_g_ep0_irq(struct musb *); | 87 | extern irqreturn_t musb_g_ep0_irq(struct musb *); |
90 | extern void musb_g_tx(struct musb *, u8); | 88 | extern void musb_g_tx(struct musb *, u8); |
91 | extern void musb_g_rx(struct musb *, u8); | 89 | extern void musb_g_rx(struct musb *, u8); |
@@ -97,8 +95,6 @@ extern void musb_g_disconnect(struct musb *); | |||
97 | 95 | ||
98 | /****************************** HOST ROLE ***********************************/ | 96 | /****************************** HOST ROLE ***********************************/ |
99 | 97 | ||
100 | #define is_host_capable() (1) | ||
101 | |||
102 | extern irqreturn_t musb_h_ep0_irq(struct musb *); | 98 | extern irqreturn_t musb_h_ep0_irq(struct musb *); |
103 | extern void musb_host_tx(struct musb *, u8); | 99 | extern void musb_host_tx(struct musb *, u8); |
104 | extern void musb_host_rx(struct musb *, u8); | 100 | extern void musb_host_rx(struct musb *, u8); |