aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-mv.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-mv.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-mv.c')
-rw-r--r--drivers/usb/host/ehci-mv.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 0e8c168ca24c..f6df1ccc9617 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -77,7 +77,6 @@ static void mv_ehci_disable(struct ehci_hcd_mv *ehci_mv)
77 77
78static int mv_ehci_reset(struct usb_hcd *hcd) 78static int mv_ehci_reset(struct usb_hcd *hcd)
79{ 79{
80 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
81 struct device *dev = hcd->self.controller; 80 struct device *dev = hcd->self.controller;
82 struct ehci_hcd_mv *ehci_mv = dev_get_drvdata(dev); 81 struct ehci_hcd_mv *ehci_mv = dev_get_drvdata(dev);
83 int retval; 82 int retval;
@@ -87,25 +86,13 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
87 return -ENODEV; 86 return -ENODEV;
88 } 87 }
89 88
90 /*
91 * data structure init
92 */
93 retval = ehci_init(hcd);
94 if (retval) {
95 dev_err(dev, "ehci_init failed %d\n", retval);
96 return retval;
97 }
98
99 hcd->has_tt = 1; 89 hcd->has_tt = 1;
100 ehci->sbrn = 0x20;
101 90
102 retval = ehci_reset(ehci); 91 retval = ehci_setup(hcd);
103 if (retval) { 92 if (retval)
104 dev_err(dev, "ehci_reset failed %d\n", retval); 93 dev_err(dev, "ehci_setup failed %d\n", retval);
105 return retval;
106 }
107 94
108 return 0; 95 return retval;
109} 96}
110 97
111static const struct hc_driver mv_ehci_hc_driver = { 98static const struct hc_driver mv_ehci_hc_driver = {
@@ -248,8 +235,6 @@ static int mv_ehci_probe(struct platform_device *pdev)
248 235
249 ehci = hcd_to_ehci(hcd); 236 ehci = hcd_to_ehci(hcd);
250 ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs; 237 ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs;
251 ehci->regs = (struct ehci_regs *) ehci_mv->op_regs;
252 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
253 238
254 ehci_mv->mode = pdata->mode; 239 ehci_mv->mode = pdata->mode;
255 if (ehci_mv->mode == MV_USB_MODE_OTG) { 240 if (ehci_mv->mode == MV_USB_MODE_OTG) {