Skip to content

Commit ec4a954

Browse files
anarsoulwens
authored andcommitted
arm64: dts: allwinner: a64: add nodes necessary for analog sound support
Add nodes for i2s, digital and analog parts of audiocodec on A64. The routing paths listed are entries connecting the digital and analog side of the audio codec together. Due to how device tree works, these must be copied over to each board device tree, in addition to any board level routes. The oversampling rate is set to 128, so that when playing back 192 kHz audio samples, the MCLK runs at the same rate as the module clock, at 24.576 MHz. The user manual suggests using different oversampling rates for different sample rates, but that's not possible without a platform-specific machine driver. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> [wens@csie.org: Lowered oversampling rate to 128; expanded commit message] Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Tested-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent 1e33e0d commit ec4a954

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,30 @@
155155
method = "smc";
156156
};
157157

158+
sound: sound {
159+
compatible = "simple-audio-card";
160+
simple-audio-card,name = "sun50i-a64-audio";
161+
simple-audio-card,format = "i2s";
162+
simple-audio-card,frame-master = <&cpudai>;
163+
simple-audio-card,bitclock-master = <&cpudai>;
164+
simple-audio-card,mclk-fs = <128>;
165+
simple-audio-card,aux-devs = <&codec_analog>;
166+
simple-audio-card,routing =
167+
"Left DAC", "AIF1 Slot 0 Left",
168+
"Right DAC", "AIF1 Slot 0 Right",
169+
"AIF1 Slot 0 Left ADC", "Left ADC",
170+
"AIF1 Slot 0 Right ADC", "Right ADC";
171+
status = "disabled";
172+
173+
cpudai: simple-audio-card,cpu {
174+
sound-dai = <&dai>;
175+
};
176+
177+
link_codec: simple-audio-card,codec {
178+
sound-dai = <&codec>;
179+
};
180+
};
181+
158182
sound_spdif {
159183
compatible = "simple-audio-card";
160184
simple-audio-card,name = "On-board SPDIF";
@@ -665,6 +689,30 @@
665689
status = "disabled";
666690
};
667691

692+
dai: dai@1c22c00 {
693+
#sound-dai-cells = <0>;
694+
compatible = "allwinner,sun50i-a64-codec-i2s";
695+
reg = <0x01c22c00 0x200>;
696+
interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
697+
clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
698+
clock-names = "apb", "mod";
699+
resets = <&ccu RST_BUS_CODEC>;
700+
reset-names = "rst";
701+
dmas = <&dma 15>, <&dma 15>;
702+
dma-names = "rx", "tx";
703+
status = "disabled";
704+
};
705+
706+
codec: codec@1c22e00 {
707+
#sound-dai-cells = <0>;
708+
compatible = "allwinner,sun8i-a33-codec";
709+
reg = <0x01c22e00 0x600>;
710+
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
711+
clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
712+
clock-names = "bus", "mod";
713+
status = "disabled";
714+
};
715+
668716
uart0: serial@1c28000 {
669717
compatible = "snps,dw-apb-uart";
670718
reg = <0x01c28000 0x400>;
@@ -924,6 +972,12 @@
924972
#reset-cells = <1>;
925973
};
926974

975+
codec_analog: codec-analog@1f015c0 {
976+
compatible = "allwinner,sun50i-a64-codec-analog";
977+
reg = <0x01f015c0 0x4>;
978+
status = "disabled";
979+
};
980+
927981
r_i2c: i2c@1f02400 {
928982
compatible = "allwinner,sun50i-a64-i2c",
929983
"allwinner,sun6i-a31-i2c";

0 commit comments

Comments
 (0)