diff options
Diffstat (limited to 'drivers/usb/host/xhci-pci.c')
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index f7efe025beda..bb668a894ab9 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -116,6 +116,30 @@ static int xhci_pci_setup(struct usb_hcd *hcd) | |||
116 | return xhci_pci_reinit(xhci, pdev); | 116 | return xhci_pci_reinit(xhci, pdev); |
117 | } | 117 | } |
118 | 118 | ||
119 | #ifdef CONFIG_PM | ||
120 | static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) | ||
121 | { | ||
122 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | ||
123 | int retval = 0; | ||
124 | |||
125 | if (hcd->state != HC_STATE_SUSPENDED) | ||
126 | return -EINVAL; | ||
127 | |||
128 | retval = xhci_suspend(xhci); | ||
129 | |||
130 | return retval; | ||
131 | } | ||
132 | |||
133 | static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) | ||
134 | { | ||
135 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | ||
136 | int retval = 0; | ||
137 | |||
138 | retval = xhci_resume(xhci, hibernated); | ||
139 | return retval; | ||
140 | } | ||
141 | #endif /* CONFIG_PM */ | ||
142 | |||
119 | static const struct hc_driver xhci_pci_hc_driver = { | 143 | static const struct hc_driver xhci_pci_hc_driver = { |
120 | .description = hcd_name, | 144 | .description = hcd_name, |
121 | .product_desc = "xHCI Host Controller", | 145 | .product_desc = "xHCI Host Controller", |
@@ -132,7 +156,10 @@ static const struct hc_driver xhci_pci_hc_driver = { | |||
132 | */ | 156 | */ |
133 | .reset = xhci_pci_setup, | 157 | .reset = xhci_pci_setup, |
134 | .start = xhci_run, | 158 | .start = xhci_run, |
135 | /* suspend and resume implemented later */ | 159 | #ifdef CONFIG_PM |
160 | .pci_suspend = xhci_pci_suspend, | ||
161 | .pci_resume = xhci_pci_resume, | ||
162 | #endif | ||
136 | .stop = xhci_stop, | 163 | .stop = xhci_stop, |
137 | .shutdown = xhci_shutdown, | 164 | .shutdown = xhci_shutdown, |
138 | 165 | ||
@@ -152,7 +179,7 @@ static const struct hc_driver xhci_pci_hc_driver = { | |||
152 | .reset_bandwidth = xhci_reset_bandwidth, | 179 | .reset_bandwidth = xhci_reset_bandwidth, |
153 | .address_device = xhci_address_device, | 180 | .address_device = xhci_address_device, |
154 | .update_hub_device = xhci_update_hub_device, | 181 | .update_hub_device = xhci_update_hub_device, |
155 | .reset_device = xhci_reset_device, | 182 | .reset_device = xhci_discover_or_reset_device, |
156 | 183 | ||
157 | /* | 184 | /* |
158 | * scheduling support | 185 | * scheduling support |
@@ -162,6 +189,8 @@ static const struct hc_driver xhci_pci_hc_driver = { | |||
162 | /* Root hub support */ | 189 | /* Root hub support */ |
163 | .hub_control = xhci_hub_control, | 190 | .hub_control = xhci_hub_control, |
164 | .hub_status_data = xhci_hub_status_data, | 191 | .hub_status_data = xhci_hub_status_data, |
192 | .bus_suspend = xhci_bus_suspend, | ||
193 | .bus_resume = xhci_bus_resume, | ||
165 | }; | 194 | }; |
166 | 195 | ||
167 | /*-------------------------------------------------------------------------*/ | 196 | /*-------------------------------------------------------------------------*/ |
@@ -186,6 +215,11 @@ static struct pci_driver xhci_pci_driver = { | |||
186 | /* suspend and resume implemented later */ | 215 | /* suspend and resume implemented later */ |
187 | 216 | ||
188 | .shutdown = usb_hcd_pci_shutdown, | 217 | .shutdown = usb_hcd_pci_shutdown, |
218 | #ifdef CONFIG_PM_SLEEP | ||
219 | .driver = { | ||
220 | .pm = &usb_hcd_pci_pm_ops | ||
221 | }, | ||
222 | #endif | ||
189 | }; | 223 | }; |
190 | 224 | ||
191 | int xhci_register_pci(void) | 225 | int xhci_register_pci(void) |