ODROID-C4:Support line-out audio (J4)
authorckkim <changkon12@gmail.com>
Thu, 20 Aug 2020 05:30:42 +0000 (14:30 +0900)
committerckkim <changkon12@gmail.com>
Thu, 20 Aug 2020 05:32:56 +0000 (14:32 +0900)
Signed-off-by: ckkim <changkon12@gmail.com>
Change-Id: I055737bbc41b11974ca4032c52e7cc335103d509

MAINTAINERS
arch/arm64/boot/dts/amlogic/meson64_odroidc4.dts
arch/arm64/boot/dts/amlogic/overlays/odroidc4/Makefile
arch/arm64/boot/dts/amlogic/overlays/odroidc4/lineout.dts [new file with mode: 0644]

index d724c84..8e40092 100644 (file)
@@ -15225,3 +15225,7 @@ HARDKERNEL S922D odroidn2
 M:     Kevin Kim <ckkim@hardkernel.com>
 F:      arch/arm64/boot/dts/amlogic/meson64_odroidn2_plus.dts
 F:      arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtsi
+
+HARDKERNEL odroidc4 DTS
+M:      Kevin Kim <ckkim@hardkernel.com>
+F:      arch/arm64/boot/dts/amlogic/overlays/odroidc4/lineout.dts
index ae635e6..4190615 100644 (file)
                reg = <0x0 0xFF632000 0x0 0x2000>;
                is_auge_used = <1>; /* meson or auge chipset used */
                tocodec_inout = <1>;
-               tdmout_index = <0>;
-               status = "okay";
+               tdmout_index = <2>;
+               ch0_sel = <0>;
+               ch1_sel = <1>;
+               status = "disabled";
        };
        audio_effect:eqdrc{
                /*eq_enable = <1>;*/
                        };
                };
        };
+
        audiolocker: locker {
                compatible = "amlogic, audiolocker";
                clocks = <&clkaudio CLKID_AUDIO_LOCKER_OUT
                status = "disabled";
        };
 
+       tdmc: tdm@2 {
+               compatible = "amlogic, sm1-snd-tdmc";
+               #sound-dai-cells = <0>;
+               dai-tdm-lane-slot-mask-in = <0 1 0 0>;
+               dai-tdm-lane-slot-mask-out = <1 0 0 0>;
+               dai-tdm-clk-sel = <2>;
+               clocks = <&clkaudio CLKID_AUDIO_MCLK_C
+                               &clkc CLKID_MPLL2>;
+               clock-names = "mclk", "clk_srcpll";
+               i2s2hdmi = <0>;
+               status = "disabled";
+       };
+
        spdifa: spdif@0 {
                compatible = "amlogic, sm1-snd-spdif-a";
                #sound-dai-cells = <0>;
index 2ec52e5..40c01e8 100644 (file)
@@ -14,7 +14,8 @@ dtbo-$(CONFIG_ARCH_MESON64_ODROIDC4) += spi0.dtbo             \
                                        onewire.dtbo            \
                                        can0.dtbo               \
                                        hifishield.dtbo         \
-                                       hifishield2.dtbo
+                                       hifishield2.dtbo        \
+                                       lineout.dtbo
 
 targets        += $(dtbo-y)
 always := $(dtbo-y)
diff --git a/arch/arm64/boot/dts/amlogic/overlays/odroidc4/lineout.dts b/arch/arm64/boot/dts/amlogic/overlays/odroidc4/lineout.dts
new file mode 100644 (file)
index 0000000..a529c84
--- /dev/null
@@ -0,0 +1,50 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+       fragment@0 {
+               target = <&amlogic_codec>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@1 {
+               target = <&tdmc>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@2 {
+               target-path = "/";
+               __overlay__ {
+                       odroid_lineout: odroid_lineout {
+                               compatible = "amlogic, g12a-sound-card";
+                               aml-audio-card,name = "ODROID-LINEOUT";
+                               status = "okay";
+
+                               /* ODROID-C4: Line-out(J4)*/
+                               aml-audio-card,dai-link@0 {
+                                       format = "i2s";
+                                       mclk-fs = <256>;
+                                       continuous-clock;
+                                       bitclock-master = <&tdmc>;
+                                       frame-master = <&tdmc>;
+                                       cpu {
+                                               sound-dai = <&tdmc>;
+                                               dai-tdm-slot-tx-mask = <1 1>;
+                                               dai-tdm-slot-rx-mask = <1 1>;
+                                               dai-tdm-slot-num = <2>;
+                                               dai-tdm-slot-width = <32>;
+                                               system-clock-frequency =
+                                                               <12288000>;
+                                       };
+                                       codec {
+                                               sound-dai = <&amlogic_codec>;
+                                       };
+                               };
+                       };
+               };
+       };
+};