]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
musb_hdrc: Fix clock usage for suspend
authorTony Lindgren <tony@atomide.com>
Tue, 7 Aug 2007 13:10:44 +0000 (06:10 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 7 Aug 2007 13:10:44 +0000 (06:10 -0700)
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: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/plat_uds.c

index 36fc5786b556883001744d7b321bf5e2e312a3f2..47db8f59691236577bef7c8c465eb52cb359eddc 100644 (file)
@@ -2120,7 +2120,10 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message)
                 */
        }
 
-       clk_disable(musb->clock);
+       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);
-       clk_enable(musb->clock);
+
+       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)