I was looking into a bit similar problem. As stated above, the magic is the device tree (overlay). It is required to get the pin routing right, here the newer kernels and dts need to work together properly. For getting e.g. SPDIF output to work, I had to modify the device tree file to actually enable it (creating packages/linux/patches/default/linux-080-odroid-c2.patch):
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2-unpatched.dts 2023-11-05 01:19:49.197991036 +0100
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts 2023-11-05 01:29:18.041481346 +0100
@@ -174,6 +174,13 @@
};
};
+ spdif_dit: audio-codec-0 {
+ #sound-dai-cells = <0>;
+ compatible = "linux,spdif-dit";
+ status = "okay";
+ sound-name-prefix = "DIT";
+ };
+
sound {
compatible = "amlogic,gx-sound-card";
model = "ODROID-C2";
@@ -184,33 +191,46 @@
assigned-clock-rates = <294912000>,
<270950400>,
<393216000>;
-
dai-link-0 {
- sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
- };
+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+ };
- dai-link-1 {
- sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
- dai-format = "i2s";
- mclk-fs = <256>;
-
- codec-0 {
- sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
- };
- };
-
- dai-link-2 {
- sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
-
- codec-0 {
- sound-dai = <&hdmi_tx>;
- };
- };
+ dai-link-1 {
+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
+ };
+
+ dai-link-2 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+ dai-format = "i2s";
+ mclk-fs = <256>;
+
+ codec-0 {
+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+ };
+ };
+
+ dai-link-3 {
+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
+
+ codec-0 {
+ sound-dai = <&spdif_dit>;
+ };
+ };
+
+ dai-link-4 {
+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+ codec-0 {
+ sound-dai = <&hdmi_tx>;
+ };
+ };
};
};
&aiu {
status = "okay";
+ pinctrl-0 = <&spdif_out_ao_6_pins &i2s_am_clk_pins &i2s_out_ao_clk_pins &i2s_out_lr_clk_pins &i2s_out_ch01_ao_pins>;
+ pinctrl-names = "default";
};
&cec_AO {
@@ -278,8 +299,8 @@
&gpio_ao {
gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En",
"USB HUB nRESET", "USB OTG Power En",
- "J7 Header Pin2", "IR In", "J7 Header Pin4",
- "J7 Header Pin6", "J7 Header Pin5", "J7 Header Pin7",
+ "SPDIF_OUTPUT", "IR In", "I2S_MCLK",
+ "I2S_SCLK", "I2S_LRCLK", "I2S_DATA_OUTPUT",
"HDMI CEC", "SYS LED",
/* GPIO_TEST_N */
"";
Display More
That worked for me a couple of month ago, unfortunately I fried my C2 board and thus being unable to test it again. Hope this find someone helpful though ...