ARM: dts: sun8i: Add audio codec, dai and card for A33
authorMylène Josserand <mylene.josserand@free-electrons.com>
Thu, 2 Feb 2017 09:24:20 +0000 (10:24 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 6 Feb 2017 07:45:31 +0000 (08:45 +0100)
Add the audio codec, dai and a simple card to be able to use the
audio stream of the builtin codec on sun8i SoC.

This commit adds also an audio-routing for the sound card node to link
the analog DAPM widgets (Right/Left DAC) and the digital one's as they
are created in different drivers.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
arch/arm/boot/dts/sun8i-a33.dtsi

index 5a9ba43ccb077ac5da523588e69ab829622d12e6..18c174fef84f512c18145e795276af099d8de07b 100644 (file)
                reg = <0x40000000 0x80000000>;
        };
 
+       sound: sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "sun8i-a33-audio";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,frame-master = <&link_codec>;
+               simple-audio-card,bitclock-master = <&link_codec>;
+               simple-audio-card,mclk-fs = <512>;
+               simple-audio-card,aux-devs = <&codec_analog>;
+               simple-audio-card,routing =
+                       "Left DAC", "Digital Left DAC",
+                       "Right DAC", "Digital Right DAC";
+               status = "disabled";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&dai>;
+               };
+
+               link_codec: simple-audio-card,codec {
+                       sound-dai = <&codec>;
+               };
+       };
+
        soc@01c00000 {
                tcon0: lcd-controller@01c0c000 {
                        compatible = "allwinner,sun8i-a33-tcon";
                        reset-names = "ahb";
                };
 
+               dai: dai@01c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun6i-a31-i2s";
+                       reg = <0x01c22c00 0x200>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+                       clock-names = "apb", "mod";
+                       resets = <&ccu RST_BUS_CODEC>;
+                       dmas = <&dma 15>, <&dma 15>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               codec: codec@01c22e00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-a33-codec";
+                       reg = <0x01c22e00 0x400>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+                       clock-names = "bus", "mod";
+                       status = "disabled";
+               };
+
                fe0: display-frontend@01e00000 {
                        compatible = "allwinner,sun8i-a33-display-frontend";
                        reg = <0x01e00000 0x20000>;