Commit d3657012 authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Fix clock usage for suspend

At least tusb implements set_clock(), and in that
case clk_disable() gets called twice. Do not call
clk_disable() if set_clock() is implemented.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 58e45f3e
......@@ -2120,6 +2120,9 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message)
*/
}
if (musb->set_clock)
musb->set_clock(musb->clock, 0);
else
clk_disable(musb->clock);
spin_unlock_irqrestore(&musb->Lock, flags);
return 0;
......@@ -2134,7 +2137,12 @@ static int musb_resume(struct platform_device *pdev)
return 0;
spin_lock_irqsave(&musb->Lock, flags);
if (musb->set_clock)
musb->set_clock(musb->clock, 1);
else
clk_enable(musb->clock);
/* for static cmos like DaVinci, register values were preserved
* unless for some reason the whole soc powered down and we're
* not treating that as a whole-system restart (e.g. swsusp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment