iMX28 change audio codec driver

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX28 change audio codec driver

444 Views
Sjoon
Contributor II

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

Tags (1)
0 Kudos
4 Replies

54 Views
GabrieleFiacchi
Contributor I

I don't know if it possible with i.MX28. From the i.Mx28 manual it seems that SAIF module when  trasmitting are forced to 
transmit the clock; so it could be not possible for the i.MX28 to source clock for transmitting audio.


Johannes De Smedt said:

let me rephrase our case: we have an imx28 with an SGTL5000 audio codec. We have linked the some pins of that codec to our own codec (similar to a cs4270). The i2c pins are no longer connected. Only the clock and the audio data pins are connected.

What we need to do is adapt the SGTL5000 driver so that the CPU is slave to the codec (takes the clocks from the codec). And can take the audio in. The cpu should not be able to change controls of the codec (that will be done in another way), so the CPU should not send anything to the i2c pins.

Can anyone help me out on how this could be achieved?

0 Kudos

54 Views
Sjoon
Contributor II

let me rephrase our case: we have an imx28 with an SGTL5000 audio codec. We have linked the some pins of that codec to our own codec (similar to a cs4270). The i2c pins are no longer connected. Only the clock and the audio data pins are connected.

What we need to do is adapt the SGTL5000 driver so that the CPU is slave to the codec (takes the clocks from the codec). And can take the audio in. The cpu should not be able to change controls of the codec (that will be done in another way), so the CPU should not send anything to the i2c pins.

Can anyone help me out on how this could be achieved?

0 Kudos

54 Views
fabio_estevam
NXP Employee
NXP Employee

The 0xa I2C address is wrong for the cs4270. It should be 0x48.

 

You can take a look at a board that has this codec supported as a reference:

arch/arm/mach-pxa/raumfeld.c

 

and you will also need to create similar file as this one for MX28: sound/soc/pxa/raumfeld.c

 

Make sure to select the cs4270 in the kernel menuconfig.

 

Regards,

 

Fabio Estevam

0 Kudos

54 Views
Sjoon
Contributor II

I have found this thread: http://imxcommunity.org/group/imx28andimx28evk/forum/topics/i2c-devicefram-on-imx28-evk?xg_source=ac...

 

So I have changed the line:  { I2C_BOARD_INFO("sgtl5000-i2c", 0xa), .flags = I2C_M_TEN }

to:  { I2C_BOARD_INFO("cs4270-i2c", 0xa), .flags = I2C_M_TEN }

 

I have also checked: build all ASoC CODEC drivers in ltib kernel configuration (Device Drivers > Sound card support > ALSA > ALSA for SoC audio support), but I still can't see my sound-device (and I also can't install the module for cs4270 with modprobe as described here: http://bugtrack.alsa-project.org/main/index.php/Matrix:Module-cs4270)

 

Any help?

Thanks

0 Kudos