My primary task is to make the Texas Instruments ADS1274 codec usable in Yocto Linux.
The linux kernel already includes the ads117x ALSA driver which includes support for the ADS1174 codec which is very similar to the ADS1274 - so I thought to get started with the ads117x and move on from there. But as of now I even fail to get that existing driver to show up as ALSA device.
The hardware base is a Variscite DART-6UL board featuring an Freescale i.MX6ULL processor. The codec chip will be attached to either SAI3 or SPI - whatever allows for easier integration. For the moment I assume that the SAI3 will be the easiest possibility to integrate the codec.
From reading all kinds of documentary and examples, I found that I have to adapt the DeviceTree configuration for our specific hardware board. So I added the following section to the root node:
sound { compatible = "simple-audio-card"; simple-audio-card,name = "ads1174audio"; simple-audio-card,format ="left_j"; /* Left justified, as specified in ads1174 datasheet */ simple-audio-card,bitclock-master = <&sound_master>; simple-audio-card,frame-master = <&sound_master>; simple-audio-card,widgets = "Line", "Channel1in", "Line", "Channel2in", "Line", "Channel3in", "Line", "Channel4in"; simple-audio-card,routing = "Channel1in", "Input1", "Channel2in", "Input2", "Channel3in", "Input3", "Channel4in", "Input4"; sound_master: simple-audio-card,cpu { sound-dai = <&sai3>; dai-tdm-slot-num = <4>; dai-tdm-slot-width = <24>; }; simple-audio-card,codec { sound-dai = <&ads1174>; /*system-clock-frequency = <12288000>;*/ /*clocks = <&codec_osc>;*/ }; Also I added the following to the sai3 configuration
&sai3 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>; ads1174: codec { compatible = "ti,ads1174"; }; }; Unfortunately I don't really know what I am doing here. I have written kernel drivers before but I am very new to DeviceTree and find it very difficult to aggregate all information that is needed. E.g. the documentation in Documentation/devicetree/bindings/sound/ti,ads117x.txt gives the following example:
ads1178 { compatible = "ti,ads1178"; }; That's how I came up with the above, though I don't know if adding it to &sai3 is the right place.
I have provided the ads117x driver on the system through a layer (expecting having to modify it for the ADS1274 later on) and added it to the KERNEL_MODULE_AUTOLOAD in the layer.conf file.
KERNEL_MODULE_AUTOLOAD += "ads117x" The Yocto build runs through cleanly and I can load the system image from SD card and the ads117x driver gets loaded. But the device will not show up in ALSA via aplay -l.
root@imx6ul-var-dart:~# aplay -l aplay: device_list:274: no soundcards found... After boot, dmesg shows:
[ 2.703831] ALSA device list: [ 2.709136] No soundcards found. ... [ 9.611115] ads117x: loading out-of-tree module taints kernel. I have no idea if it's just an issue of getting the drivers loaded in the correct order or if the DeviceTree configuration is missing some essential bits and pieces.