alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: OMAP: mcbsp: ensure that CLKX and CLKR are not used as ouput pins when they are used as input clock for the SRG.
@ 2015-01-15 22:28 Thomas Niederprüm
  2015-01-16  9:09 ` Jarkko Nikula
  2015-01-16  9:15 ` Peter Ujfalusi
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Niederprüm @ 2015-01-15 22:28 UTC (permalink / raw)
  To: peter.ujfalusi, jarkko.nikula
  Cc: linux-omap, alsa-devel, Thomas Niederprüm

This patch fixes faulty behaviour in a setup where the input clock for
the SRG is fed through the CLKR pin but the McBSP is configured to be
master (SND_SOC_DAIFMT_CBS_CFS). In that case of course CLKR must not be
configured as output pin. Otherwise the input clock is messed up
horribly. The same reasoning applies if CLKX is configured as input for
the SRG.

Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
---
 sound/soc/omap/omap-mcbsp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index bd3ef2a..c89f562 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -530,8 +530,12 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 
 	case OMAP_MCBSP_SYSCLK_CLKX_EXT:
 		regs->srgr2	|= CLKSM;
+		regs->pcr0	|= SCLKME;
+		regs->pcr0	&= ~CLKXM;
+		break;
 	case OMAP_MCBSP_SYSCLK_CLKR_EXT:
 		regs->pcr0	|= SCLKME;
+		regs->pcr0	&= ~CLKRM;
 		break;
 	default:
 		err = -ENODEV;
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-19  7:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 22:28 [PATCH] ASoC: OMAP: mcbsp: ensure that CLKX and CLKR are not used as ouput pins when they are used as input clock for the SRG Thomas Niederprüm
2015-01-16  9:09 ` Jarkko Nikula
2015-01-16  9:15 ` Peter Ujfalusi
2015-01-16 10:15   ` Thomas Niederprüm
2015-01-16 12:42     ` Peter Ujfalusi
2015-01-16 15:06       ` Thomas Niederprüm
2015-01-19  7:44         ` Peter Ujfalusi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).