I am trying to use I2S0 on the Hikey 960. From the hikey schematics, I see I2S0 being connected to the low speed header.
I want to use I2S0 to interface with the following MIC and Speaker:
MIC: https://www.tindie.com/products/onehorse/ics43434-i2s-digital-microphone/
Speaker: Overview | Adafruit MAX98357 I2S Class-D Mono Amp | Adafruit Learning System
The dts for hikey 960 (hi3660.dtsi) does not have any entry for i2s0. The essential part is as follows:
I know to make the I2S0 work, I will have to add a device node for I2S0. My question is related to the sound device node. Right now the sound device node is assuming one dai link. If I understand it correctly, each I2S is a dai link. The dai link also has to mention the cpu and the codec. In the setup I want, I will have two external codecs, one for MIC and one for speaker. My question is that will I have to create two dai links for the MIC and speaker codecs (something like shows below), or they somehow need to be put together in one dai link ?
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "<I will fill this>";
simple-audio-card,dai-link@0 { /* I2S2 */
format = "i2s";
bitclock-master = <&sound_i2s2>;
frame-master = <&sound_i2s2>
sound_i2s2: cpu {
sound-dai = <&i2s2>;
};
codec {
sound-dai = <&adv7533>;
};
};
simple-audio-card,dai-link@1 { /* I2S0 + MIC */
format = "i2s";
bitclock-master = <&sound_i2s0_1>;
frame-master = <&sound_i2s0_1>;
cpu {
sound-dai = <&i2s0>;
};
sound_i2s0_1: codec {
sound-dai = <&max98357a>;
};
};
simple-audio-card,dai-link@2 { /* I2S0 + Speaker */
format = "i2s";
bitclock-master = <&sound_i2s0_2>;
frame-master = <&sound_i2s0_2>;
cpu {
sound-dai = <&i2s0>;
};
sound_i2s0_2: codec {
sound-dai = <&ics43432>;
};
};
};
Thank you.