Audio Codec and McASP2 Configuration

Hi

i am using a Beagleboard x15 with an AM5728. I want to connect several Microphones to the BBx15 via the Expansion Headers on the back of the board and McASP2.

McASP2 is not configured in the default linux kernel under /arch/arm/boot/dts/am57xx-beagle-x15-revc.dts, therefore I am trying to configure and built my own linux kernel.

I am using the am57xx Processor SDK and the Kernel coming with it. I want to get it up and running as fast as possible so I reduced the number of microphone to 1 with the option to later add more microphones.I tried following the instructions from this Guide and adapting the changes to the AM5728:

http://www.ti.com/lit/an/sprac97/sprac97.pdf

this is the audio codec file:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


<br>static struct snd_soc_dai_driver pcm5102a_dai = {<br>.name = "pcm5102a-hifi",<br>.playback = {<br>.channels_min = 2,<br>.channels_max = 2,<br>.rates = SNDRV_PCM_RATE_8000_192000,<br>.formats = SNDRV_PCM_FMTBIT_S16_LE |<br>SNDRV_PCM_FMTBIT_S24_LE|<br>SNDRV_PCM_FMTBIT_S32_LE<br>},<br>.capture = {<br>.stream_name = "Capture",<br>.channels_min = 1,<br>.channels_max = 2,<br>.rates = SNDRV_PCM_RATE_8000_192000,<br>.formats = SNDRV_PCM_FMTBIT_S16_LE |<br>SNDRV_PCM_FMTBIT_S24_LE |<br>SNDRV_PCM_FMTBIT_S32_LE<br>}<br>};<br>



I verified that pcm5102a is included in the Makefile, I added pcm5102a to Kconfig and selected it via Menuconfig and built the Kernel.

Device Tree Modifications:

I used sound2 instead of sound1 because sound1 is already used by the hdmi codec of the beagleboard


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


<br>pcm5102a:pcm5102a {<br>#sound-dai-cells = <0>;<br>compatible = "ti,pcm5102a";<br>status = "okay";<br>};<br><br>sound2: sound2 {<br>compatible = "simple-audio-card";<br>simple-audio-card,name = "PCM5102a";<br>simple-audio-card,format = "i2s";<br>simple-audio-card,bitclock-master = <&sound2_master>;<br>simple-audio-card,frame-master = <&sound2_master>;<br>simple-audio-card,bitclock-inversion;<br>simple-audio-card,cpu {<br>sound-dai = <&mcasp2>;<br>};<br>sound2_master: simple-audio-card,codec {<br>#sound-dai-cells = <0>;<br>sound-dai = <&pcm5102a>;<br>clocks = <&clkout2_clk>;<br>clock-names = "mclk";<br>};<br>};<br>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18


<br>&mcasp2 {<br>#sound-dai-cells = <0>;<br>pinctrl-names = "default";<br>pinctrl-0 = <&mcasp2_pins>;<br>/*<br>assigned-clocks = <&mcasp2_ahclkr_mux>;<br>assigned-clock-parents = <&sys_clkin2>;<br>*/<br>status = "okay";<br>op-mode = <0>; /* MCASP_IIS_MODE */<br>tdm-slots = <2>;<br>num-serializer = <4>;<br>serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */<br>2 0 0 0<br>>;<br>rx-num-evt = <32>;<br>tx-num-evt = <32>;<br>};<br>


1
2
3
4
5
6
7
8
9


<br>&dra7_pmx_core {<br>mcasp2_pins: mcasp2_pins{<br>pinctrl-single,pins = <<br>0x2fc (PIN_INPUT_PULLDOWN | MUX_MODE0)<br>0x300 (PIN_INPUT_PULLDOWN | MUX_MODE0)<br>0x304 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)<br>0x308 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)<br>>;<br>}<br>



mcasp2_pins is located under dra7_pmx core since am33xx_pinmux or am57xx_pinmux do not exist and previously (older kernel versions) pinmux config was located here. The pinmux config was done with the help of https://docs.google.com/spreadsheets/d/1mSqEpV_BAUHfeNApytxHcGhgTZwypy564GyOr66Nphs/edit#gid=0

The pinmux syntax used in the guide caused compilation errors (Syntax Errors), therefore I tried different kinds of syntaxes i found in various forum posts and documentation. This is the only one that did not cause Syntax errors.

The ALSA Configuration was copy pasted from the Guide.

→ Unfortunately McASP2 with PCM5102a does not appear in the kernel logs, something causes the linux kernel either not to load the linux driver or aborts loading it.

What could have caused the issue of not loading the linux driver?