Hi. I’m trying to use an ADC driver that was developed for the sound subsystem. The ADC I have is a ti ads127x, which is very similar to the ads117x driver (available on mainline), but the ads117x is a 16 bit adc, while the ads127x is a 24 bit adc.
I’m using the following dts, which follows the simple-card bindings documentation
&pinctrl_sai5 {
fsl,pins = <
MX8MM_IOMUXC_SAI5_RXD0_SAI5_RX_DATA0 0x6 /* SODIMM 48 */
MX8MM_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0x6 /* SODIMM 44 */
MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0x6 /* SODIMM 42 */
MX8MM_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0x6 /* SODIMM 46 */
>;
};
&sai5 {
#sound-dai-cells = <0>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
assigned-clocks = <&clk IMX8MM_CLK_SAI5>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai5>;
status = "okay";
};
/ {
adc: adc {
compatible = "simple-audio-card";
simple-audio-card,name = "ti-ads1278";
bitclock-master = <&ads1278_codec>;
frame-master = <&ads1278_codec>;
simple-audio-card,routing =
"Input1", "Capture",
"Input2", "Capture",
"Input3", "Capture",
"Input4", "Capture",
"Input5", "Capture",
"Input6", "Capture",
"Input7", "Capture",
"Input8", "Capture";
simple-audio-card,dai-link {
format = "left_j";
bitclock-master = <&ads1278_codec>;
frame-master = <&ads1278_codec>;
cpu {
sound-dai = <&sai5>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <24>;
};
ads1278_codec: codec {
sound-dai = <&ads1278 0>;
clocks = <&clk IMX8MM_CLK_SAI5_ROOT>;
};
};
};
ads1278: codec-ads1278@0 {
compatible = "ti,ads1278";
#sound-dai-cells = <0>;
status = "okay";
};
};
&wm8904_1a {
status = "disabled";
}
I’ve connected a logic analyzer to the I2S_1_BCLK, I2S_1_MCLK, I2S_2_BCLK, I2S_2_SYNC pins on header X2/X3 (and disconnected them from X4). With the logic analyzer connected, and after running arecord
, I’d expected to see the bit clock signal on I2S_2_BCLK, but it doesn’t change a bit. None of the I2S_2 signals change.
This is the output of several commands:
root@verdin-imx8mm-06894967:~# ./stest
### Devices (/proc/asound/devices)
2: [ 0- 0]: digital audio capture
3: [ 0] : control
33: : timer
### Cards (/proc/asound/cards)
0 [tiads1278 ]: ti-ads1278 - ti-ads1278
ti-ads1278
### Modules
snd_soc_ads127x 20480 1
### dmesg
[ 4.796126] ads127x-codec codec-ads1278@0: > ti,ads127x_probe
[ 4.797902] debugfs: Directory '30050000.sai' with parent 'ti-ads1278' already present!
[ 4.798415] asoc-simple-card adc: ads127x-hifi <-> 30050000.sai mapping ok
### test
arecord -D hw:0,0 -V mono -c 1 -f S24_LE -r 48000 -t wav line.wav
Recording WAVE 'line.wav' : Signed 24 bit Little Endian, Rate 48000 Hz, Mono
It can be seen that the “card” is detected, the codec is enabled, that the adc is recognized and connected to sai5 (30050000.sai
).
If I change the “card”'s codec to use the SAI2_ROOT clock (instead of SAI5_ROOT) and the cpu to use sai2 (instead of sai5), the card gets connected to sai2 (30020000.sai
), and I get a 25 MHz signal on I2S_1_MCLK, but nothing else.
The DTS I’m using is device-trees/dts-arm64/imx8mm-verdin-nonwifi-dev.dts
, which includes:
imx8mm-verdin.dtsi
imx8mm-verdin-nonwifi.dtsi
imx8mm-verdin-dev.dtsi
And the DTS I’ve copied above is a modified version of imx8mm-verdin-dev.dtsi
(the last on of the list).
Can someone see what I’m doing wrong or what I’m missing?
Thanks!