octeon: add detection for edgerouter and edgerouter-pro
[oweals/openwrt.git] / target / linux / sunxi / patches-3.13 / 180-0-usb-backport-device_wakeup_enable.patch
1 From 3c9740a117d40a74412775b5d3fe2b88a7635a0e Mon Sep 17 00:00:00 2001
2 From: Peter Chen <peter.chen@freescale.com>
3 Date: Tue, 5 Nov 2013 10:46:02 +0800
4 Subject: [PATCH] usb: hcd: move controller wakeup setting initialization to
5  individual driver
6
7 Individual controller driver has different requirement for wakeup
8 setting, so move it from core to itself. In order to align with
9 current etting the default wakeup setting is enabled (except for
10 chipidea host).
11
12 Pass compile test with below commands:
13         make O=outout/all allmodconfig
14         make -j$CPU_NUM O=outout/all drivers/usb
15
16 Signed-off-by: Peter Chen <peter.chen@freescale.com>
17 Acked-by: Alan Stern <stern@rowland.harvard.edu>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20  drivers/staging/dwc2/hcd.c              | 2 ++
21  drivers/staging/octeon-usb/octeon-hcd.c | 1 +
22  drivers/staging/ozwpan/ozhcd.c          | 2 ++
23  drivers/usb/c67x00/c67x00-hcd.c         | 2 ++
24  drivers/usb/core/hcd-pci.c              | 1 +
25  drivers/usb/core/hcd.c                  | 6 ------
26  drivers/usb/host/ehci-atmel.c           | 1 +
27  drivers/usb/host/ehci-exynos.c          | 1 +
28  drivers/usb/host/ehci-fsl.c             | 1 +
29  drivers/usb/host/ehci-grlib.c           | 1 +
30  drivers/usb/host/ehci-mv.c              | 1 +
31  drivers/usb/host/ehci-mxc.c             | 1 +
32  drivers/usb/host/ehci-octeon.c          | 1 +
33  drivers/usb/host/ehci-omap.c            | 1 +
34  drivers/usb/host/ehci-orion.c           | 1 +
35  drivers/usb/host/ehci-platform.c        | 1 +
36  drivers/usb/host/ehci-pmcmsp.c          | 4 +++-
37  drivers/usb/host/ehci-ppc-of.c          | 1 +
38  drivers/usb/host/ehci-ps3.c             | 1 +
39  drivers/usb/host/ehci-sead3.c           | 1 +
40  drivers/usb/host/ehci-sh.c              | 1 +
41  drivers/usb/host/ehci-spear.c           | 1 +
42  drivers/usb/host/ehci-tegra.c           | 1 +
43  drivers/usb/host/ehci-tilegx.c          | 1 +
44  drivers/usb/host/ehci-w90x900.c         | 1 +
45  drivers/usb/host/ehci-xilinx-of.c       | 4 +++-
46  drivers/usb/host/fhci-hcd.c             | 2 ++
47  drivers/usb/host/fotg210-hcd.c          | 1 +
48  drivers/usb/host/fusbh200-hcd.c         | 1 +
49  drivers/usb/host/hwa-hc.c               | 1 +
50  drivers/usb/host/imx21-hcd.c            | 1 +
51  drivers/usb/host/isp116x-hcd.c          | 2 ++
52  drivers/usb/host/isp1362-hcd.c          | 2 ++
53  drivers/usb/host/isp1760-hcd.c          | 1 +
54  drivers/usb/host/ohci-at91.c            | 4 +++-
55  drivers/usb/host/ohci-da8xx.c           | 2 ++
56  drivers/usb/host/ohci-exynos.c          | 1 +
57  drivers/usb/host/ohci-jz4740.c          | 1 +
58  drivers/usb/host/ohci-nxp.c             | 4 +++-
59  drivers/usb/host/ohci-octeon.c          | 2 ++
60  drivers/usb/host/ohci-omap.c            | 1 +
61  drivers/usb/host/ohci-omap3.c           | 1 +
62  drivers/usb/host/ohci-platform.c        | 2 ++
63  drivers/usb/host/ohci-ppc-of.c          | 4 +++-
64  drivers/usb/host/ohci-ps3.c             | 1 +
65  drivers/usb/host/ohci-pxa27x.c          | 4 +++-
66  drivers/usb/host/ohci-s3c2410.c         | 1 +
67  drivers/usb/host/ohci-sa1111.c          | 4 +++-
68  drivers/usb/host/ohci-sm501.c           | 1 +
69  drivers/usb/host/ohci-spear.c           | 4 +++-
70  drivers/usb/host/ohci-tilegx.c          | 1 +
71  drivers/usb/host/ohci-tmio.c            | 1 +
72  drivers/usb/host/oxu210hp-hcd.c         | 1 +
73  drivers/usb/host/r8a66597-hcd.c         | 1 +
74  drivers/usb/host/sl811-hcd.c            | 2 ++
75  drivers/usb/host/u132-hcd.c             | 1 +
76  drivers/usb/host/uhci-grlib.c           | 1 +
77  drivers/usb/host/uhci-platform.c        | 1 +
78  drivers/usb/host/whci/hcd.c             | 1 +
79  drivers/usb/host/xhci-plat.c            | 1 +
80  drivers/usb/musb/musb_host.c            | 1 +
81  drivers/usb/phy/phy-msm-usb.c           | 1 +
82  drivers/usb/phy/phy-mv-usb.c            | 6 ++++--
83  drivers/usb/renesas_usbhs/mod_host.c    | 1 +
84  64 files changed, 92 insertions(+), 16 deletions(-)
85
86 diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c
87 index 3cfd2d5..078cd91 100644
88 --- a/drivers/staging/dwc2/hcd.c
89 +++ b/drivers/staging/dwc2/hcd.c
90 @@ -2921,6 +2921,8 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
91         if (retval < 0)
92                 goto error3;
93  
94 +       device_wakeup_enable(hcd->self.controller);
95 +
96         dwc2_hcd_dump_state(hsotg);
97  
98         dwc2_enable_global_interrupts(hsotg);
99 diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
100 index d118952..47e0a91 100644
101 --- a/drivers/staging/octeon-usb/octeon-hcd.c
102 +++ b/drivers/staging/octeon-usb/octeon-hcd.c
103 @@ -3498,6 +3498,7 @@ static int octeon_usb_driver_probe(struct device *dev)
104                 kfree(hcd);
105                 return -1;
106         }
107 +       device_wakeup_enable(hcd->self.controller);
108  
109         dev_dbg(dev, "Registered HCD for port %d on irq %d\n", usb_num, irq);
110  
111 diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
112 index d9c43c3..efaf26f 100644
113 --- a/drivers/staging/ozwpan/ozhcd.c
114 +++ b/drivers/staging/ozwpan/ozhcd.c
115 @@ -2270,6 +2270,8 @@ static int oz_plat_probe(struct platform_device *dev)
116                 usb_put_hcd(hcd);
117                 return -1;
118         }
119 +       device_wakeup_enable(hcd->self.controller);
120 +
121         spin_lock_bh(&g_hcdlock);
122         g_ozhcd = ozhcd;
123         spin_unlock_bh(&g_hcdlock);
124 diff --git a/drivers/usb/c67x00/c67x00-hcd.c b/drivers/usb/c67x00/c67x00-hcd.c
125 index 75e47b8..20ec4ee 100644
126 --- a/drivers/usb/c67x00/c67x00-hcd.c
127 +++ b/drivers/usb/c67x00/c67x00-hcd.c
128 @@ -384,6 +384,8 @@ int c67x00_hcd_probe(struct c67x00_sie *sie)
129                 goto err2;
130         }
131  
132 +       device_wakeup_enable(hcd->self.controller);
133 +
134         spin_lock_irqsave(&sie->lock, flags);
135         sie->private_data = c67x00;
136         sie->irq = c67x00_hcd_irq;
137 diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
138 index dfe9d0f..d59d993 100644
139 --- a/drivers/usb/core/hcd-pci.c
140 +++ b/drivers/usb/core/hcd-pci.c
141 @@ -282,6 +282,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
142  
143         if (retval != 0)
144                 goto unmap_registers;
145 +       device_wakeup_enable(hcd->self.controller);
146  
147         if (pci_dev_run_wake(dev))
148                 pm_runtime_put_noidle(&dev->dev);
149 diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
150 index d3a9bcd..6297c9e 100644
151 --- a/drivers/usb/core/hcd.c
152 +++ b/drivers/usb/core/hcd.c
153 @@ -2712,12 +2712,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
154         if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
155                 usb_hcd_poll_rh_status(hcd);
156  
157 -       /*
158 -        * Host controllers don't generate their own wakeup requests;
159 -        * they only forward requests from the root hub.  Therefore
160 -        * controllers should always be enabled for remote wakeup.
161 -        */
162 -       device_wakeup_enable(hcd->self.controller);
163         return retval;
164  
165  error_create_attr_group:
166 diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
167 index 284f841..ec9f7b7 100644
168 --- a/drivers/usb/host/ehci-atmel.c
169 +++ b/drivers/usb/host/ehci-atmel.c
170 @@ -153,6 +153,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
171         retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
172         if (retval)
173                 goto fail_add_hcd;
174 +       device_wakeup_enable(hcd->self.controller);
175  
176         return retval;
177  
178 diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
179 index e97c198..d1d8c47 100644
180 --- a/drivers/usb/host/ehci-exynos.c
181 +++ b/drivers/usb/host/ehci-exynos.c
182 @@ -166,6 +166,7 @@ static int exynos_ehci_probe(struct platform_device *pdev)
183                 dev_err(&pdev->dev, "Failed to add USB HCD\n");
184                 goto fail_add_hcd;
185         }
186 +       device_wakeup_enable(hcd->self.controller);
187  
188         platform_set_drvdata(pdev, hcd);
189  
190 diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
191 index 87a7426..854a68f 100644
192 --- a/drivers/usb/host/ehci-fsl.c
193 +++ b/drivers/usb/host/ehci-fsl.c
194 @@ -138,6 +138,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
195         retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
196         if (retval != 0)
197                 goto err4;
198 +       device_wakeup_enable(hcd->self.controller);
199  
200  #ifdef CONFIG_USB_OTG
201         if (pdata->operating_mode == FSL_USB2_DR_OTG) {
202 diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c
203 index b52a66c..054792c 100644
204 --- a/drivers/usb/host/ehci-grlib.c
205 +++ b/drivers/usb/host/ehci-grlib.c
206 @@ -140,6 +140,7 @@ static int ehci_hcd_grlib_probe(struct platform_device *op)
207         if (rv)
208                 goto err_ioremap;
209  
210 +       device_wakeup_enable(hcd->self.controller);
211         return 0;
212  
213  err_ioremap:
214 diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
215 index 6e8afca..bd61612 100644
216 --- a/drivers/usb/host/ehci-mv.c
217 +++ b/drivers/usb/host/ehci-mv.c
218 @@ -257,6 +257,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
219                                 "failed to add hcd with err %d\n", retval);
220                         goto err_set_vbus;
221                 }
222 +               device_wakeup_enable(hcd->self.controller);
223         }
224  
225         if (pdata->private_init)
226 diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
227 index 0528dc4..dbe5e4e 100644
228 --- a/drivers/usb/host/ehci-mxc.c
229 +++ b/drivers/usb/host/ehci-mxc.c
230 @@ -155,6 +155,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
231         if (ret)
232                 goto err_add;
233  
234 +       device_wakeup_enable(hcd->self.controller);
235         return 0;
236  
237  err_add:
238 diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c
239 index 4c528b2..c4ad7ed 100644
240 --- a/drivers/usb/host/ehci-octeon.c
241 +++ b/drivers/usb/host/ehci-octeon.c
242 @@ -158,6 +158,7 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)
243                 dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret);
244                 goto err3;
245         }
246 +       device_wakeup_enable(hcd->self.controller);
247  
248         platform_set_drvdata(pdev, hcd);
249  
250 diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
251 index 6fa82d6..a24720b 100644
252 --- a/drivers/usb/host/ehci-omap.c
253 +++ b/drivers/usb/host/ehci-omap.c
254 @@ -215,6 +215,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
255                 dev_err(dev, "failed to add hcd with err %d\n", ret);
256                 goto err_pm_runtime;
257         }
258 +       device_wakeup_enable(hcd->self.controller);
259  
260         /*
261          * Bring PHYs out of reset for non PHY modes.
262 diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
263 index 2ba7673..aa8b92b 100644
264 --- a/drivers/usb/host/ehci-orion.c
265 +++ b/drivers/usb/host/ehci-orion.c
266 @@ -252,6 +252,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
267         if (err)
268                 goto err4;
269  
270 +       device_wakeup_enable(hcd->self.controller);
271         return 0;
272  
273  err4:
274 diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
275 index 7f30b71..01536cf 100644
276 --- a/drivers/usb/host/ehci-platform.c
277 +++ b/drivers/usb/host/ehci-platform.c
278 @@ -132,6 +132,7 @@ static int ehci_platform_probe(struct platform_device *dev)
279         if (err)
280                 goto err_put_hcd;
281  
282 +       device_wakeup_enable(hcd->self.controller);
283         platform_set_drvdata(dev, hcd);
284  
285         return err;
286 diff --git a/drivers/usb/host/ehci-pmcmsp.c b/drivers/usb/host/ehci-pmcmsp.c
287 index 893b707f..af3974a 100644
288 --- a/drivers/usb/host/ehci-pmcmsp.c
289 +++ b/drivers/usb/host/ehci-pmcmsp.c
290 @@ -210,8 +210,10 @@ int usb_hcd_msp_probe(const struct hc_driver *driver,
291  
292  
293         retval = usb_add_hcd(hcd, res->start, IRQF_SHARED);
294 -       if (retval == 0)
295 +       if (retval == 0) {
296 +               device_wakeup_enable(hcd->self.controller);
297                 return 0;
298 +       }
299  
300         usb_remove_hcd(hcd);
301  err3:
302 diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
303 index 875d2fc..b0965eb 100644
304 --- a/drivers/usb/host/ehci-ppc-of.c
305 +++ b/drivers/usb/host/ehci-ppc-of.c
306 @@ -169,6 +169,7 @@ static int ehci_hcd_ppc_of_probe(struct platform_device *op)
307         if (rv)
308                 goto err_ioremap;
309  
310 +       device_wakeup_enable(hcd->self.controller);
311         return 0;
312  
313  err_ioremap:
314 diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
315 index 8188542..7934ff9 100644
316 --- a/drivers/usb/host/ehci-ps3.c
317 +++ b/drivers/usb/host/ehci-ps3.c
318 @@ -189,6 +189,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
319                 goto fail_add_hcd;
320         }
321  
322 +       device_wakeup_enable(hcd->self.controller);
323         return result;
324  
325  fail_add_hcd:
326 diff --git a/drivers/usb/host/ehci-sead3.c b/drivers/usb/host/ehci-sead3.c
327 index 8a73449..cf12676 100644
328 --- a/drivers/usb/host/ehci-sead3.c
329 +++ b/drivers/usb/host/ehci-sead3.c
330 @@ -126,6 +126,7 @@ static int ehci_hcd_sead3_drv_probe(struct platform_device *pdev)
331                           IRQF_SHARED);
332         if (ret == 0) {
333                 platform_set_drvdata(pdev, hcd);
334 +               device_wakeup_enable(hcd->self.controller);
335                 return ret;
336         }
337  
338 diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
339 index dc899eb..9b9b9f5 100644
340 --- a/drivers/usb/host/ehci-sh.c
341 +++ b/drivers/usb/host/ehci-sh.c
342 @@ -151,6 +151,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
343                 dev_err(&pdev->dev, "Failed to add hcd");
344                 goto fail_add_hcd;
345         }
346 +       device_wakeup_enable(hcd->self.controller);
347  
348         priv->hcd = hcd;
349         platform_set_drvdata(pdev, priv);
350 diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
351 index ee6f9ff..8bd915b 100644
352 --- a/drivers/usb/host/ehci-spear.c
353 +++ b/drivers/usb/host/ehci-spear.c
354 @@ -130,6 +130,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
355         if (retval)
356                 goto err_stop_ehci;
357  
358 +       device_wakeup_enable(hcd->self.controller);
359         return retval;
360  
361  err_stop_ehci:
362 diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
363 index b9fd039..a8f4471 100644
364 --- a/drivers/usb/host/ehci-tegra.c
365 +++ b/drivers/usb/host/ehci-tegra.c
366 @@ -455,6 +455,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
367                 dev_err(&pdev->dev, "Failed to add USB HCD\n");
368                 goto cleanup_otg_set_host;
369         }
370 +       device_wakeup_enable(hcd->self.controller);
371  
372         return err;
373  
374 diff --git a/drivers/usb/host/ehci-tilegx.c b/drivers/usb/host/ehci-tilegx.c
375 index 67026ff..f3713d3 100644
376 --- a/drivers/usb/host/ehci-tilegx.c
377 +++ b/drivers/usb/host/ehci-tilegx.c
378 @@ -170,6 +170,7 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev)
379         ret = usb_add_hcd(hcd, pdata->irq, IRQF_SHARED);
380         if (ret == 0) {
381                 platform_set_drvdata(pdev, hcd);
382 +               device_wakeup_enable(hcd->self.controller);
383                 return ret;
384         }
385  
386 diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
387 index cdad843..12c1a56 100644
388 --- a/drivers/usb/host/ehci-w90x900.c
389 +++ b/drivers/usb/host/ehci-w90x900.c
390 @@ -94,6 +94,7 @@ static int usb_w90x900_probe(const struct hc_driver *driver,
391         if (retval != 0)
392                 goto err4;
393  
394 +       device_wakeup_enable(hcd->self.controller);
395         return retval;
396  err4:
397         iounmap(hcd->regs);
398 diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c
399 index 95979f9..3cd2efa 100644
400 --- a/drivers/usb/host/ehci-xilinx-of.c
401 +++ b/drivers/usb/host/ehci-xilinx-of.c
402 @@ -191,8 +191,10 @@ static int ehci_hcd_xilinx_of_probe(struct platform_device *op)
403         ehci->caps = hcd->regs + 0x100;
404  
405         rv = usb_add_hcd(hcd, irq, 0);
406 -       if (rv == 0)
407 +       if (rv == 0) {
408 +               device_wakeup_enable(hcd->self.controller);
409                 return 0;
410 +       }
411  
412  err_irq:
413         usb_put_hcd(hcd);
414 diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
415 index 0551c0a..1cf68ea 100644
416 --- a/drivers/usb/host/fhci-hcd.c
417 +++ b/drivers/usb/host/fhci-hcd.c
418 @@ -754,6 +754,8 @@ static int of_fhci_probe(struct platform_device *ofdev)
419         if (ret < 0)
420                 goto err_add_hcd;
421  
422 +       device_wakeup_enable(hcd->self.controller);
423 +
424         fhci_dfs_create(fhci);
425  
426         return 0;
427 diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
428 index 97d6939..98a89d1 100644
429 --- a/drivers/usb/host/fotg210-hcd.c
430 +++ b/drivers/usb/host/fotg210-hcd.c
431 @@ -5889,6 +5889,7 @@ static int fotg210_hcd_probe(struct platform_device *pdev)
432                 dev_err(dev, "failed to add hcd with err %d\n", retval);
433                 goto fail_add_hcd;
434         }
435 +       device_wakeup_enable(hcd->self.controller);
436  
437         return retval;
438  
439 diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200-hcd.c
440 index 9ea85b6..ba94990 100644
441 --- a/drivers/usb/host/fusbh200-hcd.c
442 +++ b/drivers/usb/host/fusbh200-hcd.c
443 @@ -5798,6 +5798,7 @@ static int fusbh200_hcd_probe(struct platform_device *pdev)
444                 dev_err(dev, "failed to add hcd with err %d\n", retval);
445                 goto fail_add_hcd;
446         }
447 +       device_wakeup_enable(hcd->self.controller);
448  
449         return retval;
450  
451 diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c
452 index a4ec9e6..7fd3f9b 100644
453 --- a/drivers/usb/host/hwa-hc.c
454 +++ b/drivers/usb/host/hwa-hc.c
455 @@ -791,6 +791,7 @@ static int hwahc_probe(struct usb_interface *usb_iface,
456                 dev_err(dev, "Cannot add HCD: %d\n", result);
457                 goto error_add_hcd;
458         }
459 +       device_wakeup_enable(usb_hcd->self.controller);
460         result = wusbhc_b_create(&hwahc->wusbhc);
461         if (result < 0) {
462                 dev_err(dev, "Cannot setup phase B of WUSBHC: %d\n", result);
463 diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c
464 index 0122624..207bad9 100644
465 --- a/drivers/usb/host/imx21-hcd.c
466 +++ b/drivers/usb/host/imx21-hcd.c
467 @@ -1910,6 +1910,7 @@ static int imx21_probe(struct platform_device *pdev)
468                 dev_err(imx21->dev, "usb_add_hcd() returned %d\n", ret);
469                 goto failed_add_hcd;
470         }
471 +       device_wakeup_enable(hcd->self.controller);
472  
473         return 0;
474  
475 diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
476 index 7722ec6..2740f65 100644
477 --- a/drivers/usb/host/isp116x-hcd.c
478 +++ b/drivers/usb/host/isp116x-hcd.c
479 @@ -1645,6 +1645,8 @@ static int isp116x_probe(struct platform_device *pdev)
480         if (ret)
481                 goto err6;
482  
483 +       device_wakeup_enable(hcd->self.controller);
484 +
485         ret = create_debug_file(isp116x);
486         if (ret) {
487                 ERR("Couldn't create debugfs entry\n");
488 diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
489 index cd94b10..34645ae 100644
490 --- a/drivers/usb/host/isp1362-hcd.c
491 +++ b/drivers/usb/host/isp1362-hcd.c
492 @@ -2746,6 +2746,8 @@ static int isp1362_probe(struct platform_device *pdev)
493         retval = usb_add_hcd(hcd, irq, irq_flags | IRQF_SHARED);
494         if (retval != 0)
495                 goto err6;
496 +       device_wakeup_enable(hcd->self.controller);
497 +
498         pr_info("%s, irq %d\n", hcd->product_desc, irq);
499  
500         create_debug_file(isp1362_hcd);
501 diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
502 index 2facee5..51a0ae9 100644
503 --- a/drivers/usb/host/isp1760-hcd.c
504 +++ b/drivers/usb/host/isp1760-hcd.c
505 @@ -2250,6 +2250,7 @@ struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len,
506         ret = usb_add_hcd(hcd, irq, irqflags);
507         if (ret)
508                 goto err_unmap;
509 +       device_wakeup_enable(hcd->self.controller);
510  
511         return hcd;
512  
513 diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
514 index cc9462f..29d2093 100644
515 diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
516 index 71dbd85..f0fe0d2 100644
517 --- a/drivers/usb/host/ohci-da8xx.c
518 +++ b/drivers/usb/host/ohci-da8xx.c
519 @@ -348,6 +348,8 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
520         if (error)
521                 goto err4;
522  
523 +       device_wakeup_enable(hcd->self.controller);
524 +
525         if (hub->ocic_notify) {
526                 error = hub->ocic_notify(ohci_da8xx_ocic_handler);
527                 if (!error)
528 diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
529 index 9897d70..68588d8 100644
530 --- a/drivers/usb/host/ohci-exynos.c
531 +++ b/drivers/usb/host/ohci-exynos.c
532 @@ -146,6 +146,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
533                 dev_err(&pdev->dev, "Failed to add USB HCD\n");
534                 goto fail_add_hcd;
535         }
536 +       device_wakeup_enable(hcd->self.controller);
537         return 0;
538  
539  fail_add_hcd:
540 diff --git a/drivers/usb/host/ohci-jz4740.c b/drivers/usb/host/ohci-jz4740.c
541 index d4ef539..efe31f3 100644
542 --- a/drivers/usb/host/ohci-jz4740.c
543 +++ b/drivers/usb/host/ohci-jz4740.c
544 @@ -217,6 +217,7 @@ static int jz4740_ohci_probe(struct platform_device *pdev)
545                 dev_err(&pdev->dev, "Failed to add hcd: %d\n", ret);
546                 goto err_disable;
547         }
548 +       device_wakeup_enable(hcd->self.controller);
549  
550         return 0;
551  
552 diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
553 index e99db8a..719f28e 100644
554 --- a/drivers/usb/host/ohci-nxp.c
555 +++ b/drivers/usb/host/ohci-nxp.c
556 @@ -274,8 +274,10 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
557  
558         dev_info(&pdev->dev, "at 0x%p, irq %d\n", hcd->regs, hcd->irq);
559         ret = usb_add_hcd(hcd, irq, 0);
560 -       if (ret == 0)
561 +       if (ret == 0) {
562 +               device_wakeup_enable(hcd->self.controller);
563                 return ret;
564 +       }
565  
566         ohci_nxp_stop_hc();
567  fail_resource:
568 diff --git a/drivers/usb/host/ohci-octeon.c b/drivers/usb/host/ohci-octeon.c
569 index 6c16dce..49b220d 100644
570 --- a/drivers/usb/host/ohci-octeon.c
571 +++ b/drivers/usb/host/ohci-octeon.c
572 @@ -171,6 +171,8 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev)
573                 goto err3;
574         }
575  
576 +       device_wakeup_enable(hcd->self.controller);
577 +
578         platform_set_drvdata(pdev, hcd);
579  
580         return 0;
581 diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
582 index f253214..a44a4fe 100644
583 --- a/drivers/usb/host/ohci-omap.c
584 +++ b/drivers/usb/host/ohci-omap.c
585 @@ -367,6 +367,7 @@ static int usb_hcd_omap_probe (const struct hc_driver *driver,
586         if (retval)
587                 goto err3;
588  
589 +       device_wakeup_enable(hcd->self.controller);
590         return 0;
591  err3:
592         iounmap(hcd->regs);
593 diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
594 index 2145741..ec15aeb 100644
595 --- a/drivers/usb/host/ohci-omap3.c
596 +++ b/drivers/usb/host/ohci-omap3.c
597 @@ -130,6 +130,7 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev)
598                 dev_dbg(dev, "failed to add hcd with err %d\n", ret);
599                 goto err_add_hcd;
600         }
601 +       device_wakeup_enable(hcd->self.controller);
602  
603         return 0;
604  
605 diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
606 index f351ff5..68f674c 100644
607 --- a/drivers/usb/host/ohci-platform.c
608 +++ b/drivers/usb/host/ohci-platform.c
609 @@ -108,6 +108,8 @@ static int ohci_platform_probe(struct platform_device *dev)
610         if (err)
611                 goto err_put_hcd;
612  
613 +       device_wakeup_enable(hcd->self.controller);
614 +
615         platform_set_drvdata(dev, hcd);
616  
617         return err;
618 diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c
619 index 81f3eba..83e33d4 100644
620 --- a/drivers/usb/host/ohci-ppc-of.c
621 +++ b/drivers/usb/host/ohci-ppc-of.c
622 @@ -147,8 +147,10 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op)
623         ohci_hcd_init(ohci);
624  
625         rv = usb_add_hcd(hcd, irq, 0);
626 -       if (rv == 0)
627 +       if (rv == 0) {
628 +               device_wakeup_enable(hcd->self.controller);
629                 return 0;
630 +       }
631  
632         /* by now, 440epx is known to show usb_23 erratum */
633         np = of_find_compatible_node(NULL, NULL, "ibm,usb-ehci-440epx");
634 diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
635 index 7d35cd9..71d8bc4 100644
636 --- a/drivers/usb/host/ohci-ps3.c
637 +++ b/drivers/usb/host/ohci-ps3.c
638 @@ -173,6 +173,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
639                 goto fail_add_hcd;
640         }
641  
642 +       device_wakeup_enable(hcd->self.controller);
643         return result;
644  
645  fail_add_hcd:
646 diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
647 index e89ac4d..5343ecf 100644
648 --- a/drivers/usb/host/ohci-pxa27x.c
649 +++ b/drivers/usb/host/ohci-pxa27x.c
650 @@ -442,8 +442,10 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
651         ohci->num_ports = 3;
652  
653         retval = usb_add_hcd(hcd, irq, 0);
654 -       if (retval == 0)
655 +       if (retval == 0) {
656 +               device_wakeup_enable(hcd->self.controller);
657                 return retval;
658 +       }
659  
660         pxa27x_stop_hc(pxa_ohci, &pdev->dev);
661   err3:
662 diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
663 index 83cd1dc..ff7c8f1 100644
664 --- a/drivers/usb/host/ohci-s3c2410.c
665 +++ b/drivers/usb/host/ohci-s3c2410.c
666 @@ -395,6 +395,7 @@ static int usb_hcd_s3c2410_probe(const struct hc_driver *driver,
667         if (retval != 0)
668                 goto err_ioremap;
669  
670 +       device_wakeup_enable(hcd->self.controller);
671         return 0;
672  
673   err_ioremap:
674 diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
675 index aa9e127..2ac266d 100644
676 --- a/drivers/usb/host/ohci-sa1111.c
677 +++ b/drivers/usb/host/ohci-sa1111.c
678 @@ -211,8 +211,10 @@ static int ohci_hcd_sa1111_probe(struct sa1111_dev *dev)
679                 goto err2;
680  
681         ret = usb_add_hcd(hcd, dev->irq[1], 0);
682 -       if (ret == 0)
683 +       if (ret == 0) {
684 +               device_wakeup_enable(hcd->self.controller);
685                 return ret;
686 +       }
687  
688         sa1111_stop_hc(dev);
689   err2:
690 diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
691 index 2a5de5f..4e81c80 100644
692 --- a/drivers/usb/host/ohci-sm501.c
693 +++ b/drivers/usb/host/ohci-sm501.c
694 @@ -168,6 +168,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
695         retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
696         if (retval)
697                 goto err5;
698 +       device_wakeup_enable(hcd->self.controller);
699  
700         /* enable power and unmask interrupts */
701  
702 diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
703 index e418c19..4cb98ab 100644
704 --- a/drivers/usb/host/ohci-spear.c
705 +++ b/drivers/usb/host/ohci-spear.c
706 @@ -103,8 +103,10 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
707         ohci = hcd_to_ohci(hcd);
708  
709         retval = usb_add_hcd(hcd, platform_get_irq(pdev, 0), 0);
710 -       if (retval == 0)
711 +       if (retval == 0) {
712 +               device_wakeup_enable(hcd->self.controller);
713                 return retval;
714 +       }
715  
716         clk_disable_unprepare(sohci_p->clk);
717  err_put_hcd:
718 diff --git a/drivers/usb/host/ohci-tilegx.c b/drivers/usb/host/ohci-tilegx.c
719 index 22540ab..0b183e0 100644
720 --- a/drivers/usb/host/ohci-tilegx.c
721 +++ b/drivers/usb/host/ohci-tilegx.c
722 @@ -159,6 +159,7 @@ static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev)
723         ret = usb_add_hcd(hcd, pdata->irq, IRQF_SHARED);
724         if (ret == 0) {
725                 platform_set_drvdata(pdev, hcd);
726 +               device_wakeup_enable(hcd->self.controller);
727                 return ret;
728         }
729  
730 diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
731 index ecb09a5..9c44093 100644
732 --- a/drivers/usb/host/ohci-tmio.c
733 +++ b/drivers/usb/host/ohci-tmio.c
734 @@ -250,6 +250,7 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
735         if (ret)
736                 goto err_add_hcd;
737  
738 +       device_wakeup_enable(hcd->self.controller);
739         if (ret == 0)
740                 return ret;
741  
742 diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
743 index 4a05148..778eeaf 100644
744 --- a/drivers/usb/host/oxu210hp-hcd.c
745 +++ b/drivers/usb/host/oxu210hp-hcd.c
746 @@ -3751,6 +3751,7 @@ static struct usb_hcd *oxu_create(struct platform_device *pdev,
747         if (ret < 0)
748                 return ERR_PTR(ret);
749  
750 +       device_wakeup_enable(hcd->self.controller);
751         return hcd;
752  }
753  
754 diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
755 index 3bddfcf..47b1322 100644
756 --- a/drivers/usb/host/r8a66597-hcd.c
757 +++ b/drivers/usb/host/r8a66597-hcd.c
758 @@ -2514,6 +2514,7 @@ static int r8a66597_probe(struct platform_device *pdev)
759                 dev_err(&pdev->dev, "Failed to add hcd\n");
760                 goto clean_up3;
761         }
762 +       device_wakeup_enable(hcd->self.controller);
763  
764         return 0;
765  
766 diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
767 index 79620c3..0115e7f 100644
768 --- a/drivers/usb/host/sl811-hcd.c
769 +++ b/drivers/usb/host/sl811-hcd.c
770 @@ -1732,6 +1732,8 @@ static void remove_debug_file(struct sl811 *sl811)
771         if (retval != 0)
772                 goto err6;
773  
774 +       device_wakeup_enable(hcd->self.controller);
775 +
776         create_debug_file(sl811);
777         return retval;
778  
779 diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
780 index 46236e9..c067175 100644
781 --- a/drivers/usb/host/u132-hcd.c
782 +++ b/drivers/usb/host/u132-hcd.c
783 @@ -3133,6 +3133,7 @@ static int u132_probe(struct platform_device *pdev)
784                         u132_u132_put_kref(u132);
785                         return retval;
786                 } else {
787 +                       device_wakeup_enable(hcd->self.controller);
788                         u132_monitor_queue_work(u132, 100);
789                         return 0;
790                 }
791 diff --git a/drivers/usb/host/uhci-grlib.c b/drivers/usb/host/uhci-grlib.c
792 index 53c23ff..ab25dc3 100644
793 --- a/drivers/usb/host/uhci-grlib.c
794 +++ b/drivers/usb/host/uhci-grlib.c
795 @@ -141,6 +141,7 @@ static int uhci_hcd_grlib_probe(struct platform_device *op)
796         if (rv)
797                 goto err_uhci;
798  
799 +       device_wakeup_enable(hcd->self.controller);
800         return 0;
801  
802  err_uhci:
803 diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
804 index 3003fef..44e6c9d 100644
805 --- a/drivers/usb/host/uhci-platform.c
806 +++ b/drivers/usb/host/uhci-platform.c
807 @@ -108,6 +108,7 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
808         if (ret)
809                 goto err_uhci;
810  
811 +       device_wakeup_enable(hcd->self.controller);
812         return 0;
813  
814  err_uhci:
815 diff --git a/drivers/usb/host/whci/hcd.c b/drivers/usb/host/whci/hcd.c
816 index 1b0888f..d7b363a 100644
817 --- a/drivers/usb/host/whci/hcd.c
818 +++ b/drivers/usb/host/whci/hcd.c
819 @@ -293,6 +293,7 @@ static int whc_probe(struct umc_dev *umc)
820                 dev_err(dev, "cannot add HCD: %d\n", ret);
821                 goto error_usb_add_hcd;
822         }
823 +       device_wakeup_enable(usb_hcd->self.controller);
824  
825         ret = wusbhc_b_create(wusbhc);
826         if (ret) {
827 diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
828 index d9c169f..9d29aa1 100644
829 --- a/drivers/usb/host/xhci-plat.c
830 +++ b/drivers/usb/host/xhci-plat.c
831 @@ -139,6 +139,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
832         ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
833         if (ret)
834                 goto unmap_registers;
835 +       device_wakeup_enable(hcd->self.controller);
836  
837         /* USB 2.0 roothub is stored in the platform_device now. */
838         hcd = platform_get_drvdata(pdev);
839 diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
840 index 6582a20..e208375 100644
841 --- a/drivers/usb/musb/musb_host.c
842 +++ b/drivers/usb/musb/musb_host.c
843 @@ -2657,6 +2657,7 @@ int musb_host_setup(struct musb *musb, int power_budget)
844         if (ret < 0)
845                 return ret;
846  
847 +       device_wakeup_enable(hcd->self.controller);
848         return 0;
849  }
850  
851 diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
852 index e9d4cd9..3775283 100644
853 --- a/drivers/usb/phy/phy-msm-usb.c
854 +++ b/drivers/usb/phy/phy-msm-usb.c
855 @@ -669,6 +669,7 @@ static void msm_otg_start_host(struct usb_phy *phy, int on)
856                         pdata->setup_gpio(OTG_STATE_A_HOST);
857  #ifdef CONFIG_USB
858                 usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
859 +               device_wakeup_enable(hcd->self.controller);
860  #endif
861         } else {
862                 dev_dbg(phy->dev, "host off\n");
863 diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
864 index 98f6ac6..44f316e 100644
865 --- a/drivers/usb/phy/phy-mv-usb.c
866 +++ b/drivers/usb/phy/phy-mv-usb.c
867 @@ -213,10 +213,12 @@ static void mv_otg_start_host(struct mv_otg *mvotg, int on)
868  
869         hcd = bus_to_hcd(otg->host);
870  
871 -       if (on)
872 +       if (on) {
873                 usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
874 -       else
875 +               device_wakeup_enable(hcd->self.controller);
876 +       } else {
877                 usb_remove_hcd(hcd);
878 +       }
879  #endif /* CONFIG_USB */
880  }
881  
882 diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c
883 index e40f565..10e1ded 100644
884 --- a/drivers/usb/renesas_usbhs/mod_host.c
885 +++ b/drivers/usb/renesas_usbhs/mod_host.c
886 @@ -1469,6 +1469,7 @@ static int usbhsh_start(struct usbhs_priv *priv)
887         ret = usb_add_hcd(hcd, 0, 0);
888         if (ret < 0)
889                 return 0;
890 +       device_wakeup_enable(hcd->self.controller);
891  
892         /*
893          * pipe initialize and enable DCP
894 -- 
895 1.8.5.5
896