diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2012-02-13 13:24:18 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-02-27 15:41:48 +0200 |
commit | b96d3b08365f5a9603f50f3aadca6012f7eaffa1 (patch) | |
tree | fceda0fed3b03c96353dc8cd21a965ba986e3e09 /drivers/usb/gadget | |
parent | b1c711d629358576e8896a18e74cd5f4d811d7f7 (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/ci13xxx_msm.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/ci13xxx_udc.c | 10 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/langwell_udc.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/mv_udc_core.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 14 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa25x_udc.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa27x_udc.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsudc.c | 6 |
9 files changed, 30 insertions, 28 deletions
diff --git a/drivers/usb/gadget/ci13xxx_msm.c b/drivers/usb/gadget/ci13xxx_msm.c index 1fc612914c52..d07e44c05e9b 100644 --- a/drivers/usb/gadget/ci13xxx_msm.c +++ b/drivers/usb/gadget/ci13xxx_msm.c @@ -37,10 +37,10 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) * Put the transceiver in non-driving mode. Otherwise host * 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_NONDRIVING; - otg_io_write(udc->transceiver, val, ULPI_FUNC_CTRL); + usb_phy_io_write(udc->transceiver, val, ULPI_FUNC_CTRL); break; default: dev_dbg(dev, "unknown ci13xxx_udc event\n"); diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 27e313718422..68ad160f2589 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c @@ -2537,7 +2537,7 @@ static int ci13xxx_vbus_draw(struct usb_gadget *_gadget, unsigned mA) struct ci13xxx *udc = container_of(_gadget, struct ci13xxx, gadget); if (udc->transceiver) - return otg_set_power(udc->transceiver, mA); + return usb_phy_set_power(udc->transceiver, mA); return -ENOTSUPP; } @@ -2900,7 +2900,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, if (retval < 0) goto free_udc; - udc->transceiver = otg_get_transceiver(); + udc->transceiver = usb_get_transceiver(); if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) { if (udc->transceiver == NULL) { @@ -2946,7 +2946,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, remove_trans: if (udc->transceiver) { otg_set_peripheral(udc->transceiver, &udc->gadget); - otg_put_transceiver(udc->transceiver); + usb_put_transceiver(udc->transceiver); } err("error = %i", retval); @@ -2958,7 +2958,7 @@ unreg_device: device_unregister(&udc->gadget.dev); put_transceiver: if (udc->transceiver) - otg_put_transceiver(udc->transceiver); + usb_put_transceiver(udc->transceiver); free_udc: kfree(udc); _udc = NULL; @@ -2982,7 +2982,7 @@ static void udc_remove(void) if (udc->transceiver) { otg_set_peripheral(udc->transceiver, &udc->gadget); - otg_put_transceiver(udc->transceiver); + usb_put_transceiver(udc->transceiver); } #ifdef CONFIG_USB_GADGET_DEBUG_FILES dbg_remove_files(&udc->gadget.dev); diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index b04712f19f1e..21fdfdb18ba8 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -1217,7 +1217,7 @@ static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA) udc = container_of(gadget, struct fsl_udc, gadget); if (udc->transceiver) - return otg_set_power(udc->transceiver, mA); + return usb_phy_set_power(udc->transceiver, mA); return -ENOTSUPP; } @@ -2430,7 +2430,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev) #ifdef CONFIG_USB_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) { ERR("Can't find OTG driver!\n"); ret = -ENODEV; diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index e2293c1588ee..b19a9e46e69d 100644 --- a/drivers/usb/gadget/langwell_udc.c +++ b/drivers/usb/gadget/langwell_udc.c @@ -1261,9 +1261,9 @@ static int langwell_vbus_draw(struct usb_gadget *_gadget, unsigned mA) dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__); 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__); - return otg_set_power(dev->transceiver, mA); + return usb_phy_set_power(dev->transceiver, mA); } dev_vdbg(&dev->pdev->dev, "<--- %s()\n", __func__); diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index f97e737d26f7..50baf3ea336b 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -2181,7 +2181,7 @@ static int __devinit mv_udc_probe(struct platform_device *dev) #ifdef CONFIG_USB_OTG_UTILS if (pdata->mode == MV_USB_MODE_OTG) - udc->transceiver = otg_get_transceiver(); + udc->transceiver = usb_get_transceiver(); #endif udc->clknum = pdata->clknum; diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index d3529787351d..e82c6995ce26 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -1345,7 +1345,7 @@ static int omap_vbus_draw(struct usb_gadget *gadget, unsigned mA) udc = container_of(gadget, struct omap_udc, gadget); if (udc->transceiver) - return otg_set_power(udc->transceiver, mA); + return usb_phy_set_power(udc->transceiver, mA); return -EOPNOTSUPP; } @@ -1839,11 +1839,13 @@ static void devstate_irq(struct omap_udc *udc, u16 irq_src) spin_lock(&udc->lock); } if (udc->transceiver) - otg_set_suspend(udc->transceiver, 1); + usb_phy_set_suspend( + udc->transceiver, 1); } else { VDBG("resume\n"); if (udc->transceiver) - otg_set_suspend(udc->transceiver, 0); + usb_phy_set_suspend( + udc->transceiver, 0); if (udc->gadget.speed == USB_SPEED_FULL && udc->driver->resume) { 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; * but not having one probably means no VBUS detection. */ - xceiv = otg_get_transceiver(); + xceiv = usb_get_transceiver(); if (xceiv) type = xceiv->label; else if (config->otg) { @@ -3009,7 +3011,7 @@ cleanup1: cleanup0: if (xceiv) - otg_put_transceiver(xceiv); + usb_put_transceiver(xceiv); if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) { clk_disable(hhc_clk); @@ -3039,7 +3041,7 @@ static int __exit omap_udc_remove(struct platform_device *pdev) pullup_disable(udc); if (udc->transceiver) { - otg_put_transceiver(udc->transceiver); + usb_put_transceiver(udc->transceiver); udc->transceiver = NULL; } omap_writew(0, UDC_SYSCON1); diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index dd470635f4f7..b86518e49415 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c @@ -995,7 +995,7 @@ static int pxa25x_udc_vbus_draw(struct usb_gadget *_gadget, unsigned mA) udc = container_of(_gadget, struct pxa25x_udc, gadget); if (udc->transceiver) - return otg_set_power(udc->transceiver, mA); + return usb_phy_set_power(udc->transceiver, mA); return -EOPNOTSUPP; } @@ -2159,7 +2159,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) dev->dev = &pdev->dev; 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 ((retval = gpio_request(dev->mach->gpio_pullup, @@ -2238,7 +2238,7 @@ lubbock_fail0: gpio_free(dev->mach->gpio_pullup); err_gpio_pullup: if (dev->transceiver) { - otg_put_transceiver(dev->transceiver); + usb_put_transceiver(dev->transceiver); dev->transceiver = NULL; } clk_put(dev->clk); @@ -2280,7 +2280,7 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev) clk_put(dev->clk); if (dev->transceiver) { - otg_put_transceiver(dev->transceiver); + usb_put_transceiver(dev->transceiver); dev->transceiver = NULL; } diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index f4c44eb806c3..1906ed0dcdc2 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c @@ -1666,7 +1666,7 @@ static int pxa_udc_vbus_draw(struct usb_gadget *_gadget, unsigned mA) udc = to_gadget_udc(_gadget); if (udc->transceiver) - return otg_set_power(udc->transceiver, mA); + return usb_phy_set_power(udc->transceiver, mA); return -EOPNOTSUPP; } @@ -2463,7 +2463,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev) udc->dev = &pdev->dev; udc->mach = pdev->dev.platform_data; - udc->transceiver = otg_get_transceiver(); + udc->transceiver = usb_get_transceiver(); gpio = udc->mach->gpio_pullup; if (gpio_is_valid(gpio)) { @@ -2542,7 +2542,7 @@ static int __exit pxa_udc_remove(struct platform_device *_dev) if (gpio_is_valid(gpio)) gpio_free(gpio); - otg_put_transceiver(udc->transceiver); + usb_put_transceiver(udc->transceiver); udc->transceiver = NULL; platform_set_drvdata(_dev, NULL); diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index dea475a61fd3..e124bfa399f5 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c @@ -1243,7 +1243,7 @@ static int s3c_hsudc_vbus_draw(struct usb_gadget *gadget, unsigned mA) return -ENODEV; if (hsudc->transceiver) - return otg_set_power(hsudc->transceiver, mA); + return usb_phy_set_power(hsudc->transceiver, mA); return -EOPNOTSUPP; } @@ -1275,7 +1275,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev) hsudc->dev = dev; 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++) hsudc->supplies[i].supply = s3c_hsudc_supply_names[i]; @@ -1377,7 +1377,7 @@ err_remap: release_mem_region(res->start, resource_size(res)); err_res: if (hsudc->transceiver) - otg_put_transceiver(hsudc->transceiver); + usb_put_transceiver(hsudc->transceiver); regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies); err_supplies: |