On Thu, Sep 18, 2014 at 06:09:50PM +0200, Jean-Michel Hautbois wrote:
Well, audmux is not getting clock, this is normal I think, the clock I was mentionning is the MCLK of SGTL5000 and this one is linked to FPGA, but found after all. I now had a further look into sound/soc/fsl/fsl_ssi.c and I see this :
sprop = of_get_property(np, "fsl,mode", NULL); if (sprop) { if (!strcmp(sprop, "ac97-slave")) ssi_private->dai_fmt = SND_SOC_DAIFMT_AC97; else if (!strcmp(sprop, "i2s-slave")) ssi_private->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM; }
I may have missed something, but it seems that i2s-master is not parsed, and does not set dai_fmt ?
Actually this is kind of obsolete property because initially the SSI driver only supported i2s-slave. We've put an i2s-slave check here is to limit the driver by excluding other modes.
But now, the driver has the capability to derive clock from CCM and output it for external CODEC. So this one could be dropped in fact rather than adding a new i2s-master case IMO.
arecord -v -V stereo -f cd -D hw:0,0 somefile.wav Recording WAVE 'somefile.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: pcm_read:2031: read error: Input/output error
The problem here should be the AUDMUX configuration issue. The imx- sgtl5000.c driver only supports CODEC in master mode. So if you try to switch the CODEC slave mode, you shall also change not only the CBM_CFM to CBS_CFS but also swap the ext_port and int_port of AUDMUX (a little confusing approach here as the configuration of AUDMUX is routing the data and clocks from a source port to a destination port while each of side, external or internal, might be a source port -- When using CBM_CFM, the source port should be external port; while using CBS_CFS, the source port should be the internal port.)
There may be another topic, however, actually the fsl-asoc-card driver does handle the master/slave mode supports. So if you are trying to add the CODEC slave mode support into imx-sgtl5000. I suggest you to try the fsl-asoc-card instead. Its DT binding's totally compatible with imx-sgtl5000's. What you need to do is just enable it (and disable imx-sgtl500) in the menuconfig or add these enable/disable into imx_v6_v7_defconfig.
Nicolin