]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: dts: renesas: sparrow-hawk: Add MSIOF Sound support
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 17 Apr 2025 23:23:36 +0000 (23:23 +0000)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 8 May 2025 18:23:32 +0000 (20:23 +0200)
Sparrow Hawk has Headset (CONN3) AUX_IN (CONN4) for Sound input/output
which is using MSIOF. Support it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/87plha2wzr.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/874ixxcg3w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts

index b109095a0d872a8a7b47711f6c91b550f8026813..6955eafd8d6ab44b00106a5fc24209acc17286b3 100644 (file)
@@ -4,6 +4,37 @@
  *
  * Copyright (C) 2025 Marek Vasut <marek.vasut+renesas@mailbox.org>
  */
+/*
+ * DA7212 Codec settings
+ *
+ * for Playback
+ *     > amixer set "Headphone" 40%
+ *     > amixer set "Headphone" on
+ *     > amixer set "Mixout Left DAC Left"  on
+ *     > amixer set "Mixout Right DAC Right" on
+ *     > aplay xxx.wav
+ *
+ * for Capture (Aux/Mic)
+ *
+ *             on/off (B)
+ *     CONN3 (HeadSet) ---+----> MSIOF1
+ *                        |
+ *     CONN4 AUX ---------+ on/off (A)
+ *
+ *     > amixer set "Mixin PGA" on
+ *     > amixer set "Mixin PGA" 50%
+ *     > amixer set "ADC" on
+ *     > amixer set "ADC" 80%
+ *     > amixer set "Aux" on                           ^
+ *     > amixer set "Aux" 80%                          | (A)
+ *     > amixer set "Mixin Left Aux Left" on           |
+ *     > amixer set "Mixin Right Aux Right" on         v
+ *     > amixer set "Mic 1" on                         ^
+ *     > amixer set "Mic 1" 80%                        | (B)
+ *     > amixer set "Mixin Left Mic 1" on              |
+ *     > amixer set "Mixin Right Mic 1" on             v
+ *     > arecord -f cd xxx.wav
+ */
 
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
                clock-frequency = <38400000>;
        };
 
+       /* Page 30 / Audio_Codec */
+       sound_card: sound {
+               compatible = "audio-graph-card2";
+               links = <&msiof1_snd>;
+       };
+
        /* Page 17 uSD-Slot */
        vcc_sdhi: regulator-vcc-sdhi {
                compatible = "regulator-gpio";
        };
 };
 
+&audio_clkin {
+       clock-frequency = <24576000>;
+};
+
 /* Page 22 / Ether_AVB0 */
 &avb0 {
        pinctrl-0 = <&avb0_pins>;
                        reg = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;
+
+                       /* Page 30 / Audio_Codec */
+                       codec@1a {
+                               compatible = "dlg,da7212";
+
+                               #sound-dai-cells = <0>;
+                               reg = <0x1a>;
+
+                               clocks = <&rcar_sound>;
+                               clock-names = "mclk";
+
+                               VDDA-supply   = <&reg_1p8v>;
+                               VDDMIC-supply = <&reg_3p3v>;
+                               VDDIO-supply  = <&reg_3p3v>;
+
+                               port {
+                                       da7212_endpoint: endpoint {
+                                               bitclock-master;
+                                               frame-master;
+                                               remote-endpoint = <&msiof1_snd_endpoint>;
+                                       };
+                               };
+                       };
                };
 
                i2c0_mux2: i2c@2 {
        status = "okay";
 };
 
+&msiof1 {
+       pinctrl-0 = <&msiof1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       /* ignore DT warning */
+       /delete-property/#address-cells;
+       /delete-property/#size-cells;
+
+       msiof1_snd: port {
+               msiof1_snd_endpoint: endpoint {
+                       remote-endpoint = <&da7212_endpoint>;
+               };
+       };
+};
+
 /* Page 26 / 2230 Key M M.2 */
 &pcie0_clkref {
        clock-frequency = <100000000>;
                function = "mmc";
                power-source = <1800>;
        };
+
+       /* Page 30 / Audio_Codec */
+       msiof1_pins: sound {
+               groups = "msiof1_clk", "msiof1_sync", "msiof1_txd", "msiof1_rxd";
+               function = "msiof1";
+       };
+
+       /* Page 30 / Audio_Codec */
+       sound_clk_pins: sound-clk {
+               groups = "audio_clkin", "audio_clkout";
+               function = "audio_clk";
+       };
+};
+
+/* Page 30 / Audio_Codec */
+&rcar_sound {
+       pinctrl-0 = <&sound_clk_pins>;
+       pinctrl-names = "default";
+
+       /* It is used for ADG output as DA7212_MCLK */
+
+       /* audio_clkout */
+       clock-frequency = <12288000>; /* 48 kHz groups */
+
+       status = "okay";
 };
 
 /* Page 31 / FAN */