aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-10-31 13:21:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-31 15:48:07 -0400
commitc73cee717e7d5da0698acb720ad1219646fe4f46 (patch)
tree7905e61101886695d291e39c7c2ee4042e2e6f70 /drivers/usb
parent4968f951913997adc8c68c4e986e8168ee1d2998 (diff)
USB: EHCI: remove ehci_port_power() routine
This patch (as1623) removes the ehci_port_power() routine and all the places that call it. There's no reason for ehci-hcd to change the port power settings; the hub driver takes care of all that stuff. There is one exception: When the controller is resumed from hibernation or following a loss of power, the ports that are supposed to be handed over to a companion controller must be powered on first. Otherwise the handover won't work. This process is not visible to the hub driver, so it has to be handled in ehci-hcd. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/host.c18
-rw-r--r--drivers/usb/host/ehci-atmel.c9
-rw-r--r--drivers/usb/host/ehci-fsl.c1
-rw-r--r--drivers/usb/host/ehci-grlib.c18
-rw-r--r--drivers/usb/host/ehci-hcd.c21
-rw-r--r--drivers/usb/host/ehci-hub.c13
-rw-r--r--drivers/usb/host/ehci-msm.c1
-rw-r--r--drivers/usb/host/ehci-mxc.c8
-rw-r--r--drivers/usb/host/ehci-octeon.c3
-rw-r--r--drivers/usb/host/ehci-omap.c3
-rw-r--r--drivers/usb/host/ehci-orion.c16
-rw-r--r--drivers/usb/host/ehci-pci.c1
-rw-r--r--drivers/usb/host/ehci-platform.c5
-rw-r--r--drivers/usb/host/ehci-pmcmsp.c1
-rw-r--r--drivers/usb/host/ehci-sh.c9
-rw-r--r--drivers/usb/host/ehci-spear.c9
-rw-r--r--drivers/usb/host/ehci-tegra.c8
17 files changed, 21 insertions, 123 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index ebff9f4f56ec..ebc041ff9cd5 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -31,22 +31,6 @@
31#include "bits.h" 31#include "bits.h"
32#include "host.h" 32#include "host.h"
33 33
34static int ci_ehci_setup(struct usb_hcd *hcd)
35{
36 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
37 int ret;
38
39 hcd->has_tt = 1;
40
41 ret = ehci_setup(hcd);
42 if (ret)
43 return ret;
44
45 ehci_port_power(ehci, 0);
46
47 return ret;
48}
49
50static const struct hc_driver ci_ehci_hc_driver = { 34static const struct hc_driver ci_ehci_hc_driver = {
51 .description = "ehci_hcd", 35 .description = "ehci_hcd",
52 .product_desc = "ChipIdea HDRC EHCI", 36 .product_desc = "ChipIdea HDRC EHCI",
@@ -61,7 +45,7 @@ static const struct hc_driver ci_ehci_hc_driver = {
61 /* 45 /*
62 * basic lifecycle operations 46 * basic lifecycle operations
63 */ 47 */
64 .reset = ci_ehci_setup, 48 .reset = ehci_setup,
65 .start = ehci_run, 49 .start = ehci_run,
66 .stop = ehci_stop, 50 .stop = ehci_stop,
67 .shutdown = ehci_shutdown, 51 .shutdown = ehci_shutdown,
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 411bb74152eb..d23321ec0e46 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -53,18 +53,11 @@ static void atmel_stop_ehci(struct platform_device *pdev)
53static int ehci_atmel_setup(struct usb_hcd *hcd) 53static int ehci_atmel_setup(struct usb_hcd *hcd)
54{ 54{
55 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 55 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
56 int retval;
57 56
58 /* registers start at offset 0x0 */ 57 /* registers start at offset 0x0 */
59 ehci->caps = hcd->regs; 58 ehci->caps = hcd->regs;
60 59
61 retval = ehci_setup(hcd); 60 return ehci_setup(hcd);
62 if (retval)
63 return retval;
64
65 ehci_port_power(ehci, 0);
66
67 return retval;
68} 61}
69 62
70static const struct hc_driver ehci_atmel_hc_driver = { 63static const struct hc_driver ehci_atmel_hc_driver = {
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 0d2f35ca93f1..fd9b5424b860 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -349,7 +349,6 @@ static int ehci_fsl_reinit(struct ehci_hcd *ehci)
349{ 349{
350 if (ehci_fsl_usb_setup(ehci)) 350 if (ehci_fsl_usb_setup(ehci))
351 return -EINVAL; 351 return -EINVAL;
352 ehci_port_power(ehci, 0);
353 352
354 return 0; 353 return 0;
355} 354}
diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c
index 3180cb3624d9..da4269550fba 100644
--- a/drivers/usb/host/ehci-grlib.c
+++ b/drivers/usb/host/ehci-grlib.c
@@ -34,22 +34,6 @@
34 34
35#define GRUSBHC_HCIVERSION 0x0100 /* Known value of cap. reg. HCIVERSION */ 35#define GRUSBHC_HCIVERSION 0x0100 /* Known value of cap. reg. HCIVERSION */
36 36
37/* called during probe() after chip reset completes */
38static int ehci_grlib_setup(struct usb_hcd *hcd)
39{
40 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
41 int retval;
42
43 retval = ehci_setup(hcd);
44 if (retval)
45 return retval;
46
47 ehci_port_power(ehci, 1);
48
49 return retval;
50}
51
52
53static const struct hc_driver ehci_grlib_hc_driver = { 37static const struct hc_driver ehci_grlib_hc_driver = {
54 .description = hcd_name, 38 .description = hcd_name,
55 .product_desc = "GRLIB GRUSBHC EHCI", 39 .product_desc = "GRLIB GRUSBHC EHCI",
@@ -64,7 +48,7 @@ static const struct hc_driver ehci_grlib_hc_driver = {
64 /* 48 /*
65 * basic lifecycle operations 49 * basic lifecycle operations
66 */ 50 */
67 .reset = ehci_grlib_setup, 51 .reset = ehci_setup,
68 .start = ehci_run, 52 .start = ehci_run,
69 .stop = ehci_stop, 53 .stop = ehci_stop,
70 .shutdown = ehci_shutdown, 54 .shutdown = ehci_shutdown,
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 68dd1c99b1f5..ab4a769a4104 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -371,24 +371,6 @@ static void ehci_shutdown(struct usb_hcd *hcd)
371 hrtimer_cancel(&ehci->hrtimer); 371 hrtimer_cancel(&ehci->hrtimer);
372} 372}
373 373
374static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
375{
376 unsigned port;
377
378 if (!HCS_PPC (ehci->hcs_params))
379 return;
380
381 ehci_dbg (ehci, "...power%s ports...\n", is_on ? "up" : "down");
382 for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; )
383 (void) ehci_hub_control(ehci_to_hcd(ehci),
384 is_on ? SetPortFeature : ClearPortFeature,
385 USB_PORT_FEAT_POWER,
386 port--, NULL, 0);
387 /* Flush those writes */
388 ehci_readl(ehci, &ehci->regs->command);
389 msleep(20);
390}
391
392/*-------------------------------------------------------------------------*/ 374/*-------------------------------------------------------------------------*/
393 375
394/* 376/*
@@ -1184,9 +1166,6 @@ static int __maybe_unused ehci_resume(struct usb_hcd *hcd, bool hibernated)
1184 ehci->rh_state = EHCI_RH_SUSPENDED; 1166 ehci->rh_state = EHCI_RH_SUSPENDED;
1185 spin_unlock_irq(&ehci->lock); 1167 spin_unlock_irq(&ehci->lock);
1186 1168
1187 /* here we "know" root ports should always stay powered */
1188 ehci_port_power(ehci, 1);
1189
1190 return 1; 1169 return 1;
1191} 1170}
1192 1171
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index a2c56cdd2c3a..a59c61fea09f 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -56,6 +56,19 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci)
56 if (!ehci->owned_ports) 56 if (!ehci->owned_ports)
57 return; 57 return;
58 58
59 /* Make sure the ports are powered */
60 port = HCS_N_PORTS(ehci->hcs_params);
61 while (port--) {
62 if (test_bit