diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 17 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap3.c | 18 |
2 files changed, 14 insertions, 21 deletions
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index e39b0297bad1..568cefbd63a2 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/usb/ulpi.h> | 41 | #include <linux/usb/ulpi.h> |
42 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
43 | #include <linux/regulator/consumer.h> | 43 | #include <linux/regulator/consumer.h> |
44 | #include <linux/pm_runtime.h> | ||
44 | 45 | ||
45 | /* EHCI Register Set */ | 46 | /* EHCI Register Set */ |
46 | #define EHCI_INSNREG04 (0xA0) | 47 | #define EHCI_INSNREG04 (0xA0) |
@@ -190,11 +191,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
190 | } | 191 | } |
191 | } | 192 | } |
192 | 193 | ||
193 | ret = omap_usbhs_enable(dev); | 194 | pm_runtime_enable(dev); |
194 | if (ret) { | 195 | pm_runtime_get_sync(dev); |
195 | dev_err(dev, "failed to start usbhs with err %d\n", ret); | ||
196 | goto err_enable; | ||
197 | } | ||
198 | 196 | ||
199 | /* | 197 | /* |
200 | * An undocumented "feature" in the OMAP3 EHCI controller, | 198 | * An undocumented "feature" in the OMAP3 EHCI controller, |
@@ -240,11 +238,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
240 | return 0; | 238 | return 0; |
241 | 239 | ||
242 | err_add_hcd: | 240 | err_add_hcd: |
243 | omap_usbhs_disable(dev); | ||
244 | |||
245 | err_enable: | ||
246 | disable_put_regulator(pdata); | 241 | disable_put_regulator(pdata); |
247 | usb_put_hcd(hcd); | 242 | pm_runtime_put_sync(dev); |
248 | 243 | ||
249 | err_io: | 244 | err_io: |
250 | iounmap(regs); | 245 | iounmap(regs); |
@@ -266,10 +261,12 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
266 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 261 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
267 | 262 | ||
268 | usb_remove_hcd(hcd); | 263 | usb_remove_hcd(hcd); |
269 | omap_usbhs_disable(dev); | ||
270 | disable_put_regulator(dev->platform_data); | 264 | disable_put_regulator(dev->platform_data); |
271 | iounmap(hcd->regs); | 265 | iounmap(hcd->regs); |
272 | usb_put_hcd(hcd); | 266 | usb_put_hcd(hcd); |
267 | pm_runtime_put_sync(dev); | ||
268 | pm_runtime_disable(dev); | ||
269 | |||
273 | return 0; | 270 | return 0; |
274 | } | 271 | } |
275 | 272 | ||
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c index 516ebc4d6cc2..1b8133b6e451 100644 --- a/drivers/usb/host/ohci-omap3.c +++ b/drivers/usb/host/ohci-omap3.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <plat/usb.h> | 33 | #include <plat/usb.h> |
34 | #include <linux/pm_runtime.h> | ||
34 | 35 | ||
35 | /*-------------------------------------------------------------------------*/ | 36 | /*-------------------------------------------------------------------------*/ |
36 | 37 | ||
@@ -134,7 +135,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
134 | int irq; | 135 | int irq; |
135 | 136 | ||
136 | if (usb_disabled()) | 137 | if (usb_disabled()) |
137 | goto err_end; | 138 | return -ENODEV; |
138 | 139 | ||
139 | if (!dev->parent) { | 140 | if (!dev->parent) { |
140 | dev_err(dev, "Missing parent device\n"); | 141 | dev_err(dev, "Missing parent device\n"); |
@@ -172,11 +173,8 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
172 | hcd->rsrc_len = resource_size(res); | 173 | hcd->rsrc_len = resource_size(res); |
173 | hcd->regs = regs; | 174 | hcd->regs = regs; |
174 | 175 | ||
175 | ret = omap_usbhs_enable(dev); | 176 | pm_runtime_enable(dev); |
176 | if (ret) { | 177 | pm_runtime_get_sync(dev); |
177 | dev_dbg(dev, "failed to start ohci\n"); | ||
178 | goto err_end; | ||
179 | } | ||
180 | 178 | ||
181 | ohci_hcd_init(hcd_to_ohci(hcd)); | 179 | ohci_hcd_init(hcd_to_ohci(hcd)); |
182 | 180 | ||
@@ -189,9 +187,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
189 | return 0; | 187 | return 0; |
190 | 188 | ||
191 | err_add_hcd: | 189 | err_add_hcd: |
192 | omap_usbhs_disable(dev); | 190 | pm_runtime_put_sync(dev); |
193 | |||
194 | err_end: | ||
195 | usb_put_hcd(hcd); | 191 | usb_put_hcd(hcd); |
196 | 192 | ||
197 | err_io: | 193 | err_io: |
@@ -220,9 +216,9 @@ static int __devexit ohci_hcd_omap3_remove(struct platform_device *pdev) | |||
220 | 216 | ||
221 | iounmap(hcd->regs); | 217 | iounmap(hcd->regs); |
222 | usb_remove_hcd(hcd); | 218 | usb_remove_hcd(hcd); |
223 | omap_usbhs_disable(dev); | 219 | pm_runtime_put_sync(dev); |
220 | pm_runtime_disable(dev); | ||
224 | usb_put_hcd(hcd); | 221 | usb_put_hcd(hcd); |
225 | |||
226 | return 0; | 222 | return 0; |
227 | } | 223 | } |
228 | 224 | ||