diff options
Diffstat (limited to 'drivers/usb/host/ehci-mxc.c')
-rw-r--r-- | drivers/usb/host/ehci-mxc.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index a22d2df769a9..fa59b26fc5bc 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -36,14 +36,8 @@ struct ehci_mxc_priv { | |||
36 | static int ehci_mxc_setup(struct usb_hcd *hcd) | 36 | static int ehci_mxc_setup(struct usb_hcd *hcd) |
37 | { | 37 | { |
38 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 38 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
39 | struct device *dev = hcd->self.controller; | ||
40 | struct mxc_usbh_platform_data *pdata = dev_get_platdata(dev); | ||
41 | int retval; | 39 | int retval; |
42 | 40 | ||
43 | /* EHCI registers start at offset 0x100 */ | ||
44 | ehci->caps = hcd->regs + 0x100; | ||
45 | ehci->regs = hcd->regs + 0x100 + | ||
46 | HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
47 | dbg_hcs_params(ehci, "reset"); | 41 | dbg_hcs_params(ehci, "reset"); |
48 | dbg_hcc_params(ehci, "reset"); | 42 | dbg_hcc_params(ehci, "reset"); |
49 | 43 | ||
@@ -65,12 +59,6 @@ static int ehci_mxc_setup(struct usb_hcd *hcd) | |||
65 | 59 | ||
66 | ehci_reset(ehci); | 60 | ehci_reset(ehci); |
67 | 61 | ||
68 | /* set up the PORTSCx register */ | ||
69 | ehci_writel(ehci, pdata->portsc, &ehci->regs->port_status[0]); | ||
70 | |||
71 | /* is this really needed? */ | ||
72 | msleep(10); | ||
73 | |||
74 | ehci_port_power(ehci, 0); | 62 | ehci_port_power(ehci, 0); |
75 | return 0; | 63 | return 0; |
76 | } | 64 | } |
@@ -100,6 +88,7 @@ static const struct hc_driver ehci_mxc_hc_driver = { | |||
100 | .urb_enqueue = ehci_urb_enqueue, | 88 | .urb_enqueue = ehci_urb_enqueue, |
101 | .urb_dequeue = ehci_urb_dequeue, | 89 | .urb_dequeue = ehci_urb_dequeue, |
102 | .endpoint_disable = ehci_endpoint_disable, | 90 | .endpoint_disable = ehci_endpoint_disable, |
91 | .endpoint_reset = ehci_endpoint_reset, | ||
103 | 92 | ||
104 | /* | 93 | /* |
105 | * scheduling support | 94 | * scheduling support |
@@ -115,6 +104,8 @@ static const struct hc_driver ehci_mxc_hc_driver = { | |||
115 | .bus_resume = ehci_bus_resume, | 104 | .bus_resume = ehci_bus_resume, |
116 | .relinquish_port = ehci_relinquish_port, | 105 | .relinquish_port = ehci_relinquish_port, |
117 | .port_handed_over = ehci_port_handed_over, | 106 | .port_handed_over = ehci_port_handed_over, |
107 | |||
108 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
118 | }; | 109 | }; |
119 | 110 | ||
120 | static int ehci_mxc_drv_probe(struct platform_device *pdev) | 111 | static int ehci_mxc_drv_probe(struct platform_device *pdev) |
@@ -125,6 +116,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
125 | int irq, ret; | 116 | int irq, ret; |
126 | struct ehci_mxc_priv *priv; | 117 | struct ehci_mxc_priv *priv; |
127 | struct device *dev = &pdev->dev; | 118 | struct device *dev = &pdev->dev; |
119 | struct ehci_hcd *ehci; | ||
128 | 120 | ||
129 | dev_info(&pdev->dev, "initializing i.MX USB Controller\n"); | 121 | dev_info(&pdev->dev, "initializing i.MX USB Controller\n"); |
130 | 122 | ||
@@ -212,6 +204,19 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
212 | if (ret < 0) | 204 | if (ret < 0) |
213 | goto err_init; | 205 | goto err_init; |
214 | 206 | ||
207 | ehci = hcd_to_ehci(hcd); | ||
208 | |||
209 | /* EHCI registers start at offset 0x100 */ | ||
210 | ehci->caps = hcd->regs + 0x100; | ||
211 | ehci->regs = hcd->regs + 0x100 + | ||
212 | HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
213 | |||
214 | /* set up the PORTSCx register */ | ||
215 | ehci_writel(ehci, pdata->portsc, &ehci->regs->port_status[0]); | ||
216 | |||
217 | /* is this really needed? */ | ||
218 | msleep(10); | ||
219 | |||
215 | /* Initialize the transceiver */ | 220 | /* Initialize the transceiver */ |
216 | if (pdata->otg) { | 221 | if (pdata->otg) { |
217 | pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; | 222 | pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; |