a348d2d6e1d8f723912e1f3622d266ee7d9dee85
[openwrt/staging/lynxis.git] / target / linux / brcm2708 / patches-4.14 / 950-0219-Add-support-for-SuperAudioBoard-sound-card-2386.patch
1 From 98f993e9d2b66f3219ac9841ad836ef79a341908 Mon Sep 17 00:00:00 2001
2 From: RF William Hollender <whollender@gmail.com>
3 Date: Sun, 18 Feb 2018 14:41:43 -0600
4 Subject: [PATCH 219/454] Add support for SuperAudioBoard sound card (#2386)
5
6 SuperAudioBoard support using simple-audio-card driver.
7 ---
8 arch/arm/boot/dts/overlays/Makefile | 1 +
9 arch/arm/boot/dts/overlays/README | 6 ++
10 .../dts/overlays/superaudioboard-overlay.dts | 73 +++++++++++++++++++
11 arch/arm/configs/bcm2709_defconfig | 1 +
12 arch/arm/configs/bcmrpi_defconfig | 1 +
13 arch/arm64/configs/bcmrpi3_defconfig | 1 +
14 6 files changed, 83 insertions(+)
15 create mode 100755 arch/arm/boot/dts/overlays/superaudioboard-overlay.dts
16
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -118,6 +118,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
20 spi2-1cs.dtbo \
21 spi2-2cs.dtbo \
22 spi2-3cs.dtbo \
23 + superaudioboard.dtbo \
24 tinylcd35.dtbo \
25 uart0.dtbo \
26 uart1.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -1658,6 +1658,12 @@ Params: cs0_pin GPIO pin
30 is 'okay' or enabled).
31
32
33 +Name: superaudioboard
34 +Info: Configures the SuperAudioBoard sound card
35 +Load: dtoverlay=superaudioboard,<param>=<val>
36 +Params: gpiopin GPIO pin for codec reset
37 +
38 +
39 Name: tinylcd35
40 Info: 3.5" Color TFT Display by www.tinylcd.com
41 Options: Touch, RTC, keypad
42 --- /dev/null
43 +++ b/arch/arm/boot/dts/overlays/superaudioboard-overlay.dts
44 @@ -0,0 +1,73 @@
45 +// Definitions for SuperAudioBoard
46 +/dts-v1/;
47 +/plugin/;
48 +
49 +/ {
50 + compatible = "brcm,bcm2708";
51 +
52 + fragment@0 {
53 + target = <&sound>;
54 + __overlay__ {
55 + compatible = "simple-audio-card";
56 + i2s-controller = <&i2s>;
57 + status = "okay";
58 +
59 + simple-audio-card,name = "SuperAudioBoard";
60 +
61 + simple-audio-card,widgets =
62 + "Line", "Line In",
63 + "Line", "Line Out";
64 +
65 + simple-audio-card,routing =
66 + "Line Out","AOUTA+",
67 + "Line Out","AOUTA-",
68 + "Line Out","AOUTB+",
69 + "Line Out","AOUTB-",
70 + "AINA","Line In",
71 + "AINB","Line In";
72 +
73 + simple-audio-card,format = "i2s";
74 +
75 + simple-audio-card,bitclock-master = <&sound_master>;
76 + simple-audio-card,frame-master = <&sound_master>;
77 +
78 + simple-audio-card,cpu {
79 + sound-dai = <&i2s>;
80 + dai-tdm-slot-num = <2>;
81 + dai-tdm-slot-width = <32>;
82 + };
83 +
84 + sound_master: simple-audio-card,codec {
85 + sound-dai = <&cs4271>;
86 + system-clock-frequency = <24576000>;
87 + };
88 + };
89 + };
90 +
91 + fragment@1 {
92 + target = <&i2s>;
93 + __overlay__ {
94 + status = "okay";
95 + };
96 + };
97 +
98 + fragment@2 {
99 + target = <&i2c1>;
100 + __overlay__ {
101 + #address-cells = <1>;
102 + #size-cells = <0>;
103 + status = "okay";
104 +
105 + cs4271: cs4271@10 {
106 + #sound-dai-cells = <0>;
107 + compatible = "cirrus,cs4271";
108 + reg = <0x10>;
109 + status = "okay";
110 + reset-gpio = <&gpio 26 0>; /* Pin 26, active high */
111 + };
112 + };
113 + };
114 + __overrides__ {
115 + gpiopin = <&cs4271>,"reset-gpio:4";
116 + };
117 +};
118 --- a/arch/arm/configs/bcm2709_defconfig
119 +++ b/arch/arm/configs/bcm2709_defconfig
120 @@ -895,6 +895,7 @@ CONFIG_SND_PISOUND=m
121 CONFIG_SND_SOC_ADAU1701=m
122 CONFIG_SND_SOC_ADAU7002=m
123 CONFIG_SND_SOC_AK4554=m
124 +CONFIG_SND_SOC_CS4271_I2C=m
125 CONFIG_SND_SOC_SPDIF=m
126 CONFIG_SND_SOC_WM8804_I2C=m
127 CONFIG_SND_SIMPLE_CARD=m
128 --- a/arch/arm/configs/bcmrpi_defconfig
129 +++ b/arch/arm/configs/bcmrpi_defconfig
130 @@ -888,6 +888,7 @@ CONFIG_SND_PISOUND=m
131 CONFIG_SND_SOC_ADAU1701=m
132 CONFIG_SND_SOC_ADAU7002=m
133 CONFIG_SND_SOC_AK4554=m
134 +CONFIG_SND_SOC_CS4271_I2C=m
135 CONFIG_SND_SOC_SPDIF=m
136 CONFIG_SND_SOC_WM8804_I2C=m
137 CONFIG_SND_SIMPLE_CARD=m
138 --- a/arch/arm64/configs/bcmrpi3_defconfig
139 +++ b/arch/arm64/configs/bcmrpi3_defconfig
140 @@ -870,6 +870,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m
141 CONFIG_SND_PISOUND=m
142 CONFIG_SND_SOC_ADAU1701=m
143 CONFIG_SND_SOC_AK4554=m
144 +CONFIG_SND_SOC_CS4271_I2C=m
145 CONFIG_SND_SOC_WM8804_I2C=m
146 CONFIG_SND_SIMPLE_CARD=m
147 CONFIG_SOUND_PRIME=m