Setting up host side Digital Audio Interface (DAI) in a machine driver

,

Hi. I am working on a project where I am supposed to send audio data from an Nvidia Xavier NX that runs L4T v4.9 to a Cirrus Logic CS47L35 chip. I have to send control signals over SPI and audio data over I2S. After talking to the Cirrus Logic support team I am made to believe that I would have to change the machine driver DAI links to connect the host I2S DAI to the cs47l35 DAI. To find the host DAI name, I will need the I2S driver for the platform. This (GitHub - OE4T/linux-tegra-4.9: Linux kernel source for NVIDIA Tegra (Jetson TX1, TX2, AGX Xavier, Xavier NX, Nano) in single-repo form, derived from the L4T BSP) is the source that I
am using for Nvidia platform. So my questions are:

  • Am I using the right source?
  • Where will I find the driver files for I2S? Is it possible to list out all the files?

Hoping to hear back. Some help would be great as I am very new to this porting.

Thanks,
Abhigyan

Check below doc to get the right source.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/kernel_custom.html#

Check below for the audio driver.
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/asoc_driver.19.1.html#

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/asoc_driver.19.1.html# talks about making changes to the sound node in the device tree. But I am not able to locate the device tree in my Nvidia Xavier NX.

Since I am using a Cirrus Logic’s cs47l35 codec, so can I add my own <.compatible> property in the machine driver and put the same in the Device Tree, or should I use “For Jetson Xavier NX, Jetson AGX Xavier series, or Jetson TX2 series: nvidia,tegra-audio-t186ref-mobile-rt565x” in my machine driver?

Hi user93455,

sound node located in “Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-audio-p3668.dtsi” can be used for your dai link specific modification ( Link points the file to be edited platform wise )

Thanks

Do I have to make changes to the Device Tree?

Since you mentioned that you are unable to locate device tree for Nvidia Xavier NX, I have pointed the same.
Refer sample codec porting guide based on I2S for data and I2C for control signal communication here. This link could give you some idea.

If there is anything else that you need help with, please post a specific question with more details

Thanks

Hi, this is what I have been trying to achieve:
“I am working on a project where I am supposed to send audio data from an Nvidia Xavier NX that runs L4T v4.9 to a Cirrus Logic CS47L35 chip. I have to send control signals over SPI and audio data over I2S.”

The information provided on your website is a little confusing. Since I am new to this, can you please write down the steps that I will need to follow to achieve the goal? Bulletin points would be appreciated.

Thanks,
Abhigyan

Hi Abhigyan,

I see I2C bus available for control signal communication on your codec. Is there any specific reason for you to choose SPI for control signal communication over I2C or is I2C fine to be used? Ensure that cirrus logic provides necessary i2c codec driver code if I2C is used.

Also, note that documentation details way to use i2c for control data communication and i2s signal for data communication. Strongly suggest you to read through it and see if that helps. If it is confusing, let us know which part of it is not understandeable.

Link has sample step by step procedure for another card. You could form your patches based on this reference and let us know issues faced in trying to use interfaces

If you wish to try SPI for communication, I might need to check/redirect to SPI expert

Thanks

Hi Atalambedu,

The requirement of my project is such that I have to use SPI. So please do the needful.

Infineon-Project2021-22/tegra-cirrus.c at master · AbhigyanBorah33/Infineon-Project2021-22 · GitHub is the link to the machine driver that I have been building with help from Cirrus Logic. They are unable to help for the host side. So please have a look at it and suggest what else I need to do.

Thanks,
Abhigyan