diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-01 08:45:33 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-01 08:45:33 -0800 |
commit | 8062d94a545457a83d5291bd62c3bfd14200bba0 (patch) | |
tree | a6a7aaaea5dff00f7415a93189720a1164ae30dd /drivers/usb/musb | |
parent | 15e68a803573974409972e761d8f08f03fce5bdb (diff) | |
parent | 6e13c6505cdff9766d5268ffb8c972c1a2f996e6 (diff) |
Merge tag 'xceiv-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB: transceiver changes for 3.4
Here we have a big rework done by Heikki Krogerus (thanks) which
splits OTG functionality away from transceivers.
We have known for quite a long time that struct otg_transceiver was
a bad name for the structure, considering transceiver is far from
being OTG-specific (see 4e67185).
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/am35x.c | 9 | ||||
-rw-r--r-- | drivers/usb/musb/blackfin.c | 6 | ||||
-rw-r--r-- | drivers/usb/musb/da8xx.c | 9 | ||||
-rw-r--r-- | drivers/usb/musb/davinci.c | 13 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 24 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.h | 2 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 13 | ||||
-rw-r--r-- | drivers/usb/musb/musb_virthub.c | 9 | ||||
-rw-r--r-- | drivers/usb/musb/omap2430.c | 35 | ||||
-rw-r--r-- | drivers/usb/musb/tusb6010.c | 22 | ||||
-rw-r--r-- | drivers/usb/musb/ux500.c | 8 |
11 files changed, 80 insertions, 70 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 5285bda1dc4e..9f3eda91ea4d 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -226,6 +226,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci) struct device *dev = musb->controller; struct musb_hdrc_platform_data *plat = dev->platform_data; struct omap_musb_board_data *data = plat->board_data; + struct usb_otg *otg = musb->xceiv->otg; unsigned long flags; irqreturn_t ret = IRQ_NONE; u32 epintr, usbintr; @@ -289,14 +290,14 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci) WARNING("VBUS error workaround (delay coming)\n"); } else if (is_host_enabled(musb) && drvvbus) { MUSB_HST_MODE(musb); - musb->xceiv->default_a = 1; + otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; portstate(musb->port1_status |= USB_PORT_STAT_POWER); del_timer(&otg_workaround); } else { musb->is_active = 0; MUSB_DEV_MODE(musb); - musb->xceiv->default_a = 0; + otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); } @@ -363,7 +364,7 @@ static int am35x_musb_init(struct musb *musb) return -ENODEV; usb_nop_xceiv_register(); - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) return -ENODEV; @@ -405,7 +406,7 @@ static int am35x_musb_exit(struct musb *musb) if (data->set_phy_power) data->set_phy_power(0); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); return 0; diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 261af3487b5e..a087ed6c3be9 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -317,7 +317,7 @@ static void bfin_musb_set_vbus(struct musb *musb, int is_on) musb_readb(musb->mregs, MUSB_DEVCTL)); } -static int bfin_musb_set_power(struct otg_transceiver *x, unsigned mA) +static int bfin_musb_set_power(struct usb_phy *x, unsigned mA) { return 0; } @@ -415,7 +415,7 @@ static int bfin_musb_init(struct musb *musb) gpio_direction_output(musb->config->gpio_vrsel, 0); usb_nop_xceiv_register(); - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) { gpio_free(musb->config->gpio_vrsel); return -ENODEV; @@ -440,7 +440,7 @@ static int bfin_musb_exit(struct musb *musb) { gpio_free(musb->config->gpio_vrsel); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); return 0; } diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 01c8f2ece084..8bd9566f3fbb 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -294,6 +294,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) { struct musb *musb = hci; void __iomem *reg_base = musb->ctrl_base; + struct usb_otg *otg = musb->xceiv->otg; unsigned long flags; irqreturn_t ret = IRQ_NONE; u32 status; @@ -351,14 +352,14 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) WARNING("VBUS error workaround (delay coming)\n"); } else if (is_host_enabled(musb) && drvvbus) { MUSB_HST_MODE(musb); - musb->xceiv->default_a = 1; + otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; portstate(musb->port1_status |= USB_PORT_STAT_POWER); del_timer(&otg_workaround); } else { musb->is_active = 0; MUSB_DEV_MODE(musb); - musb->xceiv->default_a = 0; + otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); } @@ -424,7 +425,7 @@ static int da8xx_musb_init(struct musb *musb) goto fail; usb_nop_xceiv_register(); - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) goto fail; @@ -457,7 +458,7 @@ static int da8xx_musb_exit(struct musb *musb) phy_off(); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); return 0; diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 0ba3e75285cf..97ab975fa442 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -265,6 +265,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci) unsigned long flags; irqreturn_t retval = IRQ_NONE; struct musb *musb = __hci; + struct usb_otg *otg = musb->xceiv->otg; void __iomem *tibase = musb->ctrl_base; struct cppi *cppi; u32 tmp; @@ -331,14 +332,14 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci) WARNING("VBUS error workaround (delay coming)\n"); } else if (is_host_enabled(musb) && drvvbus) { MUSB_HST_MODE(musb); - musb->xceiv->default_a = 1; + otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; portstate(musb->port1_status |= USB_PORT_STAT_POWER); del_timer(&otg_workaround); } else { musb->is_active = 0; MUSB_DEV_MODE(musb); - musb->xceiv->default_a = 0; + otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); } @@ -383,7 +384,7 @@ static int davinci_musb_init(struct musb *musb) u32 revision; usb_nop_xceiv_register(); - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) return -ENODEV; @@ -442,7 +443,7 @@ static int davinci_musb_init(struct musb *musb) return 0; fail: - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); return -ENODEV; } @@ -464,7 +465,7 @@ static int davinci_musb_exit(struct musb *musb) davinci_musb_source_power(musb, 0 /*off*/, 1); /* delay, to avoid problems with module reload */ - if (is_host_enabled(musb) && musb->xceiv->default_a) { + if (is_host_enabled(musb) && musb->xceiv->otg->default_a) { int maxdelay = 30; u8 devctl, warn = 0; @@ -491,7 +492,7 @@ static int davinci_musb_exit(struct musb *musb) phy_off(); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); return 0; diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3746fff628b2..b527e9e6dbac 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -131,9 +131,9 @@ static inline struct musb *dev_to_musb(struct device *dev) /*-------------------------------------------------------------------------*/ #ifndef CONFIG_BLACKFIN -static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset) +static int musb_ulpi_read(struct usb_phy *phy, u32 offset) { - void __iomem *addr = otg->io_priv; + void __iomem *addr = phy->io_priv; int i = 0; u8 r; u8 power; @@ -165,10 +165,9 @@ static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset) return musb_readb(addr, MUSB_ULPI_REG_DATA); } -static int musb_ulpi_write(struct otg_transceiver *otg, - u32 offset, u32 data) +static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) { - void __iomem *addr = otg->io_priv; + void __iomem *addr = phy->io_priv; int i = 0; u8 r = 0; u8 power; @@ -200,7 +199,7 @@ static int musb_ulpi_write(struct otg_transceiver *otg, #define musb_ulpi_write NULL #endif -static struct otg_io_access_ops musb_ulpi_access = { +static struct usb_phy_io_ops musb_ulpi_access = { .read = musb_ulpi_read, .write = musb_ulpi_write, }; @@ -414,6 +413,7 @@ void musb_hnp_stop(struct musb *musb) static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, u8 devctl, u8 power) { + struct usb_otg *otg = musb->xceiv->otg; irqreturn_t handled = IRQ_NONE; dev_dbg(musb->controller, "<== Power=%02x, DevCtl=%02x, int_usb=0x%x\n", power, devctl, @@ -626,7 +626,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, case OTG_STATE_B_PERIPHERAL: musb_g_suspend(musb); musb->is_active = is_otg_enabled(musb) - && musb->xceiv->gadget->b_hnp_enable; + && otg->gadget->b_hnp_enable; if (musb->is_active) { musb->xceiv->state = OTG_STATE_B_WAIT_ACON; dev_dbg(musb->controller, "HNP: Setting timer for b_ase0_brst\n"); @@ -643,7 +643,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, case OTG_STATE_A_HOST: musb->xceiv->state = OTG_STATE_A_SUSPEND; musb->is_active = is_otg_enabled(musb) - && musb->xceiv->host->b_hnp_enable; + && otg->host->b_hnp_enable; break; case OTG_STATE_B_HOST: /* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */ @@ -1961,11 +1961,11 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (is_host_enabled(musb)) { struct usb_hcd *hcd = musb_to_hcd(musb); - otg_set_host(musb->xceiv, &hcd->self); + otg_set_host(musb->xceiv->otg, &hcd->self); if (is_otg_enabled(musb)) hcd->self.otg_port = 1; - musb->xceiv->host = &hcd->self; + musb->xceiv->otg->host = &hcd->self; hcd->power_budget = 2 * (plat->power ? : 250); /* program PHY to use external vBus if required */ @@ -1984,7 +1984,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) struct usb_hcd *hcd = musb_to_hcd(musb); MUSB_HST_MODE(musb); - musb->xceiv->default_a = 1; + musb->xceiv->otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_IDLE; status = usb_add_hcd(musb_to_hcd(musb), -1, 0); @@ -1999,7 +1999,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) } else /* peripheral is enabled */ { MUSB_DEV_MODE(musb); - musb->xceiv->default_a = 0; + musb->xceiv->otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; status = musb_gadget_setup(musb); diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 3d28fb8a2dc9..93de517a32a0 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -372,7 +372,7 @@ struct musb { u16 int_rx; u16 int_tx; - struct otg_transceiver *xceiv; + struct usb_phy *xceiv; u8 xceiv_event; int nIrq; diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 957d9ca3d06d..a495a3079c07 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1642,7 +1642,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) } spin_unlock_irqrestore(&musb->lock, flags); - otg_start_srp(musb->xceiv); + otg_start_srp(musb->xceiv->otg); spin_lock_irqsave(&musb->lock, flags); /* Block idling for at least 1s */ @@ -1721,7 +1721,7 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) if (!musb->xceiv->set_power) return -EOPNOTSUPP; - return otg_set_power(musb->xceiv, mA); + return usb_phy_set_power(musb->xceiv, mA); } static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) @@ -1916,6 +1916,7 @@ static int musb_gadget_start(struct usb_gadget *g, struct usb_gadget_driver *driver) { struct musb *musb = gadget_to_musb(g); + struct usb_otg *otg = musb->xceiv->otg; unsigned long flags; int retval = -EINVAL; @@ -1932,7 +1933,7 @@ static int musb_gadget_start(struct usb_gadget *g, spin_lock_irqsave(&musb->lock, flags); musb->is_active = 1; - otg_set_peripheral(musb->xceiv, &musb->g); + otg_set_peripheral(otg, &musb->g); musb->xceiv->state = OTG_STATE_B_IDLE; /* @@ -1963,8 +1964,8 @@ static int musb_gadget_start(struct usb_gadget *g, } if ((musb->xceiv->last_event == USB_EVENT_ID) - && musb->xceiv->set_vbus) - otg_set_vbus(musb->xceiv, 1); + && otg->set_vbus) + otg_set_vbus(otg, 1); hcd->self.uses_pio_for_control = 1; } @@ -2046,7 +2047,7 @@ static int musb_gadget_stop(struct usb_gadget *g, musb->xceiv->state = OTG_STATE_UNDEFINED; stop_activity(musb, driver); - otg_set_peripheral(musb->xceiv, NULL); + otg_set_peripheral(musb->xceiv->otg, NULL); dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index e9f80adc45a4..22ec3e379980 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c @@ -47,6 +47,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend) { + struct usb_otg *otg = musb->xceiv->otg; u8 power; void __iomem *mbase = musb->mregs; @@ -81,7 +82,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend) case OTG_STATE_A_HOST: musb->xceiv->state = OTG_STATE_A_SUSPEND; musb->is_active = is_otg_enabled(musb) - && musb->xceiv->host->b_hnp_enable; + && otg->host->b_hnp_enable; if (musb->is_active) mod_timer(&musb->otg_timer, jiffies + msecs_to_jiffies( @@ -91,7 +92,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend) case OTG_STATE_B_HOST: musb->xceiv->state = OTG_STATE_B_WAIT_ACON; musb->is_active = is_otg_enabled(musb) - && musb->xceiv->host->b_hnp_enable; + && otg->host->b_hnp_enable; musb_platform_try_idle(musb, 0); break; default: @@ -179,6 +180,8 @@ static void musb_port_reset(struct musb *musb, bool do_reset) void musb_root_disconnect(struct musb *musb) { + struct usb_otg *otg = musb->xceiv->otg; + musb->port1_status = USB_PORT_STAT_POWER | (USB_PORT_STAT_C_CONNECTION << 16); @@ -188,7 +191,7 @@ void musb_root_disconnect(struct musb *musb) switch (musb->xceiv->state) { case OTG_STATE_A_SUSPEND: if (is_otg_enabled(musb) - && musb->xceiv->host->b_hnp_enable) { + && otg->host->b_hnp_enable) { musb->xceiv->state = OTG_STATE_A_PERIPHERAL; musb->g.is_a_peripheral = 1; break; diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index da430c31ebef..2ae0bb309994 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -132,6 +132,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout) static void omap2430_musb_set_vbus(struct musb *musb, int is_on) { + struct usb_otg *otg = musb->xceiv->otg; u8 devctl; unsigned long timeout = jiffies + msecs_to_jiffies(1000); int ret = 1; @@ -163,11 +164,11 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) } } - if (ret && musb->xceiv->set_vbus) - otg_set_vbus(musb->xceiv, 1); + if (ret && otg->set_vbus) + otg_set_vbus(otg, 1); } else { musb->is_active = 1; - musb->xceiv->default_a = 1; + otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; devctl |= MUSB_DEVCTL_SESSION; MUSB_HST_MODE(musb); @@ -179,7 +180,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) * jumping right to B_IDLE... */ - musb->xceiv->default_a = 0; + otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; devctl &= ~MUSB_DEVCTL_SESSION; @@ -246,7 +247,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) if (!is_otg_enabled(musb) || musb->gadget_driver) { pm_runtime_get_sync(musb->controller); - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); omap2430_musb_set_vbus(musb, 1); } break; @@ -256,7 +257,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) if (musb->gadget_driver) pm_runtime_get_sync(musb->controller); - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); break; case USB_EVENT_NONE: @@ -269,10 +270,10 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) } if (data->interface_type == MUSB_INTERFACE_UTMI) { - if (musb->xceiv->set_vbus) - otg_set_vbus(musb->xceiv, 0); + if (musb->xceiv->otg->set_vbus) + otg_set_vbus(musb->xceiv->otg, 0); } - otg_shutdown(musb->xceiv); + usb_phy_shutdown(musb->xceiv); break; default: dev_dbg(musb->controller, "ID float\n"); @@ -290,7 +291,7 @@ static int omap2430_musb_init(struct musb *musb) * up through ULPI. TWL4030-family PMICs include one, * which needs a driver, drivers aren't always needed. */ - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) { pr_err("HS USB OTG: no transceiver configured\n"); return -ENODEV; @@ -325,7 +326,7 @@ static int omap2430_musb_init(struct musb *musb) musb_readl(musb->mregs, OTG_SIMENABLE)); musb->nb.notifier_call = musb_otg_notifications; - status = otg_register_notifier(musb->xceiv, &musb->nb); + status = usb_register_notifier(musb->xceiv, &musb->nb); if (status) dev_dbg(musb->controller, "notification register failed\n"); @@ -349,7 +350,7 @@ static void omap2430_musb_enable(struct musb *musb) switch (musb->xceiv->last_event) { case USB_EVENT_ID: - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); if (data->interface_type != MUSB_INTERFACE_UTMI) break; devctl = musb_readb(musb->mregs, MUSB_DEVCTL); @@ -368,7 +369,7 @@ static void omap2430_musb_enable(struct musb *musb) break; case USB_EVENT_VBUS: - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); break; default: @@ -379,7 +380,7 @@ static void omap2430_musb_enable(struct musb *musb) static void omap2430_musb_disable(struct musb *musb) { if (musb->xceiv->last_event) - otg_shutdown(musb->xceiv); + usb_phy_shutdown(musb->xceiv); } static int omap2430_musb_exit(struct musb *musb) @@ -388,7 +389,7 @@ static int omap2430_musb_exit(struct musb *musb) cancel_work_sync(&musb->otg_notifier_work); omap2430_low_level_exit(musb); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); return 0; } @@ -494,7 +495,7 @@ static int omap2430_runtime_suspend(struct device *dev) OTG_INTERFSEL); omap2430_low_level_exit(musb); - otg_set_suspend(musb->xceiv, 1); + usb_phy_set_suspend(musb->xceiv, 1); return 0; } @@ -508,7 +509,7 @@ static int omap2430_runtime_resume(struct device *dev) musb_writel(musb->mregs, OTG_INTERFSEL, musb->context.otg_interfsel); - otg_set_suspend(musb->xceiv, 0); + usb_phy_set_suspend(musb->xceiv, 0); return 0; } diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index b387f12d05b8..de1355946a83 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -277,7 +277,7 @@ static struct musb *the_musb; * mode), or low power Default-B sessions, something else supplies power. * Caller must take care of locking. */ -static int tusb_draw_power(struct otg_transceiver *x, unsigned mA) +static int tusb_draw_power(struct usb_phy *x, unsigned mA) { struct musb *musb = the_musb; void __iomem *tbase = musb->ctrl_base; @@ -293,7 +293,7 @@ static int tusb_draw_power(struct otg_transceiver *x, unsigned mA) * The actual current usage would be very board-specific. For now, * it's simpler to just use an aggregate (also board-specific). */ - if (x->default_a || mA < (musb->min_power << 1)) + if (x->otg->default_a || mA < (musb->min_power << 1)) mA = 0; reg = musb_readl(tbase, TUSB_PRCM_MNGMT); @@ -510,6 +510,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) void __iomem *tbase = musb->ctrl_base; u32 conf, prcm, timer; u8 devctl; + struct usb_otg *otg = musb->xceiv->otg; /* HDRC controls CPEN, but beware current surges during device * connect. They can trigger transient overcurrent conditions @@ -522,7 +523,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) if (is_on) { timer = OTG_TIMER_MS(OTG_TIME_A_WAIT_VRISE); - musb->xceiv->default_a = 1; + otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; devctl |= MUSB_DEVCTL_SESSION; @@ -548,11 +549,11 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on) musb->xceiv->state = OTG_STATE_A_IDLE; } musb->is_active = 0; - musb->xceiv->default_a = 1; + otg->default_a = 1; MUSB_HST_MODE(musb); } else { musb->is_active = 0; - musb->xceiv->default_a = 0; + otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; MUSB_DEV_MODE(musb); } @@ -644,6 +645,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) { u32 otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); unsigned long idle_timeout = 0; + struct usb_otg *otg = musb->xceiv->otg; /* ID pin */ 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) else default_a = is_host_enabled(musb); dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B'); - musb->xceiv->default_a = default_a; + otg->default_a = default_a; tusb_musb_set_vbus(musb, default_a); /* Don't allow idling immediately */ @@ -666,7 +668,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) if (int_src & TUSB_INT_SRC_VBUS_SENSE_CHNG) { /* B-dev state machine: no vbus ~= disconnect */ - if ((is_otg_enabled(musb) && !musb->xceiv->default_a) + if ((is_otg_enabled(musb) && !otg->default_a) || !is_host_enabled(musb)) { /* ? musb_root_disconnect(musb); */ musb->port1_status &= @@ -1076,7 +1078,7 @@ static int tusb_musb_init(struct musb *musb) int ret; usb_nop_xceiv_register(); - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) return -ENODEV; @@ -1128,7 +1130,7 @@ done: if (sync) iounmap(sync); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); } return ret; @@ -1144,7 +1146,7 @@ static int tusb_musb_exit(struct musb *musb) iounmap(musb->sync_va); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); usb_nop_xceiv_unregister(); return 0; } diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index bcfc48f4854a..aa09dd417b94 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -37,7 +37,7 @@ struct ux500_glue { static int ux500_musb_init(struct musb *musb) { - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) { pr_err("HS USB OTG: no transceiver configured\n"); return -ENODEV; @@ -48,7 +48,7 @@ static int ux500_musb_init(struct musb *musb) static int ux500_musb_exit(struct musb *musb) { - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); return 0; } @@ -160,7 +160,7 @@ static int ux500_suspend(struct device *dev) struct ux500_glue *glue = dev_get_drvdata(dev); struct musb *musb = glue_to_musb(glue); - otg_set_suspend(musb->xceiv, 1); + usb_phy_set_suspend(musb->xceiv, 1); clk_disable(glue->clk); return 0; @@ -178,7 +178,7 @@ static int ux500_resume(struct device *dev) return ret; } - otg_set_suspend(musb->xceiv, 0); + usb_phy_set_suspend(musb->xceiv, 0); return 0; } |