arm64: dts: meson: p241: add sound support
authorJerome Brunet <jbrunet@baylibre.com>
Tue, 30 Nov 2021 10:01:59 +0000 (11:01 +0100)
committerNeil Armstrong <narmstrong@baylibre.com>
Wed, 1 Dec 2021 09:27:13 +0000 (10:27 +0100)
Add the p241 sound card support. This board can play audio through HDMI
and the internal DAC.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20211130100159.214489-3-jbrunet@baylibre.com
arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts

index 9d0684a..ff906be 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 #include "meson-gxl-s805x.dtsi"
 
                ethernet0 = &ethmac;
        };
 
+       au2: analog-amplifier {
+               compatible = "simple-audio-amplifier";
+               sound-name-prefix = "AU2";
+               VCC-supply = <&vcc_5v>;
+               enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+       };
+
        chosen {
                stdout-path = "serial0:115200n8";
        };
                clocks = <&wifi32k>;
                clock-names = "ext_clock";
        };
+
+       sound {
+               compatible = "amlogic,gx-sound-card";
+               model = "GXL-P241";
+               audio-aux-devs = <&au2>;
+               audio-widgets = "Line", "Lineout";
+               audio-routing = "AU2 INL", "ACODEC LOLN",
+                               "AU2 INR", "ACODEC LORN",
+                               "Lineout", "AU2 OUTL",
+                               "Lineout", "AU2 OUTR";
+               assigned-clocks = <&clkc CLKID_MPLL0>,
+                                 <&clkc CLKID_MPLL1>,
+                                 <&clkc CLKID_MPLL2>;
+               assigned-clock-parents = <0>, <0>, <0>;
+               assigned-clock-rates = <294912000>,
+                                      <270950400>,
+                                      <393216000>;
+               status = "okay";
+
+               dai-link-0 {
+                       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>;
+                       };
+
+                       codec-1 {
+                               sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
+                       };
+               };
+
+               dai-link-2 {
+                       sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+                       codec-0 {
+                               sound-dai = <&hdmi_tx>;
+                       };
+               };
+
+               dai-link-3 {
+                       sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
+
+                       codec-0 {
+                               sound-dai = <&acodec>;
+                       };
+               };
+       };
+};
+
+&acodec {
+       AVDD-supply = <&vddio_ao18>;
+       status = "okay";
+};
+
+&aiu {
+       status = "okay";
 };
 
 &cec_AO {