From: Peter Ujfalusi Date: Mon, 5 Mar 2012 09:32:27 +0000 (+0200) Subject: ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal X-Git-Tag: v3.4-rc1~144^2~2^2~9 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e386615c01d37145aa27fd06d1f8de26f1acbb7f;p=karo-tx-linux.git ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal If external source for the CLKS signal selection kept after the port is no longer in use the system might refuse to go suspend. There is also a chance that the external clock is not running when next time the McBSP port is started which can result errors when we try to access McBSP registers. Reset the CLKS source back to PRCM source unconditionally. Signed-off-by: Peter Ujfalusi Acked-by: Mark Brown Tested-by: Grazvydas Ignotas Signed-off-by: Liam Girdwood --- diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index d7167932113a..21dbb0532bca 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c @@ -548,6 +548,16 @@ void omap_mcbsp_free(struct omap_mcbsp *mcbsp) reg_cache = mcbsp->reg_cache; + /* + * Select CLKS source from internal source unconditionally before + * marking the McBSP port as free. + * If the external clock source via MCBSP_CLKS pin has been selected the + * system will refuse to enter idle if the CLKS pin source is not reset + * back to internal source. + */ + if (!cpu_class_is_omap1()) + omap2_mcbsp_set_clks_src(mcbsp, MCBSP_CLKS_PRCM_SRC); + spin_lock(&mcbsp->lock); if (mcbsp->free) dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);