diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2012-02-13 06:24:15 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-02-13 06:52:54 -0500 |
commit | d445b6da8da491e025eb60576ce959f6a3a56a4f (patch) | |
tree | 06bf3afc86c3c6248a9c2d980cf359bdb008447e /drivers/usb/musb/tusb6010.c | |
parent | 76eb57ec1bf3201d2f417cafa5c974e7c0b6aaf9 (diff) |
usb: musb: Start using struct usb_otg
Use struct usb_otg members with OTG specific functions instead
of usb_phy members.
[ balbi@ti.com: added a missing change on musb_gadget.c to avoid
a compile error on a later patch ]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/tusb6010.c')
-rw-r--r-- | drivers/usb/musb/tusb6010.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 5ce01bdb1951..0665c14cc540 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -293,7 +293,7 @@ static int tusb_draw_power(struct usb_phy *x, unsigned mA) | |||
293 | * The actual current usage would be very board-specific. For now, | 293 | * The actual current usage would be very board-specific. For now, |
294 | * it's simpler to just use an aggregate (also board-specific). | 294 | * it's simpler to just use an aggregate (also board-specific). |
295 | */ | 295 | */ |
296 | if (x->default_a || mA < (musb->min_power << 1)) | 296 | if (x->otg->default_a || mA < (musb->min_power << 1)) |
297 | mA = 0; | 297 | mA = 0; |
298 | 298 | ||
299 | reg = musb_readl(tbase, TUSB_PRCM_MNGMT); | 299 | reg = musb_readl(tbase, TUSB_PRCM_MNGMT); |
@@ -510,6 +510,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) | |||
510 | void __iomem *tbase = musb->ctrl_base; | 510 | void __iomem *tbase = musb->ctrl_base; |
511 | u32 conf, prcm, timer; | 511 | u32 conf, prcm, timer; |
512 | u8 devctl; | 512 | u8 devctl; |
513 | struct usb_otg *otg = musb->xceiv->otg; | ||
513 | 514 | ||
514 | /* HDRC controls CPEN, but beware current surges during device | 515 | /* HDRC controls CPEN, but beware current surges during device |
515 | * connect. They can trigger transient overcurrent conditions | 516 | * connect. They can trigger transient overcurrent conditions |
@@ -522,7 +523,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) | |||
522 | 523 | ||
523 | if (is_on) { | 524 | if (is_on) { |
524 | timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE); | 525 | timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE); |
525 | musb->xceiv->default_a = 1; | 526 | otg->default_a = 1; |
526 | musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; | 527 | musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; |
527 | devctl |= MUSB_DEVCTL_SESSION; | 528 | devctl |= MUSB_DEVCTL_SESSION; |
528 | 529 | ||
@@ -548,11 +549,11 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) | |||
548 | musb->xceiv->state = OTG_STATE_A_IDLE; | 549 | musb->xceiv->state = OTG_STATE_A_IDLE; |
549 | } | 550 | } |
550 | musb->is_active = 0; | 551 | musb->is_active = 0; |
551 | musb->xceiv->default_a = 1; | 552 | otg->default_a = 1; |
552 | MUSB_HST_MODE(musb); | 553 | MUSB_HST_MODE(musb); |
553 | } else { | 554 | } else { |
554 | musb->is_active = 0; | 555 | musb->is_active = 0; |
555 | musb->xceiv->default_a = 0; | 556 | otg->default_a = 0; |
556 | musb->xceiv->state = OTG_STATE_B_IDLE; | 557 | musb->xceiv->state = OTG_STATE_B_IDLE; |
557 | MUSB_DEV_MODE(musb); | 558 | MUSB_DEV_MODE(musb); |
558 | } | 559 | } |
@@ -644,6 +645,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) | |||
644 | { | 645 | { |
645 | u32 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); | 646 | u32 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); |
646 | unsigned long idle_timeout = 0; | 647 | unsigned long idle_timeout = 0; |
648 | struct usb_otg *otg = musb->xceiv->otg; | ||
647 | 649 | ||
648 | /* ID pin */ | 650 | /* ID pin */ |
649 | if ((int_src & TUSB_INT_SRC_ID_STATUS_CHNG)) { | 651 | if ((int_src & TUSB_INT_SRC_ID_STATUS_CHNG)) { |
@@ -654,7 +656,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) | |||
654 | else | 656 | else |
655 | default_a = is_host_enabled(musb); | 657 | default_a = is_host_enabled(musb); |
656 | dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B'); | 658 | dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B'); |
657 | musb->xceiv->default_a = default_a; | 659 | otg->default_a = default_a; |
658 | tusb_musb_set_vbus(musb, default_a); | 660 | tusb_musb_set_vbus(musb, default_a); |
659 | 661 | ||
660 | /* Don't allow idling immediately */ | 662 | /* Don't allow idling immediately */ |
@@ -666,7 +668,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) | |||
666 | if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) { | 668 | if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) { |
667 | 669 | ||
668 | /* B-dev state machine: no vbus ~= disconnect */ | 670 | /* B-dev state machine: no vbus ~= disconnect */ |
669 | if ((is_otg_enabled(musb) && !musb->xceiv->default_a) | 671 | if ((is_otg_enabled(musb) && !otg->default_a) |
670 | || !is_host_enabled(musb)) { | 672 | || !is_host_enabled(musb)) { |
671 | /* ? musb_root_disconnect(musb); */ | 673 | /* ? musb_root_disconnect(musb); */ |
672 | musb->port1_status &= | 674 | musb->port1_status &= |