提交 721002ec 编写于 作者: K Kishon Vijay Abraham I 提交者: Felipe Balbi

usb: otg: utils: rename function name in OTG utils

_transceiver() in otg.c is replaced with _phy. usb_set_transceiver is
replaced with usb_add_phy to make it similar to other usb standard
function names like usb_add_hcd.
Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 6b03b133
...@@ -2517,7 +2517,7 @@ static int __devexit ab8500_charger_remove(struct platform_device *pdev) ...@@ -2517,7 +2517,7 @@ static int __devexit ab8500_charger_remove(struct platform_device *pdev)
dev_err(di->dev, "%s mask and set failed\n", __func__); dev_err(di->dev, "%s mask and set failed\n", __func__);
usb_unregister_notifier(di->usb_phy, &di->nb); usb_unregister_notifier(di->usb_phy, &di->nb);
usb_put_transceiver(di->usb_phy); usb_put_phy(di->usb_phy);
/* Delete the work queue */ /* Delete the work queue */
destroy_workqueue(di->charger_wq); destroy_workqueue(di->charger_wq);
...@@ -2688,7 +2688,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev) ...@@ -2688,7 +2688,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
goto free_ac; goto free_ac;
} }
di->usb_phy = usb_get_transceiver(); di->usb_phy = usb_get_phy();
if (!di->usb_phy) { if (!di->usb_phy) {
dev_err(di->dev, "failed to get usb transceiver\n"); dev_err(di->dev, "failed to get usb transceiver\n");
ret = -EINVAL; ret = -EINVAL;
...@@ -2747,7 +2747,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev) ...@@ -2747,7 +2747,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
free_irq(irq, di); free_irq(irq, di);
} }
put_usb_phy: put_usb_phy:
usb_put_transceiver(di->usb_phy); usb_put_phy(di->usb_phy);
free_usb: free_usb:
power_supply_unregister(&di->usb_chg.psy); power_supply_unregister(&di->usb_chg.psy);
free_ac: free_ac:
......
...@@ -415,7 +415,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev) ...@@ -415,7 +415,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
if (!isp) if (!isp)
return -ENOMEM; return -ENOMEM;
isp->phy = usb_get_transceiver(); isp->phy = usb_get_phy();
if (!isp->phy) if (!isp->phy)
goto fail0; goto fail0;
...@@ -475,7 +475,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev) ...@@ -475,7 +475,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
power_supply_unregister(&isp->psy); power_supply_unregister(&isp->psy);
fail1: fail1:
isp1704_charger_set_power(isp, 0); isp1704_charger_set_power(isp, 0);
usb_put_transceiver(isp->phy); usb_put_phy(isp->phy);
fail0: fail0:
kfree(isp); kfree(isp);
...@@ -490,7 +490,7 @@ static int __devexit isp1704_charger_remove(struct platform_device *pdev) ...@@ -490,7 +490,7 @@ static int __devexit isp1704_charger_remove(struct platform_device *pdev)
usb_unregister_notifier(isp->phy, &isp->nb); usb_unregister_notifier(isp->phy, &isp->nb);
power_supply_unregister(&isp->psy); power_supply_unregister(&isp->psy);
usb_put_transceiver(isp->phy); usb_put_phy(isp->phy);
isp1704_charger_set_power(isp, 0); isp1704_charger_set_power(isp, 0);
kfree(isp); kfree(isp);
......
...@@ -321,7 +321,7 @@ static int pda_power_probe(struct platform_device *pdev) ...@@ -321,7 +321,7 @@ static int pda_power_probe(struct platform_device *pdev)
} }
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
transceiver = usb_get_transceiver(); transceiver = usb_get_phy();
if (transceiver && !pdata->is_usb_online) { if (transceiver && !pdata->is_usb_online) {
pdata->is_usb_online = otg_is_usb_online; pdata->is_usb_online = otg_is_usb_online;
} }
...@@ -409,7 +409,7 @@ static int pda_power_probe(struct platform_device *pdev) ...@@ -409,7 +409,7 @@ static int pda_power_probe(struct platform_device *pdev)
free_irq(ac_irq->start, &pda_psy_ac); free_irq(ac_irq->start, &pda_psy_ac);
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
if (transceiver) if (transceiver)
usb_put_transceiver(transceiver); usb_put_phy(transceiver);
#endif #endif
ac_irq_failed: ac_irq_failed:
if (pdata->is_ac_online) if (pdata->is_ac_online)
...@@ -444,7 +444,7 @@ static int pda_power_remove(struct platform_device *pdev) ...@@ -444,7 +444,7 @@ static int pda_power_remove(struct platform_device *pdev)
power_supply_unregister(&pda_psy_ac); power_supply_unregister(&pda_psy_ac);
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
if (transceiver) if (transceiver)
usb_put_transceiver(transceiver); usb_put_phy(transceiver);
#endif #endif
if (ac_draw) { if (ac_draw) {
regulator_put(ac_draw); regulator_put(ac_draw);
......
...@@ -479,7 +479,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) ...@@ -479,7 +479,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
INIT_WORK(&bci->work, twl4030_bci_usb_work); INIT_WORK(&bci->work, twl4030_bci_usb_work);
bci->transceiver = usb_get_transceiver(); bci->transceiver = usb_get_phy();
if (bci->transceiver != NULL) { if (bci->transceiver != NULL) {
bci->usb_nb.notifier_call = twl4030_bci_usb_ncb; bci->usb_nb.notifier_call = twl4030_bci_usb_ncb;
usb_register_notifier(bci->transceiver, &bci->usb_nb); usb_register_notifier(bci->transceiver, &bci->usb_nb);
...@@ -509,7 +509,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) ...@@ -509,7 +509,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
fail_unmask_interrupts: fail_unmask_interrupts:
if (bci->transceiver != NULL) { if (bci->transceiver != NULL) {
usb_unregister_notifier(bci->transceiver, &bci->usb_nb); usb_unregister_notifier(bci->transceiver, &bci->usb_nb);
usb_put_transceiver(bci->transceiver); usb_put_phy(bci->transceiver);
} }
free_irq(bci->irq_bci, bci); free_irq(bci->irq_bci, bci);
fail_bci_irq: fail_bci_irq:
...@@ -540,7 +540,7 @@ static int __exit twl4030_bci_remove(struct platform_device *pdev) ...@@ -540,7 +540,7 @@ static int __exit twl4030_bci_remove(struct platform_device *pdev)
if (bci->transceiver != NULL) { if (bci->transceiver != NULL) {
usb_unregister_notifier(bci->transceiver, &bci->usb_nb); usb_unregister_notifier(bci->transceiver, &bci->usb_nb);
usb_put_transceiver(bci->transceiver); usb_put_phy(bci->transceiver);
} }
free_irq(bci->irq_bci, bci); free_irq(bci->irq_bci, bci);
free_irq(bci->irq_chg, bci); free_irq(bci->irq_chg, bci);
......
...@@ -1687,7 +1687,7 @@ static int udc_start(struct ci13xxx *udc) ...@@ -1687,7 +1687,7 @@ static int udc_start(struct ci13xxx *udc)
udc->gadget.ep0 = &udc->ep0in->ep; udc->gadget.ep0 = &udc->ep0in->ep;
udc->transceiver = usb_get_transceiver(); udc->transceiver = usb_get_phy();
if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) { if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
if (udc->transceiver == NULL) { if (udc->transceiver == NULL) {
...@@ -1731,7 +1731,7 @@ static int udc_start(struct ci13xxx *udc) ...@@ -1731,7 +1731,7 @@ static int udc_start(struct ci13xxx *udc)
remove_trans: remove_trans:
if (udc->transceiver) { if (udc->transceiver) {
otg_set_peripheral(udc->transceiver->otg, &udc->gadget); otg_set_peripheral(udc->transceiver->otg, &udc->gadget);
usb_put_transceiver(udc->transceiver); usb_put_phy(udc->transceiver);
} }
dev_err(dev, "error = %i\n", retval); dev_err(dev, "error = %i\n", retval);
...@@ -1741,7 +1741,7 @@ static int udc_start(struct ci13xxx *udc) ...@@ -1741,7 +1741,7 @@ static int udc_start(struct ci13xxx *udc)
device_unregister(&udc->gadget.dev); device_unregister(&udc->gadget.dev);
put_transceiver: put_transceiver:
if (udc->transceiver) if (udc->transceiver)
usb_put_transceiver(udc->transceiver); usb_put_phy(udc->transceiver);
free_pools: free_pools:
dma_pool_destroy(udc->td_pool); dma_pool_destroy(udc->td_pool);
free_qh_pool: free_qh_pool:
...@@ -1774,7 +1774,7 @@ static void udc_stop(struct ci13xxx *udc) ...@@ -1774,7 +1774,7 @@ static void udc_stop(struct ci13xxx *udc)
if (udc->transceiver) { if (udc->transceiver) {
otg_set_peripheral(udc->transceiver->otg, NULL); otg_set_peripheral(udc->transceiver->otg, NULL);
usb_put_transceiver(udc->transceiver); usb_put_phy(udc->transceiver);
} }
dbg_remove_files(&udc->gadget.dev); dbg_remove_files(&udc->gadget.dev);
device_unregister(&udc->gadget.dev); device_unregister(&udc->gadget.dev);
......
...@@ -2455,7 +2455,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev) ...@@ -2455,7 +2455,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 = usb_get_transceiver(); udc_controller->transceiver = usb_get_phy();
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;
......
...@@ -2180,7 +2180,7 @@ static int __devinit mv_udc_probe(struct platform_device *dev) ...@@ -2180,7 +2180,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 = usb_get_transceiver(); udc->transceiver = usb_get_phy();
#endif #endif
udc->clknum = pdata->clknum; udc->clknum = pdata->clknum;
......
...@@ -2865,7 +2865,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) ...@@ -2865,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 = usb_get_transceiver(); xceiv = usb_get_phy();
if (xceiv) if (xceiv)
type = xceiv->label; type = xceiv->label;
else if (config->otg) { else if (config->otg) {
...@@ -3011,7 +3011,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) ...@@ -3011,7 +3011,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)
cleanup0: cleanup0:
if (xceiv) if (xceiv)
usb_put_transceiver(xceiv); usb_put_phy(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);
...@@ -3041,7 +3041,7 @@ static int __exit omap_udc_remove(struct platform_device *pdev) ...@@ -3041,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) {
usb_put_transceiver(udc->transceiver); usb_put_phy(udc->transceiver);
udc->transceiver = NULL; udc->transceiver = NULL;
} }
omap_writew(0, UDC_SYSCON1); omap_writew(0, UDC_SYSCON1);
......
...@@ -2159,7 +2159,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) ...@@ -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 = usb_get_transceiver(); dev->transceiver = usb_get_phy();
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) ...@@ -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) {
usb_put_transceiver(dev->transceiver); usb_put_phy(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) ...@@ -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) {
usb_put_transceiver(dev->transceiver); usb_put_phy(dev->transceiver);
dev->transceiver = NULL; dev->transceiver = NULL;
} }
......
...@@ -2464,7 +2464,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev) ...@@ -2464,7 +2464,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 = usb_get_transceiver(); udc->transceiver = usb_get_phy();
gpio = udc->mach->gpio_pullup; gpio = udc->mach->gpio_pullup;
if (gpio_is_valid(gpio)) { if (gpio_is_valid(gpio)) {
...@@ -2543,7 +2543,7 @@ static int __exit pxa_udc_remove(struct platform_device *_dev) ...@@ -2543,7 +2543,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);
usb_put_transceiver(udc->transceiver); usb_put_phy(udc->transceiver);
udc->transceiver = NULL; udc->transceiver = NULL;
platform_set_drvdata(_dev, NULL); platform_set_drvdata(_dev, NULL);
......
...@@ -1282,7 +1282,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev) ...@@ -1282,7 +1282,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 = usb_get_transceiver(); hsudc->transceiver = usb_get_phy();
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];
...@@ -1386,7 +1386,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev) ...@@ -1386,7 +1386,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)
usb_put_transceiver(hsudc->transceiver); usb_put_phy(hsudc->transceiver);
regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies); regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
err_supplies: err_supplies:
......
...@@ -142,7 +142,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, ...@@ -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 = usb_get_transceiver(); ehci->transceiver = usb_get_phy();
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);
...@@ -150,7 +150,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, ...@@ -150,7 +150,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
retval = otg_set_host(ehci->transceiver->otg, retval = otg_set_host(ehci->transceiver->otg,
&ehci_to_hcd(ehci)->self); &ehci_to_hcd(ehci)->self);
if (retval) { if (retval) {
usb_put_transceiver(ehci->transceiver); usb_put_phy(ehci->transceiver);
goto err4; goto err4;
} }
} else { } else {
...@@ -194,7 +194,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd, ...@@ -194,7 +194,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
if (ehci->transceiver) { if (ehci->transceiver) {
otg_set_host(ehci->transceiver->otg, NULL); otg_set_host(ehci->transceiver->otg, NULL);
usb_put_transceiver(ehci->transceiver); usb_put_phy(ehci->transceiver);
} }
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
......
...@@ -145,7 +145,7 @@ static int ehci_msm_probe(struct platform_device *pdev) ...@@ -145,7 +145,7 @@ 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.
*/ */
phy = usb_get_transceiver(); phy = usb_get_phy();
if (!phy) { if (!phy) {
dev_err(&pdev->dev, "unable to find transceiver\n"); dev_err(&pdev->dev, "unable to find transceiver\n");
ret = -ENODEV; ret = -ENODEV;
...@@ -169,7 +169,7 @@ static int ehci_msm_probe(struct platform_device *pdev) ...@@ -169,7 +169,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
return 0; return 0;
put_transceiver: put_transceiver:
usb_put_transceiver(phy); usb_put_phy(phy);
unmap: unmap:
iounmap(hcd->regs); iounmap(hcd->regs);
put_hcd: put_hcd:
...@@ -187,7 +187,7 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev) ...@@ -187,7 +187,7 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev)
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);
otg_set_host(phy->otg, NULL); otg_set_host(phy->otg, NULL);
usb_put_transceiver(phy); usb_put_phy(phy);
usb_put_hcd(hcd); usb_put_hcd(hcd);
......
...@@ -253,7 +253,7 @@ static int mv_ehci_probe(struct platform_device *pdev) ...@@ -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 = usb_get_transceiver(); ehci_mv->otg = usb_get_phy();
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) ...@@ -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)
usb_put_transceiver(ehci_mv->otg); usb_put_phy(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) ...@@ -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->otg, NULL); otg_set_host(ehci_mv->otg->otg, NULL);
usb_put_transceiver(ehci_mv->otg); usb_put_phy(ehci_mv->otg);
} }
if (ehci_mv->mode == MV_USB_MODE_HOST) { if (ehci_mv->mode == MV_USB_MODE_HOST) {
......
...@@ -749,7 +749,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -749,7 +749,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 = usb_get_transceiver(); tegra->transceiver = usb_get_phy();
if (tegra->transceiver) if (tegra->transceiver)
otg_set_host(tegra->transceiver->otg, &hcd->self); otg_set_host(tegra->transceiver->otg, &hcd->self);
} }
...@@ -775,7 +775,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -775,7 +775,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->otg, NULL); otg_set_host(tegra->transceiver->otg, NULL);
usb_put_transceiver(tegra->transceiver); usb_put_phy(tegra->transceiver);
} }
#endif #endif
tegra_usb_phy_close(tegra->phy); tegra_usb_phy_close(tegra->phy);
...@@ -810,7 +810,7 @@ static int tegra_ehci_remove(struct platform_device *pdev) ...@@ -810,7 +810,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->otg, NULL); otg_set_host(tegra->transceiver->otg, NULL);
usb_put_transceiver(tegra->transceiver); usb_put_phy(tegra->transceiver);
} }
#endif #endif
......
...@@ -211,14 +211,14 @@ static int ohci_omap_init(struct usb_hcd *hcd) ...@@ -211,14 +211,14 @@ 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 = usb_get_transceiver(); ohci->transceiver = usb_get_phy();
if (ohci->transceiver) { if (ohci->transceiver) {
int status = otg_set_host(ohci->transceiver->otg, int status = otg_set_host(ohci->transceiver->otg,
&ohci_to_hcd(ohci)->self); &ohci_to_hcd(ohci)->self);
dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
ohci->transceiver->label, status); ohci->transceiver->label, status);
if (status) { if (status) {
usb_put_transceiver(ohci->transceiver); usb_put_phy(ohci->transceiver);
return status; return status;
} }
} else { } else {
...@@ -405,7 +405,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) ...@@ -405,7 +405,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
if (ohci->transceiver) { if (ohci->transceiver) {
(void) otg_set_host(ohci->transceiver->otg, 0); (void) otg_set_host(ohci->transceiver->otg, 0);
usb_put_transceiver(ohci->transceiver); usb_put_phy(ohci->transceiver);
} }
if (machine_is_omap_osk()) if (machine_is_omap_osk())
gpio_free(9); gpio_free(9);
......
...@@ -364,7 +364,7 @@ static int am35x_musb_init(struct musb *musb) ...@@ -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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; return -ENODEV;
...@@ -406,7 +406,7 @@ static int am35x_musb_exit(struct musb *musb) ...@@ -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);
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
......
...@@ -415,7 +415,7 @@ static int bfin_musb_init(struct musb *musb) ...@@ -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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
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) ...@@ -440,7 +440,7 @@ static int bfin_musb_exit(struct musb *musb)
{ {
gpio_free(musb->config->gpio_vrsel); gpio_free(musb->config->gpio_vrsel);
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
} }
......
...@@ -425,7 +425,7 @@ static int da8xx_musb_init(struct musb *musb) ...@@ -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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
if (!musb->xceiv) if (!musb->xceiv)
goto fail; goto fail;
...@@ -458,7 +458,7 @@ static int da8xx_musb_exit(struct musb *musb) ...@@ -458,7 +458,7 @@ static int da8xx_musb_exit(struct musb *musb)
phy_off(); phy_off();
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
......
...@@ -384,7 +384,7 @@ static int davinci_musb_init(struct musb *musb) ...@@ -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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
if (!musb->xceiv) if (!musb->xceiv)
goto unregister; goto unregister;
...@@ -443,7 +443,7 @@ static int davinci_musb_init(struct musb *musb) ...@@ -443,7 +443,7 @@ static int davinci_musb_init(struct musb *musb)
return 0; return 0;
fail: fail:
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
unregister: unregister:
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return -ENODEV; return -ENODEV;
...@@ -493,7 +493,7 @@ static int davinci_musb_exit(struct musb *musb) ...@@ -493,7 +493,7 @@ static int davinci_musb_exit(struct musb *musb)
phy_off(); phy_off();
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
......
...@@ -1909,7 +1909,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -1909,7 +1909,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
/* The musb_platform_init() call: /* The musb_platform_init() call:
* - adjusts musb->mregs and musb->isr if needed, * - adjusts musb->mregs and musb->isr if needed,
* - may initialize an integrated tranceiver * - may initialize an integrated tranceiver
* - initializes musb->xceiv, usually by otg_get_transceiver() * - initializes musb->xceiv, usually by otg_get_phy()
* - stops powering VBUS * - stops powering VBUS
* *
* There are various transceiver configurations. Blackfin, * There are various transceiver configurations. Blackfin,
......
...@@ -376,7 +376,7 @@ static int dsps_musb_init(struct musb *musb) ...@@ -376,7 +376,7 @@ static int dsps_musb_init(struct musb *musb)
/* NOP driver needs change if supporting dual instance */ /* NOP driver needs change if supporting dual instance */
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = usb_get_transceiver(); musb->xceiv = usb_get_phy();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; return -ENODEV;
...@@ -409,7 +409,7 @@ static int dsps_musb_init(struct musb *musb) ...@@ -409,7 +409,7 @@ static int dsps_musb_init(struct musb *musb)
return 0; return 0;
err0: err0:
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return status; return status;
} }
...@@ -430,7 +430,7 @@ static int dsps_musb_exit(struct musb *musb) ...@@ -430,7 +430,7 @@ static int dsps_musb_exit(struct musb *musb)
data->set_phy_power(0); data->set_phy_power(0);
/* NOP driver needs change if supporting dual instance */ /* NOP driver needs change if supporting dual instance */
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
......
...@@ -292,7 +292,7 @@ static int omap2430_musb_init(struct musb *musb) ...@@ -292,7 +292,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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
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;
...@@ -391,7 +391,7 @@ static int omap2430_musb_exit(struct musb *musb) ...@@ -391,7 +391,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);
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
return 0; return 0;
} }
......
...@@ -1078,7 +1078,7 @@ static int tusb_musb_init(struct musb *musb) ...@@ -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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; return -ENODEV;
...@@ -1130,7 +1130,7 @@ static int tusb_musb_init(struct musb *musb) ...@@ -1130,7 +1130,7 @@ static int tusb_musb_init(struct musb *musb)
if (sync) if (sync)
iounmap(sync); iounmap(sync);
usb_put_transceiver(musb->xceiv); usb_put_phy(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) ...@@ -1146,7 +1146,7 @@ static int tusb_musb_exit(struct musb *musb)
iounmap(musb->sync_va); iounmap(musb->sync_va);
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return 0; return 0;
} }
......
...@@ -37,7 +37,7 @@ struct ux500_glue { ...@@ -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 = usb_get_transceiver(); musb->xceiv = usb_get_phy();
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) ...@@ -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)
{ {
usb_put_transceiver(musb->xceiv); usb_put_phy(musb->xceiv);
return 0; return 0;
} }
......
...@@ -529,7 +529,7 @@ static int __devinit ab8500_usb_probe(struct platform_device *pdev) ...@@ -529,7 +529,7 @@ static int __devinit ab8500_usb_probe(struct platform_device *pdev)
if (err < 0) if (err < 0)
goto fail0; goto fail0;
err = usb_set_transceiver(&ab->phy); err = usb_add_phy(&ab->phy);
if (err) { if (err) {
dev_err(&pdev->dev, "Can't register transceiver\n"); dev_err(&pdev->dev, "Can't register transceiver\n");
goto fail1; goto fail1;
...@@ -556,7 +556,7 @@ static int __devexit ab8500_usb_remove(struct platform_device *pdev) ...@@ -556,7 +556,7 @@ static int __devexit ab8500_usb_remove(struct platform_device *pdev)
cancel_work_sync(&ab->phy_dis_work); cancel_work_sync(&ab->phy_dis_work);
usb_set_transceiver(NULL); usb_add_phy(NULL);
ab8500_usb_host_phy_dis(ab); ab8500_usb_host_phy_dis(ab);
ab8500_usb_peri_phy_dis(ab); ab8500_usb_peri_phy_dis(ab);
......
...@@ -806,7 +806,7 @@ static int fsl_otg_conf(struct platform_device *pdev) ...@@ -806,7 +806,7 @@ static int fsl_otg_conf(struct platform_device *pdev)
fsl_otg_dev = fsl_otg_tc; fsl_otg_dev = fsl_otg_tc;
/* Store the otg transceiver */ /* Store the otg transceiver */
status = usb_set_transceiver(&fsl_otg_tc->phy); status = usb_add_phy(&fsl_otg_tc->phy);
if (status) { if (status) {
pr_warn(FSL_OTG_NAME ": unable to register OTG transceiver.\n"); pr_warn(FSL_OTG_NAME ": unable to register OTG transceiver.\n");
goto err; goto err;
...@@ -824,7 +824,7 @@ static int fsl_otg_conf(struct platform_device *pdev) ...@@ -824,7 +824,7 @@ static int fsl_otg_conf(struct platform_device *pdev)
int usb_otg_start(struct platform_device *pdev) int usb_otg_start(struct platform_device *pdev)
{ {
struct fsl_otg *p_otg; struct fsl_otg *p_otg;
struct usb_phy *otg_trans = usb_get_transceiver(); struct usb_phy *otg_trans = usb_get_phy();
struct otg_fsm *fsm; struct otg_fsm *fsm;
int status; int status;
struct resource *res; struct resource *res;
...@@ -1134,7 +1134,7 @@ static int __devexit fsl_otg_remove(struct platform_device *pdev) ...@@ -1134,7 +1134,7 @@ static int __devexit fsl_otg_remove(struct platform_device *pdev)
{ {
struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
usb_set_transceiver(NULL); usb_add_phy(NULL);
free_irq(fsl_otg_dev->irq, fsl_otg_dev); free_irq(fsl_otg_dev->irq, fsl_otg_dev);
iounmap((void *)usb_dr_regs); iounmap((void *)usb_dr_regs);
......
...@@ -320,7 +320,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) ...@@ -320,7 +320,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev)
} }
/* only active when a gadget is registered */ /* only active when a gadget is registered */
err = usb_set_transceiver(&gpio_vbus->phy); err = usb_add_phy(&gpio_vbus->phy);
if (err) { if (err) {
dev_err(&pdev->dev, "can't register transceiver, err: %d\n", dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
err); err);
...@@ -354,7 +354,7 @@ static int __exit gpio_vbus_remove(struct platform_device *pdev) ...@@ -354,7 +354,7 @@ static int __exit gpio_vbus_remove(struct platform_device *pdev)
cancel_delayed_work_sync(&gpio_vbus->work); cancel_delayed_work_sync(&gpio_vbus->work);
regulator_put(gpio_vbus->vbus_draw); regulator_put(gpio_vbus->vbus_draw);
usb_set_transceiver(NULL); usb_add_phy(NULL);
free_irq(gpio_vbus->irq, pdev); free_irq(gpio_vbus->irq, pdev);
if (gpio_is_valid(pdata->gpio_pullup)) if (gpio_is_valid(pdata->gpio_pullup))
......
...@@ -1611,7 +1611,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) ...@@ -1611,7 +1611,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
dev_dbg(&i2c->dev, "scheduled timer, %d min\n", TIMER_MINUTES); dev_dbg(&i2c->dev, "scheduled timer, %d min\n", TIMER_MINUTES);
#endif #endif
status = usb_set_transceiver(&isp->phy); status = usb_add_phy(&isp->phy);
if (status < 0) if (status < 0)
dev_err(&i2c->dev, "can't register transceiver, %d\n", dev_err(&i2c->dev, "can't register transceiver, %d\n",
status); status);
...@@ -1650,7 +1650,7 @@ subsys_initcall(isp_init); ...@@ -1650,7 +1650,7 @@ subsys_initcall(isp_init);
static void __exit isp_exit(void) static void __exit isp_exit(void)
{ {
if (the_transceiver) if (the_transceiver)
usb_set_transceiver(NULL); usb_add_phy(NULL);
i2c_del_driver(&isp1301_driver); i2c_del_driver(&isp1301_driver);
} }
module_exit(isp_exit); module_exit(isp_exit);
......
...@@ -1555,9 +1555,9 @@ static int __init msm_otg_probe(struct platform_device *pdev) ...@@ -1555,9 +1555,9 @@ static int __init msm_otg_probe(struct platform_device *pdev)
phy->otg->set_host = msm_otg_set_host; phy->otg->set_host = msm_otg_set_host;
phy->otg->set_peripheral = msm_otg_set_peripheral; phy->otg->set_peripheral = msm_otg_set_peripheral;
ret = usb_set_transceiver(&motg->phy); ret = usb_add_phy(&motg->phy);
if (ret) { if (ret) {
dev_err(&pdev->dev, "usb_set_transceiver failed\n"); dev_err(&pdev->dev, "usb_add_phy failed\n");
goto free_irq; goto free_irq;
} }
...@@ -1624,7 +1624,7 @@ static int __devexit msm_otg_remove(struct platform_device *pdev) ...@@ -1624,7 +1624,7 @@ static int __devexit msm_otg_remove(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
usb_set_transceiver(NULL); usb_add_phy(NULL);
free_irq(motg->irq, motg); free_irq(motg->irq, motg);
/* /*
......
...@@ -690,7 +690,7 @@ int mv_otg_remove(struct platform_device *pdev) ...@@ -690,7 +690,7 @@ int mv_otg_remove(struct platform_device *pdev)
for (clk_i = 0; clk_i <= mvotg->clknum; clk_i++) for (clk_i = 0; clk_i <= mvotg->clknum; clk_i++)
clk_put(mvotg->clk[clk_i]); clk_put(mvotg->clk[clk_i]);
usb_set_transceiver(NULL); usb_add_phy(NULL);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(mvotg->phy.otg); kfree(mvotg->phy.otg);
...@@ -853,7 +853,7 @@ static int mv_otg_probe(struct platform_device *pdev) ...@@ -853,7 +853,7 @@ static int mv_otg_probe(struct platform_device *pdev)
goto err_disable_clk; goto err_disable_clk;
} }
retval = usb_set_transceiver(&mvotg->phy); retval = usb_add_phy(&mvotg->phy);
if (retval < 0) { if (retval < 0) {
dev_err(&pdev->dev, "can't register transceiver, %d\n", dev_err(&pdev->dev, "can't register transceiver, %d\n",
retval); retval);
...@@ -880,7 +880,7 @@ static int mv_otg_probe(struct platform_device *pdev) ...@@ -880,7 +880,7 @@ static int mv_otg_probe(struct platform_device *pdev)
return 0; return 0;
err_set_transceiver: err_set_transceiver:
usb_set_transceiver(NULL); usb_add_phy(NULL);
err_free_irq: err_free_irq:
free_irq(mvotg->irq, mvotg); free_irq(mvotg->irq, mvotg);
err_disable_clk: err_disable_clk:
......
...@@ -117,7 +117,7 @@ static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev) ...@@ -117,7 +117,7 @@ static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev)
nop->phy.otg->set_host = nop_set_host; nop->phy.otg->set_host = nop_set_host;
nop->phy.otg->set_peripheral = nop_set_peripheral; nop->phy.otg->set_peripheral = nop_set_peripheral;
err = usb_set_transceiver(&nop->phy); err = usb_add_phy(&nop->phy);
if (err) { if (err) {
dev_err(&pdev->dev, "can't register transceiver, err: %d\n", dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
err); err);
...@@ -139,7 +139,7 @@ static int __devexit nop_usb_xceiv_remove(struct platform_device *pdev) ...@@ -139,7 +139,7 @@ static int __devexit nop_usb_xceiv_remove(struct platform_device *pdev)
{ {
struct nop_usb_xceiv *nop = platform_get_drvdata(pdev); struct nop_usb_xceiv *nop = platform_get_drvdata(pdev);
usb_set_transceiver(NULL); usb_add_phy(NULL);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(nop->phy.otg); kfree(nop->phy.otg);
......
...@@ -18,53 +18,53 @@ ...@@ -18,53 +18,53 @@
static struct usb_phy *phy; static struct usb_phy *phy;
/** /**
* usb_get_transceiver - find the (single) USB transceiver * usb_get_phy - find the (single) USB PHY
* *
* Returns the transceiver driver, after getting a refcount to it; or * Returns the phy driver, after getting a refcount to it; or
* null if there is no such transceiver. The caller is responsible for * null if there is no such phy. The caller is responsible for
* calling usb_put_transceiver() to release that count. * calling usb_put_phy() to release that count.
* *
* For use by USB host and peripheral drivers. * For use by USB host and peripheral drivers.
*/ */
struct usb_phy *usb_get_transceiver(void) struct usb_phy *usb_get_phy(void)
{ {
if (phy) if (phy)
get_device(phy->dev); get_device(phy->dev);
return phy; return phy;
} }
EXPORT_SYMBOL(usb_get_transceiver); EXPORT_SYMBOL(usb_get_phy);
/** /**
* usb_put_transceiver - release the (single) USB transceiver * usb_put_phy - release the (single) USB PHY
* @x: the transceiver returned by usb_get_transceiver() * @x: the phy returned by usb_get_phy()
* *
* Releases a refcount the caller received from usb_get_transceiver(). * Releases a refcount the caller received from usb_get_phy().
* *
* For use by USB host and peripheral drivers. * For use by USB host and peripheral drivers.
*/ */
void usb_put_transceiver(struct usb_phy *x) void usb_put_phy(struct usb_phy *x)
{ {
if (x) if (x)
put_device(x->dev); put_device(x->dev);
} }
EXPORT_SYMBOL(usb_put_transceiver); EXPORT_SYMBOL(usb_put_phy);
/** /**
* usb_set_transceiver - declare the (single) USB transceiver * usb_add_phy - declare the (single) USB PHY
* @x: the USB transceiver to be used; or NULL * @x: the USB phy to be used; or NULL
* *
* This call is exclusively for use by transceiver drivers, which * This call is exclusively for use by phy drivers, which
* coordinate the activities of drivers for host and peripheral * coordinate the activities of drivers for host and peripheral
* controllers, and in some cases for VBUS current regulation. * controllers, and in some cases for VBUS current regulation.
*/ */
int usb_set_transceiver(struct usb_phy *x) int usb_add_phy(struct usb_phy *x)
{ {
if (phy && x) if (phy && x)
return -EBUSY; return -EBUSY;
phy = x; phy = x;
return 0; return 0;
} }
EXPORT_SYMBOL(usb_set_transceiver); EXPORT_SYMBOL(usb_add_phy);
const char *otg_state_string(enum usb_otg_state state) const char *otg_state_string(enum usb_otg_state state)
{ {
......
...@@ -633,7 +633,7 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) ...@@ -633,7 +633,7 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)
kfree(twl); kfree(twl);
return err; return err;
} }
usb_set_transceiver(&twl->phy); usb_add_phy(&twl->phy);
platform_set_drvdata(pdev, twl); platform_set_drvdata(pdev, twl);
if (device_create_file(&pdev->dev, &dev_attr_vbus)) if (device_create_file(&pdev->dev, &dev_attr_vbus))
......
...@@ -443,7 +443,7 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev) ...@@ -443,7 +443,7 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)
kfree(twl); kfree(twl);
return err; return err;
} }
usb_set_transceiver(&twl->phy); usb_add_phy(&twl->phy);
platform_set_drvdata(pdev, twl); platform_set_drvdata(pdev, twl);
if (device_create_file(&pdev->dev, &dev_attr_vbus)) if (device_create_file(&pdev->dev, &dev_attr_vbus))
......
...@@ -121,7 +121,7 @@ struct usb_phy { ...@@ -121,7 +121,7 @@ struct usb_phy {
/* for board-specific init logic */ /* for board-specific init logic */
extern int usb_set_transceiver(struct usb_phy *); extern int usb_add_phy(struct usb_phy *);
#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
/* sometimes transceivers are accessed only through e.g. ULPI */ /* sometimes transceivers are accessed only through e.g. ULPI */
...@@ -172,16 +172,16 @@ usb_phy_shutdown(struct usb_phy *x) ...@@ -172,16 +172,16 @@ usb_phy_shutdown(struct usb_phy *x)
/* for usb host and peripheral controller drivers */ /* for usb host and peripheral controller drivers */
#ifdef CONFIG_USB_OTG_UTILS #ifdef CONFIG_USB_OTG_UTILS
extern struct usb_phy *usb_get_transceiver(void); extern struct usb_phy *usb_get_phy(void);
extern void usb_put_transceiver(struct usb_phy *); extern void usb_put_phy(struct usb_phy *);
extern const char *otg_state_string(enum usb_otg_state state); extern const char *otg_state_string(enum usb_otg_state state);
#else #else
static inline struct usb_phy *usb_get_transceiver(void) static inline struct usb_phy *usb_get_phy(void)
{ {
return NULL; return NULL;
} }
static inline void usb_put_transceiver(struct usb_phy *x) static inline void usb_put_phy(struct usb_phy *x)
{ {
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册