return err;
}
- err = otg_set_vbus(u2d->otg, 1);
+ err = otg_set_vbus(u2d->otg->otg, 1);
if (err) {
pr_err("OTG transceiver VBUS set failed");
return err;
}
- err = otg_set_host(u2d->otg, host);
+ err = otg_set_host(u2d->otg->otg, host);
if (err)
pr_err("OTG transceiver Host mode set failed");
{
pxa310_otg_transceiver_rtsm();
- otg_set_host(u2d->otg, NULL);
- otg_set_vbus(u2d->otg, 0);
+ otg_set_host(u2d->otg->otg, NULL);
+ otg_set_vbus(u2d->otg->otg, 0);
usb_phy_shutdown(u2d->otg);
}
goto unreg_device;
if (udc->transceiver) {
- retval = otg_set_peripheral(udc->transceiver, &udc->gadget);
+ retval = otg_set_peripheral(udc->transceiver->otg,
+ &udc->gadget);
if (retval)
goto remove_dbg;
}
remove_trans:
if (udc->transceiver) {
- otg_set_peripheral(udc->transceiver, &udc->gadget);
+ otg_set_peripheral(udc->transceiver->otg, &udc->gadget);
usb_put_transceiver(udc->transceiver);
}
usb_del_gadget_udc(&udc->gadget);
if (udc->transceiver) {
- otg_set_peripheral(udc->transceiver, &udc->gadget);
+ otg_set_peripheral(udc->transceiver->otg, &udc->gadget);
usb_put_transceiver(udc->transceiver);
}
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
/* connect to bus through transceiver */
if (udc_controller->transceiver) {
- retval = otg_set_peripheral(udc_controller->transceiver,
+ retval = otg_set_peripheral(
+ udc_controller->transceiver->otg,
&udc_controller->gadget);
if (retval < 0) {
ERR("can't bind to transceiver\n");
return -EINVAL;
if (udc_controller->transceiver)
- otg_set_peripheral(udc_controller->transceiver, NULL);
+ otg_set_peripheral(udc_controller->transceiver->otg, NULL);
/* stop DR, disable intr */
dr_controller_stop(udc_controller);
/* unbind OTG 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 */
langwell_udc_stop(dev);
}
if (udc->transceiver) {
- retval = otg_set_peripheral(udc->transceiver, &udc->gadget);
+ retval = otg_set_peripheral(udc->transceiver->otg,
+ &udc->gadget);
if (retval) {
dev_err(&udc->dev->dev,
"unable to register peripheral to otg\n");
/* NOTE: non-OTG systems may use SRP TOO... */
} else if (!(udc->devstat & UDC_ATT)) {
if (udc->transceiver)
- retval = otg_start_srp(udc->transceiver);
+ retval = otg_start_srp(udc->transceiver->otg);
}
spin_unlock_irqrestore(&udc->lock, flags);
/* connect to bus through transceiver */
if (udc->transceiver) {
- status = otg_set_peripheral(udc->transceiver, &udc->gadget);
+ status = otg_set_peripheral(udc->transceiver->otg,
+ &udc->gadget);
if (status < 0) {
ERR("can't bind to transceiver\n");
if (driver->unbind) {
omap_vbus_session(&udc->gadget, 0);
if (udc->transceiver)
- (void) otg_set_peripheral(udc->transceiver, NULL);
+ (void) otg_set_peripheral(udc->transceiver->otg, NULL);
else
pullup_disable(udc);
/* connect to bus through transceiver */
if (dev->transceiver) {
- retval = otg_set_peripheral(dev->transceiver, &dev->gadget);
+ retval = otg_set_peripheral(dev->transceiver->otg,
+ &dev->gadget);
if (retval) {
DMSG("can't bind to transceiver\n");
if (driver->unbind)
local_irq_enable();
if (dev->transceiver)
- (void) otg_set_peripheral(dev->transceiver, NULL);
+ (void) otg_set_peripheral(dev->transceiver->otg, NULL);
driver->unbind(&dev->gadget);
dev->gadget.dev.driver = NULL;
driver->driver.name);
if (udc->transceiver) {
- retval = otg_set_peripheral(udc->transceiver, &udc->gadget);
+ retval = otg_set_peripheral(udc->transceiver->otg,
+ &udc->gadget);
if (retval) {
dev_err(udc->dev, "can't bind to transceiver\n");
goto transceiver_fail;
driver->driver.name);
if (udc->transceiver)
- return otg_set_peripheral(udc->transceiver, NULL);
+ return otg_set_peripheral(udc->transceiver->otg, NULL);
return 0;
}
/* connect to bus through transceiver */
if (hsudc->transceiver) {
- ret = otg_set_peripheral(hsudc->transceiver, &hsudc->gadget);
+ ret = otg_set_peripheral(hsudc->transceiver->otg,
+ &hsudc->gadget);
if (ret) {
dev_err(hsudc->dev, "%s: can't bind to transceiver\n",
hsudc->gadget.name);
spin_unlock_irqrestore(&hsudc->lock, flags);
if (hsudc->transceiver)
- (void) otg_set_peripheral(hsudc->transceiver, NULL);
+ (void) otg_set_peripheral(hsudc->transceiver->otg, NULL);
disable_irq(hsudc->irq);
hcd, ehci, ehci->transceiver);
if (ehci->transceiver) {
- retval = otg_set_host(ehci->transceiver,
+ retval = otg_set_host(ehci->transceiver->otg,
&ehci_to_hcd(ehci)->self);
if (retval) {
if (ehci->transceiver)
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
if (ehci->transceiver) {
- otg_set_host(ehci->transceiver, NULL);
+ otg_set_host(ehci->transceiver->otg, NULL);
put_device(ehci->transceiver->dev);
}
#ifdef CONFIG_USB_OTG
if ((hcd->self.otg_port == (wIndex + 1))
&& hcd->self.b_hnp_enable) {
- otg_start_hnp(ehci->transceiver);
+ otg_start_hnp(ehci->transceiver->otg);
break;
}
#endif
goto unmap;
}
- ret = otg_set_host(phy, &hcd->self);
+ ret = otg_set_host(phy->otg, &hcd->self);
if (ret < 0) {
dev_err(&pdev->dev, "unable to register with transceiver\n");
goto put_transceiver;
pm_runtime_disable(&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_hcd(hcd);
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) {
dev_err(&pdev->dev,
"unable to register with transceiver\n");
usb_remove_hcd(hcd);
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);
}
ret = -ENODEV;
goto err_add;
}
- ret = otg_set_vbus(pdata->otg, 1);
+ ret = otg_set_vbus(pdata->otg->otg, 1);
if (ret) {
dev_err(dev, "unable to enable vbus on transceiver\n");
goto err_add;
if (pdata->operating_mode == TEGRA_USB_OTG) {
tegra->transceiver = usb_get_transceiver();
if (tegra->transceiver)
- otg_set_host(tegra->transceiver, &hcd->self);
+ otg_set_host(tegra->transceiver->otg, &hcd->self);
}
#endif
fail:
#ifdef CONFIG_USB_OTG_UTILS
if (tegra->transceiver) {
- otg_set_host(tegra->transceiver, NULL);
+ otg_set_host(tegra->transceiver->otg, NULL);
usb_put_transceiver(tegra->transceiver);
}
#endif
#ifdef CONFIG_USB_OTG_UTILS
if (tegra->transceiver) {
- otg_set_host(tegra->transceiver, NULL);
+ otg_set_host(tegra->transceiver->otg, NULL);
usb_put_transceiver(tegra->transceiver);
}
#endif
unsigned long flags;
u32 l;
- otg_start_hnp(ohci->transceiver);
+ otg_start_hnp(ohci->transceiver->otg);
local_irq_save(flags);
ohci->transceiver->state = OTG_STATE_A_SUSPEND;
if (need_transceiver) {
ohci->transceiver = usb_get_transceiver();
if (ohci->transceiver) {
- int status = otg_set_host(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);
usb_remove_hcd(hcd);
if (ohci->transceiver) {
- (void) otg_set_host(ohci->transceiver, 0);
+ (void) otg_set_host(ohci->transceiver->otg, 0);
put_device(ohci->transceiver->dev);
}
if (machine_is_omap_osk())
if (is_host_enabled(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))
hcd->self.otg_port = 1;
}
spin_unlock_irqrestore(&musb->lock, flags);
- otg_start_srp(musb->xceiv);
+ otg_start_srp(musb->xceiv->otg);
spin_lock_irqsave(&musb->lock, flags);
/* Block idling for at least 1s */
spin_lock_irqsave(&musb->lock, flags);
musb->is_active = 1;
- otg_set_peripheral(musb->xceiv, &musb->g);
+ otg_set_peripheral(otg, &musb->g);
musb->xceiv->state = OTG_STATE_B_IDLE;
/*
if ((musb->xceiv->last_event == USB_EVENT_ID)
&& otg->set_vbus)
- otg_set_vbus(musb->xceiv, 1);
+ otg_set_vbus(otg, 1);
hcd->self.uses_pio_for_control = 1;
}
musb->xceiv->state = OTG_STATE_UNDEFINED;
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);
}
}
- if (ret && musb->xceiv->set_vbus)
- otg_set_vbus(musb->xceiv, 1);
+ if (ret && otg->set_vbus)
+ otg_set_vbus(otg, 1);
} else {
musb->is_active = 1;
otg->default_a = 1;
}
if (data->interface_type == MUSB_INTERFACE_UTMI) {
- if (musb->xceiv->set_vbus)
- otg_set_vbus(musb->xceiv, 0);
+ if (musb->xceiv->otg->set_vbus)
+ otg_set_vbus(musb->xceiv->otg, 0);
}
usb_phy_shutdown(musb->xceiv);
break;
/* Context: can sleep */
static inline int
-otg_start_hnp(struct usb_phy *x)
+otg_start_hnp(struct usb_otg *otg)
{
- if (x->otg && x->otg->start_hnp)
- return x->otg->start_hnp(x->otg);
+ if (otg && otg->start_hnp)
+ return otg->start_hnp(otg);
return -ENOTSUPP;
}
/* Context: can sleep */
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)
- return x->otg->set_vbus(x->otg, enabled);
+ if (otg && otg->set_vbus)
+ return otg->set_vbus(otg, enabled);
return -ENOTSUPP;
}
/* for HCDs */
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)
- return x->otg->set_host(x->otg, host);
+ if (otg && otg->set_host)
+ return otg->set_host(otg, host);
return -ENOTSUPP;
}
/* Context: can sleep */
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)
- return x->otg->set_peripheral(x->otg, periph);
+ if (otg && otg->set_peripheral)
+ return otg->set_peripheral(otg, periph);
return -ENOTSUPP;
}
}
static inline int
-otg_start_srp(struct usb_phy *x)
+otg_start_srp(struct usb_otg *otg)
{
- if (x->otg && x->otg->start_srp)
- return x->otg->start_srp(x->otg);
+ if (otg && otg->start_srp)
+ return otg->start_srp(otg);
return -ENOTSUPP;
}