583b2c8b5dd912789d96d2a2c54b81ee10e61e64
[oweals/openwrt.git] /
1 From e2516e3a7d2244f74c3267be8bdc143448c278be Mon Sep 17 00:00:00 2001
2 From: Matt Flax <flatmax@flatmax.org>
3 Date: Tue, 28 Aug 2018 18:42:13 +1000
4 Subject: [PATCH] Add support for audioinjector.net ultra soundcard.
5  (#2664)
6
7 Uses the simple-audio-card ALSA machine driver. Sets up the machine
8 driver in the device tree overlay file. The overlays/Makefile is
9 altered to add the audioinjector-ultra.dtbo dtb overlay.
10
11 Adds CONFIG_SND_SOC_CS4265 to the defconfig files.
12
13 Signed-off-by: Matt Flax <flatmax@flatmax.org>
14 ---
15  arch/arm/boot/dts/overlays/Makefile           |  1 +
16  arch/arm/boot/dts/overlays/README             |  6 ++
17  .../overlays/audioinjector-ultra-overlay.dts  | 71 +++++++++++++++++++
18  5 files changed, 80 insertions(+)
19  create mode 100644 arch/arm/boot/dts/overlays/audioinjector-ultra-overlay.dts
20
21 --- a/arch/arm/boot/dts/overlays/Makefile
22 +++ b/arch/arm/boot/dts/overlays/Makefile
23 @@ -15,6 +15,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
24         applepi-dac.dtbo \
25         at86rf233.dtbo \
26         audioinjector-addons.dtbo \
27 +       audioinjector-ultra.dtbo \
28         audioinjector-wm8731-audio.dtbo \
29         audremap.dtbo \
30         balena-fin.dtbo \
31 --- a/arch/arm/boot/dts/overlays/README
32 +++ b/arch/arm/boot/dts/overlays/README
33 @@ -389,6 +389,12 @@ Params: non-stop-clocks         Keeps th
34                                  is paused or stopped (default off)
35  
36  
37 +Name:   audioinjector-ultra
38 +Info:   Configures the audioinjector.net ultra soundcard
39 +Load:   dtoverlay=audioinjector-ultra
40 +Params: <None>
41 +
42 +
43  Name:   audioinjector-wm8731-audio
44  Info:   Configures the audioinjector.net audio add on soundcard
45  Load:   dtoverlay=audioinjector-wm8731-audio
46 --- /dev/null
47 +++ b/arch/arm/boot/dts/overlays/audioinjector-ultra-overlay.dts
48 @@ -0,0 +1,71 @@
49 +// Definitions for audioinjector.net audio add on soundcard
50 +/dts-v1/;
51 +/plugin/;
52 +
53 +/ {
54 +       compatible = "brcm,bcm2708";
55 +
56 +       fragment@0 {
57 +               target = <&i2s>;
58 +               __overlay__ {
59 +                       status = "okay";
60 +               };
61 +       };
62 +
63 +       fragment@1 {
64 +               target = <&i2c1>;
65 +               __overlay__ {
66 +                       #address-cells = <1>;
67 +                       #size-cells = <0>;
68 +                       status = "okay";
69 +
70 +                       cs4265: cs4265@4e {
71 +                               #sound-dai-cells = <0>;
72 +                               compatible = "cirrus,cs4265";
73 +                               reg = <0x4e>;
74 +                               reset-gpios = <&gpio 5 0>;
75 +                               status = "okay";
76 +                       };
77 +               };
78 +       };
79 +
80 +       fragment@2 {
81 +               target = <&sound>;
82 +               __overlay__ {
83 +                       compatible = "simple-audio-card";
84 +                       i2s-controller = <&i2s>;
85 +                       status = "okay";
86 +
87 +                       simple-audio-card,name = "audioinjector-ultra";
88 +
89 +                       simple-audio-card,widgets =
90 +                               "Line", "OUTPUTS",
91 +                               "Line", "INPUTS";
92 +
93 +                       simple-audio-card,routing =
94 +                               "OUTPUTS","LINEOUTL",
95 +                               "OUTPUTS","LINEOUTR",
96 +                               "OUTPUTS","SPDIFOUT",
97 +                               "LINEINL","INPUTS",
98 +                               "LINEINR","INPUTS",
99 +                               "MICL","INPUTS",
100 +                               "MICR","INPUTS";
101 +
102 +                       simple-audio-card,format = "i2s";
103 +
104 +                       simple-audio-card,bitclock-master = <&sound_master>;
105 +                       simple-audio-card,frame-master = <&sound_master>;
106 +
107 +                       simple-audio-card,cpu {
108 +                               sound-dai = <&i2s>;
109 +                               dai-tdm-slot-num = <2>;
110 +                               dai-tdm-slot-width = <32>;
111 +                       };
112 +
113 +                       sound_master: simple-audio-card,codec {
114 +                               sound-dai = <&cs4265>;
115 +                               system-clock-frequency = <12288000>;
116 +                       };
117 +               };
118 +       };
119 +};