Bit clock/Frame Sync enabled on i.MX7 at boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bit clock/Frame Sync enabled on i.MX7 at boot

658 Views
f_antonini
Contributor III

Hi

I'm working on an i.MX7d custom board interfacing a Silicon Labs chipset on the SAI2 interface.

I have developed a machine driver to link che CPU dai (sai2) to the Silicon Labs chip codec modeled as a snd-soc-dummy codec. The sound card has been successfully configured and mapped from the operating system.

So I can successfully play an audio file to the chipset. I see the bitclock/framesync and data transmitted on the SAI2 inteface (by a probe) during the play of the audio file and hear the audio.

Anyway the Silicon Labs chipset requires that the Bit clock and frame sync should be provided since from the reset stage of the chip. So my question is how I can enable the bit clock and framesync on the SAI2 interface at boot stage even without any PCM streaming of audio data. Is it doable in any way (from kernel or u-boot)? In other words what i would like to do is to have bit clock and frame sync always enabled on the bus even when there is no streaming of data on the bus.

I have tried to enable the bitclock and frame sync from fsl_sai.c during the probe stage, but unsuccessfully. 

Every hints will be appreciated.

Thanks in advance

Fabio

Labels (2)
0 Kudos
4 Replies

561 Views
igorpadykov
NXP Employee
NXP Employee

Hi Fabio

one can try to set clocks in uboot or dcd header described in sect.6.6.7.2 Device Configuration

Data (DCD) i.MX7D Reference Manual.

imximage_TO_1_1.cfg\mx7dsabresd\freescale\board - uboot-imx - i.MX U-Boot 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

561 Views
f_antonini
Contributor III

Hi Igor

it sounds really interesting. I was not aware of such interesting feature.

So we could add some DCD write commands to configure the SAI2 controller

register to start at boot stage the bit clock and the frame sync.

My doubt is if this initial setting can be lost or overwritten when the

linux kernel starts and the SAI2 is used to stream some audio.

For example I have realized that in the function fsl_sai_trigger (within

the fs_sai.c) the bit clock and frame sync are disabled when the

function is invoked

with a SNDRV_PCM_TRIGGER_STOP parameter. In your opinion do this event

overwrite the DCD initial settings?

Thanks a lot for your help

Best regards

fabio

0 Kudos

561 Views
igorpadykov
NXP Employee
NXP Employee

Hi Fabio

in general yes, linux can temporarily change sai clocks,

since it can adjust parent clocks used for (example) some other modules.

Best regards
igor

0 Kudos

561 Views
f_antonini
Contributor III

Hi Igor

thanks a lot for your support.

Best regards

fabio

0 Kudos