usb: Convert all users to new usb_phy

Use the new usb_phy_* functions with transceiver
operations instead of the old otg functions.

Includes fixes from Sascha Hauer.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Heikki Krogerus 2012-02-13 13:24:18 +02:00 committed by Felipe Balbi
parent b1c711d629
commit b96d3b0836
25 changed files with 86 additions and 83 deletions

View file

@ -608,13 +608,13 @@ static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
writel(val, base + ULPI_TIMING_CTRL_1); writel(val, base + ULPI_TIMING_CTRL_1);
/* Fix VbusInvalid due to floating VBUS */ /* Fix VbusInvalid due to floating VBUS */
ret = otg_io_write(phy->ulpi, 0x40, 0x08); ret = usb_phy_io_write(phy->ulpi, 0x40, 0x08);
if (ret) { if (ret) {
pr_err("%s: ulpi write failed\n", __func__); pr_err("%s: ulpi write failed\n", __func__);
return ret; return ret;
} }
ret = otg_io_write(phy->ulpi, 0x80, 0x0B); ret = usb_phy_io_write(phy->ulpi, 0x80, 0x0B);
if (ret) { if (ret) {
pr_err("%s: ulpi write failed\n", __func__); pr_err("%s: ulpi write failed\n", __func__);
return ret; return ret;

View file

@ -37,10 +37,10 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event)
* Put the transceiver in non-driving mode. Otherwise host * Put the transceiver in non-driving mode. Otherwise host
* may not detect soft-disconnection. * may not detect soft-disconnection.
*/ */
val = otg_io_read(udc->transceiver, ULPI_FUNC_CTRL); val = usb_phy_io_read(udc->transceiver, ULPI_FUNC_CTRL);
val &= ~ULPI_FUNC_CTRL_OPMODE_MASK; val &= ~ULPI_FUNC_CTRL_OPMODE_MASK;
val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; val |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING;
otg_io_write(udc->transceiver, val, ULPI_FUNC_CTRL); usb_phy_io_write(udc->transceiver, val, ULPI_FUNC_CTRL);
break; break;
default: default:
dev_dbg(dev, "unknown ci13xxx_udc event\n"); dev_dbg(dev, "unknown ci13xxx_udc event\n");

View file

@ -2537,7 +2537,7 @@ static int ci13xxx_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
struct ci13xxx *udc = container_of(_gadget, struct ci13xxx, gadget); struct ci13xxx *udc = container_of(_gadget, struct ci13xxx, gadget);
if (udc->transceiver) if (udc->transceiver)
return otg_set_power(udc->transceiver, mA); return usb_phy_set_power(udc->transceiver, mA);
return -ENOTSUPP; return -ENOTSUPP;
} }
@ -2900,7 +2900,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
if (retval < 0) if (retval < 0)
goto free_udc; goto free_udc;
udc->transceiver = otg_get_transceiver(); udc->transceiver = usb_get_transceiver();
if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) { if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
if (udc->transceiver == NULL) { if (udc->transceiver == NULL) {
@ -2946,7 +2946,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
remove_trans: remove_trans:
if (udc->transceiver) { if (udc->transceiver) {
otg_set_peripheral(udc->transceiver, &udc->gadget); otg_set_peripheral(udc->transceiver, &udc->gadget);
otg_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
} }
err("error = %i", retval); err("error = %i", retval);
@ -2958,7 +2958,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
device_unregister(&udc->gadget.dev); device_unregister(&udc->gadget.dev);
put_transceiver: put_transceiver:
if (udc->transceiver) if (udc->transceiver)
otg_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
free_udc: free_udc:
kfree(udc); kfree(udc);
_udc = NULL; _udc = NULL;
@ -2982,7 +2982,7 @@ static void udc_remove(void)
if (udc->transceiver) { if (udc->transceiver) {
otg_set_peripheral(udc->transceiver, &udc->gadget); otg_set_peripheral(udc->transceiver, &udc->gadget);
otg_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
} }
#ifdef CONFIG_USB_GADGET_DEBUG_FILES #ifdef CONFIG_USB_GADGET_DEBUG_FILES
dbg_remove_files(&udc->gadget.dev); dbg_remove_files(&udc->gadget.dev);

View file

@ -1217,7 +1217,7 @@ static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA)
udc = container_of(gadget, struct fsl_udc, gadget); udc = container_of(gadget, struct fsl_udc, gadget);
if (udc->transceiver) if (udc->transceiver)
return otg_set_power(udc->transceiver, mA); return usb_phy_set_power(udc->transceiver, mA);
return -ENOTSUPP; return -ENOTSUPP;
} }
@ -2430,7 +2430,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
if (pdata->operating_mode == FSL_USB2_DR_OTG) { if (pdata->operating_mode == FSL_USB2_DR_OTG) {
udc_controller->transceiver = otg_get_transceiver(); udc_controller->transceiver = usb_get_transceiver();
if (!udc_controller->transceiver) { if (!udc_controller->transceiver) {
ERR("Can't find OTG driver!\n"); ERR("Can't find OTG driver!\n");
ret = -ENODEV; ret = -ENODEV;

View file

@ -1261,9 +1261,9 @@ static int langwell_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__); dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__);
if (dev->transceiver) { if (dev->transceiver) {
dev_vdbg(&dev->pdev->dev, "otg_set_power\n"); dev_vdbg(&dev->pdev->dev, "usb_phy_set_power\n");
dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__); dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__);
return otg_set_power(dev->transceiver, mA); return usb_phy_set_power(dev->transceiver, mA);
} }
dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__); dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__);

