kernel: bump 4.14 to 4.14.99
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0236-Removing-broken-RaspiDac3-support.patch
1 From 50e9c65f5062bba726f94374127ea89f78102aa3 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 28 Feb 2018 22:28:14 +0000
4 Subject: [PATCH 236/454] Removing (broken) RaspiDac3 support...
5
6 ...at the request of the author.
7
8 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
9 ---
10 arch/arm/boot/dts/overlays/Makefile | 1 -
11 arch/arm/boot/dts/overlays/README | 6 -
12 .../boot/dts/overlays/raspidac3-overlay.dts | 49 -----
13 arch/arm/configs/bcm2709_defconfig | 1 -
14 arch/arm/configs/bcmrpi_defconfig | 1 -
15 arch/arm64/configs/bcmrpi3_defconfig | 1 -
16 sound/soc/bcm/Kconfig | 8 -
17 sound/soc/bcm/Makefile | 2 -
18 sound/soc/bcm/raspidac3.c | 172 ------------------
19 9 files changed, 241 deletions(-)
20 delete mode 100644 arch/arm/boot/dts/overlays/raspidac3-overlay.dts
21 delete mode 100644 sound/soc/bcm/raspidac3.c
22
23 --- a/arch/arm/boot/dts/overlays/Makefile
24 +++ b/arch/arm/boot/dts/overlays/Makefile
25 @@ -89,7 +89,6 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
26 pwm-2chan.dtbo \
27 pwm-ir-tx.dtbo \
28 qca7000.dtbo \
29 - raspidac3.dtbo \
30 rotary-encoder.dtbo \
31 rpi-backlight.dtbo \
32 rpi-cirrus-wm5102.dtbo \
33 --- a/arch/arm/boot/dts/overlays/README
34 +++ b/arch/arm/boot/dts/overlays/README
35 @@ -1350,12 +1350,6 @@ Params: int_pin GPIO pin
36 speed SPI bus speed (default 12 MHz)
37
38
39 -Name: raspidac3
40 -Info: Configures the RaspiDAV Rev.3x audio card
41 -Load: dtoverlay=raspidac3
42 -Params: <None>
43 -
44 -
45 Name: rotary-encoder
46 Info: Overlay for GPIO connected rotary encoder.
47 Load: dtoverlay=rotary-encoder,<param>=<val>
48 --- a/arch/arm/boot/dts/overlays/raspidac3-overlay.dts
49 +++ /dev/null
50 @@ -1,49 +0,0 @@
51 -// Definitions for RaspiDACv3
52 -/dts-v1/;
53 -/plugin/;
54 -
55 -/ {
56 - compatible = "brcm,bcm2708";
57 -
58 - fragment@0 {
59 - target = <&i2s>;
60 - __overlay__ {
61 - status = "okay";
62 - };
63 - };
64 -
65 - fragment@1 {
66 - target = <&i2c1>;
67 - __overlay__ {
68 - #address-cells = <1>;
69 - #size-cells = <0>;
70 - status = "okay";
71 -
72 - pcm5122@4c {
73 - #sound-dai-cells = <0>;
74 - compatible = "ti,pcm5122";
75 - reg = <0x4c>;
76 - AVDD-supply = <&vdd_3v3_reg>;
77 - DVDD-supply = <&vdd_3v3_reg>;
78 - CPVDD-supply = <&vdd_3v3_reg>;
79 - status = "okay";
80 - };
81 -
82 - tpa6130a2: tpa6130a2@60 {
83 - compatible = "ti,tpa6130a2";
84 - reg = <0x60>;
85 - Vdd-supply = <&vdd_3v3_reg>;
86 - status = "okay";
87 - };
88 - };
89 - };
90 -
91 - fragment@2 {
92 - target = <&sound>;
93 - __overlay__ {
94 - compatible = "jg,raspidacv3";
95 - i2s-controller = <&i2s>;
96 - status = "okay";
97 - };
98 - };
99 -};
100 --- a/arch/arm/configs/bcm2709_defconfig
101 +++ b/arch/arm/configs/bcm2709_defconfig
102 @@ -879,7 +879,6 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
103 CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
104 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
105 CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
106 -CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
107 CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
108 CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
109 CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m
110 --- a/arch/arm/configs/bcmrpi_defconfig
111 +++ b/arch/arm/configs/bcmrpi_defconfig
112 @@ -872,7 +872,6 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
113 CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
114 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
115 CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
116 -CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
117 CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
118 CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
119 CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m
120 --- a/arch/arm64/configs/bcmrpi3_defconfig
121 +++ b/arch/arm64/configs/bcmrpi3_defconfig
122 @@ -861,7 +861,6 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
123 CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
124 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
125 CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
126 -CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
127 CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
128 CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
129 CONFIG_SND_DIGIDAC1_SOUNDCARD=m
130 --- a/sound/soc/bcm/Kconfig
131 +++ b/sound/soc/bcm/Kconfig
132 @@ -104,14 +104,6 @@ config SND_BCM2708_SOC_IQAUDIO_DIGI
133 help
134 Say Y or M if you want to add support for IQAudIO Digital IO board.
135
136 -config SND_BCM2708_SOC_RASPIDAC3
137 - tristate "Support for RaspiDAC Rev.3x"
138 - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
139 - select SND_SOC_PCM512x_I2C
140 - select SND_SOC_TPA6130A2
141 - help
142 - Say Y or M if you want to add support for RaspiDAC Rev.3x.
143 -
144 config SND_BCM2708_SOC_ADAU1977_ADC
145 tristate "Support for ADAU1977 ADC"
146 depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
147 --- a/sound/soc/bcm/Makefile
148 +++ b/sound/soc/bcm/Makefile
149 @@ -25,7 +25,6 @@ snd-soc-rpi-dac-objs := rpi-dac.o
150 snd-soc-rpi-proto-objs := rpi-proto.o
151 snd-soc-iqaudio-dac-objs := iqaudio-dac.o
152 snd-soc-iqaudio-digi-objs := iqaudio_digi.o
153 -snd-soc-raspidac3-objs := raspidac3.o
154 snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o
155 snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o
156 snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o
157 @@ -52,7 +51,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) +=
158 obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o
159 obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o
160 obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI) += snd-soc-iqaudio-digi.o
161 -obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o
162 obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o
163 obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-soundcard.o
164 obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o
165 --- a/sound/soc/bcm/raspidac3.c
166 +++ /dev/null
167 @@ -1,172 +0,0 @@
168 -/*
169 - * ASoC Driver for RaspiDAC v3
170 - *
171 - * Author: Jan Grulich <jan@grulich.eu>
172 - * Copyright 2015
173 - * based on code by Daniel Matuschek <daniel@hifiberry.com>
174 - * based on code by Florian Meier <florian.meier@koalo.de>
175 - *
176 - * This program is free software; you can redistribute it and/or
177 - * modify it under the terms of the GNU General Public License
178 - * version 2 as published by the Free Software Foundation.
179 - *
180 - * This program is distributed in the hope that it will be useful, but
181 - * WITHOUT ANY WARRANTY; without even the implied warranty of
182 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
183 - * General Public License for more details.
184 - */
185 -
186 -#include <linux/module.h>
187 -#include <linux/platform_device.h>
188 -
189 -#include <sound/core.h>
190 -#include <sound/pcm.h>
191 -#include <sound/pcm_params.h>
192 -#include <sound/soc.h>
193 -#include <sound/jack.h>
194 -#include <sound/soc-dapm.h>
195 -
196 -#include "../codecs/pcm512x.h"
197 -#include "../codecs/tpa6130a2.h"
198 -
199 -/* sound card init */
200 -static int snd_rpi_raspidac3_init(struct snd_soc_pcm_runtime *rtd)
201 -{
202 - int ret;
203 - struct snd_soc_card *card = rtd->card;
204 - struct snd_soc_codec *codec = rtd->codec;
205 - snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08);
206 - snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02);
207 - snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
208 -
209 - ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207);
210 - if (ret < 0)
211 - dev_warn(card->dev, "Failed to set volume limit: %d\n", ret);
212 - else {
213 - struct snd_kcontrol *kctl;
214 -
215 - ret = snd_soc_limit_volume(card,
216 - "TPA6130A2 Headphone Playback Volume",
217 - 54);
218 - if (ret < 0)
219 - dev_warn(card->dev, "Failed to set TPA6130A2 volume limit: %d\n",
220 - ret);
221 - kctl = snd_soc_card_get_kcontrol(card,
222 - "TPA6130A2 Headphone Playback Volume");
223 - if (kctl) {
224 - strcpy(kctl->id.name, "Headphones Playback Volume");
225 - /* disable the volume dB scale so alsamixer works */
226 - kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
227 - }
228 -
229 - kctl = snd_soc_card_get_kcontrol(card,
230 - "TPA6130A2 Headphone Playback Switch");
231 - if (kctl)
232 - strcpy(kctl->id.name, "Headphones Playback Switch");
233 - }
234 -
235 - return 0;
236 -}
237 -
238 -/* startup */
239 -static int snd_rpi_raspidac3_startup(struct snd_pcm_substream *substream) {
240 - struct snd_soc_pcm_runtime *rtd = substream->private_data;
241 - struct snd_soc_codec *codec = rtd->codec;
242 - snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
243 - return 0;
244 -}
245 -
246 -/* shutdown */
247 -static void snd_rpi_raspidac3_shutdown(struct snd_pcm_substream *substream) {
248 - struct snd_soc_pcm_runtime *rtd = substream->private_data;
249 - struct snd_soc_codec *codec = rtd->codec;
250 - snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
251 -}
252 -
253 -/* machine stream operations */
254 -static struct snd_soc_ops snd_rpi_raspidac3_ops = {
255 - .startup = snd_rpi_raspidac3_startup,
256 - .shutdown = snd_rpi_raspidac3_shutdown,
257 -};
258 -
259 -/* interface setup */
260 -static struct snd_soc_dai_link snd_rpi_raspidac3_dai[] = {
261 -{
262 - .name = "RaspiDAC Rev.3x",
263 - .stream_name = "RaspiDAC HiFi",
264 - .cpu_dai_name = "bcm2708-i2s.0",
265 - .codec_dai_name = "pcm512x-hifi",
266 - .platform_name = "bcm2708-i2s.0",
267 - .codec_name = "pcm512x.1-004c",
268 - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
269 - SND_SOC_DAIFMT_CBS_CFS,
270 - .ops = &snd_rpi_raspidac3_ops,
271 - .init = snd_rpi_raspidac3_init,
272 -},
273 -};
274 -
275 -/* audio machine driver */
276 -static struct snd_soc_card snd_rpi_raspidac3 = {
277 - .name = "RaspiDAC Rev.3x HiFi Audio Card",
278 - .owner = THIS_MODULE,
279 - .dai_link = snd_rpi_raspidac3_dai,
280 - .num_links = ARRAY_SIZE(snd_rpi_raspidac3_dai),
281 -};
282 -
283 -/* sound card test */
284 -static int snd_rpi_raspidac3_probe(struct platform_device *pdev)
285 -{
286 - int ret = 0;
287 -
288 - snd_rpi_raspidac3.dev = &pdev->dev;
289 -
290 - if (pdev->dev.of_node) {
291 - struct device_node *i2s_node;
292 - struct snd_soc_dai_link *dai = &snd_rpi_raspidac3_dai[0];
293 - i2s_node = of_parse_phandle(pdev->dev.of_node,
294 - "i2s-controller", 0);
295 -
296 - if (i2s_node) {
297 - dai->cpu_dai_name = NULL;
298 - dai->cpu_of_node = i2s_node;
299 - dai->platform_name = NULL;
300 - dai->platform_of_node = i2s_node;
301 - }
302 - }
303 -
304 - ret = snd_soc_register_card(&snd_rpi_raspidac3);
305 - if (ret && ret != -EPROBE_DEFER)
306 - dev_err(&pdev->dev,
307 - "snd_soc_register_card() failed: %d\n", ret);
308 -
309 - return ret;
310 -}
311 -
312 -/* sound card disconnect */
313 -static int snd_rpi_raspidac3_remove(struct platform_device *pdev)
314 -{
315 - return snd_soc_unregister_card(&snd_rpi_raspidac3);
316 -}
317 -
318 -static const struct of_device_id raspidac3_of_match[] = {
319 - { .compatible = "jg,raspidacv3", },
320 - {},
321 -};
322 -MODULE_DEVICE_TABLE(of, raspidac3_of_match);
323 -
324 -/* sound card platform driver */
325 -static struct platform_driver snd_rpi_raspidac3_driver = {
326 - .driver = {
327 - .name = "snd-rpi-raspidac3",
328 - .owner = THIS_MODULE,
329 - .of_match_table = raspidac3_of_match,
330 - },
331 - .probe = snd_rpi_raspidac3_probe,
332 - .remove = snd_rpi_raspidac3_remove,
333 -};
334 -
335 -module_platform_driver(snd_rpi_raspidac3_driver);
336 -
337 -MODULE_AUTHOR("Jan Grulich <jan@grulich.eu>");
338 -MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x");
339 -MODULE_LICENSE("GPL v2");