From d365701281c06b644cdf7b7211c2be9a9036fd4b Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Tue, 7 Aug 2007 06:10:44 -0700 Subject: [PATCH] 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: Tony Lindgren --- drivers/usb/musb/plat_uds.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/plat_uds.c b/drivers/usb/musb/plat_uds.c index 36fc5786b55..47db8f59691 100644 --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -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) -- 2.41.1