aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/tusb6010.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-11-24 08:46:26 -0500
committerFelipe Balbi <balbi@ti.com>2012-08-09 05:34:46 -0400
commit032ec49f5351e9cb242b1a1c367d14415043ab95 (patch)
treec23887e0302e4fa10a5ee6501a85e69bbd802475 /drivers/usb/musb/tusb6010.c
parent4f3e8d263d34e52e75b5adfa14811467d3033d8e (diff)
usb: musb: drop useless board_mode usage
we are compiling the driver always with full OTG capabilities, so that board_mode trick becomes useless. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/tusb6010.c')
-rw-r--r--drivers/usb/musb/tusb6010.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 4073a6fa2633..1d0c090be78c 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -437,14 +437,13 @@ static void musb_do_idle(unsigned long _musb)
437 if (is_host_active(musb) && (musb->port1_status >> 16)) 437 if (is_host_active(musb) && (musb->port1_status >> 16))
438 goto done; 438 goto done;
439 439
440 if (is_peripheral_enabled(musb) && !musb->gadget_driver) { 440 if (!musb->gadget_driver) {
441 wakeups = 0; 441 wakeups = 0;
442 } else { 442 } else {
443 wakeups = TUSB_PRCM_WHOSTDISCON 443 wakeups = TUSB_PRCM_WHOSTDISCON
444 | TUSB_PRCM_WBUS 444 | TUSB_PRCM_WBUS
445 | TUSB_PRCM_WVBUS; 445 | TUSB_PRCM_WVBUS;
446 if (is_otg_enabled(musb)) 446 wakeups |= TUSB_PRCM_WID;
447 wakeups |= TUSB_PRCM_WID;
448 } 447 }
449 tusb_allow_idle(musb, wakeups); 448 tusb_allow_idle(musb, wakeups);
450 } 449 }
@@ -582,21 +581,12 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on)
582 * 581 *
583 * Note that if a mini-A cable is plugged in the ID line will stay down as 582 * Note that if a mini-A cable is plugged in the ID line will stay down as
584 * the weak ID pull-up is not able to pull the ID up. 583 * the weak ID pull-up is not able to pull the ID up.
585 *
586 * REVISIT: It would be possible to add support for changing between host
587 * and peripheral modes in non-OTG configurations by reconfiguring hardware
588 * and then setting musb->board_mode. For now, only support OTG mode.
589 */ 584 */
590static int tusb_musb_set_mode(struct musb *musb, u8 musb_mode) 585static int tusb_musb_set_mode(struct musb *musb, u8 musb_mode)
591{ 586{
592 void __iomem *tbase = musb->ctrl_base; 587 void __iomem *tbase = musb->ctrl_base;
593 u32 otg_stat, phy_otg_ctrl, phy_otg_ena, dev_conf; 588 u32 otg_stat, phy_otg_ctrl, phy_otg_ena, dev_conf;
594 589
595 if (musb->board_mode != MUSB_OTG) {
596 ERR("Changing mode currently only supported in OTG mode\n");
597 return -EINVAL;
598 }
599
600 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); 590 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT);
601 phy_otg_ctrl = musb_readl(tbase, TUSB_PHY_OTG_CTRL); 591 phy_otg_ctrl = musb_readl(tbase, TUSB_PHY_OTG_CTRL);
602 phy_otg_ena = musb_readl(tbase, TUSB_PHY_OTG_CTRL_ENABLE); 592 phy_otg_ena = musb_readl(tbase, TUSB_PHY_OTG_CTRL_ENABLE);
@@ -652,10 +642,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
652 if ((int_src & TUSB_INT_SRC_ID_STATUS_CHNG)) { 642 if ((int_src & TUSB_INT_SRC_ID_STATUS_CHNG)) {
653 int default_a; 643 int default_a;
654 644
655 if (is_otg_enabled(musb)) 645 default_a = !(otg_stat & TUSB_DEV_OTG_STAT_ID_STATUS);
656 default_a = !(otg_stat & TUSB_DEV_OTG_STAT_ID_STATUS);
657 else
658 default_a = is_host_enabled(musb);
659 dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B'); 646 dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B');
660 otg->default_a = default_a; 647 otg->default_a = default_a;
661 tusb_musb_set_vbus(musb, default_a); 648 tusb_musb_set_vbus(musb, default_a);
@@ -669,8 +656,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
669 if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) { 656 if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) {
670 657
671 /* B-dev state machine: no vbus ~= disconnect */ 658 /* B-dev state machine: no vbus ~= disconnect */
672 if ((is_otg_enabled(musb) && !otg->default_a) 659 if (!otg->default_a) {
673 || !is_host_enabled(musb)) {
674 /* ? musb_root_disconnect(musb); */ 660 /* ? musb_root_disconnect(musb); */
675 musb->port1_status &= 661 musb->port1_status &=
676 ~(USB_PORT_STAT_CONNECTION 662 ~(USB_PORT_STAT_CONNECTION
@@ -1119,10 +1105,8 @@ static int tusb_musb_init(struct musb *musb)
1119 } 1105 }
1120 musb->isr = tusb_musb_interrupt; 1106 musb->isr = tusb_musb_interrupt;
1121 1107
1122 if (is_peripheral_enabled(musb)) { 1108 musb->xceiv->set_power = tusb_draw_power;
1123 musb->xceiv->set_power = tusb_draw_power; 1109 the_musb = musb;
1124 the_musb = musb;
1125 }
1126 1110
1127 setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); 1111 setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
1128 1112