Johannes De Smedt

iMX28 change audio codec driver

Discussion created by Johannes De Smedt on Sep 18, 2011
Latest reply on Oct 6, 2011 by Gabriele Fiacchini

Hi,

 

I have an iMX28 EVK board and I have replaced the default audio codec with a CS4270. (The data pins are linked through and the I2C pins are discarded)

Now I need to update the linux kernel so that the CS4270 acts as master. Also the clock-frequencies have to be modified (I think).

I have no experience in driver/kernel development, so newbie help will be appreciated.

 

What I tried so far is modifying the mxs-devb.c file: in mxs_evk_audio_hw_params function I have changed following:

/* set codec to slave mode */

dai_format = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |    SND_SOC_DAIFMT_CBM_CFM; //EDIT: was CBS_CFS
/* set codec DAI configuration */

ret = snd_soc_dai_set_fmt(codec_dai, dai_format);

if (ret < 0)return ret;

 

/* set cpu_dai to master mode for playback, slave mode for record */

dai_format = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |SND_SOC_DAIFMT_CBS_CFS; //EDIT: was CBM_CFM
/* set cpu DAI configuration */

ret = snd_soc_dai_set_fmt(cpu_dai, dai_format);

if (ret < 0)return ret;

 

With these changes however we still measure a clock signal coming from the cpu (so the codec acts as slave)

 

Can anyone help me on adapting the driver so that the cs4270 is master. How should the frequencies be adapted?

 

If more info is needed, just ask (I am a real newbie on this so if I haven't included some info, please forgive me)

 

Thanks in advance

Outcomes