Dear Bruno,
thank you for the information, I was able to build the Yocto image with codec driver. However, I have a following questions.
After boot, the system does not see my driver. Commands “aplay -l” or “arecord -l” output: “no soundcards”. The codec is placed and connected to the Mallow board. Modprobe snd-soc-ak4621 succesfully loaded the driver.
It is possible that I made a mistake in device tree configuration as I do not understand it completely. I used parts of Toradex development board configuration with nau8822 codec and ak4642 bindings information.
My device tree patch to k3-am625-verdin-nonwifi-mallow.dts looks like this:
diff --git a/arch/arm64/boot/dts/ti/k3-am625-verdin-nonwifi-mallow.dts b/arch/arm64/boot/dts/ti/k3-am625-verdin-nonwifi-mallow.dts
index 9cae12106e0e6..6ed7d53ef4251 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-verdin-nonwifi-mallow.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-verdin-nonwifi-mallow.dts
@@ -14,9 +14,56 @@
#include "k3-am62-verdin-mallow.dtsi"
/ {
- model = "Toradex Verdin AM62 on Mallow Board";
+ model = "Toradex Verdin AM62 XXX on Mallow Board";
compatible = "toradex,verdin-am62-nonwifi-mallow",
"toradex,verdin-am62-nonwifi",
"toradex,verdin-am62",
"ti,am625";
+
+ sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,bitclock-master = <&codec_dai>;
+ simple-audio-card,format = "i2s";
+ simple-audio-card,frame-master = <&codec_dai>;
+ simple-audio-card,name = "ak4621";
+ simple-audio-card,routing =
+ "Headphones", "LOUT1",
+ "Headphones", "ROUT1",
+ "Speaker", "LOUT2",
+ "Speaker", "ROUT2",
+ "LIN1", "Mic In",
+ "RIN1", "Mic In";
+ simple-audio-card,widgets =
+ "Headphones", "Headphones",
+ "Speaker", "Speaker",
+ "Microphone", "Mic In",
+
+ codec_dai: simple-audio-card,codec {
+ clocks = <&audio_refclk1>;
+ sound-dai = <&ak4621>;
+ };
+
+ simple-audio-card,cpu {
+ sound-dai = <&mcasp0>;
+ };
+ };
};
+
+&main_i2c1 {
+ status = "okay";
+
+ /* Audio Codec */
+ ak4621: codec@12 {
+ compatible = "asahi-kasei,ak4621";
+ reg = <0x12>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2s1_mclk>;
+ #sound-dai-cells = <0>;
+ };
+};
+
+&mcasp0 {
+ status = "okay";
+};
The “compatible” should correspond to the custom ak4621 codec driver name, as well as routing and widgets. However, I do not know if “reg = <0x12>;” is correct or not (how should I obtain this value?). In the case of nau8822, reg=<0x1a>. Pinctrl and other settings were copied from development board device tree, see k3-am62-verdin.dtsi, is this a correct setting?
I also changed the /etc/asound.conf file to default settings:
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
But I suppose this is useless as long as the system sees no soundcards. Dmesg does not print anything about ak4621. So my questions are:
- Does the device tree configuration seem correct for Mallow board, AM62 with custom AK4621 codec?
- How to setup reg value in device tree codec setting?
- Should I also change something else for the codec to be visible?
Thank you.
Best regards
Matej I.