[Letux-kernel] [PATCH 2/2] omap-mcbsp: dirty hack for mcbsp1 clock setting for fm

Andreas Kemnade andreas at kemnade.info
Sat Aug 4 11:40:20 CEST 2018


This unconditionally sets the clock divider to the right value
for using the si4721 in the gta04.
seems not be possible by dtb.
So this it a first intermediate solution but chances are high
that other uses of mcbsp1 are broken.

Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
---
 sound/soc/omap/omap-mcbsp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index d0ebb6b9bfac..f111e8a2c04e 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -511,6 +511,16 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
 	if (inv_fs == true)
 		regs->pcr0 ^= FSXP | FSRP;
 
+#define IN_FREQUENCY (96000000)
+#define CLOCK_DIVISOR (IN_FREQUENCY / 2594000)  /* 37 */
+	printk("omap phys base %x\n", mcbsp->phys_base);
+	if ((uint32_t)mcbsp->phys_base == 0x48074000) {
+		printk("McBSP1 hack in action\n");
+//		snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_FCLK, IN_FREQUENCY,
+ //                                                                SND_SOC_CLOCK_IN);
+	        snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, CLOCK_DIVISOR);
+
+	}
 	return 0;
 }
 
-- 
2.11.0



More information about the Letux-kernel mailing list