diff options
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 27 | ||||
-rw-r--r-- | drivers/usb/host/ohci.h | 5 |
5 files changed, 25 insertions, 34 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 43362577b54a..3379945b095e 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c | |||
@@ -142,19 +142,19 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, | |||
142 | if (pdata->operating_mode == FSL_USB2_DR_OTG) { | 142 | if (pdata->operating_mode == FSL_USB2_DR_OTG) { |
143 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 143 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
144 | 144 | ||
145 | ehci->transceiver = usb_get_transceiver(); | 145 | hcd->phy = usb_get_transceiver(); |
146 | dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", | 146 | dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, phy=0x%p\n", |
147 | hcd, ehci, ehci->transceiver); | 147 | hcd, ehci, hcd->phy); |
148 | 148 | ||
149 | if (ehci->transceiver) { | 149 | if (hcd->phy) { |
150 | retval = otg_set_host(ehci->transceiver->otg, | 150 | retval = otg_set_host(hcd->phy->otg, |
151 | &ehci_to_hcd(ehci)->self); | 151 | &ehci_to_hcd(ehci)->self); |
152 | if (retval) { | 152 | if (retval) { |
153 | usb_put_transceiver(ehci->transceiver); | 153 | usb_put_transceiver(hcd->phy); |
154 | goto err4; | 154 | goto err4; |
155 | } | 155 | } |
156 | } else { | 156 | } else { |
157 | dev_err(&pdev->dev, "can't find transceiver\n"); | 157 | dev_err(&pdev->dev, "can't find phy\n"); |
158 | retval = -ENODEV; | 158 | retval = -ENODEV; |
159 | goto err4; | 159 | goto err4; |
160 | } | 160 | } |
@@ -190,11 +190,10 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd, | |||
190 | struct platform_device *pdev) | 190 | struct platform_device *pdev) |
191 | { | 191 | { |
192 | struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; | 192 | struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; |
193 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
194 | 193 | ||
195 | if (ehci->transceiver) { | 194 | if (hcd->phy) { |
196 | otg_set_host(ehci->transceiver->otg, NULL); | 195 | otg_set_host(hcd->phy->otg, NULL); |
197 | usb_put_transceiver(ehci->transceiver); | 196 | usb_put_transceiver(hcd->phy); |
198 | } | 197 | } |
199 | 198 | ||
200 | usb_remove_hcd(hcd); | 199 | usb_remove_hcd(hcd); |
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index fc9e7cc6ac9b..dd5eef6af6df 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -724,7 +724,7 @@ static int ehci_hub_control ( | |||
724 | #ifdef CONFIG_USB_OTG | 724 | #ifdef CONFIG_USB_OTG |
725 | if ((hcd->self.otg_port == (wIndex + 1)) | 725 | if ((hcd->self.otg_port == (wIndex + 1)) |
726 | && hcd->self.b_hnp_enable) { | 726 | && hcd->self.b_hnp_enable) { |
727 | otg_start_hnp(ehci->transceiver->otg); | 727 | otg_start_hnp(hcd->phy->otg); |
728 | break; | 728 | break; |
729 | } | 729 | } |
730 | #endif | 730 | #endif |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 2694ed6558d2..85c3572155d1 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -175,10 +175,6 @@ struct ehci_hcd { /* one per controller */ | |||
175 | #ifdef DEBUG | 175 | #ifdef DEBUG |
176 | struct dentry *debug_dir; | 176 | struct dentry *debug_dir; |
177 | #endif | 177 | #endif |
178 | /* | ||
179 | * OTG controllers and transceivers need software interaction | ||
180 | */ | ||
181 | struct usb_phy *transceiver; | ||
182 | }; | 178 | }; |
183 | 179 | ||
184 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ | 180 | /* convert between an HCD pointer and the corresponding EHCI_HCD */ |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 9ce35d0d9d5d..eccddb461396 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -167,14 +167,15 @@ static int omap_1510_local_bus_init(void) | |||
167 | 167 | ||
168 | static void start_hnp(struct ohci_hcd *ohci) | 168 | static void start_hnp(struct ohci_hcd *ohci) |
169 | { | 169 | { |
170 | const unsigned port = ohci_to_hcd(ohci)->self.otg_port - 1; | 170 | struct usb_hcd *hcd = ohci_to_hcd(ohci); |
171 | const unsigned port = hcd->self.otg_port - 1; | ||
171 | unsigned long flags; | 172 | unsigned long flags; |
172 | u32 l; | 173 | u32 l; |
173 | 174 | ||
174 | otg_start_hnp(ohci->transceiver->otg); | 175 | otg_start_hnp(hcd->phy->otg); |
175 | 176 | ||
176 | local_irq_save(flags); | 177 | local_irq_save(flags); |
177 | ohci->transceiver->state = OTG_STATE_A_SUSPEND; | 178 | hcd->phy->state = OTG_STATE_A_SUSPEND; |
178 | writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]); | 179 | writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]); |
179 | l = omap_readl(OTG_CTRL); | 180 | l = omap_readl(OTG_CTRL); |
180 | l &= ~OTG_A_BUSREQ; | 181 | l &= ~OTG_A_BUSREQ; |
@@ -211,18 +212,18 @@ static int ohci_omap_init(struct usb_hcd *hcd) | |||
211 | 212 | ||
212 | #ifdef CONFIG_USB_OTG | 213 | #ifdef CONFIG_USB_OTG |
213 | if (need_transceiver) { | 214 | if (need_transceiver) { |
214 | ohci->transceiver = usb_get_transceiver(); | 215 | hcd->phy = usb_get_transceiver(); |
215 | if (ohci->transceiver) { | 216 | if (hcd->phy) { |
216 | int status = otg_set_host(ohci->transceiver->otg, | 217 | int status = otg_set_host(hcd->phy->otg, |
217 | &ohci_to_hcd(ohci)->self); | 218 | &ohci_to_hcd(ohci)->self); |
218 | dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", | 219 | dev_dbg(hcd->self.controller, "init %s phy, status %d\n", |
219 | ohci->transceiver->label, status); | 220 | hcd->phy->label, status); |
220 | if (status) { | 221 | if (status) { |
221 | usb_put_transceiver(ohci->transceiver); | 222 | usb_put_transceiver(hcd->phy); |
222 | return status; | 223 | return status; |
223 | } | 224 | } |
224 | } else { | 225 | } else { |
225 | dev_err(hcd->self.controller, "can't find transceiver\n"); | 226 | dev_err(hcd->self.controller, "can't find phy\n"); |
226 | return -ENODEV; | 227 | return -ENODEV; |
227 | } | 228 | } |
228 | ohci->start_hnp = start_hnp; | 229 | ohci->start_hnp = start_hnp; |
@@ -403,9 +404,9 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) | |||
403 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 404 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
404 | 405 | ||
405 | usb_remove_hcd(hcd); | 406 | usb_remove_hcd(hcd); |
406 | if (ohci->transceiver) { | 407 | if (hcd->phy) { |
407 | (void) otg_set_host(ohci->transceiver->otg, 0); | 408 | (void) otg_set_host(hcd->phy->otg, 0); |
408 | usb_put_transceiver(ohci->transceiver); | 409 | usb_put_transceiver(hcd->phy); |
409 | } | 410 | } |
410 | if (machine_is_omap_osk()) | 411 | if (machine_is_omap_osk()) |
411 | gpio_free(9); | 412 | gpio_free(9); |
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 1b19aea25a2b..d3299143d9e2 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h | |||
@@ -372,11 +372,6 @@ struct ohci_hcd { | |||
372 | struct ed *ed_controltail; /* last in ctrl list */ | 372 | struct ed *ed_controltail; /* last in ctrl list */ |
373 | struct ed *periodic [NUM_INTS]; /* shadow int_table */ | 373 | struct ed *periodic [NUM_INTS]; /* shadow int_table */ |
374 | 374 | ||
375 | /* | ||
376 | * OTG controllers and transceivers need software interaction; | ||
377 | * other external transceivers should be software-transparent | ||
378 | */ | ||
379 | struct usb_phy *transceiver; | ||
380 | void (*start_hnp)(struct ohci_hcd *ohci); | 375 | void (*start_hnp)(struct ohci_hcd *ohci); |
381 | 376 | ||
382 | /* | 377 | /* |