Enable i2s slave mode in Apalis iMX6

Hi, for some reason, I need to enable the iMX6 to become i2s slave for , I tried to enable the i2s through a dummy driver by using this patch: [alsa-devel] Simple-card without codec for testing purpose , but I didn’t detect any sound card.

I look through the [alsa-devel] Simple-card without codec for testing purpose, but he is using i2s master mode, how can I change to i2s slave mode?

Do I need to create a glue code in sound/soc/fsl to activate AUD interface?

hi
which bsp for the toradex module are you using? Usually for Apalis iMX6, the i2s is already in slave mode. what should be changed to slave mode? the soundcard or the apalis imx6 soc? Which soundcard are you using?

Hi, thanks for reply.
I’m using Apalis iMX6 to connect with a noise cancel sound card. The sound card is i2s master, and the Apalis iMX6 is i2s slave.
As refer to the Apalis iMX6 dataseheet, the aud4 is can be used as i2s mode, may I know which codec that enable the aud4 to become i2s slave mode?
Because in my application, I need to use aud3 as i2s slave, I hope to refer the codec and change it to aud3?
Do I need to do anything other than change the codec if I change the aud3, like the device tree?

hi, you can use whatever kind of codec. On the Apalis Evaluation Board, we are using this codec. Check the Table 5 -50 Additional Digital Audio Ports on page 49 of datasheet to know how to use aud3. You have to change the device tree, since these pins are defined as SPI pins usually.

Hi, thanks for reply. I look at the codec that you give me, but I’m not sure which part codec should I change in order to enable the i2s. Do toradex have any documentation about enable i2s? Or can you tell me how you make the aud4 into i2s salve, so that I can refer and change the aud3. Thank you.

As i said, you have to change the device tree.

Thanks, so I do not need to edit the codec?
Just edit the device tree like this, and it will link the codec to the aud4 become i2s?

You will need a driver for your codec to setup the codec correctly as master or slave. On Apalis side, just change the device tree.

Yes, what I want to know is how to write the dirver. Do Toradex have any sample for that? Or I can direct use the codec that apalis used for aud4 for i2s slave, if so, which codec is it? Is the driver means just enable the enable the driver in the menuconfig? Thanks

Hi
We don’t have any sample for the driver, but you can have a look here. The Apalis Imx6 uses the NXP SGTL5000 as described in datasheet.

Is the driver means just enable the enable the driver in the menuconfig?
No, the driver for SGTL5000 is already included in the Toradex images.