diff options
author | Matthieu CASTET <castet.matthieu@free.fr> | 2011-07-02 13:47:33 -0400 |
---|---|---|
committer | Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | 2011-11-21 12:54:51 -0500 |
commit | e5e5c4508401beb6ba7b7d40ccef395c655999bf (patch) | |
tree | 1b245017d5e697887e58f165d58a0d99ef8ae2b2 /drivers/usb | |
parent | 23daaefa8a548b92e9ae07e5bac7a67b1a2716af (diff) |
EHCI : introduce a common ehci_setup
BugLink: http://bugs.launchpad.net/bugs/890952
commit 2093c6b49c8f1dc581d8953aca71297d4cace55e upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'drivers/usb')
-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 9ff9abc7e3a..c45a116f50f 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -761,6 +761,35 @@ static int ehci_run (struct usb_hcd *hcd) | |||
761 | return 0; | 761 | return 0; |
762 | } | 762 | } |
763 | 763 | ||
764 | static int __maybe_unused ehci_setup (struct usb_hcd *hcd) | ||
765 | { | ||
766 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
767 | int retval; | ||
768 | |||
769 | ehci->regs = (void __iomem *)ehci->caps + | ||
770 | HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
771 | dbg_hcs_params(ehci, "reset"); | ||
772 | dbg_hcc_params(ehci, "reset"); | ||
773 | |||
774 | /* cache this readonly data; minimize chip reads */ | ||
775 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); | ||
776 | |||
777 | ehci->sbrn = HCD_USB2; | ||
778 | |||
779 | retval = ehci_halt(ehci); | ||
780 | if (retval) | ||
781 | return retval; | ||
782 | |||
783 | /* data structure init */ | ||
784 | retval = ehci_init(hcd); | ||
785 | if (retval) | ||
786 | return retval; | ||
787 | |||
788 | ehci_reset(ehci); | ||
789 | |||
790 | return 0; | ||
791 | } | ||
792 | |||
764 | /*-------------------------------------------------------------------------*/ | 793 | /*-------------------------------------------------------------------------*/ |
765 | 794 | ||
766 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) | 795 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) |