Skip to content

Commit

Permalink
usb: otg: utils: rename function name in OTG utils
Browse files Browse the repository at this point in the history
_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: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Kishon Vijay Abraham I authored and Felipe Balbi committed Jun 25, 2012
1 parent 6b03b13 commit 721002e
Show file tree
Hide file tree
Showing 36 changed files with 103 additions and 103 deletions.
6 changes: 3 additions & 3 deletions drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);

usb_unregister_notifier(di->usb_phy, &di->nb);
usb_put_transceiver(di->usb_phy);
usb_put_phy(di->usb_phy);

/* Delete the work queue */
destroy_workqueue(di->charger_wq);
Expand Down Expand Up @@ -2688,7 +2688,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
goto free_ac;
}

di->usb_phy = usb_get_transceiver();
di->usb_phy = usb_get_phy();
if (!di->usb_phy) {
dev_err(di->dev, "failed to get usb transceiver\n");
ret = -EINVAL;
Expand Down Expand Up @@ -2747,7 +2747,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
free_irq(irq, di);
}
put_usb_phy:
usb_put_transceiver(di->usb_phy);
usb_put_phy(di->usb_phy);
free_usb:
power_supply_unregister(&di->usb_chg.psy);
free_ac:
Expand Down
6 changes: 3 additions & 3 deletions drivers/power/isp1704_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
if (!isp)
return -ENOMEM;

isp->phy = usb_get_transceiver();
isp->phy = usb_get_phy();
if (!isp->phy)
goto fail0;

Expand Down Expand Up @@ -475,7 +475,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
power_supply_unregister(&isp->psy);
fail1:
isp1704_charger_set_power(isp, 0);
usb_put_transceiver(isp->phy);
usb_put_phy(isp->phy);
fail0:
kfree(isp);

Expand All @@ -490,7 +490,7 @@ static int __devexit isp1704_charger_remove(struct platform_device *pdev)

usb_unregister_notifier(isp->phy, &isp->nb);
power_supply_unregister(&isp->psy);
usb_put_transceiver(isp->phy);
usb_put_phy(isp->phy);
isp1704_charger_set_power(isp, 0);
kfree(isp);

Expand Down
6 changes: 3 additions & 3 deletions drivers/power/pda_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static int pda_power_probe(struct platform_device *pdev)
}

#ifdef CONFIG_USB_OTG_UTILS
transceiver = usb_get_transceiver();
transceiver = usb_get_phy();
if (transceiver && !pdata->is_usb_online) {
pdata->is_usb_online = otg_is_usb_online;
}
Expand Down Expand Up @@ -409,7 +409,7 @@ static int pda_power_probe(struct platform_device *pdev)
free_irq(ac_irq->start, &pda_psy_ac);
#ifdef CONFIG_USB_OTG_UTILS
if (transceiver)
usb_put_transceiver(transceiver);
usb_put_phy(transceiver);
#endif
ac_irq_failed:
if (pdata->is_ac_online)
Expand Down Expand Up @@ -444,7 +444,7 @@ static int pda_power_remove(struct platform_device *pdev)
power_supply_unregister(&pda_psy_ac);
#ifdef CONFIG_USB_OTG_UTILS
if (transceiver)
usb_put_transceiver(transceiver);
usb_put_phy(transceiver);
#endif
if (ac_draw) {
regulator_put(ac_draw);
Expand Down
6 changes: 3 additions & 3 deletions drivers/power/twl4030_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)

INIT_WORK(&bci->work, twl4030_bci_usb_work);