View file

@ -2181,7 +2181,7 @@ static int __devinit mv_udc_probe(struct platform_device *dev)
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
if (pdata->mode == MV_USB_MODE_OTG) if (pdata->mode == MV_USB_MODE_OTG)
udc->transceiver = otg_get_transceiver(); udc->transceiver = usb_get_transceiver();
#endif #endif
udc->clknum = pdata->clknum; udc->clknum = pdata->clknum;

View file

@ -1345,7 +1345,7 @@ static int omap_vbus_draw(struct usb_gadget *gadget, unsigned mA)
udc = container_of(gadget, struct omap_udc, gadget); udc = container_of(gadget, struct omap_udc, gadget);
if (udc->transceiver) if (udc->transceiver)
return otg_set_power(udc->transceiver, mA); return usb_phy_set_power(udc->transceiver, mA);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@ -1839,11 +1839,13 @@ static void devstate_irq(struct omap_udc *udc, u16 irq_src)
spin_lock(&udc->lock); spin_lock(&udc->lock);
} }
if (udc->transceiver) if (udc->transceiver)
otg_set_suspend(udc->transceiver, 1); usb_phy_set_suspend(
udc->transceiver, 1);
} else { } else {
VDBG("resume\n"); VDBG("resume\n");
if (udc->transceiver) if (udc->transceiver)
otg_set_suspend(udc->transceiver, 0); usb_phy_set_suspend(
udc->transceiver, 0);
if (udc->gadget.speed == USB_SPEED_FULL if (udc->gadget.speed == USB_SPEED_FULL
&& udc->driver->resume) { && udc->driver->resume) {
spin_unlock(&udc->lock); spin_unlock(&udc->lock);
@ -2863,7 +2865,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)
* use it. Except for OTG, we don't _need_ to talk to one; * use it. Except for OTG, we don't _need_ to talk to one;
* but not having one probably means no VBUS detection. * but not having one probably means no VBUS detection.
*/ */
xceiv = otg_get_transceiver(); xceiv = usb_get_transceiver();
if (xceiv) if (xceiv)
type = xceiv->label; type = xceiv->label;
else if (config->otg) { else if (config->otg) {
@ -3009,7 +3011,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)
cleanup0: cleanup0:
if (xceiv) if (xceiv)
otg_put_transceiver(xceiv); usb_put_transceiver(xceiv);
if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) { if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) {
clk_disable(hhc_clk); clk_disable(hhc_clk);
@ -3039,7 +3041,7 @@ static int __exit omap_udc_remove(struct platform_device *pdev)
pullup_disable(udc); pullup_disable(udc);
if (udc->transceiver) { if (udc->transceiver) {
otg_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
udc->transceiver = NULL; udc->transceiver = NULL;
} }
omap_writew(0, UDC_SYSCON1); omap_writew(0, UDC_SYSCON1);

View file

@ -995,7 +995,7 @@ static int pxa25x_udc_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
udc = container_of(_gadget, struct pxa25x_udc, gadget); udc = container_of(_gadget, struct pxa25x_udc, gadget);
if (udc->transceiver) if (udc->transceiver)
return otg_set_power(udc->transceiver, mA); return usb_phy_set_power(udc->transceiver, mA);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@ -2159,7 +2159,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
dev->mach = pdev->dev.platform_data; dev->mach = pdev->dev.platform_data;
dev->transceiver = otg_get_transceiver(); dev->transceiver = usb_get_transceiver();
if (gpio_is_valid(dev->mach->gpio_pullup)) { if (gpio_is_valid(dev->mach->gpio_pullup)) {
if ((retval = gpio_request(dev->mach->gpio_pullup, if ((retval = gpio_request(dev->mach->gpio_pullup,
@ -2238,7 +2238,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
gpio_free(dev->mach->gpio_pullup); gpio_free(dev->mach->gpio_pullup);
err_gpio_pullup: err_gpio_pullup:
if (dev->transceiver) { if (dev->transceiver) {
otg_put_transceiver(dev->transceiver); usb_put_transceiver(dev->transceiver);
dev->transceiver = NULL; dev->transceiver = NULL;
} }
clk_put(dev->clk); clk_put(dev->clk);
@ -2280,7 +2280,7 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
clk_put(dev->clk); clk_put(dev->clk);
if (dev->transceiver) { if (dev->transceiver) {
otg_put_transceiver(dev->transceiver); usb_put_transceiver(dev->transceiver);
dev->transceiver = NULL; dev->transceiver = NULL;
} }

View file

@ -1666,7 +1666,7 @@ static int pxa_udc_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
udc = to_gadget_udc(_gadget); udc = to_gadget_udc(_gadget);
if (udc->transceiver) if (udc->transceiver)
return otg_set_power(udc->transceiver, mA); return usb_phy_set_power(udc->transceiver, mA);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@ -2463,7 +2463,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
udc->dev = &pdev->dev; udc->dev = &pdev->dev;
udc->mach = pdev->dev.platform_data; udc->mach = pdev->dev.platform_data;
udc->transceiver = otg_get_transceiver(); udc->transceiver = usb_get_transceiver();
gpio = udc->mach->gpio_pullup; gpio = udc->mach->gpio_pullup;
if (gpio_is_valid(gpio)) { if (gpio_is_valid(gpio)) {
@ -2542,7 +2542,7 @@ static int __exit pxa_udc_remove(struct platform_device *_dev)
if (gpio_is_valid(gpio)) if (gpio_is_valid(gpio))
gpio_free(gpio); gpio_free(gpio);
otg_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
udc->transceiver = NULL; udc->transceiver = NULL;
platform_set_drvdata(_dev, NULL); platform_set_drvdata(_dev, NULL);

View file

@ -1243,7 +1243,7 @@ static int s3c_hsudc_vbus_draw(struct usb_gadget *gadget, unsigned mA)
return -ENODEV; return -ENODEV;
if (hsudc->transceiver) if (hsudc->transceiver)
return otg_set_power(hsudc->transceiver, mA); return usb_phy_set_power(hsudc->transceiver, mA);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@ -1275,7 +1275,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
hsudc->dev = dev; hsudc->dev = dev;
hsudc->pd = pdev->dev.platform_data; hsudc->pd = pdev->dev.platform_data;
hsudc->transceiver = otg_get_transceiver(); hsudc->transceiver = usb_get_transceiver();
for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++) for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++)
hsudc->supplies[i].supply = s3c_hsudc_supply_names[i]; hsudc->supplies[i].supply = s3c_hsudc_supply_names[i];
@ -1377,7 +1377,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
err_res: err_res:
if (hsudc->transceiver) if (hsudc->transceiver)
otg_put_transceiver(hsudc->transceiver); usb_put_transceiver(hsudc->transceiver);
regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies); regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
err_supplies: err_supplies:

View file

@ -142,7 +142,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
if (pdata->operating_mode == FSL_USB2_DR_OTG) { if (pdata->operating_mode == FSL_USB2_DR_OTG) {
struct ehci_hcd *ehci = hcd_to_ehci(hcd); struct ehci_hcd *ehci = hcd_to_ehci(hcd);
ehci->transceiver = otg_get_transceiver(); ehci->transceiver = usb_get_transceiver();
dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n",
hcd, ehci, ehci->transceiver); hcd, ehci, ehci->transceiver);

View file

@ -32,7 +32,7 @@
#define MSM_USB_BASE (hcd->regs) #define MSM_USB_BASE (hcd->regs)
static struct usb_phy *otg; static struct usb_phy *phy;
static int ehci_msm_reset(struct usb_hcd *hcd) static int ehci_msm_reset(struct usb_hcd *hcd)
{ {
@ -145,14 +145,14 @@ static int ehci_msm_probe(struct platform_device *pdev)
* powering up VBUS, mapping of registers address space and power * powering up VBUS, mapping of registers address space and power
* management. * management.
*/ */
otg = otg_get_transceiver(); phy = usb_get_transceiver();
if (!otg) { if (!phy) {
dev_err(&pdev->dev, "unable to find transceiver\n"); dev_err(&pdev->dev, "unable to find transceiver\n");
ret = -ENODEV; ret = -ENODEV;
goto unmap; goto unmap;
} }
ret = otg_set_host(otg, &hcd->self); ret = otg_set_host(phy, &hcd->self);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "unable to register with transceiver\n"); dev_err(&pdev->dev, "unable to register with transceiver\n");
goto put_transceiver; goto put_transceiver;
@ -169,7 +169,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
return 0; return 0;
put_transceiver: put_transceiver:
otg_put_transceiver(otg); usb_put_transceiver(phy);
unmap: unmap:
iounmap(hcd->regs); iounmap(hcd->regs);
put_hcd: put_hcd:
@ -186,8 +186,8 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);
otg_set_host(otg, NULL); otg_set_host(phy, NULL);
otg_put_transceiver(otg); usb_put_transceiver(phy);
usb_put_hcd(hcd); usb_put_hcd(hcd);

View file

@ -253,7 +253,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
ehci_mv->mode = pdata->mode; ehci_mv->mode = pdata->mode;
if (ehci_mv->mode == MV_USB_MODE_OTG) { if (ehci_mv->mode == MV_USB_MODE_OTG) {
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
ehci_mv->otg = otg_get_transceiver(); ehci_mv->otg = usb_get_transceiver();
if (!ehci_mv->otg) { if (!ehci_mv->otg) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"unable to find transceiver\n"); "unable to find transceiver\n");
@ -303,7 +303,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
err_put_transceiver: err_put_transceiver:
if (ehci_mv->otg) if (ehci_mv->otg)
otg_put_transceiver(ehci_mv->otg); usb_put_transceiver(ehci_mv->otg);
#endif #endif
err_disable_clk: err_disable_clk:
mv_ehci_disable(ehci_mv); mv_ehci_disable(ehci_mv);
@ -333,7 +333,7 @@ static int mv_ehci_remove(struct platform_device *pdev)
if (ehci_mv->otg) { if (ehci_mv->otg) {
otg_set_host(ehci_mv->otg, NULL); otg_set_host(ehci_mv->otg, NULL);
otg_put_transceiver(ehci_mv->otg); usb_put_transceiver(ehci_mv->otg);
} }
if (ehci_mv->mode == MV_USB_MODE_HOST) { if (ehci_mv->mode == MV_USB_MODE_HOST) {

View file

@ -220,7 +220,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
/* Initialize the transceiver */ /* Initialize the transceiver */
if (pdata->otg) { if (pdata->otg) {
pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET;
ret = otg_init(pdata->otg); ret = usb_phy_init(pdata->otg);
if (ret) { if (ret) {
dev_err(dev, "unable to init transceiver, probably missing\n"); dev_err(dev, "unable to init transceiver, probably missing\n");
ret = -ENODEV; ret = -ENODEV;
@ -247,9 +247,11 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
* It's in violation of USB specs * It's in violation of USB specs
*/ */
if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) { if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) {
flags = otg_io_read(pdata->otg, ULPI_OTG_CTRL); flags = usb_phy_io_read(pdata->otg,
ULPI_OTG_CTRL);
flags |= ULPI_OTG_CTRL_CHRGVBUS; flags |= ULPI_OTG_CTRL_CHRGVBUS;
ret = otg_io_write(pdata->otg, flags, ULPI_OTG_CTRL); ret = usb_phy_io_write(pdata->otg, flags,
ULPI_OTG_CTRL);
if (ret) { if (ret) {
dev_err(dev, "unable to set CHRVBUS\n"); dev_err(dev, "unable to set CHRVBUS\n");
goto err_add; goto err_add;
@ -297,7 +299,7 @@ static int __exit ehci_mxc_drv_remove(struct platform_device *pdev)
pdata->exit(pdev); pdata->exit(pdev);
if (pdata->otg) if (pdata->otg)
otg_shutdown(pdata->otg); usb_phy_shutdown(pdata->otg);
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
iounmap(hcd->regs); iounmap(hcd->regs);

View file

@ -733,7 +733,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
if (pdata->operating_mode == TEGRA_USB_OTG) { if (pdata->operating_mode == TEGRA_USB_OTG) {
tegra->transceiver = otg_get_transceiver(); tegra->transceiver = usb_get_transceiver();
if (tegra->transceiver) if (tegra->transceiver)
otg_set_host(tegra->transceiver, &hcd->self); otg_set_host(tegra->transceiver, &hcd->self);
} }
@ -751,7 +751,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
if (tegra->transceiver) { if (tegra->transceiver) {
otg_set_host(tegra->transceiver, NULL); otg_set_host(tegra->transceiver, NULL);
otg_put_transceiver(tegra->transceiver); usb_put_transceiver(tegra->transceiver);
} }
#endif #endif
tegra_usb_phy_close(tegra->phy); tegra_usb_phy_close(tegra->phy);
@ -809,7 +809,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
if (tegra->transceiver) { if (tegra->transceiver) {
otg_set_host(tegra->transceiver, NULL); otg_set_host(tegra->transceiver, NULL);
otg_put_transceiver(tegra->transceiver); usb_put_transceiver(tegra->transceiver);
} }
#endif #endif

View file

@ -210,7 +210,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
if (need_transceiver) { if (need_transceiver) {
ohci->transceiver = otg_get_transceiver(); ohci->transceiver = usb_get_transceiver();
if (ohci->transceiver) { if (ohci->transceiver) {
int status = otg_set_host(ohci->transceiver, int status = otg_set_host(ohci->transceiver,
&ohci_to_hcd(ohci)->self); &ohci_to_hcd(ohci)->self);

View file

@ -364,7 +364,7 @@ static int am35x_musb_init(struct musb *musb)
return -ENODEV; return -ENODEV;
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; return -ENODEV;
@ -406,7 +406,7 @@ static int am35x_musb_exit(struct musb *musb)
if (data->set_phy_power) if (data->set_phy_power)
data->set_phy_power(0); data->set_phy_power(0);
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;

View file

@ -415,7 +415,7 @@ static int bfin_musb_init(struct musb *musb)
gpio_direction_output(musb->config->gpio_vrsel, 0); gpio_direction_output(musb->config->gpio_vrsel, 0);
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) { if (!musb->xceiv) {
gpio_free(musb->config->gpio_vrsel); gpio_free(musb->config->gpio_vrsel);
return -ENODEV; return -ENODEV;
@ -440,7 +440,7 @@ static int bfin_musb_exit(struct musb *musb)
{ {
gpio_free(musb->config->gpio_vrsel); gpio_free(musb->config->gpio_vrsel);
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
} }

View file

@ -425,7 +425,7 @@ static int da8xx_musb_init(struct musb *musb)
goto fail; goto fail;
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) if (!musb->xceiv)
goto fail; goto fail;
@ -458,7 +458,7 @@ static int da8xx_musb_exit(struct musb *musb)
phy_off(); phy_off();
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;

View file

@ -384,7 +384,7 @@ static int davinci_musb_init(struct musb *musb)
u32 revision; u32 revision;
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; return -ENODEV;
@ -443,7 +443,7 @@ static int davinci_musb_init(struct musb *musb)
return 0; return 0;
fail: fail:
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return -ENODEV; return -ENODEV;
} }
@ -492,7 +492,7 @@ static int davinci_musb_exit(struct musb *musb)
phy_off(); phy_off();
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;

View file

@ -131,9 +131,9 @@ static inline struct musb *dev_to_musb(struct device *dev)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#ifndef CONFIG_BLACKFIN #ifndef CONFIG_BLACKFIN
static int musb_ulpi_read(struct usb_phy *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; int i = 0;
u8 r; u8 r;
u8 power; u8 power;
@ -165,10 +165,9 @@ static int musb_ulpi_read(struct usb_phy *otg, u32 offset)
return musb_readb(addr, MUSB_ULPI_REG_DATA); return musb_readb(addr, MUSB_ULPI_REG_DATA);
} }
static int musb_ulpi_write(struct usb_phy *otg, static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data)
u32 offset, u32 data)
{ {
void __iomem *addr = otg->io_priv; void __iomem *addr = phy->io_priv;
int i = 0; int i = 0;
u8 r = 0; u8 r = 0;
u8 power; u8 power;
@ -200,7 +199,7 @@ static int musb_ulpi_write(struct usb_phy *otg,
#define musb_ulpi_write NULL #define musb_ulpi_write NULL
#endif #endif
static struct otg_io_access_ops musb_ulpi_access = { static struct usb_phy_io_ops musb_ulpi_access = {
.read = musb_ulpi_read, .read = musb_ulpi_read,
.write = musb_ulpi_write, .write = musb_ulpi_write,
}; };

View file

@ -1703,7 +1703,7 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
if (!musb->xceiv->set_power) if (!musb->xceiv->set_power)
return -EOPNOTSUPP; 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) static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)

View file

@ -247,7 +247,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
if (!is_otg_enabled(musb) || musb->gadget_driver) { if (!is_otg_enabled(musb) || musb->gadget_driver) {
pm_runtime_get_sync(musb->controller); pm_runtime_get_sync(musb->controller);
otg_init(musb->xceiv); usb_phy_init(musb->xceiv);
omap2430_musb_set_vbus(musb, 1); omap2430_musb_set_vbus(musb, 1);
} }
break; break;
@ -257,7 +257,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
if (musb->gadget_driver) if (musb->gadget_driver)
pm_runtime_get_sync(musb->controller); pm_runtime_get_sync(musb->controller);
otg_init(musb->xceiv); usb_phy_init(musb->xceiv);
break; break;
case USB_EVENT_NONE: case USB_EVENT_NONE:
@ -273,7 +273,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
if (musb->xceiv->set_vbus) if (musb->xceiv->set_vbus)
otg_set_vbus(musb->xceiv, 0); otg_set_vbus(musb->xceiv, 0);
} }
otg_shutdown(musb->xceiv); usb_phy_shutdown(musb->xceiv);
break; break;
default: default:
dev_dbg(musb->controller, "ID float\n"); dev_dbg(musb->controller, "ID float\n");
@ -291,7 +291,7 @@ static int omap2430_musb_init(struct musb *musb)
* up through ULPI. TWL4030-family PMICs include one, * up through ULPI. TWL4030-family PMICs include one,
* which needs a driver, drivers aren't always needed. * which needs a driver, drivers aren't always needed.
*/ */
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) { if (!musb->xceiv) {
pr_err("HS USB OTG: no transceiver configured\n"); pr_err("HS USB OTG: no transceiver configured\n");
return -ENODEV; return -ENODEV;
@ -326,7 +326,7 @@ static int omap2430_musb_init(struct musb *musb)
musb_readl(musb->mregs, OTG_SIMENABLE)); musb_readl(musb->mregs, OTG_SIMENABLE));
musb->nb.notifier_call = musb_otg_notifications; 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) if (status)
dev_dbg(musb->controller, "notification register failed\n"); dev_dbg(musb->controller, "notification register failed\n");
@ -350,7 +350,7 @@ static void omap2430_musb_enable(struct musb *musb)
switch (musb->xceiv->last_event) { switch (musb->xceiv->last_event) {
case USB_EVENT_ID: case USB_EVENT_ID:
otg_init(musb->xceiv); usb_phy_init(musb->xceiv);
if (data->interface_type != MUSB_INTERFACE_UTMI) if (data->interface_type != MUSB_INTERFACE_UTMI)
break; break;
devctl = musb_readb(musb->mregs, MUSB_DEVCTL); devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
@ -369,7 +369,7 @@ static void omap2430_musb_enable(struct musb *musb)
break; break;
case USB_EVENT_VBUS: case USB_EVENT_VBUS:
otg_init(musb->xceiv); usb_phy_init(musb->xceiv);
break; break;
default: default:
@ -380,7 +380,7 @@ static void omap2430_musb_enable(struct musb *musb)
static void omap2430_musb_disable(struct musb *musb) static void omap2430_musb_disable(struct musb *musb)
{ {
if (musb->xceiv->last_event) if (musb->xceiv->last_event)
otg_shutdown(musb->xceiv); usb_phy_shutdown(musb->xceiv);
} }
static int omap2430_musb_exit(struct musb *musb) static int omap2430_musb_exit(struct musb *musb)
@ -389,7 +389,7 @@ static int omap2430_musb_exit(struct musb *musb)
cancel_work_sync(&musb->otg_notifier_work); cancel_work_sync(&musb->otg_notifier_work);
omap2430_low_level_exit(musb); omap2430_low_level_exit(musb);
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
return 0; return 0;
} }
@ -495,7 +495,7 @@ static int omap2430_runtime_suspend(struct device *dev)
OTG_INTERFSEL); OTG_INTERFSEL);
omap2430_low_level_exit(musb); omap2430_low_level_exit(musb);
otg_set_suspend(musb->xceiv, 1); usb_phy_set_suspend(musb->xceiv, 1);
return 0; return 0;
} }
@ -509,7 +509,7 @@ static int omap2430_runtime_resume(struct device *dev)
musb_writel(musb->mregs, OTG_INTERFSEL, musb_writel(musb->mregs, OTG_INTERFSEL,
musb->context.otg_interfsel); musb->context.otg_interfsel);
otg_set_suspend(musb->xceiv, 0); usb_phy_set_suspend(musb->xceiv, 0);
return 0; return 0;
} }

View file

@ -1078,7 +1078,7 @@ static int tusb_musb_init(struct musb *musb)
int ret; int ret;
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; return -ENODEV;
@ -1130,7 +1130,7 @@ static int tusb_musb_init(struct musb *musb)
if (sync) if (sync)
iounmap(sync); iounmap(sync);
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
} }
return ret; return ret;
@ -1146,7 +1146,7 @@ static int tusb_musb_exit(struct musb *musb)
iounmap(musb->sync_va); iounmap(musb->sync_va);
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
} }

View file

@ -37,7 +37,7 @@ struct ux500_glue {
static int ux500_musb_init(struct musb *musb) static int ux500_musb_init(struct musb *musb)
{ {
musb->xceiv = otg_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) { if (!musb->xceiv) {
pr_err("HS USB OTG: no transceiver configured\n"); pr_err("HS USB OTG: no transceiver configured\n");
return -ENODEV; return -ENODEV;
@ -48,7 +48,7 @@ static int ux500_musb_init(struct musb *musb)
static int ux500_musb_exit(struct musb *musb) static int ux500_musb_exit(struct musb *musb)
{ {
otg_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
return 0; return 0;
} }
@ -160,7 +160,7 @@ static int ux500_suspend(struct device *dev)
struct ux500_glue *glue = dev_get_drvdata(dev); struct ux500_glue *glue = dev_get_drvdata(dev);
struct musb *musb = glue_to_musb(glue); struct musb *musb = glue_to_musb(glue);
otg_set_suspend(musb->xceiv, 1); usb_phy_set_suspend(musb->xceiv, 1);
clk_disable(glue->clk); clk_disable(glue->clk);
return 0; return 0;
@ -178,7 +178,7 @@ static int ux500_resume(struct device *dev)
return ret; return ret;
} }
otg_set_suspend(musb->xceiv, 0); usb_phy_set_suspend(musb->xceiv, 0);
return 0; return 0;
} }