0

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.

4
  • "Load a module" simply means that the module is transferred to memory. But not every (loadable) module is necessarily a (device) driver. So the syslog indicates that the module is in memory/"loaded", but the driver code (i.e. the probe() or init() routine) is not executed. See stackoverflow.com/questions/26840267/… Did you check the board schematics as to how this codec is connected, i.e. is it really sai3? Is the sai3 node enabled in your DT? Commented Oct 4, 2023 at 7:01
  • Thank you for the hint. I added the status = "okay"; line for the sai3 interface which was necessary, obviously, as I got hints to pinning conflicts afterwards. After I got those resolved (by disabling the lcdif) the board now boots without errors in syslog. Still I don't get the ads1174 ALSA device. :/ Commented Oct 4, 2023 at 16:05
  • See stackoverflow.com/questions/37272109/… Check the syslog for the ads1174 driver as well as all of its parent device drivers. Commented Oct 4, 2023 at 23:24
  • @sawdust Thanks again for your valuable input. After adding clocking information and using arecord -l to list the device; I am able to see and access the device. aplay didn't show anything as the device doesn't have any capture channels. I will provide an answer to the post after I have confirmed to receive valid data. Commented Oct 9, 2023 at 14:37

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.