On 23 February 2012 16:19, Mark Brown broonie@opensource.wolfsonmicro.com wrote:
On Thu, Feb 23, 2012 at 01:40:40PM +0100, javier Martin wrote:
As I wasn't sure about the meaning of 'normal' I've dug into the code of some platforms to see what they do. What I've found, however, is that it doesn't seem to be an agreement about it.
It's whatever is standard for the given format - the Wolfson datasheets are a pretty good reference, they have clear diagrams.
So, let's see if I understood properly. If I want to configure the i.MX SSI into standard, I2S format I should do:
dai_format = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF; snd_soc_dai_set_fmt(cpu_dai, dai_format);
However, this doesn't work with the imx-ssi driver which does the following: http://lxr.linux.no/#linux+v3.2.7/sound/soc/imx/imx-ssi.c#L83
case SND_SOC_DAIFMT_I2S: /* data on rising edge of bclk, frame low 1clk before data */ strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0; scr |= SSI_SCR_NET; if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) { scr &= ~SSI_I2S_MODE_MASK; scr |= SSI_SCR_I2S_MODE_SLAVE; } break; [...] case SND_SOC_DAIFMT_NB_NF: strcr &= ~SSI_STCR_TFSI; strcr |= SSI_STCR_TSCKP; break;
While initially TFSI bit is set because of I2S flag, it is then cleared because of the NB_NF.
Does this mean this is a bug then? If it is, I would gladly fix it but there is at least one platform relying on this misleading behavior that I can't test: http://lxr.linux.no/#linux+v3.2.7/sound/soc/imx/wm1133-ev1.c#L81