bci->transceiver = usb_get_transceiver();
bci->transceiver = usb_get_phy();
if (bci->transceiver != NULL) {
bci->usb_nb.notifier_call = twl4030_bci_usb_ncb;
usb_register_notifier(bci->transceiver, &bci->usb_nb);
Expand Down Expand Up @@ -509,7 +509,7 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
fail_unmask_interrupts:
if (bci->transceiver != NULL) {
usb_unregister_notifier(bci->transceiver, &bci->usb_nb);
usb_put_transceiver(bci->transceiver);
usb_put_phy(bci->transceiver);
}
free_irq(bci->irq_bci, bci);
fail_bci_irq:
Expand Down Expand Up @@ -540,7 +540,7 @@ static int __exit twl4030_bci_remove(struct platform_device *pdev)

if (bci->transceiver != NULL) {
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_chg, bci);
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ static int udc_start(struct ci13xxx *udc)

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->transceiver == NULL) {
Expand Down Expand Up @@ -1731,7 +1731,7 @@ static int udc_start(struct ci13xxx *udc)
remove_trans:
if (udc->transceiver) {
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);
Expand All @@ -1741,7 +1741,7 @@ static int udc_start(struct ci13xxx *udc)
device_unregister(&udc->gadget.dev);
put_transceiver:
if (udc->transceiver)
usb_put_transceiver(udc->transceiver);
usb_put_phy(udc->transceiver);
free_pools:
dma_pool_destroy(udc->td_pool);
free_qh_pool:
Expand Down Expand Up @@ -1774,7 +1774,7 @@ static void udc_stop(struct ci13xxx *udc)

if (udc->transceiver) {
otg_set_peripheral(udc->transceiver->otg, NULL);
usb_put_transceiver(udc->transceiver);
usb_put_phy(udc->transceiver);
}
dbg_remove_files(&udc->gadget.dev);
device_unregister(&udc->gadget.dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/fsl_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,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 = usb_get_transceiver();
udc_controller->transceiver = usb_get_phy();
if (!udc_controller->transceiver) {
ERR("Can't find OTG driver!\n");
ret = -ENODEV;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,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 = usb_get_transceiver();
udc->transceiver = usb_get_phy();
#endif

udc->clknum = pdata->clknum;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/omap_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
* but not having one probably means no VBUS detection.
*/
xceiv = usb_get_transceiver();
xceiv = usb_get_phy();
if (xceiv)
type = xceiv->label;
else if (config->otg) {
Expand Down Expand Up @@ -3011,7 +3011,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)

cleanup0:
if (xceiv)
usb_put_transceiver(xceiv);
usb_put_phy(xceiv);

if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) {
clk_disable(hhc_clk);
Expand Down Expand Up @@ -3041,7 +3041,7 @@ static int __exit omap_udc_remove(struct platform_device *pdev)

pullup_disable(udc);
if (udc->transceiver) {
usb_put_transceiver(udc->transceiver);
usb_put_phy(udc->transceiver);
udc->transceiver = NULL;
}
omap_writew(0, UDC_SYSCON1);
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = usb_get_transceiver();
dev->transceiver = usb_get_phy();

if (gpio_is_valid(dev->mach->gpio_pullup)) {
if ((retval = gpio_request(dev->mach->gpio_pullup,
Expand Down Expand Up @@ -2238,7 +2238,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
gpio_free(dev->mach->gpio_pullup);
err_gpio_pullup:
if (dev->transceiver) {
usb_put_transceiver(dev->transceiver);
usb_put_phy(dev->transceiver);
dev->transceiver = NULL;
}
clk_put(dev->clk);
Expand Down Expand Up @@ -2280,7 +2280,7 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
clk_put(dev->clk);

if (dev->transceiver) {
usb_put_transceiver(dev->transceiver);
usb_put_phy(dev->transceiver);
dev->transceiver = NULL;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/pxa27x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev)

udc->dev = &pdev->dev;
udc->mach = pdev->dev.platform_data;
udc->transceiver = usb_get_transceiver();
udc->transceiver = usb_get_phy();

gpio = udc->mach->gpio_pullup;
if (gpio_is_valid(gpio)) {
Expand Down Expand Up @@ -2543,7 +2543,7 @@ static int __exit pxa_udc_remove(struct platform_device *_dev)
if (gpio_is_valid(gpio))
gpio_free(gpio);

usb_put_transceiver(udc->transceiver);
usb_put_phy(udc->transceiver);

udc->transceiver = NULL;
platform_set_drvdata(_dev, NULL);
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/s3c-hsudc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
hsudc->dev = dev;
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++)
hsudc->supplies[i].supply = s3c_hsudc_supply_names[i];
Expand Down Expand Up @@ -1386,7 +1386,7 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
release_mem_region(res->start, resource_size(res));
err_res:
if (hsudc->transceiver)
usb_put_transceiver(hsudc->transceiver);
usb_put_phy(hsudc->transceiver);

regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
err_supplies:
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/ehci-fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
if (pdata->operating_mode == FSL_USB2_DR_OTG) {
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",
hcd, ehci, ehci->transceiver);

if (ehci->transceiver) {
retval = otg_set_host(ehci->transceiver->otg,
&ehci_to_hcd(ehci)->self);
if (retval) {
usb_put_transceiver(ehci->transceiver);
usb_put_phy(ehci->transceiver);
goto err4;
}
} else {
Expand Down Expand Up @@ -194,7 +194,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,

if (ehci->transceiver) {
otg_set_host(ehci->transceiver->otg, NULL);
usb_put_transceiver(ehci->transceiver);
usb_put_phy(ehci->transceiver);
}

usb_remove_hcd(hcd);
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/ehci-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
* powering up VBUS, mapping of registers address space and power
* management.
*/
phy = usb_get_transceiver();
phy = usb_get_phy();
if (!phy) {
dev_err(&pdev->dev, "unable to find transceiver\n");
ret = -ENODEV;
Expand All @@ -169,7 +169,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
return 0;

put_transceiver:
usb_put_transceiver(phy);
usb_put_phy(phy);
unmap:
iounmap(hcd->regs);
put_hcd:
Expand All @@ -187,7 +187,7 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev)
pm_runtime_set_suspended(&pdev->dev);

otg_set_host(phy->otg, NULL);
usb_put_transceiver(phy);
usb_put_phy(phy);

usb_put_hcd(hcd);

Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/ehci-mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
ehci_mv->mode = pdata->mode;
if (ehci_mv->mode == MV_USB_MODE_OTG) {
#ifdef CONFIG_USB_OTG_UTILS
ehci_mv->otg = usb_get_transceiver();
ehci_mv->otg = usb_get_phy();
if (!ehci_mv->otg) {
dev_err(&pdev->dev,
"unable to find transceiver\n");
Expand Down Expand Up @@ -303,7 +303,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS
err_put_transceiver:
if (ehci_mv->otg)
usb_put_transceiver(ehci_mv->otg);
usb_put_phy(ehci_mv->otg);
#endif
err_disable_clk:
mv_ehci_disable(ehci_mv);
Expand Down Expand Up @@ -333,7 +333,7 @@ static int mv_ehci_remove(struct platform_device *pdev)

if (ehci_mv->otg) {
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) {
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/ehci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)

#ifdef CONFIG_USB_OTG_UTILS
if (pdata->operating_mode == TEGRA_USB_OTG) {
tegra->transceiver = usb_get_transceiver();
tegra->transceiver = usb_get_phy();
if (tegra->transceiver)
otg_set_host(tegra->transceiver->otg, &hcd->self);
}
Expand All @@ -775,7 +775,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS
if (tegra->transceiver) {
otg_set_host(tegra->transceiver->otg, NULL);
usb_put_transceiver(tegra->transceiver);
usb_put_phy(tegra->transceiver);
}
#endif
tegra_usb_phy_close(tegra->phy);
Expand Down Expand Up @@ -810,7 +810,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
#ifdef CONFIG_USB_OTG_UTILS
if (tegra->transceiver) {
otg_set_host(tegra->transceiver->otg, NULL);
usb_put_transceiver(tegra->transceiver);
usb_put_phy(tegra->transceiver);
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/ohci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ static int ohci_omap_init(struct usb_hcd *hcd)

#ifdef CONFIG_USB_OTG
if (need_transceiver) {
ohci->transceiver = usb_get_transceiver();
ohci->transceiver = usb_get_phy();
if (ohci->transceiver) {
int status = otg_set_host(ohci->transceiver->otg,
&ohci_to_hcd(ohci)->self);
dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
ohci->transceiver->label, status);
if (status) {
usb_put_transceiver(ohci->transceiver);
usb_put_phy(ohci->transceiver);
return status;
}
} else {
Expand Down Expand Up @@ -405,7 +405,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
usb_remove_hcd(hcd);
if (ohci->transceiver) {
(void) otg_set_host(ohci->transceiver->otg, 0);
usb_put_transceiver(ohci->transceiver);
usb_put_phy(ohci->transceiver);
}
if (machine_is_omap_osk())
gpio_free(9);
Expand Down
Loading

0 comments on commit 721002e

Please sign in to comment.