From: Felipe Balbi Date: Thu, 3 Apr 2008 13:59:37 +0000 (+0300) Subject: USB: MUSB: Be sure that we enable musb->clock X-Git-Tag: v2.6.25-omap1~68 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8e3b6ea0c74a3cb4145dc21210854b84db40aa34;p=linux-2.6-omap-h63xx.git USB: MUSB: Be sure that we enable musb->clock If CONFIG_OMAP_RESET_CLOCKS is enabled, musb->clock would be disabled because nobody was enabling it. Be sure that omap2430.c enables musb->clock to avoid problems later. Signed-off-by: Felipe Balbi Signed-off-by: Tony Lindgren --- diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 8041ddecec4..c21d93ac7e4 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -246,6 +246,9 @@ int __init musb_platform_init(struct musb *musb) int musb_platform_suspend(struct musb *musb) { + if (!musb->clock) + return 0; + /* in any role */ OTG_FORCESTDBY_REG &= ~ENABLEFORCE; /* disable MSTANDBY */ OTG_SYSCONFIG_REG &= FORCESTDBY; /* enable force standby */ @@ -257,14 +260,27 @@ int musb_platform_suspend(struct musb *musb) if (musb->xceiv.set_suspend) musb->xceiv.set_suspend(&musb->xceiv, 1); + if (musb->set_clock) + musb->set_clock(musb->clock, 0); + else + clk_disable(musb->clock); + return 0; } int musb_platform_resume(struct musb *musb) { + if (!musb->clock) + return 0; + if (musb->xceiv.set_suspend) musb->xceiv.set_suspend(&musb->xceiv, 0); + if (musb->set_clock) + musb->set_clock(musb->clock, 1); + else + clk_enable(musb->clock); + OTG_FORCESTDBY_REG &= ~ENABLEFORCE; /* disable MSTANDBY */ OTG_SYSCONFIG_REG |= SMARTSTDBY; /* enable smart standby */ OTG_SYSCONFIG_REG &= ~AUTOIDLE; /* disable auto idle */