diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 5dd20dbe852d..2fdb262d4726 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -75,33 +75,6 @@ static int pxa27x_ohci_select_pmm( int mode ) | |||
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | /* | ||
79 | If you select PMM_PERPORT_MODE, you should set the port power | ||
80 | */ | ||
81 | static int pxa27x_ohci_set_port_power( int port ) | ||
82 | { | ||
83 | if ( (pxa27x_ohci_pmm_state==PMM_PERPORT_MODE) | ||
84 | && (port>0) && (port<PXA_UHC_MAX_PORTNUM) ) { | ||
85 | UHCRHPS(port) |= 0x100; | ||
86 | return 0; | ||
87 | } | ||
88 | return -1; | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | If you select PMM_PERPORT_MODE, you should set the port power | ||
93 | */ | ||
94 | static int pxa27x_ohci_clear_port_power( int port ) | ||
95 | { | ||
96 | if ( (pxa27x_ohci_pmm_state==PMM_PERPORT_MODE) | ||
97 | && (port>0) && (port<PXA_UHC_MAX_PORTNUM) ) { | ||
98 | UHCRHPS(port) |= 0x200; | ||
99 | return 0; | ||
100 | } | ||
101 | |||
102 | return -1; | ||
103 | } | ||
104 | |||
105 | extern int usb_disabled(void); | 78 | extern int usb_disabled(void); |
106 | 79 | ||
107 | /*-------------------------------------------------------------------------*/ | 80 | /*-------------------------------------------------------------------------*/ |
@@ -130,11 +103,17 @@ static void pxa27x_start_hc(struct platform_device *dev) | |||
130 | Polarity Low to active low. Supply power to USB ports. */ | 103 | Polarity Low to active low. Supply power to USB ports. */ |
131 | UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & | 104 | UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & |
132 | ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE); | 105 | ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE); |
106 | |||
107 | pxa27x_ohci_pmm_state = PMM_PERPORT_MODE; | ||
133 | } | 108 | } |
134 | 109 | ||
135 | UHCHR &= ~UHCHR_SSE; | 110 | UHCHR &= ~UHCHR_SSE; |
136 | 111 | ||
137 | UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE); | 112 | UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE); |
113 | |||
114 | /* Clear any OTG Pin Hold */ | ||
115 | if (PSSR & PSSR_OTGPH) | ||
116 | PSSR |= PSSR_OTGPH; | ||
138 | } | 117 | } |
139 | 118 | ||
140 | static void pxa27x_stop_hc(struct platform_device *dev) | 119 | static void pxa27x_stop_hc(struct platform_device *dev) |
@@ -198,17 +177,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, | |||
198 | pxa27x_start_hc(dev); | 177 | pxa27x_start_hc(dev); |
199 | 178 | ||
200 | /* Select Power Management Mode */ | 179 | /* Select Power Management Mode */ |
201 | pxa27x_ohci_select_pmm( PMM_PERPORT_MODE ); | 180 | pxa27x_ohci_select_pmm(pxa27x_ohci_pmm_state); |
202 | |||
203 | /* If choosing PMM_PERPORT_MODE, we should set the port power before we use it. */ | ||
204 | if (pxa27x_ohci_set_port_power(1) < 0) | ||
205 | printk(KERN_ERR "Setting port 1 power failed.\n"); | ||
206 | |||
207 | if (pxa27x_ohci_clear_port_power(2) < 0) | ||
208 | printk(KERN_ERR "Setting port 2 power failed.\n"); | ||
209 | |||
210 | if (pxa27x_ohci_clear_port_power(3) < 0) | ||
211 | printk(KERN_ERR "Setting port 3 power failed.\n"); | ||
212 | 181 | ||
213 | ohci_hcd_init(hcd_to_ohci(hcd)); | 182 | ohci_hcd_init(hcd_to_ohci(hcd)); |
214 | 183 | ||