diff options
author | Matthieu CASTET <castet.matthieu@free.fr> | 2011-07-02 13:47:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-26 18:48:41 -0400 |
commit | 2093c6b49c8f1dc581d8953aca71297d4cace55e (patch) | |
tree | fef0517cff188ceab2e7fe4386999f6702670fcf /drivers | |
parent | 236c448cb6e7f82096101e1ace4b77f8b38f82c8 (diff) |
EHCI : introduce a common ehci_setup
This allow to clean duplicated code in most of SOC driver.
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org> # fixes 3.1 build error
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 2f0cf863b379..05abbcd93cf4 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -768,6 +768,35 @@ static int ehci_run (struct usb_hcd *hcd) | |||
768 | return 0; | 768 | return 0; |
769 | } | 769 | } |
770 | 770 | ||
771 | static int __maybe_unused ehci_setup (struct usb_hcd *hcd) | ||
772 | { | ||
773 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
774 | int retval; | ||
775 | |||
776 | ehci->regs = (void __iomem *)ehci->caps + | ||
777 | HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
778 | dbg_hcs_params(ehci, "reset"); | ||
779 | dbg_hcc_params(ehci, "reset"); | ||
780 | |||
781 | /* cache this readonly data; minimize chip reads */ | ||
782 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); | ||
783 | |||
784 | ehci->sbrn = HCD_USB2; | ||
785 | |||
786 | retval = ehci_halt(ehci); | ||
787 | if (retval) | ||
788 | return retval; | ||
789 | |||
790 | /* data structure init */ | ||
791 | retval = ehci_init(hcd); | ||
792 | if (retval) | ||
793 | return retval; | ||
794 | |||
795 | ehci_reset(ehci); | ||
796 | |||
797 | return 0; | ||
798 | } | ||
799 | |||
771 | /*-------------------------------------------------------------------------*/ | 800 | /*-------------------------------------------------------------------------*/ |
772 | 801 | ||
773 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) | 802 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) |