aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-omap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ohci-omap.c')
-rw-r--r--drivers/usb/host/ohci-omap.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index b02c344e2cc9..e7d75d295988 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -18,6 +18,7 @@
18#include <linux/jiffies.h> 18#include <linux/jiffies.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h>
21#include <linux/gpio.h> 22#include <linux/gpio.h>
22 23
23#include <asm/io.h> 24#include <asm/io.h>
@@ -168,14 +169,15 @@ static int omap_1510_local_bus_init(void)
168 169
169static void start_hnp(struct ohci_hcd *ohci) 170static void start_hnp(struct ohci_hcd *ohci)
170{ 171{
171 const unsigned port = ohci_to_hcd(ohci)->self.otg_port - 1; 172 struct usb_hcd *hcd = ohci_to_hcd(ohci);
173 const unsigned port = hcd->self.otg_port - 1;
172 unsigned long flags; 174 unsigned long flags;
173 u32 l; 175 u32 l;
174 176
175 otg_start_hnp(ohci->transceiver->otg); 177 otg_start_hnp(hcd->phy->otg);
176 178
177 local_irq_save(flags); 179 local_irq_save(flags);
178 ohci->transceiver->state = OTG_STATE_A_SUSPEND; 180 hcd->phy->state = OTG_STATE_A_SUSPEND;
179 writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]); 181 writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]);
180 l = omap_readl(OTG_CTRL); 182 l = omap_readl(OTG_CTRL);
181 l &= ~OTG_A_BUSREQ; 183 l &= ~OTG_A_BUSREQ;
@@ -212,18 +214,18 @@ static int ohci_omap_init(struct usb_hcd *hcd)
212 214
213#ifdef CONFIG_USB_OTG 215#ifdef CONFIG_USB_OTG
214 if (need_transceiver) { 216 if (need_transceiver) {
215 ohci->transceiver = usb_get_transceiver(); 217 hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2);
216 if (ohci->transceiver) { 218 if (!IS_ERR_OR_NULL(hcd->phy)) {
217 int status = otg_set_host(ohci->transceiver->otg, 219 int status = otg_set_host(hcd->phy->otg,
218 &ohci_to_hcd(ohci)->self); 220 &ohci_to_hcd(ohci)->self);
219 dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", 221 dev_dbg(hcd->self.controller, "init %s phy, status %d\n",
220 ohci->transceiver->label, status); 222 hcd->phy->label, status);
221 if (status) { 223 if (status) {
222 usb_put_transceiver(ohci->transceiver); 224 usb_put_phy(hcd->phy);
223 return status; 225 return status;
224 } 226 }
225 } else { 227 } else {
226 dev_err(hcd->self.controller, "can't find transceiver\n"); 228 dev_err(hcd->self.controller, "can't find phy\n");
227 return -ENODEV; 229 return -ENODEV;
228 } 230 }
229 ohci->start_hnp = start_hnp; 231 ohci->start_hnp = start_hnp;
@@ -404,9 +406,9 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
404 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 406 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
405 407
406 usb_remove_hcd(hcd); 408 usb_remove_hcd(hcd);
407 if (ohci->transceiver) { 409 if (!IS_ERR_OR_NULL(hcd->phy)) {
408 (void) otg_set_host(ohci->transceiver->otg, 0); 410 (void) otg_set_host(hcd->phy->otg, 0);
409 usb_put_transceiver(ohci->transceiver); 411 usb_put_phy(hcd->phy);
410 } 412 }
411 if (machine_is_omap_osk()) 413 if (machine_is_omap_osk())
412 gpio_free(9); 414 gpio_free(9);