Dear All,
I'm facing a problem with the integration of a sgtl5000 codec on our custom AM335x hardware. We're using linux kernel 3.12.10.
Playing a wave file or speaker-test is possible and works as expected. What goes wrong is the recording of the line in signal. Calling "arecord -f cd test.wav" produces an empty file although I have set the controls for recording via alsamixer (capture volume = max, capture source=LINE_IN). Unfortunatelly no error messages were displayed.
Any help would be appreciated.
Here are our modifications to the *.dts-file:
// Pinmuxing mcasp0_pins: mcasp0_pins { pinctrl-single,pins = < 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ 0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr0.mcasp0_axr0 */ 0x1a8 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr1.mcasp0_axr1 */ >; }; codec_pins: codec_pins { pinctrl-single,pins = < 0x1b0 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ >; }; ... // Sound sound { compatible = "ti,sgtl5000"; ti,model = "SGTL5000"; ti,audio-codec = <&sgtl5000>; ti,mcasp-controller = <&mcasp0>; ti,codec-clock-rate = <24000000>; ti,audio-routing = "Headphone Jack", "HPLOUT", "Headphone Jack", "HPROUT", "LINE1L", "Line In", "LINE1R", "Line In"; }; ... // I2C sgtl5000: sgtl5000@0a { compatible = "fsl,sgtl5000"; reg = <0x0a>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&codec_pins>; clocks = <&clk_24mhz>; VDDA-supply = <&vaux33_reg>; VDDIO-supply = <&vaux33_reg>; VDDD-supply = <&vaux33_reg>; };
...
//MCASP &mcasp0 { pinctrl-names = "default"; pinctrl-0 = <&mcasp0_pins>; status = "okay"; op-mode = <0>; /* MCASP_IIS_MODE */ tdm-slots = <2>; /* 4 serializer */ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ 2 1 0 0 >; tx-num-evt = <1>; rx-num-evt = <1>; };
Furthermore we've changed the davinci-evm.c:
static struct snd_soc_dai_link evm_dai_sgtl5000 = { .name = "sgtl5000", .stream_name = "SGTL5000", .codec_dai_name = "sgtl5000", .ops = &evm_ops, .dai_fmt = (SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_IB_NF), }; ... static const struct of_device_id davinci_evm_dt_ids[] = { { .compatible = "ti,da830-evm-audio", .data = &evm_dai_tlv320aic3x, }, { .compatible = "ti,am33xx-beaglebone-black", .data = &evm_dai_tda998x_hdmi, }, { .compatible = "ti,dra7xx-evm-audio", .data = (void *) &dra7xx_evm_link, }, { .compatible = "ti,am43xx-epos-evm-audio", .data = &evm_dai_tlv320aic3111, }, { .compatible = "ti,sgtl5000", .data = &evm_dai_sgtl5000, }, { /* sentinel */ } };
Here is the output from dmesg:
# dmesg | grep -i sgtl
[ 1.815346] sgtl5000 0-000a: sgtl5000 revision 0x11
[ 1.912585] sgtl5000 0-000a: Using internal LDO instead of VDDD
[ 1.928645] davinci_evm sound.3: sgtl5000 <-> 48038000.mcasp mapping ok
This is how we connected the codec: