Hello everyone,
I using am437x with linux 3.12.10.
For some reasons we need to use sgtl5000 on our products. but even I debugged one week on our product, the sgtl5000 still can not works OK.
I modified the device tree:
sound {
compatible = "ti,myd-c437x-audio";
ti,model = "AM437x-GP-EVM";
ti,audio-codec = <&sgtl5000>;
ti,mcasp-controller = <&mcasp1>;
ti,codec-clock-rate = <12000000>;
ti,audio-routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT",
"LINE1L", "Line In",
"LINE1R", "Line In";
};
// ..............
&i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
// .............
sgtl5000: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
clocks = <&func_12m_clk>;
clock-names = "fck";
VDDA-supply = <&evm_v3p3>;
VDDIO-supply = <&evm_v3p3>;
VDDD-supply = <&evm_v3p3>;
};
};
And added the machine code in davinci-evm.c:
static struct snd_soc_dai_link myd_dai_sgtl5000 = {
.name = "sgtl5000",
.stream_name = "SGTL5000",
.codec_dai_name = "sgtl5000",
.ops = &evm_ops,
.dai_fmt = (SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_DSP_B |
SND_SOC_DAIFMT_IB_NF),
};
static const struct of_device_id davinci_evm_dt_ids[] = {
// ....................
/* For myd-c437x */
{
.compatible = "ti,myd-c437x-audio",
.data = &myd_dai_sgtl5000,
},
{ /* sentinel */ }
};
Now, I could find the sound card:
root@am437x-evm ~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: AM437xGPEVM [AM437x-GP-EVM], device 0: SGTL5000 sgtl5000-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0
But I could not hear any sounds from headphone, and I could not capture any waveform on MCASP1_ACLKX,MCASP1_FSX,MCASP1_AXR0,MCASP1_AXR1.
The hardware design as the following:
I though the sound data was not be sent to the codec, because after several snd_pcm_writei calls in my application, the kernel function snd_pcm_playback_avail() that in pcm.h would return 0, it indicates the DMA is full.
Can anyone provide some suggestions? for example, how do I to debug the codec, or how do I to modify the codes for making the codec works fine?
Thanks!
Warm Regards,
Kinly


