Other Parts Discussed in Thread: PCM5102A
Hi,
We are working on a board and we would like to interface an I2S microphone. We have made the following steps to set it up:
1. Added capture element to pcm5102a.c
.capture = {
+ .stream_name = "Capture",
+ .channels_min = 1,
+ .channels_max = 2,
+ .rates = SNDRV_PCM_RATE_8000_192000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S24_LE |
+ SNDRV_PCM_FMTBIT_S32_LE
+ },
2. Setup the device tree (only relevant parts):
mcasp0_pins_default: pinmux_mcasp0_pins_default {
pinctrl-single,pins = <
AM33XX_IOPAD(0x9a0, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (B12) mcasp0_aclkr.mcasp0_aclkr sck, bit clock mic*/
AM33XX_IOPAD(0x9a4, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (C13) mcasp0_fsr.mcasp0_fsr ws, frame sync mic*/
AM33XX_IOPAD(0x998, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (D12) mcasp0_axr0.mcasp0_axr0 sd, data mic*/
AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (A13) mcasp0_aclkx.mcasp0_aclkx clk, bit clock dac*/
AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (B13) mcasp0_fsx.mcasp0_fsx ws, frame sync dac*/
AM33XX_IOPAD(0x9a8, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (D13) mcasp0_axr1.mcasp0_axr1 data, data dac*/
>;
};
&mcasp0 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&mcasp0_pins_default>;
status = "okay";
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
num-serializer = <4>;
serial-dir = < 2 1 0 0 >;
rx-num-evt = <32>;
tx-num-evt = <32>;
};
pcm5102a: pcm5102a {
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
status = "okay";
};
sound0: sound@0 {
compatible = "simple-audio-card";
simple-audio-card,name = "PCM5102a";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&sound_master>;
simple-audio-card,frame-master = <&sound_master>;
sound_master: simple-audio-card,cpu {
sound-dai = <&mcasp0>;
system-clock-direction-out;
system-clock-frequency = <24576000>;
};
simple-audio-card,codec {
#sound-dai-cells = <0>;
sound-dai = <&pcm5102a>;
};
};
When we try to use arecord to record something, the volume level is 0 and we cannot see any clock on frame sync pin (mcasp0.fsr). However we see bit clock(mcasp0.aclkr). Strange thing is that the mcasp0.fsr pin goes high, when we start recording and goes low when we stop.
We have a dac connected to mcasp0.aclkx(bit clock), mcasp0.fsx(frame sync) and mcasp0.axr1 data. When we play something, we can see bit clock, frame sync and data on the corresponding pins on the dac.
Is there anything we missed in the setup?
Thanks,
Marton