I am trying to use a tlv320dac3100 codec as a slave. MCLK in the codec is not connected, so I need BCLK provided by the processor.
So far, I have not been able to see a clock output from AUDMUX port 5. Here's what I have done so far.
Thanks in advance for any help.
In the SSI to generate a clock that's 44100*32*2 (I2S requires 32 bit words):
/*
* the target is 11289600 Hz as a good starting point per RM
* section 61.8.4.2. Because the clk_round_rate() function
* rounds down, we ask for a slightly higher target to get a closer
* value. We will end up with a rate of 11294117 HZ
*/
clk_set_rate(ssi->clk, clk_round_rate(ssi->clk, 11294118));
Then in the codec driver I have:
snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PM, 1);
snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_2, 0);
snd_soc_dai_set_clkdiv(cpu_dai, IMX_SSI_TX_DIV_PSR, 0);
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_IF |
SND_SOC_DAIFMT_CBS_CFS);
AUDMUX is configured as follows:
slave=5
master-2
slave = slave - 1;
master = master - 1;
ptcr = MXC_AUDMUX_V2_PTCR_TFSDIR |
MXC_AUDMUX_V2_PTCR_TFSEL(master) |
MXC_AUDMUX_V2_PTCR_TCLKDIR |
MXC_AUDMUX_V2_PTCR_TCSEL(master);
pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(master);
mxc_audmux_v2_configure_port(slave, ptcr, pdcr);
ptcr = 0;
pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(slave);
mxc_audmux_v2_configure_port(master, ptcr, pdcr);
I have the codec set BCLK as input.
I have recently managed to get mx6 working in SSI master mode:
Thanks for the reply Fabio, but I already have those changes. Anything else I might check?
Ed,
I have never tried this on 3.0.35, so not sure if the ssi master support is in place in this version.
Try dumping the following information from the SSI registers and codec registers:
- Check if SSI is actually in master mode
- Check if the codec is really in slave mode
Which kernel did you use? Also, I didn't see in your patch any changes for the SSI clock? Wasn't that necessary as well?
Thanks again for your help.
I was using linux-next tree:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=refs/tags/next-20141001
Also, if you use linux-next, then you will need to convert your board to device tree.
that's a typo - master=2, not master-2 in the audmux config.