diff options
-rw-r--r-- | arch/arm/mach-pxa/pxa3xx-ulpi.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/ci13xxx_udc.c | 7 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/langwell_udc.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/mv_udc_core.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 7 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa25x_udc.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa27x_udc.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsudc.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-msm.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-mv.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-mxc.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 6 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 8 | ||||
-rw-r--r-- | drivers/usb/musb/omap2430.c | 8 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 30 |
20 files changed, 65 insertions, 58 deletions
diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c index a13f33565623..5ead6d480c6d 100644 --- a/arch/arm/mach-pxa/pxa3xx-ulpi.c +++ b/arch/arm/mach-pxa/pxa3xx-ulpi.c | |||
@@ -145,13 +145,13 @@ static int pxa310_start_otg_host_transcvr(struct usb_bus *host) | |||
145 | return err; | 145 | return err; |
146 | } | 146 | } |
147 | 147 | ||
148 | err = otg_set_vbus(u2d->otg, 1); | 148 | err = otg_set_vbus(u2d->otg->otg, 1); |
149 | if (err) { | 149 | if (err) { |
150 | pr_err("OTG transceiver VBUS set failed"); | 150 | pr_err("OTG transceiver VBUS set failed"); |
151 | return err; | 151 | return err; |
152 | } | 152 | } |
153 | 153 | ||
154 | err = otg_set_host(u2d->otg, host); | 154 | err = otg_set_host(u2d->otg->otg, host); |
155 | if (err) | 155 | if (err) |
156 | pr_err("OTG transceiver Host mode set failed"); | 156 | pr_err("OTG transceiver Host mode set failed"); |
157 | 157 | ||
@@ -189,8 +189,8 @@ static void pxa310_stop_otg_hc(void) | |||
189 | { | 189 | { |
190 | pxa310_otg_transceiver_rtsm(); | 190 | pxa310_otg_transceiver_rtsm(); |
191 | 191 | ||
192 | otg_set_host(u2d->otg, NULL); | 192 | otg_set_host(u2d->otg->otg, NULL); |
193 | otg_set_vbus(u2d->otg, 0); | 193 | otg_set_vbus(u2d->otg->otg, 0); |
194 | usb_phy_shutdown(u2d->otg); | 194 | usb_phy_shutdown(u2d->otg); |
195 | } | 195 | } |
196 | 196 | ||
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 68ad160f2589..b27cb0b0077b 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c | |||
@@ -2928,7 +2928,8 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, | |||
2928 | goto unreg_device; | 2928 | goto unreg_device; |
2929 | 2929 | ||
2930 | if (udc->transceiver) { | 2930 | if (udc->transceiver) { |
2931 | retval = otg_set_peripheral(udc->transceiver, &udc->gadget); | 2931 | retval = otg_set_peripheral(udc->transceiver->otg, |
2932 | &udc->gadget); | ||
2932 | if (retval) | 2933 | if (retval) |
2933 | goto remove_dbg; | 2934 | goto remove_dbg; |
2934 | } | 2935 | } |
@@ -2945,7 +2946,7 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, | |||
2945 | 2946 | ||
2946 | remove_trans: | 2947 | remove_trans: |
2947 | if (udc->transceiver) { | 2948 | if (udc->transceiver) { |
2948 | otg_set_peripheral(udc->transceiver, &udc->gadget); | 2949 | otg_set_peripheral(udc->transceiver->otg, &udc->gadget); |
2949 | usb_put_transceiver(udc->transceiver); | 2950 | usb_put_transceiver(udc->transceiver); |
2950 | } | 2951 | } |
2951 | 2952 | ||
@@ -2981,7 +2982,7 @@ static void udc_remove(void) | |||
2981 | usb_del_gadget_udc(&udc->gadget); | 2982 | usb_del_gadget_udc(&udc->gadget); |
2982 | 2983 | ||
2983 | if (udc->transceiver) { | 2984 | if (udc->transceiver) { |
2984 | otg_set_peripheral(udc->transceiver, &udc->gadget); | 2985 | otg_set_peripheral(udc->transceiver->otg, &udc->gadget); |
2985 | usb_put_transceiver(udc->transceiver); | 2986 | usb_put_transceiver(udc->transceiver); |
2986 | } | 2987 | } |
2987 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES | 2988 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES |
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 21fdfdb18ba8..1e8c0c425fa1 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
@@ -1966,7 +1966,8 @@ static int fsl_start(struct usb_gadget_driver *driver, | |||
1966 | 1966 | ||
1967 | /* connect to bus through transceiver */ | 1967 | /* connect to bus through transceiver */ |
1968 | if (udc_controller->transceiver) { | 1968 | if (udc_controller->transceiver) { |
1969 | retval = otg_set_peripheral(udc_controller->transceiver, | 1969 | retval = otg_set_peripheral( |
1970 | udc_controller->transceiver->otg, | ||
1970 | &udc_controller->gadget); | 1971 | &udc_controller->gadget); |
1971 | if (retval < 0) { | 1972 | if (retval < 0) { |
1972 | ERR("can't bind to transceiver\n"); | 1973 | ERR("can't bind to transceiver\n"); |
@@ -2006,7 +2007,7 @@ static int fsl_stop(struct usb_gadget_driver *driver) | |||
2006 | return -EINVAL; | 2007 | return -EINVAL; |
2007 | 2008 | ||
2008 | if (udc_controller->transceiver) | 2009 | if (udc_controller->transceiver) |
2009 | otg_set_peripheral(udc_controller->transceiver, NULL); | 2010 | otg_set_peripheral(udc_controller->transceiver->otg, NULL); |
2010 | 2011 | ||
2011 | /* stop DR, disable intr */ | 2012 | /* stop DR, disable intr */ |
2012 | dr_controller_stop(udc_controller); | 2013 | dr_controller_stop(udc_controller); |
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index b19a9e46e69d..42a88b680f25 100644 --- a/drivers/usb/gadget/langwell_udc.c +++ b/drivers/usb/gadget/langwell_udc.c | |||
@@ -1906,7 +1906,7 @@ static int langwell_stop(struct usb_gadget *g, | |||
1906 | 1906 | ||
1907 | /* unbind OTG transceiver */ | 1907 | /* unbind OTG transceiver */ |
1908 | if (dev->transceiver) | 1908 | if (dev->transceiver) |
1909 | (void)otg_set_peripheral(dev->transceiver, 0); | 1909 | (void)otg_set_peripheral(dev->transceiver->otg, 0); |
1910 | 1910 | ||
1911 | /* disable interrupt and set controller to stop state */ | 1911 | /* disable interrupt and set controller to stop state */ |
1912 | langwell_udc_stop(dev); | 1912 | langwell_udc_stop(dev); |
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index 50baf3ea336b..7369fd92c03f 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c | |||
@@ -1384,7 +1384,8 @@ static int mv_udc_start(struct usb_gadget_driver *driver, | |||
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | if (udc->transceiver) { | 1386 | if (udc->transceiver) { |
1387 | retval = otg_set_peripheral(udc->transceiver, &udc->gadget); | 1387 | retval = otg_set_peripheral(udc->transceiver->otg, |
1388 | &udc->gadget); | ||
1388 | if (retval) { | 1389 | if (retval) { |
1389 | dev_err(&udc->dev->dev, | 1390 | dev_err(&udc->dev->dev, |
1390 | "unable to register peripheral to otg\n"); | 1391 | "unable to register peripheral to otg\n"); |
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index e82c6995ce26..ace8a652b32b 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -1213,7 +1213,7 @@ static int omap_wakeup(struct usb_gadget *gadget) | |||
1213 | /* NOTE: non-OTG systems may use SRP TOO... */ | 1213 | /* NOTE: non-OTG systems may use SRP TOO... */ |
1214 | } else if (!(udc->devstat & UDC_ATT)) { | 1214 | } else if (!(udc->devstat & UDC_ATT)) { |
1215 | if (udc->transceiver) | 1215 | if (udc->transceiver) |
1216 | retval = otg_start_srp(udc->transceiver); | 1216 | retval = otg_start_srp(udc->transceiver->otg); |
1217 | } | 1217 | } |
1218 | spin_unlock_irqrestore(&udc->lock, flags); | 1218 | spin_unlock_irqrestore(&udc->lock, flags); |
1219 | 1219 | ||
@@ -2156,7 +2156,8 @@ static int omap_udc_start(struct usb_gadget_driver *driver, | |||
2156 | 2156 | ||
2157 | /* connect to bus through transceiver */ | 2157 | /* connect to bus through transceiver */ |
2158 | if (udc->transceiver) { | 2158 | if (udc->transceiver) { |
2159 | status = otg_set_peripheral(udc->transceiver, &udc->gadget); | 2159 | status = otg_set_peripheral(udc->transceiver->otg, |
2160 | &udc->gadget); | ||
2160 | if (status < 0) { | 2161 | if (status < 0) { |
2161 | ERR("can't bind to transceiver\n"); | 2162 | ERR("can't bind to transceiver\n"); |
2162 | if (driver->unbind) { | 2163 | if (driver->unbind) { |
@@ -2202,7 +2203,7 @@ static int omap_udc_stop(struct usb_gadget_driver *driver) | |||
2202 | omap_vbus_session(&udc->gadget, 0); | 2203 | omap_vbus_session(&udc->gadget, 0); |
2203 | 2204 | ||
2204 | if (udc->transceiver) | 2205 | if (udc->transceiver) |
2205 | (void) otg_set_peripheral(udc->transceiver, NULL); | 2206 | (void) otg_set_peripheral(udc->transceiver->otg, NULL); |
2206 | else | 2207 | else |
2207 | pullup_disable(udc); | 2208 | pullup_disable(udc); |
2208 | 2209 | ||
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index b86518e49415..df681b5cd695 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -1301,7 +1301,8 @@ fail: | |||
1301 | 1301 | ||
1302 | /* connect to bus through transceiver */ | 1302 | /* connect to bus through transceiver */ |
1303 | if (dev->transceiver) { | 1303 | if (dev->transceiver) { |
1304 | retval = otg_set_peripheral(dev->transceiver, &dev->gadget); | 1304 | retval = otg_set_peripheral(dev->transceiver->otg, |
1305 | &dev->gadget); | ||
1305 | if (retval) { | 1306 | if (retval) { |
1306 | DMSG("can't bind to transceiver\n"); | 1307 | DMSG("can't bind to transceiver\n"); |
1307 | if (driver->unbind) | 1308 | if (driver->unbind) |
@@ -1360,7 +1361,7 @@ static int pxa25x_stop(struct usb_gadget_driver *driver) | |||
1360 | local_irq_enable(); | 1361 | local_irq_enable(); |
1361 | 1362 | ||
1362 | if (dev->transceiver) | 1363 | if (dev->transceiver) |
1363 | (void) otg_set_peripheral(dev->transceiver, NULL); | 1364 | (void) otg_set_peripheral(dev->transceiver->otg, NULL); |
1364 | 1365 | ||
1365 | driver->unbind(&dev->gadget); | 1366 | driver->unbind(&dev->gadget); |
1366 | dev->gadget.dev.driver = NULL; | 1367 | dev->gadget.dev.driver = NULL; |
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index 1906ed0dcdc2..98acb3ab9e17 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -1835,7 +1835,8 @@ static int pxa27x_udc_start(struct usb_gadget_driver *driver, | |||
1835 | driver->driver.name); | 1835 | driver->driver.name); |
1836 | 1836 | ||
1837 | if (udc->transceiver) { | 1837 | if (udc->transceiver) { |
1838 | retval = otg_set_peripheral(udc->transceiver, &udc->gadget); | 1838 | retval = otg_set_peripheral(udc->transceiver->otg, |
1839 | &udc->gadget); | ||
1839 | if (retval) { | 1840 | if (retval) { |
1840 | dev_err(udc->dev, "can't bind to transceiver\n"); | 1841 | dev_err(udc->dev, "can't bind to transceiver\n"); |
1841 | goto transceiver_fail; | 1842 | goto transceiver_fail; |
@@ -1908,7 +1909,7 @@ static int pxa27x_udc_stop(struct usb_gadget_driver *driver) | |||
1908 | driver->driver.name); | 1909 | driver->driver.name); |
1909 | 1910 | ||
1910 | if (udc->transceiver) | 1911 | if (udc->transceiver) |
1911 | return otg_set_peripheral(udc->transceiver, NULL); | 1912 | return otg_set_peripheral(udc->transceiver->otg, NULL); |
1912 | return 0; | 1913 | return 0; |
1913 | } | 1914 | } |
1914 | 1915 | ||
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index e124bfa399f5..c2f3aa650584 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -1166,7 +1166,8 @@ static int s3c_hsudc_start(struct usb_gadget *gadget, | |||
1166 | 1166 | ||
1167 | /* connect to bus through transceiver */ | 1167 | /* connect to bus through transceiver */ |
1168 | if (hsudc->transceiver) { | 1168 | if (hsudc->transceiver) { |
1169 | ret = otg_set_peripheral(hsudc->transceiver, &hsudc->gadget); | 1169 | ret = otg_set_peripheral(hsudc->transceiver->otg, |
1170 | &hsudc->gadget); | ||
1170 | if (ret) { | 1171 | if (ret) { |
1171 | dev_err(hsudc->dev, "%s: can't bind to transceiver\n", | 1172 | dev_err(hsudc->dev, "%s: can't bind to transceiver\n", |
1172 | hsudc->gadget.name); | 1173 | hsudc->gadget.name); |
@@ -1214,7 +1215,7 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget, | |||
1214 | spin_unlock_irqrestore(&hsudc->lock, flags); | 1215 | spin_unlock_irqrestore(&hsudc->lock, flags); |
1215 | 1216 | ||
1216 | if (hsudc->transceiver) | 1217 | if (hsudc->transceiver) |
1217 | (void) otg_set_peripheral(hsudc->transceiver, NULL); | 1218 | (void) otg_set_peripheral(hsudc->transceiver->otg, NULL); |
1218 | 1219 | ||
1219 | disable_irq(hsudc->irq); | 1220 | disable_irq(hsudc->irq); |
1220 | 1221 | ||
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 481effdc7f54..4786ba5f2e6c 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c | |||
@@ -147,7 +147,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, | |||
147 | hcd, ehci, ehci->transceiver); | 147 | hcd, ehci, ehci->transceiver); |
148 | 148 | ||
149 | if (ehci->transceiver) { | 149 | if (ehci->transceiver) { |
150 | retval = otg_set_host(ehci->transceiver, | 150 | retval = otg_set_host(ehci->transceiver->otg, |
151 | &ehci_to_hcd(ehci)->self); | 151 | &ehci_to_hcd(ehci)->self); |
152 | if (retval) { | 152 | if (retval) { |
153 | if (ehci->transceiver) | 153 | if (ehci->transceiver) |
@@ -194,7 +194,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd, | |||
194 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 194 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
195 | 195 | ||
196 | if (ehci->transceiver) { | 196 | if (ehci->transceiver) { |
197 | otg_set_host(ehci->transceiver, NULL); | 197 | otg_set_host(ehci->transceiver->otg, NULL); |
198 | put_device(ehci->transceiver->dev); | 198 | put_device(ehci->transceiver->dev); |
199 | } | 199 | } |
200 | 200 | ||
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 77bbb2357e47..75a2b30d8aa6 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -727,7 +727,7 @@ static int ehci_hub_control ( | |||
727 | #ifdef CONFIG_USB_OTG | 727 | #ifdef CONFIG_USB_OTG |
728 | if ((hcd->self.otg_port == (wIndex + 1)) | 728 | if ((hcd->self.otg_port == (wIndex + 1)) |
729 | && hcd->self.b_hnp_enable) { | 729 | && hcd->self.b_hnp_enable) { |
730 | otg_start_hnp(ehci->transceiver); | 730 | otg_start_hnp(ehci->transceiver->otg); |
731 | break; | 731 | break; |
732 | } | 732 | } |
733 | #endif | 733 | #endif |
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index d8db5ecf5e37..9803a55fd5f4 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c | |||
@@ -152,7 +152,7 @@ static int ehci_msm_probe(struct platform_device *pdev) | |||
152 | goto unmap; | 152 | goto unmap; |
153 | } | 153 | } |
154 | 154 | ||
155 | ret = otg_set_host(phy, &hcd->self); | 155 | ret = otg_set_host(phy->otg, &hcd->self); |
156 | if (ret < 0) { | 156 | if (ret < 0) { |
157 | dev_err(&pdev->dev, "unable to register with transceiver\n"); | 157 | dev_err(&pdev->dev, "unable to register with transceiver\n"); |
158 | goto put_transceiver; | 158 | goto put_transceiver; |
@@ -186,7 +186,7 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev) | |||
186 | pm_runtime_disable(&pdev->dev); | 186 | pm_runtime_disable(&pdev->dev); |
187 | pm_runtime_set_suspended(&pdev->dev); | 187 | pm_runtime_set_suspended(&pdev->dev); |
188 | 188 | ||
189 | otg_set_host(phy, NULL); | 189 | otg_set_host(phy->otg, NULL); |
190 | usb_put_transceiver(phy); | 190 | usb_put_transceiver(phy); |
191 | 191 | ||
192 | usb_put_hcd(hcd); | 192 | usb_put_hcd(hcd); |
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 62a63b598149..a936bbcff8f4 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c | |||
@@ -261,7 +261,7 @@ static int mv_ehci_probe(struct platform_device *pdev) | |||
261 | goto err_disable_clk; | 261 | goto err_disable_clk; |
262 | } | 262 | } |
263 | 263 | ||
264 | retval = otg_set_host(ehci_mv->otg, &hcd->self); | 264 | retval = otg_set_host(ehci_mv->otg->otg, &hcd->self); |
265 | if (retval < 0) { | 265 | if (retval < 0) { |
266 | dev_err(&pdev->dev, | 266 | dev_err(&pdev->dev, |
267 | "unable to register with transceiver\n"); | 267 | "unable to register with transceiver\n"); |
@@ -332,7 +332,7 @@ static int mv_ehci_remove(struct platform_device *pdev) | |||
332 | usb_remove_hcd(hcd); | 332 | usb_remove_hcd(hcd); |
333 | 333 | ||
334 | if (ehci_mv->otg) { | 334 | if (ehci_mv->otg) { |
335 | otg_set_host(ehci_mv->otg, NULL); | 335 | otg_set_host(ehci_mv->otg->otg, NULL); |
336 | usb_put_transceiver(ehci_mv->otg); | 336 | usb_put_transceiver(ehci_mv->otg); |
337 | } | 337 | } |
338 | 338 | ||
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index b762fe0955b9..a797d51ecbe8 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -226,7 +226,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
226 | ret = -ENODEV; | 226 | ret = -ENODEV; |
227 | goto err_add; | 227 | goto err_add; |
228 | } | 228 | } |
229 | ret = otg_set_vbus(pdata->otg, 1); | 229 | ret = otg_set_vbus(pdata->otg->otg, 1); |
230 | if (ret) { | 230 | if (ret) { |
231 | dev_err(dev, "unable to enable vbus on transceiver\n"); | 231 | dev_err(dev, "unable to enable vbus on transceiver\n"); |
232 | goto err_add; | 232 | goto err_add; |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 701a0bf58623..3de48a2d7955 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -735,7 +735,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
735 | if (pdata->operating_mode == TEGRA_USB_OTG) { | 735 | if (pdata->operating_mode == TEGRA_USB_OTG) { |
736 | tegra->transceiver = usb_get_transceiver(); | 736 | tegra->transceiver = usb_get_transceiver(); |
737 | if (tegra->transceiver) | 737 | if (tegra->transceiver) |
738 | otg_set_host(tegra->transceiver, &hcd->self); | 738 | otg_set_host(tegra->transceiver->otg, &hcd->self); |
739 | } | 739 | } |
740 | #endif | 740 | #endif |
741 | 741 | ||
@@ -750,7 +750,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
750 | fail: | 750 | fail: |
751 | #ifdef CONFIG_USB_OTG_UTILS | 751 | #ifdef CONFIG_USB_OTG_UTILS |
752 | if (tegra->transceiver) { | 752 | if (tegra->transceiver) { |
753 | otg_set_host(tegra->transceiver, NULL); | 753 | otg_set_host(tegra->transceiver->otg, NULL); |
754 | usb_put_transceiver(tegra->transceiver); | 754 | usb_put_transceiver(tegra->transceiver); |
755 | } | 755 | } |
756 | #endif | 756 | #endif |
@@ -808,7 +808,7 @@ static int tegra_ehci_remove(struct platform_device *pdev) | |||
808 | 808 | ||
809 | #ifdef CONFIG_USB_OTG_UTILS | 809 | #ifdef CONFIG_USB_OTG_UTILS |
810 | if (tegra->transceiver) { | 810 | if (tegra->transceiver) { |
811 | otg_set_host(tegra->transceiver, NULL); | 811 | otg_set_host(tegra->transceiver->otg, NULL); |
812 | usb_put_transceiver(tegra->transceiver); | 812 | usb_put_transceiver(tegra->transceiver); |
813 | } | 813 | } |
814 | #endif | 814 | #endif |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 744e25da800f..96451e41ee8a 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -171,7 +171,7 @@ static void start_hnp(struct ohci_hcd *ohci) | |||
171 | unsigned long flags; | 171 | unsigned long flags; |
172 | u32 l; | 172 | u32 l; |
173 | 173 | ||
174 | otg_start_hnp(ohci->transceiver); | 174 | otg_start_hnp(ohci->transceiver->otg); |
175 | 175 | ||
176 | local_irq_save(flags); | 176 | local_irq_save(flags); |
177 | ohci->transceiver->state = OTG_STATE_A_SUSPEND; | 177 | ohci->transceiver->state = OTG_STATE_A_SUSPEND; |
@@ -212,7 +212,7 @@ static int ohci_omap_init(struct usb_hcd *hcd) | |||
212 | if (need_transceiver) { | 212 | if (need_transceiver) { |
213 | ohci->transceiver = usb_get_transceiver(); | 213 | ohci->transceiver = usb_get_transceiver(); |
214 | if (ohci->transceiver) { | 214 | if (ohci->transceiver) { |
215 | int status = otg_set_host(ohci->transceiver, | 215 | int status = otg_set_host(ohci->transceiver->otg, |
216 | &ohci_to_hcd(ohci)->self); | 216 | &ohci_to_hcd(ohci)->self); |
217 | dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", | 217 | dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", |
218 | ohci->transceiver->label, status); | 218 | ohci->transceiver->label, status); |
@@ -404,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) | |||
404 | 404 | ||
405 | usb_remove_hcd(hcd); | 405 | usb_remove_hcd(hcd); |
406 | if (ohci->transceiver) { | 406 | if (ohci->transceiver) { |
407 | (void) otg_set_host(ohci->transceiver, 0); | 407 | (void) otg_set_host(ohci->transceiver->otg, 0); |
408 | put_device(ohci->transceiver->dev); | 408 | put_device(ohci->transceiver->dev); |
409 | } | 409 | } |
410 | if (machine_is_omap_osk()) | 410 | if (machine_is_omap_osk()) |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 7e9be74dba4d..88bf453e33da 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -1961,7 +1961,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
1961 | if (is_host_enabled(musb)) { | 1961 | if (is_host_enabled(musb)) { |
1962 | struct usb_hcd *hcd = musb_to_hcd(musb); | 1962 | struct usb_hcd *hcd = musb_to_hcd(musb); |
1963 | 1963 | ||
1964 | otg_set_host(musb->xceiv, &hcd->self); | 1964 | otg_set_host(musb->xceiv->otg, &hcd->self); |
1965 | 1965 | ||
1966 | if (is_otg_enabled(musb)) | 1966 | if (is_otg_enabled(musb)) |
1967 | hcd->self.otg_port = 1; | 1967 | hcd->self.otg_port = 1; |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 3a1793663d91..caeaf9f96f73 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1624,7 +1624,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) | |||
1624 | } | 1624 | } |
1625 | 1625 | ||
1626 | spin_unlock_irqrestore(&musb->lock, flags); | 1626 | spin_unlock_irqrestore(&musb->lock, flags); |
1627 | otg_start_srp(musb->xceiv); | 1627 | otg_start_srp(musb->xceiv->otg); |
1628 | spin_lock_irqsave(&musb->lock, flags); | 1628 | spin_lock_irqsave(&musb->lock, flags); |
1629 | 1629 | ||
1630 | /* Block idling for at least 1s */ | 1630 | /* Block idling for at least 1s */ |
@@ -1915,7 +1915,7 @@ static int musb_gadget_start(struct usb_gadget *g, | |||
1915 | spin_lock_irqsave(&musb->lock, flags); | 1915 | spin_lock_irqsave(&musb->lock, flags); |
1916 | musb->is_active = 1; | 1916 | musb->is_active = 1; |
1917 | 1917 | ||
1918 | otg_set_peripheral(musb->xceiv, &musb->g); | 1918 | otg_set_peripheral(otg, &musb->g); |
1919 | musb->xceiv->state = OTG_STATE_B_IDLE; | 1919 | musb->xceiv->state = OTG_STATE_B_IDLE; |
1920 | 1920 | ||
1921 | /* | 1921 | /* |
@@ -1947,7 +1947,7 @@ static int musb_gadget_start(struct usb_gadget *g, | |||
1947 | 1947 | ||
1948 | if ((musb->xceiv->last_event == USB_EVENT_ID) | 1948 | if ((musb->xceiv->last_event == USB_EVENT_ID) |
1949 | && otg->set_vbus) | 1949 | && otg->set_vbus) |
1950 | otg_set_vbus(musb->xceiv, 1); | 1950 | otg_set_vbus(otg, 1); |
1951 | 1951 | ||
1952 | hcd->self.uses_pio_for_control = 1; | 1952 | hcd->self.uses_pio_for_control = 1; |
1953 | } | 1953 | } |
@@ -2029,7 +2029,7 @@ static int musb_gadget_stop(struct usb_gadget *g, | |||
2029 | 2029 | ||
2030 | musb->xceiv->state = OTG_STATE_UNDEFINED; | 2030 | musb->xceiv->state = OTG_STATE_UNDEFINED; |
2031 | stop_activity(musb, driver); | 2031 | stop_activity(musb, driver); |
2032 | otg_set_peripheral(musb->xceiv, NULL); | 2032 | otg_set_peripheral(musb->xceiv->otg, NULL); |
2033 | 2033 | ||
2034 | dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); | 2034 | dev_dbg(musb->controller, "unregistering driver %s\n", driver->function); |
2035 | 2035 | ||
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 96a3d3763cc4..d8df60a9fc2a 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -164,8 +164,8 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) | |||
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | if (ret && musb->xceiv->set_vbus) | 167 | if (ret && otg->set_vbus) |
168 | otg_set_vbus(musb->xceiv, 1); | 168 | otg_set_vbus(otg, 1); |
169 | } else { | 169 | } else { |
170 | musb->is_active = 1; | 170 | musb->is_active = 1; |
171 | otg->default_a = 1; | 171 | otg->default_a = 1; |
@@ -270,8 +270,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) | |||
270 | } | 270 | } |
271 | 271 | ||
272 | if (data->interface_type == MUSB_INTERFACE_UTMI) { | 272 | if (data->interface_type == MUSB_INTERFACE_UTMI) { |
273 | if (musb->xceiv->set_vbus) | 273 | if (musb->xceiv->otg->set_vbus) |
274 | otg_set_vbus(musb->xceiv, 0); | 274 | otg_set_vbus(musb->xceiv->otg, 0); |
275 | } | 275 | } |
276 | usb_phy_shutdown(musb->xceiv); | 276 | usb_phy_shutdown(musb->xceiv); |
277 | break; | 277 | break; |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index de89342098e4..f67810f8f21b 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -192,30 +192,30 @@ static inline const char *otg_state_string(enum usb_otg_state state) | |||
192 | 192 | ||
193 | /* Context: can sleep */ | 193 | /* Context: can sleep */ |
194 | static inline int | 194 | static inline int |
195 | otg_start_hnp(struct usb_phy *x) | 195 | otg_start_hnp(struct usb_otg *otg) |
196 | { | 196 | { |
197 | if (x->otg && x->otg->start_hnp) | 197 | if (otg && otg->start_hnp) |
198 | return x->otg->start_hnp(x->otg); | 198 | return otg->start_hnp(otg); |
199 | 199 | ||
200 | return -ENOTSUPP; | 200 | return -ENOTSUPP; |
201 | } | 201 | } |
202 | 202 | ||
203 | /* Context: can sleep */ | 203 | /* Context: can sleep */ |
204 | static inline int | 204 | static inline int |
205 | otg_set_vbus(struct usb_phy *x, bool enabled) | 205 | otg_set_vbus(struct usb_otg *otg, bool enabled) |
206 | { | 206 | { |
207 | if (x->otg && x->otg->set_vbus) | 207 | if (otg && otg->set_vbus) |
208 | return x->otg->set_vbus(x->otg, enabled); | 208 | return otg->set_vbus(otg, enabled); |
209 | 209 | ||
210 | return -ENOTSUPP; | 210 | return -ENOTSUPP; |
211 | } | 211 | } |
212 | 212 | ||
213 | /* for HCDs */ | 213 | /* for HCDs */ |
214 | static inline int | 214 | static inline int |
215 | otg_set_host(struct usb_phy *x, struct usb_bus *host) | 215 | otg_set_host(struct usb_otg *otg, struct usb_bus *host) |
216 | { | 216 | { |
217 | if (x->otg && x->otg->set_host) | 217 | if (otg && otg->set_host) |
218 | return x->otg->set_host(x->otg, host); | 218 | return otg->set_host(otg, host); |
219 | 219 | ||
220 | return -ENOTSUPP; | 220 | return -ENOTSUPP; |
221 | } | 221 | } |
@@ -224,10 +224,10 @@ otg_set_host(struct usb_phy *x, struct usb_bus *host) | |||
224 | 224 | ||
225 | /* Context: can sleep */ | 225 | /* Context: can sleep */ |
226 | static inline int | 226 | static inline int |
227 | otg_set_peripheral(struct usb_phy *x, struct usb_gadget *periph) | 227 | otg_set_peripheral(struct usb_otg *otg, struct usb_gadget *periph) |
228 | { | 228 | { |
229 | if (x->otg && x->otg->set_peripheral) | 229 | if (otg && otg->set_peripheral) |
230 | return x->otg->set_peripheral(x->otg, periph); | 230 | return otg->set_peripheral(otg, periph); |
231 | 231 | ||
232 | return -ENOTSUPP; | 232 | return -ENOTSUPP; |
233 | } | 233 | } |
@@ -251,10 +251,10 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend) | |||
251 | } | 251 | } |
252 | 252 | ||
253 | static inline int | 253 | static inline int |
254 | otg_start_srp(struct usb_phy *x) | 254 | otg_start_srp(struct usb_otg *otg) |
255 | { | 255 | { |
256 | if (x->otg && x->otg->start_srp) | 256 | if (otg && otg->start_srp) |
257 | return x->otg->start_srp(x->otg); | 257 | return otg->start_srp(otg); |
258 | 258 | ||
259 | return -ENOTSUPP; | 259 | return -ENOTSUPP; |
260 | } | 260 | } |