提交 6e13c650 编写于 作者: H Heikki Krogerus 提交者: Felipe Balbi

usb: otg: Convert all users to pass struct usb_otg for OTG functions

This changes the otg functions so that they receive struct
otg instead of struct usb_phy as parameter and
converts all users of these functions to pass the otg member
of their usb_phy.

Includes fixes to IMX code from Sascha Hauer.

[ balbi@ti.com : fixed a compile warning on ehci-mv.c ]
Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: NSascha Hauer <s.hauer@pengutronix.de>
Acked-by: NIgor Grinberg <grinberg@compulab.co.il>
Acked-by: NPavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: NLi Yang <leoli@freescale.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 136ced89
...@@ -145,13 +145,13 @@ static int pxa310_start_otg_host_transcvr(struct usb_bus *host) ...@@ -145,13 +145,13 @@ static int pxa310_start_otg_host_transcvr(struct usb_bus *host)
return err; return err;
} }
err = otg_set_vbus(u2d->otg, 1); err = otg_set_vbus(u2d->otg->otg, 1);
if (err) { if (err) {
pr_err("OTG transceiver VBUS set failed"); pr_err("OTG transceiver VBUS set failed");
return err; return err;
} }
err = otg_set_host(u2d->otg, host); err = otg_set_host(u2d->otg->otg, host);
if (err) if (err)
pr_err("OTG transceiver Host mode set failed"); pr_err("OTG transceiver Host mode set failed");
...@@ -189,8 +189,8 @@ static void pxa310_stop_otg_hc(void) ...@@ -189,8 +189,8 @@ static void pxa310_stop_otg_hc(void)
{ {
pxa310_otg_transceiver_rtsm(); pxa310_otg_transceiver_rtsm();
otg_set_host(u2d->otg, NULL); otg_set_host(u2d->otg->otg, NULL);
otg_set_vbus(u2d->otg, 0); otg_set_vbus(u2d->otg->otg, 0);
usb_phy_shutdown(u2d->otg); usb_phy_shutdown(u2d->otg);
} }
......
...@@ -2928,7 +2928,8 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, ...@@ -2928,7 +2928,8 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
goto unreg_device; goto unreg_device;
if (udc->transceiver) { if (udc->transceiver) {
retval = otg_set_peripheral(udc->transceiver, &udc->gadget); retval = otg_set_peripheral(udc->transceiver->otg,
&udc->gadget);
if (retval) if (retval)
goto remove_dbg; goto remove_dbg;
} }
...@@ -2945,7 +2946,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, ...@@ -2945,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->otg, &udc->gadget);
usb_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
} }
...@@ -2981,7 +2982,7 @@ static void udc_remove(void) ...@@ -2981,7 +2982,7 @@ static void udc_remove(void)
usb_del_gadget_udc(&udc->gadget); usb_del_gadget_udc(&udc->gadget);
if (udc->transceiver) { if (udc->transceiver) {
otg_set_peripheral(udc->transceiver, &udc->gadget); otg_set_peripheral(udc->transceiver->otg, &udc->gadget);
usb_put_transceiver(udc->transceiver); usb_put_transceiver(udc->transceiver);
} }
#ifdef CONFIG_USB_GADGET_DEBUG_FILES #ifdef CONFIG_USB_GADGET_DEBUG_FILES
......
...@@ -1966,7 +1966,8 @@ static int fsl_start(struct usb_gadget_driver *driver, ...@@ -1966,7 +1966,8 @@ static int fsl_start(struct usb_gadget_driver *driver,
/* connect to bus through transceiver */ /* connect to bus through transceiver */
if (udc_controller->transceiver) { if (udc_controller->transceiver) {
retval = otg_set_peripheral(udc_controller->transceiver, retval = otg_set_peripheral(
udc_controller->transceiver->otg,
&udc_controller->gadget); &udc_controller->gadget);
if (retval < 0) { if (retval < 0) {
ERR("can't bind to transceiver\n"); ERR("can't bind to transceiver\n");
...@@ -2006,7 +2007,7 @@ static int fsl_stop(struct usb_gadget_driver *driver) ...@@ -2006,7 +2007,7 @@ static int fsl_stop(struct usb_gadget_driver *driver)
return -EINVAL; return -EINVAL;
if (udc_controller->transceiver) if (udc_controller->transceiver)
otg_set_peripheral(udc_controller->transceiver, NULL); otg_set_peripheral(udc_controller->transceiver->otg, NULL);
/* stop DR, disable intr */ /* stop DR, disable intr */
dr_controller_stop(udc_controller); dr_controller_stop(udc_controller);
......
...@@ -1906,7 +1906,7 @@ static int langwell_stop(struct usb_gadget *g, ...@@ -1906,7 +1906,7 @@ static int langwell_stop(struct usb_gadget *g,
/* unbind OTG transceiver */ /* unbind OTG transceiver */
if (dev->transceiver) if (dev->transceiver)
(void)otg_set_peripheral(dev->transceiver, 0); (void)otg_set_peripheral(dev->transceiver->otg, 0);
/* disable interrupt and set controller to stop state */ /* disable interrupt and set controller to stop state */
langwell_udc_stop(dev); langwell_udc_stop(dev);
......
...@@ -1384,7 +1384,8 @@ static int mv_udc_start(struct usb_gadget_driver *driver, ...@@ -1384,7 +1384,8 @@ static int mv_udc_start(struct usb_gadget_driver *driver,
} }
if (udc->transceiver) { if (udc->transceiver) {
retval = otg_set_peripheral(udc->transceiver, &udc->gadget); retval = otg_set_peripheral(udc->transceiver->otg,
&udc->gadget);
if (retval) { if (retval) {
dev_err(&udc->dev->dev, dev_err(&udc->dev->dev,
"unable to register peripheral to otg\n"); "unable to register peripheral to otg\n");
......
...@@ -1213,7 +1213,7 @@ static int omap_wakeup(struct usb_gadget *gadget) ...@@ -1213,7 +1213,7 @@ static int omap_wakeup(struct usb_gadget *gadget)
/* NOTE: non-OTG systems may use SRP TOO... */ /* NOTE: non-OTG systems may use SRP TOO... */
} else if (!(udc->devstat & UDC_ATT)) { } else if (!(udc->devstat & UDC_ATT)) {
if (udc->transceiver) if (udc->transceiver)
retval = otg_start_srp(udc->transceiver); retval = otg_start_srp(udc->transceiver->otg);
} }
spin_unlock_irqrestore(&udc->lock, flags); spin_unlock_irqrestore(&udc->lock, flags);
...@@ -2156,7 +2156,8 @@ static int omap_udc_start(struct usb_gadget_driver *driver, ...@@ -2156,7 +2156,8 @@ static int omap_udc_start(struct usb_gadget_driver *driver,
/* connect to bus through transceiver */ /* connect to bus through transceiver */
if (udc->transceiver) { if (udc->transceiver) {
status = otg_set_peripheral(udc->transceiver, &udc->gadget); status = otg_set_peripheral(udc->transceiver->otg,
&udc->gadget);
if (status < 0) { if (status < 0) {
ERR("can't bind to transceiver\n"); ERR("can't bind to transceiver\n");
if (driver->unbind) { if (driver->unbind) {
...@@ -2202,7 +2203,7 @@ static int omap_udc_stop(struct usb_gadget_driver *driver) ...@@ -2202,7 +2203,7 @@ static int omap_udc_stop(struct usb_gadget_driver *driver)
omap_vbus_session(&udc->gadget, 0); omap_vbus_session(&udc->gadget, 0);
if (udc->transceiver) if (udc->transceiver)
(void) otg_set_peripheral(udc->transceiver, NULL); (void) otg_set_peripheral(udc->transceiver->otg, NULL);
else else
pullup_disable(udc); pullup_disable(udc);
......
...@@ -1301,7 +1301,8 @@ static int pxa25x_start(struct usb_gadget_driver *driver, ...@@ -1301,7 +1301,8 @@ static int pxa25x_start(struct usb_gadget_driver *driver,
/* connect to bus through transceiver */ /* connect to bus through transceiver */
if (dev->transceiver) { if (dev->transceiver) {
retval = otg_set_peripheral(dev->transceiver, &dev->gadget); retval = otg_set_peripheral(dev->transceiver->otg,
&dev->gadget);
if (retval) { if (retval) {
DMSG("can't bind to transceiver\n"); DMSG("can't bind to transceiver\n");
if (driver->unbind) if (driver->unbind)
...@@ -1360,7 +1361,7 @@ static int pxa25x_stop(struct usb_gadget_driver *driver) ...@@ -1360,7 +1361,7 @@ static int pxa25x_stop(struct usb_gadget_driver *driver)
local_irq_enable(); local_irq_enable();
if (dev->transceiver) if (dev->transceiver)
(void) otg_set_peripheral(dev->transceiver, NULL); (void) otg_set_peripheral(dev->transceiver->otg, NULL);
driver->unbind(&dev->gadget); driver->unbind(&dev->gadget);
dev->gadget.dev.driver = NULL; dev->gadget.dev.driver = NULL;
......
...@@ -1835,7 +1835,8 @@ static int pxa27x_udc_start(struct usb_gadget_driver *driver, ...@@ -1835,7 +1835,8 @@ static int pxa27x_udc_start(struct usb_gadget_driver *driver,
driver->driver.name); driver->driver.name);
if (udc->transceiver) { if (udc->transceiver) {
retval = otg_set_peripheral(udc->transceiver, &udc->gadget); retval = otg_set_peripheral(udc->transceiver->otg,
&udc->gadget);
if (retval) { if (retval) {
dev_err(udc->dev, "can't bind to transceiver\n"); dev_err(udc->dev, "can't bind to transceiver\n");
goto transceiver_fail; goto transceiver_fail;
...@@ -1908,7 +1909,7 @@ static int pxa27x_udc_stop(struct usb_gadget_driver *driver) ...@@ -1908,7 +1909,7 @@ static int pxa27x_udc_stop(struct usb_gadget_driver *driver)
driver->driver.name); driver->driver.name);
if (udc->transceiver) if (udc->transceiver)
return otg_set_peripheral(udc->transceiver, NULL); return otg_set_peripheral(udc->transceiver->otg, NULL);
return 0; return 0;
} }
......
...@@ -1166,7 +1166,8 @@ static int s3c_hsudc_start(struct usb_gadget *gadget, ...@@ -1166,7 +1166,8 @@ static int s3c_hsudc_start(struct usb_gadget *gadget,
/* connect to bus through transceiver */ /* connect to bus through transceiver */
if (hsudc->transceiver) { if (hsudc->transceiver) {
ret = otg_set_peripheral(hsudc->transceiver, &hsudc->gadget); ret = otg_set_peripheral(hsudc->transceiver->otg,
&hsudc->gadget);
if (ret) { if (ret) {
dev_err(hsudc->dev, "%s: can't bind to transceiver\n", dev_err(hsudc->dev, "%s: can't bind to transceiver\n",
hsudc->gadget.name); hsudc->gadget.name);
...@@ -1214,7 +1215,7 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget, ...@@ -1214,7 +1215,7 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget,
spin_unlock_irqrestore(&hsudc->lock, flags); spin_unlock_irqrestore(&hsudc->lock, flags);
if (hsudc->transceiver) if (hsudc->transceiver)
(void) otg_set_peripheral(hsudc->transceiver, NULL); (void) otg_set_peripheral(hsudc->transceiver->otg, NULL);
disable_irq(hsudc->irq); disable_irq(hsudc->irq);
......
...@@ -147,7 +147,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, ...@@ -147,7 +147,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
hcd, ehci, ehci->transceiver); hcd, ehci, ehci->transceiver);
if (ehci->transceiver) { if (ehci->transceiver) {
retval = otg_set_host(ehci->transceiver, retval = otg_set_host(ehci->transceiver->otg,
&ehci_to_hcd(ehci)->self); &ehci_to_hcd(ehci)->self);
if (retval) { if (retval) {
if (ehci->transceiver) if (ehci->transceiver)
...@@ -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,
struct ehci_hcd *ehci = hcd_to_ehci(hcd); struct ehci_hcd *ehci = hcd_to_ehci(hcd);
if (ehci->transceiver) { if (ehci->transceiver) {
otg_set_host(ehci->transceiver, NULL); otg_set_host(ehci->transceiver->otg, NULL);
put_device(ehci->transceiver->dev); put_device(ehci->transceiver->dev);
} }
......
...@@ -727,7 +727,7 @@ static int ehci_hub_control ( ...@@ -727,7 +727,7 @@ static int ehci_hub_control (
#ifdef CONFIG_USB_OTG #ifdef CONFIG_USB_OTG
if ((hcd->self.otg_port == (wIndex + 1)) if ((hcd->self.otg_port == (wIndex + 1))
&& hcd->self.b_hnp_enable) { && hcd->self.b_hnp_enable) {
otg_start_hnp(ehci->transceiver); otg_start_hnp(ehci->transceiver->otg);
break; break;
} }
#endif #endif
......
...@@ -152,7 +152,7 @@ static int ehci_msm_probe(struct platform_device *pdev) ...@@ -152,7 +152,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
goto unmap; goto unmap;
} }
ret = otg_set_host(phy, &hcd->self); ret = otg_set_host(phy->otg, &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;
...@@ -186,7 +186,7 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev) ...@@ -186,7 +186,7 @@ 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(phy, NULL); otg_set_host(phy->otg, NULL);
usb_put_transceiver(phy); usb_put_transceiver(phy);
usb_put_hcd(hcd); usb_put_hcd(hcd);
......
...@@ -261,7 +261,7 @@ static int mv_ehci_probe(struct platform_device *pdev) ...@@ -261,7 +261,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
goto err_disable_clk; goto err_disable_clk;
} }
retval = otg_set_host(ehci_mv->otg, &hcd->self); retval = otg_set_host(ehci_mv->otg->otg, &hcd->self);
if (retval < 0) { if (retval < 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"unable to register with transceiver\n"); "unable to register with transceiver\n");
...@@ -332,7 +332,7 @@ static int mv_ehci_remove(struct platform_device *pdev) ...@@ -332,7 +332,7 @@ static int mv_ehci_remove(struct platform_device *pdev)
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
if (ehci_mv->otg) { if (ehci_mv->otg) {
otg_set_host(ehci_mv->otg, NULL); otg_set_host(ehci_mv->otg->otg, NULL);
usb_put_transceiver(ehci_mv->otg); usb_put_transceiver(ehci_mv->otg);
} }
......
...@@ -226,7 +226,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) ...@@ -226,7 +226,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
goto err_add; goto err_add;
} }
ret = otg_set_vbus(pdata->otg, 1); ret = otg_set_vbus(pdata->otg->otg, 1);
if (ret) { if (ret) {
dev_err(dev, "unable to enable vbus on transceiver\n"); dev_err(dev, "unable to enable vbus on transceiver\n");
goto err_add; goto err_add;
......
...@@ -735,7 +735,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -735,7 +735,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
if (pdata->operating_mode == TEGRA_USB_OTG) { if (pdata->operating_mode == TEGRA_USB_OTG) {
tegra->transceiver = usb_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->otg, &hcd->self);
} }
#endif #endif
...@@ -750,7 +750,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -750,7 +750,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
fail: fail:
#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->otg, NULL);
usb_put_transceiver(tegra->transceiver); usb_put_transceiver(tegra->transceiver);
} }
#endif #endif
...@@ -808,7 +808,7 @@ static int tegra_ehci_remove(struct platform_device *pdev) ...@@ -808,7 +808,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->otg, NULL);
usb_put_transceiver(tegra->transceiver); usb_put_transceiver(tegra->transceiver);
} }
#endif #endif
......
...@@ -171,7 +171,7 @@ static void start_hnp(struct ohci_hcd *ohci) ...@@ -171,7 +171,7 @@ static void start_hnp(struct ohci_hcd *ohci)
unsigned long flags; unsigned long flags;
u32 l; u32 l;
otg_start_hnp(ohci->transceiver); otg_start_hnp(ohci->transceiver->otg);
local_irq_save(flags); local_irq_save(flags);
ohci->transceiver->state = OTG_STATE_A_SUSPEND; ohci->transceiver->state = OTG_STATE_A_SUSPEND;
...@@ -212,7 +212,7 @@ static int ohci_omap_init(struct usb_hcd *hcd) ...@@ -212,7 +212,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
if (need_transceiver) { if (need_transceiver) {
ohci->transceiver = usb_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->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);
...@@ -404,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) ...@@ -404,7 +404,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, 0); (void) otg_set_host(ohci->transceiver->otg, 0);
put_device(ohci->transceiver->dev); put_device(ohci->transceiver->dev);
} }
if (machine_is_omap_osk()) if (machine_is_omap_osk())
......
...@@ -1961,7 +1961,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -1961,7 +1961,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
if (is_host_enabled(musb)) { if (is_host_enabled(musb)) {
struct usb_hcd *hcd = musb_to_hcd(musb); struct usb_hcd *hcd = musb_to_hcd(musb);
otg_set_host(musb->xceiv, &hcd->self); otg_set_host(musb->xceiv->otg, &hcd->self);
if (is_otg_enabled(musb)) if (is_otg_enabled(musb))
hcd->self.otg_port = 1; hcd->self.otg_port = 1;
......
...@@ -1624,7 +1624,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) ...@@ -1624,7 +1624,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget)
} }
spin_unlock_irqrestore(&musb->lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
otg_start_srp(musb->xceiv); otg_start_srp(musb->xceiv->otg);
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
/* Block idling for at least 1s */ /* Block idling for at least 1s */
...@@ -1915,7 +1915,7 @@ static int musb_gadget_start(struct usb_gadget *g, ...@@ -1915,7 +1915,7 @@ static int musb_gadget_start(struct usb_gadget *g,
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
musb->is_active = 1; musb->is_active = 1;
otg_set_peripheral(musb->xceiv, &musb->g); otg_set_peripheral(otg, &musb->g);
musb->xceiv->state = OTG_STATE_B_IDLE; musb->xceiv->state = OTG_STATE_B_IDLE;
/* /*
...@@ -1947,7 +1947,7 @@ static int musb_gadget_start(struct usb_gadget *g, ...@@ -1947,7 +1947,7 @@ static int musb_gadget_start(struct usb_gadget *g,
if ((musb->xceiv->last_event == USB_EVENT_ID) if ((musb->xceiv->last_event == USB_EVENT_ID)
&& otg->set_vbus) && otg->set_vbus)
otg_set_vbus(musb->xceiv, 1); otg_set_vbus(otg, 1);
hcd->self.uses_pio_for_control = 1; hcd->self.uses_pio_for_control = 1;
} }
...@@ -2029,7 +2029,7 @@ static int musb_gadget_stop(struct usb_gadget *g, ...@@ -2029,7 +2029,7 @@ static int musb_gadget_stop(struct usb_gadget *g,
musb->xceiv->state = OTG_STATE_UNDEFINED; musb->xceiv->state = OTG_STATE_UNDEFINED;
stop_activity(musb, driver); stop_activity(musb, driver);
otg_set_peripheral(musb->xceiv, NULL); otg_set_peripheral(musb->xceiv->otg, NULL);
dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); dev_dbg(musb->controller, "unregistering driver %s\n", driver->function);
......
...@@ -164,8 +164,8 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) ...@@ -164,8 +164,8 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
} }
} }
if (ret && musb->xceiv->set_vbus) if (ret && otg->set_vbus)
otg_set_vbus(musb->xceiv, 1); otg_set_vbus(otg, 1);
} else { } else {
musb->is_active = 1; musb->is_active = 1;
otg->default_a = 1; otg->default_a = 1;
...@@ -270,8 +270,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) ...@@ -270,8 +270,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)
} }
if (data->interface_type == MUSB_INTERFACE_UTMI) { if (data->interface_type == MUSB_INTERFACE_UTMI) {
if (musb->xceiv->set_vbus) if (musb->xceiv->otg->set_vbus)
otg_set_vbus(musb->xceiv, 0); otg_set_vbus(musb->xceiv->otg, 0);
} }
usb_phy_shutdown(musb->xceiv); usb_phy_shutdown(musb->xceiv);
break; break;
......
...@@ -192,30 +192,30 @@ static inline const char *otg_state_string(enum usb_otg_state state) ...@@ -192,30 +192,30 @@ static inline const char *otg_state_string(enum usb_otg_state state)
/* Context: can sleep */ /* Context: can sleep */
static inline int static inline int
otg_start_hnp(struct usb_phy *x) otg_start_hnp(struct usb_otg *otg)
{ {
if (x->otg && x->otg->start_hnp) if (otg && otg->start_hnp)
return x->otg->start_hnp(x->otg); return otg->start_hnp(otg);
return -ENOTSUPP; return -ENOTSUPP;
} }
/* Context: can sleep */ /* Context: can sleep */
static inline int static inline int
otg_set_vbus(struct usb_phy *x, bool enabled) otg_set_vbus(struct usb_otg *otg, bool enabled)
{ {
if (x->otg && x->otg->set_vbus) if (otg && otg->set_vbus)
return x->otg->set_vbus(x->otg, enabled); return otg->set_vbus(otg, enabled);
return -ENOTSUPP; return -ENOTSUPP;
} }
/* for HCDs */ /* for HCDs */
static inline int static inline int
otg_set_host(struct usb_phy *x, struct usb_bus *host) otg_set_host(struct usb_otg *otg, struct usb_bus *host)
{ {
if (x->otg && x->otg->set_host) if (otg && otg->set_host)
return x->otg->set_host(x->otg, host); return otg->set_host(otg, host);
return -ENOTSUPP; return -ENOTSUPP;
} }
...@@ -224,10 +224,10 @@ otg_set_host(struct usb_phy *x, struct usb_bus *host) ...@@ -224,10 +224,10 @@ otg_set_host(struct usb_phy *x, struct usb_bus *host)
/* Context: can sleep */ /* Context: can sleep */
static inline int static inline int
otg_set_peripheral(struct usb_phy *x, struct usb_gadget *periph) otg_set_peripheral(struct usb_otg *otg, struct usb_gadget *periph)
{ {
if (x->otg && x->otg->set_peripheral) if (otg && otg->set_peripheral)
return x->otg->set_peripheral(x->otg, periph); return otg->set_peripheral(otg, periph);
return -ENOTSUPP; return -ENOTSUPP;
} }
...@@ -251,10 +251,10 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend) ...@@ -251,10 +251,10 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
} }
static inline int static inline int
otg_start_srp(struct usb_phy *x) otg_start_srp(struct usb_otg *otg)
{ {
if (x->otg && x->otg->start_srp) if (otg && otg->start_srp)
return x->otg->start_srp(x->otg); return otg->start_srp(otg);
return -ENOTSUPP; return -ENOTSUPP;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册