diff options
Diffstat (limited to 'ANDROID_3.4.5/drivers/usb/host/ehci-pci.c')
-rw-r--r-- | ANDROID_3.4.5/drivers/usb/host/ehci-pci.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/ANDROID_3.4.5/drivers/usb/host/ehci-pci.c b/ANDROID_3.4.5/drivers/usb/host/ehci-pci.c index 12348179..49726685 100644 --- a/ANDROID_3.4.5/drivers/usb/host/ehci-pci.c +++ b/ANDROID_3.4.5/drivers/usb/host/ehci-pci.c @@ -27,6 +27,8 @@ /*-------------------------------------------------------------------------*/ +extern char enable_ehci_wake; + /* called after powerup, by probe or system-pm "wakeup" */ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) { @@ -334,7 +336,7 @@ static int ehci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) struct ehci_hcd *ehci = hcd_to_ehci(hcd); unsigned long flags; int rc = 0; - + u16 pmc_enable = 0; if (time_before(jiffies, ehci->next_statechange)) msleep(10); @@ -352,7 +354,12 @@ static int ehci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) // could save FLADJ in case of Vaux power loss // ... we'd only use it to handle clock skew - + //CharlesTu,for PM high memory + if (enable_ehci_wake) { + pci_read_config_word(to_pci_dev(hcd->self.controller), 0x84, &pmc_enable); + pmc_enable |= 0x103; + pci_write_config_word(to_pci_dev(hcd->self.controller), 0x84, pmc_enable); + } return rc; } @@ -399,6 +406,13 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated) * a '1' to the port switchover registers should have no effect if the * port was already switched over. */ + u16 pmc_enable = 0; + //CharlesTu,for PM high memory + if (enable_ehci_wake) { + pci_read_config_word(pdev, 0x84, &pmc_enable); + pmc_enable &= ~0x03; + pci_write_config_word(pdev, 0x84, pmc_enable); + } if (usb_is_intel_switchable_ehci(pdev)) ehci_enable_xhci_companion(); @@ -409,7 +423,11 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated) /* Mark hardware accessible again as we are out of D3 state by now */ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - + /*CharlesTu,2011.01,21,move ahead,due to vbus lost when suspend + * when resume ehci hub activate ,type= HUB_RESET_RESUME + */ + if (!enable_ehci_wake) + usb_root_hub_lost_power(hcd->self.root_hub); /* If CF is still set and we aren't resuming from hibernation * then we maintained PCI Vaux power. * Just undo the effect of ehci_pci_suspend(). @@ -425,8 +443,9 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated) ehci_readl(ehci, &ehci->regs->intr_enable); return 0; } - - usb_root_hub_lost_power(hcd->self.root_hub); + /*CharlesTu,2011.01,21,move ahead,due to vbus lost when suspend*/ + if (enable_ehci_wake) + usb_root_hub_lost_power(hcd->self.root_hub); /* Else reset, to cope with power loss or flush-to-storage * style "resume" having let BIOS kick in during reboot. |