Hi, I am using PCM5102a dac module to i2s@0 for JETSON-tx2 board. This module driver is not located in Linux-tegra kernel source. So I have downloaded the pcm5102a driver from latest kernel 4.17 revision. I have kept it in linux-tegra kernel-source/sound/soc/codexs/ and I modified Makefile and Kconfig file. Driver entry is created in Menuconfig. I have selected it and compiled successfully. Then i have checked in Rootfs inside /sys/snd/ all modules located over there. but my pcm5102a module is not there.
Is there any problem with module driver or Device tree problem.
Now My doubt is
Is it necessary to add a module entry node inside the DTS file…?
The Linux kernel documentation  states the following about the ‘/sys/modules/’ location …
The name of the module that is in the kernel. This
module name will always show up if the module is loaded as a
dynamic module. If it is built directly into the kernel, it
will only show up if it has a version or at least one
So if you have built the driver into the kernel, then you may not see it under ‘/sys/modules’ which is expected.
Looking at the PCM5102a, there is not control interface (ie. I2C or SPI interface) and hence no registers that need to be configured. Therefore, you should not need to modify the DTS files. You should be able to connect the codec to an I2S interface on the Jetson TX2 and use it. Yes I would recommend using the I2S0 interface on J21. Did you also connect the Tegra AUD_MCLK to the PCM5102a SCK pin?
Tried to play a simple wave file by using below commands but no sound. Are we missing anything here?
amixer -c tegrasndt186ref cset name=“I2S0 Mux” “ADMAIF1” // tried with name=“I2S1 Mux”
aplay -D hw:tegrasndt186ref,0
Platform driver list indicates “tegra210”, I hope this is fine. As our interfaced DAC module is based on TI “pcm5102a” chipset, do we need to add/enable any drivers ?
Yes this is expected. You will not see any indication that the DAC is connected. The kernel is unaware of the presence of the DAC and given that there is no control interface for the DAC (ie I2C or SPI interface) it has no means of knowing that it is present.
You should use ‘I2S1 Mux’ and you should find that the mixer control ‘I2S0 Mux’ does not exist.
Yes this is also expected. The Tegra186 and Tegra210 devices have a lot of common devices and so you may see some device have the tegra210 prefix. Again you will never see any indication that the DAC is present.
Looking at the driver, the only useful thing that it does is define what sample-rates and sample-sizes are supported. However, given that there are no internal settings to configure on the DAC, for testing this is not necessary to make it work and so I would not worry with this for now.
Do you have an oscilliscope and can you verify that the I2S signals and MCLK are being driven when you execute the aplay command?
What is the sample-rate and sample-size of the WAV file you are using? You may wish to start with something that is 16-bit @ 44.1kHz or 48kHz.
You should see that all the signals, MCLK, BCK, LRCK and DOUT are toggling. At 48kHz, the MCLK should be 12.288MHz (25648000), the BCK should be 1.536MHz (4800016*2), and the LRCK should be 48kHz. If this looks correct, then check that PCM5102a data sheet to ensure that these align with the PCM5102a specifications. If it all looks good and you still cannot hear anything please check with Texas Instruments through their support channels because this is not a DAC we test with.
That’s great. So now you need to focus on the DAC side and for support on that please check with Texas Instruments support. If you have any questions with regard to clocking, frame format, etc, let us know.