aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/musb/omap2430.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 2c54f52ae386..22f15b026ab9 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -268,13 +268,8 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work)
268{ 268{
269 struct omap2430_glue *glue = container_of(mailbox_work, 269 struct omap2430_glue *glue = container_of(mailbox_work,
270 struct omap2430_glue, omap_musb_mailbox_work); 270 struct omap2430_glue, omap_musb_mailbox_work);
271 struct musb *musb = glue_to_musb(glue);
272 struct device *dev = musb->controller;
273 271
274 pm_runtime_get_sync(dev);
275 omap_musb_set_mailbox(glue); 272 omap_musb_set_mailbox(glue);
276 pm_runtime_mark_last_busy(dev);
277 pm_runtime_put_autosuspend(dev);
278} 273}
279 274
280static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci) 275static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci)
@@ -343,16 +338,6 @@ static int omap2430_musb_init(struct musb *musb)
343 musb->isr = omap2430_musb_interrupt; 338 musb->isr = omap2430_musb_interrupt;
344 phy_init(musb->phy); 339 phy_init(musb->phy);
345 340
346 /*
347 * Enable runtime PM for musb parent (this driver). We can't
348 * do it earlier as struct musb is not yet allocated and we
349 * need to touch the musb registers for runtime PM.
350 */
351 pm_runtime_enable(glue->dev);
352 status = pm_runtime_get_sync(glue->dev);
353 if (status < 0)
354 goto err1;
355
356 l = musb_readl(musb->mregs, OTG_INTERFSEL); 341 l = musb_readl(musb->mregs, OTG_INTERFSEL);
357 342
358 if (data->interface_type == MUSB_INTERFACE_UTMI) { 343 if (data->interface_type == MUSB_INTERFACE_UTMI) {
@@ -376,11 +361,7 @@ static int omap2430_musb_init(struct musb *musb)
376 if (glue->status != MUSB_UNKNOWN) 361 if (glue->status != MUSB_UNKNOWN)
377 omap_musb_set_mailbox(glue); 362 omap_musb_set_mailbox(glue);
378 363
379 pm_runtime_put(glue->dev);
380 return 0; 364 return 0;
381
382err1:
383 return status;
384} 365}
385 366
386static void omap2430_musb_enable(struct musb *musb) 367static void omap2430_musb_enable(struct musb *musb)
@@ -588,11 +569,9 @@ static int omap2430_probe(struct platform_device *pdev)
588 goto err2; 569 goto err2;
589 } 570 }
590 571
591 /* 572 pm_runtime_enable(glue->dev);
592 * Note that we cannot enable PM runtime yet for this 573 pm_runtime_use_autosuspend(glue->dev);
593 * driver as we need struct musb initialized first. 574 pm_runtime_set_autosuspend_delay(glue->dev, 500);
594 * See omap2430_musb_init above.
595 */
596 575
597 ret = platform_device_add(musb); 576 ret = platform_device_add(musb);
598 if (ret) { 577 if (ret) {
@@ -618,6 +597,7 @@ static int omap2430_remove(struct platform_device *pdev)
618 platform_device_unregister(glue->musb); 597 platform_device_unregister(glue->musb);
619 omap2430_set_power(musb, false, false); 598 omap2430_set_power(musb, false, false);
620 pm_runtime_put_sync(glue->dev); 599 pm_runtime_put_sync(glue->dev);
600 pm_runtime_dont_use_autosuspend(glue->dev);
621 pm_runtime_disable(glue->dev); 601 pm_runtime_disable(glue->dev);
622 602
623 return 0; 603 return 0;