diff options
author | Alek Du <alek.du@intel.com> | 2010-06-04 03:47:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 17:35:35 -0400 |
commit | 48f24970144479c29b8cee6d2e1dbedf6dcf9cfb (patch) | |
tree | 5a4944c496f4209a862188c16f29cdef55db3224 /drivers/usb/host/ehci-hcd.c | |
parent | aa4d8342988d0c1a79ff19b2ede1e81dfbb16ea5 (diff) |
USB: EHCI: EHCI 1.1 addendum: Basic LPM feature support
With this patch, the LPM capable EHCI host controller can put device
into L1 sleep state which is a mode that can enter/exit quickly, and
reduce power consumption.
Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 20ca6a9ff213..baf9b648bb1f 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -101,6 +101,11 @@ static int ignore_oc = 0; | |||
101 | module_param (ignore_oc, bool, S_IRUGO); | 101 | module_param (ignore_oc, bool, S_IRUGO); |
102 | MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications"); | 102 | MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications"); |
103 | 103 | ||
104 | /* for link power management(LPM) feature */ | ||
105 | static unsigned int hird; | ||
106 | module_param(hird, int, S_IRUGO); | ||
107 | MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us\n"); | ||
108 | |||
104 | #define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT) | 109 | #define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT) |
105 | 110 | ||
106 | /*-------------------------------------------------------------------------*/ | 111 | /*-------------------------------------------------------------------------*/ |
@@ -305,6 +310,7 @@ static void end_unlink_async(struct ehci_hcd *ehci); | |||
305 | static void ehci_work(struct ehci_hcd *ehci); | 310 | static void ehci_work(struct ehci_hcd *ehci); |
306 | 311 | ||
307 | #include "ehci-hub.c" | 312 | #include "ehci-hub.c" |
313 | #include "ehci-lpm.c" | ||
308 | #include "ehci-mem.c" | 314 | #include "ehci-mem.c" |
309 | #include "ehci-q.c" | 315 | #include "ehci-q.c" |
310 | #include "ehci-sched.c" | 316 | #include "ehci-sched.c" |
@@ -604,6 +610,17 @@ static int ehci_init(struct usb_hcd *hcd) | |||
604 | default: BUG(); | 610 | default: BUG(); |
605 | } | 611 | } |
606 | } | 612 | } |
613 | if (HCC_LPM(hcc_params)) { | ||
614 | /* support link power management EHCI 1.1 addendum */ | ||
615 | ehci_dbg(ehci, "support lpm\n"); | ||
616 | ehci->has_lpm = 1; | ||
617 | if (hird > 0xf) { | ||
618 | ehci_dbg(ehci, "hird %d invalid, use default 0", | ||
619 | hird); | ||
620 | hird = 0; | ||
621 | } | ||
622 | temp |= hird << 24; | ||
623 | } | ||
607 | ehci->command = temp; | 624 | ehci->command = temp; |
608 | 625 | ||
609 | /* Accept arbitrarily long scatter-gather lists */ | 626 | /* Accept arbitrarily long scatter-gather lists */ |