Other Parts Discussed in Thread: AM5728, DRA722, TSC2007
Hi,
We have developed a custom board with AM5708 processor using ti-processor-sdk-linux-am57xx-evm-05.03.00.07.
We are having McASP5 interface in the board and for MCLK we have connected to H5 ball of AM5708 processor.
Could you help us to make the sound work?
Pinmux in uboot we set
{GPMC_ADVN_ALE, (M2 | PIN_OUTPUT)}, /* gpmc_advn_ale.clkout2 *//* audio_master_clk */
{XREF_CLK0, (M4 | PIN_OUTPUT)}, /* xref_clk0.mcasp5_ahclkx */
{MCASP5_ACLKX, (M0 | PIN_OUTPUT)}, /* mcasp5_aclkx.mcasp5_aclkx */
{MCASP5_FSX, (M0 | PIN_OUTPUT)}, /* mcasp5_fsx.mcasp5_fsx */
{MCASP5_AXR0, (M0 | PIN_OUTPUT)}, /* mcasp5_axr0.mcasp5_axr0 */
am571x-idk.dts we add
sound0: sound@0 {
compatible = "simple-audio-card";
simple-audio-card,name = "DRA7xx-EVM";
simple-audio-card,widgets =
"Headphone", "Headphone Jack",
"Line", "Line Out",
"Microphone", "Mic Jack",
"Line", "Line In";
simple-audio-card,routing =
"Headphone Jack", "DAC to AOUT";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&sound0_master>;
simple-audio-card,frame-master = <&sound0_master>;
simple-audio-card,bitclock-inversion;
sound0_master: simple-audio-card,cpu {
sound-dai = <&mcasp5>;
system-clock-frequency = <24576000>;
};
simple-audio-card,codec {
sound-dai = <&audio>;
clocks = <&clkout2_clk>;
};
};
&i2c2 {
status = "okay";
clock-frequency = <400000>;
audio: audio-codec@19 {
#sound-dai-cells = <0>;
compatible = "akm,ak4432";
reg = <0x19>;
};
};
&mcasp5 {
#sound-dai-cells = <0>;
assigned-clocks = <&mcasp5_ahclkx_mux>;
assigned-clock-parents = <&sys_clkin2>;
status = "okay";
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
/* 4 serializers */
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
1 0 0 0
>;
tx-num-evt = <32>;
rx-num-evt = <32>;
};
The kernle log is
[ 3.614856] [AK4432] ak4432_probe(668)
[ 3.618711] Read PDN pin from device tree
[ 3.646825] ak4432 pdn pin(4294967294) is invalid(642)
[ 3.652035] ak4432 mute pin(4294967294) is invalid(652)
[ 3.657282] [AK4432] ak4432_set_bias_level(494)
[ 3.662065] [AK4432] ak4432_init_reg(604)
[ 3.666385] [AK4432] ak4432_write_register (01, 01)
[ 3.671525] [AK4432] ak4432_init_reg ACKS bit = 1
[ 3.676337] [AK4432] ak4432_init_reg(611)
[ 3.680450] [AK4432] ak4432_probe(691) return 0
[ 3.685182] [AK4432] ak4432_set_dai_sysclk(329)
[ 3.690096] [AK4432] ak4432_set_dai_fmt(344) addr 02H = 06
[ 3.695711] [AK4432] ak4432_set_dai_fmt(371) addr 02H = 07
[ 3.701517] [AK4432] ak4432_write_register (02, 07)
[ 3.706682] ===>>> SND_SOC_DAIFMT_I2S
[ 3.710361] ===>>> SND_SOC_DAIFMT_CBS_CFS
[ 3.714402] ===>>> SND_SOC_DAIFMT_IB_NF
[ 3.718545] asoc-simple-card sound@0: ak4432-aif <-> 48470000.mcasp mapping ok
[ 3.725828] asoc-simple-card sound@0: ASoC: no DMI vendor name!
[ 3.732323] [AK4432] ak4432_write_register (00, 00)
[ 3.748367] ALSA device list:
[ 3.751393] #0: DRA7xx-EVM
In userspace with aplay -Dplughw:0,0 alarm.mp3
# aplay -Dplughw:0,0 alarm.mp3
Playing raw data 'alarm.mp3' : [ 7.763355] [AK4432] ak4432_hw_params(268)
Unsigned 8 bit, Rate 8000 Hz, Mono
[ 7.768479] [AK4432] ak4432_write_register (02, 03)
[ 7.776696] ===>>> SND_SOC_DAIFMT_I2S
[ 7.780398] ===>>> SND_SOC_DAIFMT_CBS_CFS
[ 7.784479] ===>>> SND_SOC_DAIFMT_IB_NF
[ 7.788359] davinci-mcasp 48470000.mcasp: Too fast reference clock (24576000)
[ 7.795954] [AK4432] ak4432_set_dai_mute mute[OFF] nfs[8000]
[ 7.801742] [AK4432] ak4432_set_dai_mute External Mute = OFF
[ 7.934723] [AK4432] ak4432_set_dai_mute(550) mdelay(127 ms)
[ 7.940494] [AK4432] ak4432_set_dai_mute(552) ret[0]
[ 7.945758] [AK4432] ak4432_trigger(482)
[ 11.961221] [AK4432] ak4432_trigger(482)
[ 11.965583] [AK4432] ak4432_set_dai_mute mute[ON] nfs[8000]
[ 11.971501] [AK4432] ak4432_write_register (03, 03)
[ 12.103644] [AK4432] ak4432_set_dai_mute(541) mdelay(127 ms)
[ 12.109416] [AK4432] ak4432_set_dai_mute External Mute = ON
[ 12.115111] [AK4432] ak4432_set_dai_mute(552) ret[1]
#
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: DRA7xxEVM [DRA7xx-EVM], device 0: davinci-mcasp.0-ak4432-aif ak4432-aif-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
#
But still no sound with these settings.