aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-grlib.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-09 15:55:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-09 16:35:05 -0400
commit1a49e2ac9651df7349867a5cf44e2c83de1046af (patch)
treeb4ba01d645073947dcf8bbe1972b7af740031b5b /drivers/usb/host/ehci-grlib.c
parent1530280084c3905be6fce802cbfa83fb3bbb8839 (diff)
EHCI: centralize controller initialization
This patch (as1564c) converts the EHCI platform drivers to use the central ehci_setup() routine for generic controller initialization rather than each having its own idiosyncratic approach. The major point of difficulty lies in ehci-pci's many vendor- and device-specific workarounds. Some of them have to be applied before calling ehci_setup() and some after, which necessitates a fair amount of code motion. The other platform drivers require much smaller changes. One point not addressed by the patch is whether ports should be powered on or off following initialization. The different drivers appear to handle this pretty much at random. In fact it shouldn't matter, because the hub driver turns on power to all ports when it binds to the root hub. Straightening that out will be left for another day. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-grlib.c')
-rw-r--r--drivers/usb/host/ehci-grlib.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c
index fdfd8c5b639b..22ca45c079a4 100644
--- a/drivers/usb/host/ehci-grlib.c
+++ b/drivers/usb/host/ehci-grlib.c
@@ -40,18 +40,13 @@ static int ehci_grlib_setup(struct usb_hcd *hcd)
40 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 40 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
41 int retval; 41 int retval;
42 42
43 retval = ehci_halt(ehci); 43 retval = ehci_setup(hcd);
44 if (retval) 44 if (retval)
45 return retval; 45 return retval;
46 46
47 retval = ehci_init(hcd);
48 if (retval)
49 return retval;
50
51 ehci->sbrn = 0x20;
52 ehci_port_power(ehci, 1); 47 ehci_port_power(ehci, 1);
53 48
54 return ehci_reset(ehci); 49 return retval;
55} 50}
56 51
57 52
@@ -164,12 +159,6 @@ static int __devinit ehci_hcd_grlib_probe(struct platform_device *op)
164 ehci->big_endian_capbase = 1; 159 ehci->big_endian_capbase = 1;
165 } 160 }
166 161
167 ehci->regs = hcd->regs +
168 HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
169
170 /* cache this readonly data; minimize chip reads */
171 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
172
173 rv = usb_add_hcd(hcd, irq, 0); 162 rv = usb_add_hcd(hcd, irq, 0);
174 if (rv) 163 if (rv)
175 goto err_ehci; 164 goto err_ehci;