In our custom made board prototype, we are using the am3352 CPU and the TLV320DAC3120 connected as shown below:
CPU-PIN | used mode | Offset/GPIO# | Pin@TLV320DAC3120 | description |
A14 | 0x00 /* mcasp0_ahclkx, OUTPUT | MODE0 */ | 0x1AC | MCLK | master clock HF |
A13 | 0x00 /* mcasp0_aclkx, OUTPUT | MODE0 */ | 0x190 | BCLK | bit clock |
B13 | 0x00 /* mcasp0_fsx, OUTPUT | MODE0 */ | 0x194 | WCLK | Word clock |
C12 | 0x02 /* mcasp0_axr2, OUTPUT | MODE2 */ | 0x19c | DIN | |
V17 | GPIO out | GPIO59 | Output Enable 0 | external switch |
V16 | GPIO out | GPIO56 | RESET 0 | Audio Reset |
the relevant device tree parts look like this:
&mcasp0 { pinctrl-names = "default"; pinctrl-0 = <&mcasp0_pins>; status = "okay"; op-mode = <0>; /* MCASP_IIS_MODE */ tdm-slots = <2>; num-serializer = <4>; serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ 1 0 0 0 >; tx-num-evt = <1>; rx-num-evt = <1>; };
mcasp0_pins: mcasp0_pins { pinctrl-single,pins = < 0x1ac 0x00 0x194 0x00 0x190 0x00 0x19c 0x02 >; };
sound { compatible = "ti,da830-evm-audio"; ti,model = "DA830 EVM"; ti,audio-codec = <&tlv320aic3x>; ti,mcasp-controller = <&mcasp0>; ti,codec-clock-rate = <12000000>; ti,audio-routing = "Headphone Jack", "HPLOUT", "Headphone Jack", "HPROUT", "LINE1L", "Line In", "LINE1R", "Line In"; };
tlv320aic3x: tlv320aic3x@18 { compatible = "ti,tlv320aic3x"; reg = <0x18>; status = "okay"; };
havin the CPU-Pins connected like this, my only option seems to be to use mcasp0_axr2 on cpu pin c12 as data out and the clock signals to be all generated on the cpu and fed into the DAC (as described on page 4300 http://www.ti.com/lit/ug/spruh73j/spruh73j.pdf).
See also figure 2 in http://www.ti.com/lit/an/slaa469/slaa469.pdf
Could you point me into the right direction regarding the correct choice of drivers and codecs (currently working in linux stable kernel 3.15.4)?
/sound/soc/codecs/tlv320aic31xx.c looks like it has all the register settings correctly in place although it is meant for a slightly different IC.
aplay -v -v -L returns: default Playback/recording through the PulseAudio sound server sysdefault:CARD=EVM DA830 EVM, Default Audio Device
but mplayer hust hangs at this screen:
========================================================================== Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO: 44100 Hz, 1 ch, s16le, 705.6 kbit/100.00% (ratio: 88200->88200) Selected audio codec: [pcm] afm: pcm (Uncompressed PCM) ========================================================================== AO: [pulse] 44100Hz 1ch s16le (2 bytes per sample) Video: no video Starting playback... A: 0.0 (00.0) of 1.5 (01.5) ??,?% $<50>
Do i need to change something in order to get the correct wclk/bclk values or shoud the driver handle this?
I do not understand the
ti,codec-clock-rate = <12000000>; op-mode = <0>; /* MCASP_IIS_MODE */ tdm-slots = <2>; num-serializer = <4>; serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ 1 0 0 0 >; tx-num-evt = <1>; rx-num-evt = <1>;
parts of the device tree, which i tried to rewrite from the BeagleBoneBlack Audio cape device tree.