aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorAndiry Xu <andiry.xu@amd.com>2010-10-14 10:23:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:22:13 -0400
commit5535b1d5f8885695c6ded783c692e3c0d0eda8ca (patch)
treef5454493a1c50e4a6254d904578dc3ecfd1d6e63 /drivers/usb/host/xhci.h
parent9777e3ce907d4cb5a513902a87ecd03b52499569 (diff)
USB: xHCI: PCI power management implementation
This patch implements the PCI suspend/resume. Please refer to xHCI spec for doing the suspend/resume operation. For S3, CSS/SRS in USBCMD is used to save/restore the internal state. However, an error maybe occurs while restoring the internal state. In this case, it means that HC internal state is wrong and HC will be re-initialized. Signed-off-by: Libin Yang <libin.yang@amd.com> Signed-off-by: Dong Nguyen <dong.nguyen@amd.com> Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r--drivers/usb/host/xhci.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 196e21fb36ff..c08928adc524 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -191,7 +191,7 @@ struct xhci_op_regs {
191/* bits 4:6 are reserved (and should be preserved on writes). */ 191/* bits 4:6 are reserved (and should be preserved on writes). */
192/* light reset (port status stays unchanged) - reset completed when this is 0 */ 192/* light reset (port status stays unchanged) - reset completed when this is 0 */
193#define CMD_LRESET (1 << 7) 193#define CMD_LRESET (1 << 7)
194/* FIXME: ignoring host controller save/restore state for now. */ 194/* host controller save/restore state. */
195#define CMD_CSS (1 << 8) 195#define CMD_CSS (1 << 8)
196#define CMD_CRS (1 << 9) 196#define CMD_CRS (1 << 9)
197/* Enable Wrap Event - '1' means xHC generates an event when MFINDEX wraps. */ 197/* Enable Wrap Event - '1' means xHC generates an event when MFINDEX wraps. */
@@ -1130,6 +1130,17 @@ struct urb_priv {
1130#define XHCI_STOP_EP_CMD_TIMEOUT 5 1130#define XHCI_STOP_EP_CMD_TIMEOUT 5
1131/* XXX: Make these module parameters */ 1131/* XXX: Make these module parameters */
1132 1132
1133struct s3_save {
1134 u32 command;
1135 u32 dev_nt;
1136 u64 dcbaa_ptr;
1137 u32 config_reg;
1138 u32 irq_pending;
1139 u32 irq_control;
1140 u32 erst_size;
1141 u64 erst_base;
1142 u64 erst_dequeue;
1143};
1133 1144
1134/* There is one ehci_hci structure per controller */ 1145/* There is one ehci_hci structure per controller */
1135struct xhci_hcd { 1146struct xhci_hcd {
@@ -1198,6 +1209,7 @@ struct xhci_hcd {
1198 unsigned long next_statechange; 1209 unsigned long next_statechange;
1199 1210
1200 u32 command; 1211 u32 command;
1212 struct s3_save s3;
1201/* Host controller is dying - not responding to commands. "I'm not dead yet!" 1213/* Host controller is dying - not responding to commands. "I'm not dead yet!"
1202 * 1214 *
1203 * xHC interrupts have been disabled and a watchdog timer will (or has already) 1215 * xHC interrupts have been disabled and a watchdog timer will (or has already)
@@ -1393,6 +1405,8 @@ int xhci_init(struct usb_hcd *hcd);
1393int xhci_run(struct usb_hcd *hcd); 1405int xhci_run(struct usb_hcd *hcd);
1394void xhci_stop(struct usb_hcd *hcd); 1406void xhci_stop(struct usb_hcd *hcd);
1395void xhci_shutdown(struct usb_hcd *hcd); 1407void xhci_shutdown(struct usb_hcd *hcd);
1408int xhci_suspend(struct xhci_hcd *xhci);
1409int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
1396int xhci_get_frame(struct usb_hcd *hcd); 1410int xhci_get_frame(struct usb_hcd *hcd);
1397irqreturn_t xhci_irq(struct usb_hcd *hcd); 1411irqreturn_t xhci_irq(struct usb_hcd *hcd);
1398irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd); 1412irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd);