brcm2708: update linux 4.4 patches to latest version
[librecmc/librecmc.git] / target / linux / brcm2708 / patches-4.4 / 0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch
1 From 648226e081795be9ebaad2dc14bf768ba785f277 Mon Sep 17 00:00:00 2001
2 From: Aaron Shaw <shawaj@gmail.com>
3 Date: Thu, 26 May 2016 23:37:11 +0100
4 Subject: [PATCH 365/423] Change BoomBerry name to JustBoom in all locations
5  due to legal challenge
6
7 ---
8  arch/arm/boot/dts/overlays/Makefile                |   4 +-
9  arch/arm/boot/dts/overlays/README                  |  52 ++---
10  .../boot/dts/overlays/boomberry-dac-overlay.dts    |  43 -----
11  .../boot/dts/overlays/boomberry-digi-overlay.dts   |  39 ----
12  .../arm/boot/dts/overlays/justboom-dac-overlay.dts |  43 +++++
13  .../boot/dts/overlays/justboom-digi-overlay.dts    |  39 ++++
14  arch/arm/configs/bcm2709_defconfig                 |   4 +-
15  arch/arm/configs/bcmrpi_defconfig                  |   4 +-
16  sound/soc/bcm/Kconfig                              |  12 +-
17  sound/soc/bcm/Makefile                             |   8 +-
18  sound/soc/bcm/boomberry-dac.c                      | 162 ----------------
19  sound/soc/bcm/boomberry-digi.c                     | 215 ---------------------
20  sound/soc/bcm/justboom-dac.c                       | 162 ++++++++++++++++
21  sound/soc/bcm/justboom-digi.c                      | 215 +++++++++++++++++++++
22  14 files changed, 501 insertions(+), 501 deletions(-)
23  delete mode 100644 arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts
24  delete mode 100644 arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts
25  create mode 100644 arch/arm/boot/dts/overlays/justboom-dac-overlay.dts
26  create mode 100644 arch/arm/boot/dts/overlays/justboom-digi-overlay.dts
27  delete mode 100644 sound/soc/bcm/boomberry-dac.c
28  delete mode 100644 sound/soc/bcm/boomberry-digi.c
29  create mode 100644 sound/soc/bcm/justboom-dac.c
30  create mode 100644 sound/soc/bcm/justboom-digi.c
31
32 --- a/arch/arm/boot/dts/overlays/Makefile
33 +++ b/arch/arm/boot/dts/overlays/Makefile
34 @@ -18,8 +18,6 @@ dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqd
35  dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo
36  dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo
37  dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo
38 -dtbo-$(RPI_DT_OVERLAYS) += boomberry-dac.dtbo
39 -dtbo-$(RPI_DT_OVERLAYS) += boomberry-digi.dtbo
40  dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo
41  dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo
42  dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo
43 @@ -43,6 +41,8 @@ dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31
44  dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo
45  dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dac.dtbo
46  dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacplus.dtbo
47 +dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo
48 +dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo
49  dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo
50  dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo
51  dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo
52 --- a/arch/arm/boot/dts/overlays/README
53 +++ b/arch/arm/boot/dts/overlays/README
54 @@ -238,32 +238,6 @@ Load:   dtoverlay=bmp085_i2c-sensor
55  Params: <None>
56  
57  
58 -Name:   boomberry-dac
59 -Info:   Configures the BoomBerry DAC HAT, Amp HAT, DAC Zero and Amp Zero audio
60 -        cards
61 -Load:   dtoverlay=boomberry-dac,<param>=<val>
62 -Params: 24db_digital_gain       Allow gain to be applied via the PCM512x codec
63 -                                Digital volume control. Enable with
64 -                                "dtoverlay=boomberry-dac,24db_digital_gain"
65 -                                (The default behaviour is that the Digital
66 -                                volume control is limited to a maximum of
67 -                                0dB. ie. it can attenuate but not provide
68 -                                gain. For most users, this will be desired
69 -                                as it will prevent clipping. By appending
70 -                                the 24dB_digital_gain parameter, the Digital
71 -                                volume control will allow up to 24dB of
72 -                                gain. If this parameter is enabled, it is the
73 -                                responsibility of the user to ensure that
74 -                                the Digital volume control is set to a value
75 -                                that does not result in clipping/distortion!)
76 -
77 -
78 -Name:   boomberry-digi
79 -Info:   Configures the BoomBerry Digi HAT and Digi Zero audio cards
80 -Load:   dtoverlay=boomberry-digi
81 -Params: <None>
82 -
83 -
84  Name:   dht11
85  Info:   Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors
86          Also sometimes found with the part number(s) AM230x.
87 @@ -541,6 +515,32 @@ Params: 24db_digital_gain       Allow ga
88                                  that does not result in clipping/distortion!)
89  
90  
91 +Name:   justboom-dac
92 +Info:   Configures the JustBoom DAC HAT, Amp HAT, DAC Zero and Amp Zero audio
93 +        cards
94 +Load:   dtoverlay=justboom-dac,<param>=<val>
95 +Params: 24db_digital_gain       Allow gain to be applied via the PCM512x codec
96 +                                Digital volume control. Enable with
97 +                                "dtoverlay=justboom-dac,24db_digital_gain"
98 +                                (The default behaviour is that the Digital
99 +                                volume control is limited to a maximum of
100 +                                0dB. ie. it can attenuate but not provide
101 +                                gain. For most users, this will be desired
102 +                                as it will prevent clipping. By appending
103 +                                the 24dB_digital_gain parameter, the Digital
104 +                                volume control will allow up to 24dB of
105 +                                gain. If this parameter is enabled, it is the
106 +                                responsibility of the user to ensure that
107 +                                the Digital volume control is set to a value
108 +                                that does not result in clipping/distortion!)
109 +
110 +
111 +Name:   justboom-digi
112 +Info:   Configures the JustBoom Digi HAT and Digi Zero audio cards
113 +Load:   dtoverlay=justboom-digi
114 +Params: <None>
115 +
116 +
117  Name:   lirc-rpi
118  Info:   Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi)
119          Consult the module documentation for more details.
120 --- a/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts
121 +++ /dev/null
122 @@ -1,43 +0,0 @@
123 -// Definitions for BoomBerry DAC
124 -/dts-v1/;
125 -/plugin/;
126 -
127 -/ {
128 -       compatible = "brcm,bcm2708";
129 -
130 -       fragment@0 {
131 -               target = <&i2s>;
132 -               __overlay__ {
133 -                       status = "okay";
134 -               };
135 -       };
136 -
137 -       fragment@1 {
138 -               target = <&i2c1>;
139 -               __overlay__ {
140 -                       #address-cells = <1>;
141 -                       #size-cells = <0>;
142 -                       status = "okay";
143 -
144 -                       pcm5122@4d {
145 -                               #sound-dai-cells = <0>;
146 -                               compatible = "ti,pcm5122";
147 -                               reg = <0x4d>;
148 -                               status = "okay";
149 -                       };
150 -               };
151 -       };
152 -
153 -       fragment@2 {
154 -               target = <&sound>;
155 -               frag2: __overlay__ {
156 -                       compatible = "boomberry,boomberry-dac";
157 -                       i2s-controller = <&i2s>;
158 -                       status = "okay";
159 -               };
160 -       };
161 -
162 -       __overrides__ {
163 -               24db_digital_gain = <&frag2>,"boomberry,24db_digital_gain?";
164 -       };
165 -};
166 --- a/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts
167 +++ /dev/null
168 @@ -1,39 +0,0 @@
169 -// Definitions for BoomBerry Digi
170 -/dts-v1/;
171 -/plugin/;
172 -
173 -/ {
174 -       compatible = "brcm,bcm2708";
175 -
176 -       fragment@0 {
177 -               target = <&i2s>;
178 -               __overlay__ {
179 -                       status = "okay";
180 -               };
181 -       };
182 -
183 -       fragment@1 {
184 -               target = <&i2c1>;
185 -               __overlay__ {
186 -                       #address-cells = <1>;
187 -                       #size-cells = <0>;
188 -                       status = "okay";
189 -
190 -                       wm8804@3b {
191 -                               #sound-dai-cells = <0>;
192 -                               compatible = "wlf,wm8804";
193 -                               reg = <0x3b>;
194 -                               status = "okay";
195 -                       };
196 -               };
197 -       };
198 -
199 -       fragment@2 {
200 -               target = <&sound>;
201 -               __overlay__ {
202 -                       compatible = "boomberry,boomberry-digi";
203 -                       i2s-controller = <&i2s>;
204 -                       status = "okay";
205 -               };
206 -       };
207 -};
208 --- /dev/null
209 +++ b/arch/arm/boot/dts/overlays/justboom-dac-overlay.dts
210 @@ -0,0 +1,43 @@
211 +// Definitions for JustBoom DAC
212 +/dts-v1/;
213 +/plugin/;
214 +
215 +/ {
216 +       compatible = "brcm,bcm2708";
217 +
218 +       fragment@0 {
219 +               target = <&i2s>;
220 +               __overlay__ {
221 +                       status = "okay";
222 +               };
223 +       };
224 +
225 +       fragment@1 {
226 +               target = <&i2c1>;
227 +               __overlay__ {
228 +                       #address-cells = <1>;
229 +                       #size-cells = <0>;
230 +                       status = "okay";
231 +
232 +                       pcm5122@4d {
233 +                               #sound-dai-cells = <0>;
234 +                               compatible = "ti,pcm5122";
235 +                               reg = <0x4d>;
236 +                               status = "okay";
237 +                       };
238 +               };
239 +       };
240 +
241 +       fragment@2 {
242 +               target = <&sound>;
243 +               frag2: __overlay__ {
244 +                       compatible = "justboom,justboom-dac";
245 +                       i2s-controller = <&i2s>;
246 +                       status = "okay";
247 +               };
248 +       };
249 +
250 +       __overrides__ {
251 +               24db_digital_gain = <&frag2>,"justboom,24db_digital_gain?";
252 +       };
253 +};
254 --- /dev/null
255 +++ b/arch/arm/boot/dts/overlays/justboom-digi-overlay.dts
256 @@ -0,0 +1,39 @@
257 +// Definitions for JustBoom Digi
258 +/dts-v1/;
259 +/plugin/;
260 +
261 +/ {
262 +       compatible = "brcm,bcm2708";
263 +
264 +       fragment@0 {
265 +               target = <&i2s>;
266 +               __overlay__ {
267 +                       status = "okay";
268 +               };
269 +       };
270 +
271 +       fragment@1 {
272 +               target = <&i2c1>;
273 +               __overlay__ {
274 +                       #address-cells = <1>;
275 +                       #size-cells = <0>;
276 +                       status = "okay";
277 +
278 +                       wm8804@3b {
279 +                               #sound-dai-cells = <0>;
280 +                               compatible = "wlf,wm8804";
281 +                               reg = <0x3b>;
282 +                               status = "okay";
283 +                       };
284 +               };
285 +       };
286 +
287 +       fragment@2 {
288 +               target = <&sound>;
289 +               __overlay__ {
290 +                       compatible = "justboom,justboom-digi";
291 +                       i2s-controller = <&i2s>;
292 +                       status = "okay";
293 +               };
294 +       };
295 +};
296 --- a/arch/arm/configs/bcm2709_defconfig
297 +++ b/arch/arm/configs/bcm2709_defconfig
298 @@ -861,8 +861,8 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m
299  CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
300  CONFIG_SND_BCM2708_SOC_RPI_DAC=m
301  CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
302 -CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m
303 -CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m
304 +CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
305 +CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
306  CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
307  CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
308  CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
309 --- a/arch/arm/configs/bcmrpi_defconfig
310 +++ b/arch/arm/configs/bcmrpi_defconfig
311 @@ -853,8 +853,8 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m
312  CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
313  CONFIG_SND_BCM2708_SOC_RPI_DAC=m
314  CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
315 -CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m
316 -CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m
317 +CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
318 +CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
319  CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
320  CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
321  CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
322 --- a/sound/soc/bcm/Kconfig
323 +++ b/sound/soc/bcm/Kconfig
324 @@ -50,19 +50,19 @@ config SND_BCM2708_SOC_RPI_PROTO
325         help
326           Say Y or M if you want to add support for Audio Codec Board PROTO (WM8731).
327  
328 -config SND_BCM2708_SOC_BOOMBERRY_DAC
329 -       tristate "Support for BoomBerry DAC"
330 +config SND_BCM2708_SOC_JUSTBOOM_DAC
331 +       tristate "Support for JustBoom DAC"
332         depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
333         select SND_SOC_PCM512x
334         help
335 -         Say Y or M if you want to add support for BoomBerry DAC.
336 +         Say Y or M if you want to add support for JustBoom DAC.
337  
338 -config SND_BCM2708_SOC_BOOMBERRY_DIGI
339 -       tristate "Support for BoomBerry Digi"
340 +config SND_BCM2708_SOC_JUSTBOOM_DIGI
341 +       tristate "Support for JustBoom Digi"
342         depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
343         select SND_SOC_WM8804
344         help
345 -         Say Y or M if you want to add support for BoomBerry Digi.
346 +         Say Y or M if you want to add support for JustBoom Digi.
347  
348  config SND_BCM2708_SOC_IQAUDIO_DAC
349         tristate "Support for IQaudIO-DAC"
350 --- a/sound/soc/bcm/Makefile
351 +++ b/sound/soc/bcm/Makefile
352 @@ -9,8 +9,8 @@ snd-soc-hifiberry-dac-objs := hifiberry_
353  snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o
354  snd-soc-hifiberry-digi-objs := hifiberry_digi.o
355  snd-soc-hifiberry-amp-objs := hifiberry_amp.o
356 -snd-soc-boomberry-dac-objs := boomberry-dac.o
357 -snd-soc-boomberry-digi-objs := boomberry-digi.o
358 +snd-soc-justboom-dac-objs := justboom-dac.o
359 +snd-soc-justboom-digi-objs := justboom-digi.o
360  snd-soc-rpi-dac-objs := rpi-dac.o
361  snd-soc-rpi-proto-objs := rpi-proto.o
362  snd-soc-iqaudio-dac-objs := iqaudio-dac.o
363 @@ -22,8 +22,8 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_D
364  obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o
365  obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o
366  obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o
367 -obj-$(CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC) += snd-soc-boomberry-dac.o
368 -obj-$(CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI) += snd-soc-boomberry-digi.o
369 +obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC) += snd-soc-justboom-dac.o
370 +obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI) += snd-soc-justboom-digi.o
371  obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o
372  obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o
373  obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o
374 --- a/sound/soc/bcm/boomberry-dac.c
375 +++ /dev/null
376 @@ -1,162 +0,0 @@
377 -/*
378 - * ASoC Driver for BoomBerry DAC Raspberry Pi HAT Sound Card
379 - *
380 - * Author:     Milan Neskovic
381 - *             Copyright 2016
382 - *             based on code by Daniel Matuschek <info@crazy-audio.com>
383 - *             based on code by Florian Meier <florian.meier@koalo.de>
384 - *
385 - * This program is free software; you can redistribute it and/or
386 - * modify it under the terms of the GNU General Public License
387 - * version 2 as published by the Free Software Foundation.
388 - *
389 - * This program is distributed in the hope that it will be useful, but
390 - * WITHOUT ANY WARRANTY; without even the implied warranty of
391 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
392 - * General Public License for more details.
393 - */
394 -
395 -#include <linux/module.h>
396 -#include <linux/platform_device.h>
397 -
398 -#include <sound/core.h>
399 -#include <sound/pcm.h>
400 -#include <sound/pcm_params.h>
401 -#include <sound/soc.h>
402 -#include <sound/jack.h>
403 -
404 -#include "../codecs/pcm512x.h"
405 -
406 -static bool digital_gain_0db_limit = true;
407 -
408 -static int snd_rpi_boomberry_dac_init(struct snd_soc_pcm_runtime *rtd)
409 -{
410 -       struct snd_soc_codec *codec = rtd->codec;
411 -       snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08);
412 -       snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02);
413 -       snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
414 -
415 -       if (digital_gain_0db_limit)
416 -       {
417 -               int ret;
418 -               struct snd_soc_card *card = rtd->card;
419 -
420 -               ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207);
421 -               if (ret < 0)
422 -                       dev_warn(card->dev, "Failed to set volume limit: %d\n", ret);
423 -       }
424 -
425 -       return 0;
426 -}
427 -
428 -static int snd_rpi_boomberry_dac_hw_params(struct snd_pcm_substream *substream,
429 -                                      struct snd_pcm_hw_params *params)
430 -{
431 -       struct snd_soc_pcm_runtime *rtd = substream->private_data;
432 -       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
433 -       /*return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);*/
434 -       unsigned int sample_bits =
435 -               snd_pcm_format_physical_width(params_format(params));
436 -       return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2);
437 -}
438 -
439 -static int snd_rpi_boomberry_dac_startup(struct snd_pcm_substream *substream) {
440 -       struct snd_soc_pcm_runtime *rtd = substream->private_data;
441 -       struct snd_soc_codec *codec = rtd->codec;
442 -       snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
443 -       return 0;
444 -}
445 -
446 -static void snd_rpi_boomberry_dac_shutdown(struct snd_pcm_substream *substream) {
447 -       struct snd_soc_pcm_runtime *rtd = substream->private_data;
448 -       struct snd_soc_codec *codec = rtd->codec;
449 -       snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
450 -}
451 -
452 -/* machine stream operations */
453 -static struct snd_soc_ops snd_rpi_boomberry_dac_ops = {
454 -       .hw_params = snd_rpi_boomberry_dac_hw_params,
455 -       .startup = snd_rpi_boomberry_dac_startup,
456 -       .shutdown = snd_rpi_boomberry_dac_shutdown,
457 -};
458 -
459 -static struct snd_soc_dai_link snd_rpi_boomberry_dac_dai[] = {
460 -{
461 -       .name           = "BoomBerry DAC",
462 -       .stream_name    = "BoomBerry DAC HiFi",
463 -       .cpu_dai_name   = "bcm2708-i2s.0",
464 -       .codec_dai_name = "pcm512x-hifi",
465 -       .platform_name  = "bcm2708-i2s.0",
466 -       .codec_name     = "pcm512x.1-004d",
467 -       .dai_fmt        = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
468 -                               SND_SOC_DAIFMT_CBS_CFS,
469 -       .ops            = &snd_rpi_boomberry_dac_ops,
470 -       .init           = snd_rpi_boomberry_dac_init,
471 -},
472 -};
473 -
474 -/* audio machine driver */
475 -static struct snd_soc_card snd_rpi_boomberry_dac = {
476 -       .name         = "snd_rpi_boomberry_dac",
477 -       .owner        = THIS_MODULE,
478 -       .dai_link     = snd_rpi_boomberry_dac_dai,
479 -       .num_links    = ARRAY_SIZE(snd_rpi_boomberry_dac_dai),
480 -};
481 -
482 -static int snd_rpi_boomberry_dac_probe(struct platform_device *pdev)
483 -{
484 -       int ret = 0;
485 -
486 -       snd_rpi_boomberry_dac.dev = &pdev->dev;
487 -
488 -       if (pdev->dev.of_node) {
489 -           struct device_node *i2s_node;
490 -           struct snd_soc_dai_link *dai = &snd_rpi_boomberry_dac_dai[0];
491 -           i2s_node = of_parse_phandle(pdev->dev.of_node,
492 -                                       "i2s-controller", 0);
493 -
494 -           if (i2s_node) {
495 -                       dai->cpu_dai_name = NULL;
496 -                       dai->cpu_of_node = i2s_node;
497 -                       dai->platform_name = NULL;
498 -                       dai->platform_of_node = i2s_node;
499 -           }
500 -
501 -           digital_gain_0db_limit = !of_property_read_bool(
502 -                       pdev->dev.of_node, "boomberry,24db_digital_gain");
503 -       }
504 -
505 -       ret = snd_soc_register_card(&snd_rpi_boomberry_dac);
506 -       if (ret)
507 -               dev_err(&pdev->dev,
508 -                       "snd_soc_register_card() failed: %d\n", ret);
509 -
510 -       return ret;
511 -}
512 -
513 -static int snd_rpi_boomberry_dac_remove(struct platform_device *pdev)
514 -{
515 -       return snd_soc_unregister_card(&snd_rpi_boomberry_dac);
516 -}
517 -
518 -static const struct of_device_id snd_rpi_boomberry_dac_of_match[] = {
519 -       { .compatible = "boomberry,boomberry-dac", },
520 -       {},
521 -};
522 -MODULE_DEVICE_TABLE(of, snd_rpi_boomberry_dac_of_match);
523 -
524 -static struct platform_driver snd_rpi_boomberry_dac_driver = {
525 -       .driver = {
526 -               .name   = "snd-rpi-boomberry-dac",
527 -               .owner  = THIS_MODULE,
528 -               .of_match_table = snd_rpi_boomberry_dac_of_match,
529 -       },
530 -       .probe          = snd_rpi_boomberry_dac_probe,
531 -       .remove         = snd_rpi_boomberry_dac_remove,
532 -};
533 -
534 -module_platform_driver(snd_rpi_boomberry_dac_driver);
535 -
536 -MODULE_AUTHOR("Milan Neskovic <info@boomberry.co>");
537 -MODULE_DESCRIPTION("ASoC Driver for BoomBerry PI DAC HAT Sound Card");
538 -MODULE_LICENSE("GPL v2");
539 --- a/sound/soc/bcm/boomberry-digi.c
540 +++ /dev/null
541 @@ -1,215 +0,0 @@
542 -/*
543 - * ASoC Driver for BoomBerry Raspberry Pi Digi HAT Sound Card
544 - *
545 - * Author:     Milan Neskovic
546 - *             Copyright 2016
547 - *             based on code by Daniel Matuschek <info@crazy-audio.com>
548 - *             based on code by Florian Meier <florian.meier@koalo.de>
549 - *
550 - * This program is free software; you can redistribute it and/or
551 - * modify it under the terms of the GNU General Public License
552 - * version 2 as published by the Free Software Foundation.
553 - *
554 - * This program is distributed in the hope that it will be useful, but
555 - * WITHOUT ANY WARRANTY; without even the implied warranty of
556 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
557 - * General Public License for more details.
558 - */
559 -
560 -#include <linux/module.h>
561 -#include <linux/platform_device.h>
562 -
563 -#include <sound/core.h>
564 -#include <sound/pcm.h>
565 -#include <sound/pcm_params.h>
566 -#include <sound/soc.h>
567 -#include <sound/jack.h>
568 -
569 -#include "../codecs/wm8804.h"
570 -
571 -static int snd_rpi_boomberry_digi_init(struct snd_soc_pcm_runtime *rtd)
572 -{
573 -       struct snd_soc_codec *codec = rtd->codec;
574 -
575 -       /* enable TX output */
576 -       snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0);
577 -
578 -       return 0;
579 -}
580 -
581 -static int snd_rpi_boomberry_digi_startup(struct snd_pcm_substream *substream) {
582 -       /* turn on digital output */
583 -       struct snd_soc_pcm_runtime *rtd = substream->private_data;
584 -       struct snd_soc_codec *codec = rtd->codec;
585 -       snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00);
586 -       return 0;
587 -}
588 -
589 -static void snd_rpi_boomberry_digi_shutdown(struct snd_pcm_substream *substream) {
590 -       /* turn off output */
591 -       struct snd_soc_pcm_runtime *rtd = substream->private_data;
592 -       struct snd_soc_codec *codec = rtd->codec;
593 -       snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c);
594 -}
595 -
596 -static int snd_rpi_boomberry_digi_hw_params(struct snd_pcm_substream *substream,
597 -                                      struct snd_pcm_hw_params *params)
598 -{
599 -       struct snd_soc_pcm_runtime *rtd = substream->private_data;
600 -       struct snd_soc_dai *codec_dai = rtd->codec_dai;
601 -       struct snd_soc_codec *codec = rtd->codec;
602 -       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
603 -
604 -       int sysclk = 27000000; /* This is fixed on this board */
605 -
606 -       long mclk_freq=0;
607 -       int mclk_div=1;
608 -       int sampling_freq=1;
609 -
610 -       int ret;
611 -
612 -       int samplerate = params_rate(params);
613 -
614 -       if (samplerate<=96000) {
615 -               mclk_freq=samplerate*256;
616 -               mclk_div=WM8804_MCLKDIV_256FS;
617 -       } else {
618 -               mclk_freq=samplerate*128;
619 -               mclk_div=WM8804_MCLKDIV_128FS;
620 -       }
621 -
622 -       switch (samplerate) {
623 -               case 32000:
624 -                       sampling_freq=0x03;
625 -                       break;
626 -               case 44100:
627 -                       sampling_freq=0x00;
628 -                       break;
629 -               case 48000:
630 -                       sampling_freq=0x02;
631 -                       break;
632 -               case 88200:
633 -                       sampling_freq=0x08;
634 -                       break;
635 -               case 96000:
636 -                       sampling_freq=0x0a;
637 -                       break;
638 -               case 176400:
639 -                       sampling_freq=0x0c;
640 -                       break;
641 -               case 192000:
642 -                       sampling_freq=0x0e;
643 -                       break;
644 -               default:
645 -                       dev_err(codec->dev,
646 -                       "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n",
647 -                       samplerate);
648 -       }
649 -
650 -       snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div);
651 -       snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq);
652 -
653 -       ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL,
654 -                                       sysclk, SND_SOC_CLOCK_OUT);
655 -       if (ret < 0) {
656 -               dev_err(codec->dev,
657 -               "Failed to set WM8804 SYSCLK: %d\n", ret);
658 -               return ret;
659 -       }
660 -
661 -       /* Enable TX output */
662 -       snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0);
663 -
664 -       /* Power on */
665 -       snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0);
666 -
667 -       /* set sampling frequency status bits */
668 -       snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq);
669 -
670 -       return snd_soc_dai_set_bclk_ratio(cpu_dai,64);
671 -}
672 -
673 -/* machine stream operations */
674 -static struct snd_soc_ops snd_rpi_boomberry_digi_ops = {
675 -       .hw_params = snd_rpi_boomberry_digi_hw_params,
676 -        .startup = snd_rpi_boomberry_digi_startup,
677 -        .shutdown = snd_rpi_boomberry_digi_shutdown,
678 -};
679 -
680 -static struct snd_soc_dai_link snd_rpi_boomberry_digi_dai[] = {
681 -{
682 -       .name           = "BoomBerry Digi",
683 -       .stream_name    = "BoomBerry Digi HiFi",
684 -       .cpu_dai_name   = "bcm2708-i2s.0",
685 -       .codec_dai_name = "wm8804-spdif",
686 -       .platform_name  = "bcm2708-i2s.0",
687 -       .codec_name     = "wm8804.1-003b",
688 -       .dai_fmt        = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
689 -                               SND_SOC_DAIFMT_CBM_CFM,
690 -       .ops            = &snd_rpi_boomberry_digi_ops,
691 -       .init           = snd_rpi_boomberry_digi_init,
692 -},
693 -};
694 -
695 -/* audio machine driver */
696 -static struct snd_soc_card snd_rpi_boomberry_digi = {
697 -       .name         = "snd_rpi_boomberry_digi",
698 -       .owner        = THIS_MODULE,
699 -       .dai_link     = snd_rpi_boomberry_digi_dai,
700 -       .num_links    = ARRAY_SIZE(snd_rpi_boomberry_digi_dai),
701 -};
702 -
703 -static int snd_rpi_boomberry_digi_probe(struct platform_device *pdev)
704 -{
705 -       int ret = 0;
706 -
707 -       snd_rpi_boomberry_digi.dev = &pdev->dev;
708 -
709 -       if (pdev->dev.of_node) {
710 -           struct device_node *i2s_node;
711 -           struct snd_soc_dai_link *dai = &snd_rpi_boomberry_digi_dai[0];
712 -           i2s_node = of_parse_phandle(pdev->dev.of_node,
713 -                                       "i2s-controller", 0);
714 -
715 -           if (i2s_node) {
716 -                       dai->cpu_dai_name = NULL;
717 -                       dai->cpu_of_node = i2s_node;
718 -                       dai->platform_name = NULL;
719 -                       dai->platform_of_node = i2s_node;
720 -           }
721 -       }
722 -
723 -       ret = snd_soc_register_card(&snd_rpi_boomberry_digi);
724 -       if (ret)
725 -               dev_err(&pdev->dev,
726 -                       "snd_soc_register_card() failed: %d\n", ret);
727 -
728 -       return ret;
729 -}
730 -
731 -static int snd_rpi_boomberry_digi_remove(struct platform_device *pdev)
732 -{
733 -       return snd_soc_unregister_card(&snd_rpi_boomberry_digi);
734 -}
735 -
736 -static const struct of_device_id snd_rpi_boomberry_digi_of_match[] = {
737 -       { .compatible = "boomberry,boomberry-digi", },
738 -       {},
739 -};
740 -MODULE_DEVICE_TABLE(of, snd_rpi_boomberry_digi_of_match);
741 -
742 -static struct platform_driver snd_rpi_boomberry_digi_driver = {
743 -       .driver = {
744 -               .name   = "snd-rpi-boomberry-digi",
745 -               .owner  = THIS_MODULE,
746 -               .of_match_table = snd_rpi_boomberry_digi_of_match,
747 -       },
748 -       .probe          = snd_rpi_boomberry_digi_probe,
749 -       .remove         = snd_rpi_boomberry_digi_remove,
750 -};
751 -
752 -module_platform_driver(snd_rpi_boomberry_digi_driver);
753 -
754 -MODULE_AUTHOR("Milan Neskovic <info@boomberry.co>");
755 -MODULE_DESCRIPTION("ASoC Driver for BoomBerry PI Digi HAT Sound Card");
756 -MODULE_LICENSE("GPL v2");
757 --- /dev/null
758 +++ b/sound/soc/bcm/justboom-dac.c
759 @@ -0,0 +1,162 @@
760 +/*
761 + * ASoC Driver for JustBoom DAC Raspberry Pi HAT Sound Card
762 + *
763 + * Author:     Milan Neskovic
764 + *             Copyright 2016
765 + *             based on code by Daniel Matuschek <info@crazy-audio.com>
766 + *             based on code by Florian Meier <florian.meier@koalo.de>
767 + *
768 + * This program is free software; you can redistribute it and/or
769 + * modify it under the terms of the GNU General Public License
770 + * version 2 as published by the Free Software Foundation.
771 + *
772 + * This program is distributed in the hope that it will be useful, but
773 + * WITHOUT ANY WARRANTY; without even the implied warranty of
774 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
775 + * General Public License for more details.
776 + */
777 +
778 +#include <linux/module.h>
779 +#include <linux/platform_device.h>
780 +
781 +#include <sound/core.h>
782 +#include <sound/pcm.h>
783 +#include <sound/pcm_params.h>
784 +#include <sound/soc.h>
785 +#include <sound/jack.h>
786 +
787 +#include "../codecs/pcm512x.h"
788 +
789 +static bool digital_gain_0db_limit = true;
790 +
791 +static int snd_rpi_justboom_dac_init(struct snd_soc_pcm_runtime *rtd)
792 +{
793 +       struct snd_soc_codec *codec = rtd->codec;
794 +       snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08);
795 +       snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02);
796 +       snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
797 +
798 +       if (digital_gain_0db_limit)
799 +       {
800 +               int ret;
801 +               struct snd_soc_card *card = rtd->card;
802 +
803 +               ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207);
804 +               if (ret < 0)
805 +                       dev_warn(card->dev, "Failed to set volume limit: %d\n", ret);
806 +       }
807 +
808 +       return 0;
809 +}
810 +
811 +static int snd_rpi_justboom_dac_hw_params(struct snd_pcm_substream *substream,
812 +                                      struct snd_pcm_hw_params *params)
813 +{
814 +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
815 +       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
816 +       /*return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);*/
817 +       unsigned int sample_bits =
818 +               snd_pcm_format_physical_width(params_format(params));
819 +       return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2);
820 +}
821 +
822 +static int snd_rpi_justboom_dac_startup(struct snd_pcm_substream *substream) {
823 +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
824 +       struct snd_soc_codec *codec = rtd->codec;
825 +       snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
826 +       return 0;
827 +}
828 +
829 +static void snd_rpi_justboom_dac_shutdown(struct snd_pcm_substream *substream) {
830 +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
831 +       struct snd_soc_codec *codec = rtd->codec;
832 +       snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
833 +}
834 +
835 +/* machine stream operations */
836 +static struct snd_soc_ops snd_rpi_justboom_dac_ops = {
837 +       .hw_params = snd_rpi_justboom_dac_hw_params,
838 +       .startup = snd_rpi_justboom_dac_startup,
839 +       .shutdown = snd_rpi_justboom_dac_shutdown,
840 +};
841 +
842 +static struct snd_soc_dai_link snd_rpi_justboom_dac_dai[] = {
843 +{
844 +       .name           = "JustBoom DAC",
845 +       .stream_name    = "JustBoom DAC HiFi",
846 +       .cpu_dai_name   = "bcm2708-i2s.0",
847 +       .codec_dai_name = "pcm512x-hifi",
848 +       .platform_name  = "bcm2708-i2s.0",
849 +       .codec_name     = "pcm512x.1-004d",
850 +       .dai_fmt        = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
851 +                               SND_SOC_DAIFMT_CBS_CFS,
852 +       .ops            = &snd_rpi_justboom_dac_ops,
853 +       .init           = snd_rpi_justboom_dac_init,
854 +},
855 +};
856 +
857 +/* audio machine driver */
858 +static struct snd_soc_card snd_rpi_justboom_dac = {
859 +       .name         = "snd_rpi_justboom_dac",
860 +       .owner        = THIS_MODULE,
861 +       .dai_link     = snd_rpi_justboom_dac_dai,
862 +       .num_links    = ARRAY_SIZE(snd_rpi_justboom_dac_dai),
863 +};
864 +
865 +static int snd_rpi_justboom_dac_probe(struct platform_device *pdev)
866 +{
867 +       int ret = 0;
868 +
869 +       snd_rpi_justboom_dac.dev = &pdev->dev;
870 +
871 +       if (pdev->dev.of_node) {
872 +           struct device_node *i2s_node;
873 +           struct snd_soc_dai_link *dai = &snd_rpi_justboom_dac_dai[0];
874 +           i2s_node = of_parse_phandle(pdev->dev.of_node,
875 +                                       "i2s-controller", 0);
876 +
877 +           if (i2s_node) {
878 +                       dai->cpu_dai_name = NULL;
879 +                       dai->cpu_of_node = i2s_node;
880 +                       dai->platform_name = NULL;
881 +                       dai->platform_of_node = i2s_node;
882 +           }
883 +
884 +           digital_gain_0db_limit = !of_property_read_bool(
885 +                       pdev->dev.of_node, "justboom,24db_digital_gain");
886 +       }
887 +
888 +       ret = snd_soc_register_card(&snd_rpi_justboom_dac);
889 +       if (ret)
890 +               dev_err(&pdev->dev,
891 +                       "snd_soc_register_card() failed: %d\n", ret);
892 +
893 +       return ret;
894 +}
895 +
896 +static int snd_rpi_justboom_dac_remove(struct platform_device *pdev)
897 +{
898 +       return snd_soc_unregister_card(&snd_rpi_justboom_dac);
899 +}
900 +
901 +static const struct of_device_id snd_rpi_justboom_dac_of_match[] = {
902 +       { .compatible = "justboom,justboom-dac", },
903 +       {},
904 +};
905 +MODULE_DEVICE_TABLE(of, snd_rpi_justboom_dac_of_match);
906 +
907 +static struct platform_driver snd_rpi_justboom_dac_driver = {
908 +       .driver = {
909 +               .name   = "snd-rpi-justboom-dac",
910 +               .owner  = THIS_MODULE,
911 +               .of_match_table = snd_rpi_justboom_dac_of_match,
912 +       },
913 +       .probe          = snd_rpi_justboom_dac_probe,
914 +       .remove         = snd_rpi_justboom_dac_remove,
915 +};
916 +
917 +module_platform_driver(snd_rpi_justboom_dac_driver);
918 +
919 +MODULE_AUTHOR("Milan Neskovic <info@justboom.co>");
920 +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI DAC HAT Sound Card");
921 +MODULE_LICENSE("GPL v2");
922 --- /dev/null
923 +++ b/sound/soc/bcm/justboom-digi.c
924 @@ -0,0 +1,215 @@
925 +/*
926 + * ASoC Driver for JustBoom Raspberry Pi Digi HAT Sound Card
927 + *
928 + * Author:     Milan Neskovic
929 + *             Copyright 2016
930 + *             based on code by Daniel Matuschek <info@crazy-audio.com>
931 + *             based on code by Florian Meier <florian.meier@koalo.de>
932 + *
933 + * This program is free software; you can redistribute it and/or
934 + * modify it under the terms of the GNU General Public License
935 + * version 2 as published by the Free Software Foundation.
936 + *
937 + * This program is distributed in the hope that it will be useful, but
938 + * WITHOUT ANY WARRANTY; without even the implied warranty of
939 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
940 + * General Public License for more details.
941 + */
942 +
943 +#include <linux/module.h>
944 +#include <linux/platform_device.h>
945 +
946 +#include <sound/core.h>
947 +#include <sound/pcm.h>
948 +#include <sound/pcm_params.h>
949 +#include <sound/soc.h>
950 +#include <sound/jack.h>
951 +
952 +#include "../codecs/wm8804.h"
953 +
954 +static int snd_rpi_justboom_digi_init(struct snd_soc_pcm_runtime *rtd)
955 +{
956 +       struct snd_soc_codec *codec = rtd->codec;
957 +
958 +       /* enable TX output */
959 +       snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0);
960 +
961 +       return 0;
962 +}
963 +
964 +static int snd_rpi_justboom_digi_startup(struct snd_pcm_substream *substream) {
965 +       /* turn on digital output */
966 +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
967 +       struct snd_soc_codec *codec = rtd->codec;
968 +       snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00);
969 +       return 0;
970 +}
971 +
972 +static void snd_rpi_justboom_digi_shutdown(struct snd_pcm_substream *substream) {
973 +       /* turn off output */
974 +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
975 +       struct snd_soc_codec *codec = rtd->codec;
976 +       snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c);
977 +}
978 +
979 +static int snd_rpi_justboom_digi_hw_params(struct snd_pcm_substream *substream,
980 +                                      struct snd_pcm_hw_params *params)
981 +{
982 +       struct snd_soc_pcm_runtime *rtd = substream->private_data;
983 +       struct snd_soc_dai *codec_dai = rtd->codec_dai;
984 +       struct snd_soc_codec *codec = rtd->codec;
985 +       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
986 +
987 +       int sysclk = 27000000; /* This is fixed on this board */
988 +
989 +       long mclk_freq=0;
990 +       int mclk_div=1;
991 +       int sampling_freq=1;
992 +
993 +       int ret;
994 +
995 +       int samplerate = params_rate(params);
996 +
997 +       if (samplerate<=96000) {
998 +               mclk_freq=samplerate*256;
999 +               mclk_div=WM8804_MCLKDIV_256FS;
1000 +       } else {
1001 +               mclk_freq=samplerate*128;
1002 +               mclk_div=WM8804_MCLKDIV_128FS;
1003 +       }
1004 +
1005 +       switch (samplerate) {
1006 +               case 32000:
1007 +                       sampling_freq=0x03;
1008 +                       break;
1009 +               case 44100:
1010 +                       sampling_freq=0x00;
1011 +                       break;
1012 +               case 48000:
1013 +                       sampling_freq=0x02;
1014 +                       break;
1015 +               case 88200:
1016 +                       sampling_freq=0x08;
1017 +                       break;
1018 +               case 96000:
1019 +                       sampling_freq=0x0a;
1020 +                       break;
1021 +               case 176400:
1022 +                       sampling_freq=0x0c;
1023 +                       break;
1024 +               case 192000:
1025 +                       sampling_freq=0x0e;
1026 +                       break;
1027 +               default:
1028 +                       dev_err(codec->dev,
1029 +                       "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n",
1030 +                       samplerate);
1031 +       }
1032 +
1033 +       snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div);
1034 +       snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq);
1035 +
1036 +       ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL,
1037 +                                       sysclk, SND_SOC_CLOCK_OUT);
1038 +       if (ret < 0) {
1039 +               dev_err(codec->dev,
1040 +               "Failed to set WM8804 SYSCLK: %d\n", ret);
1041 +               return ret;
1042 +       }
1043 +
1044 +       /* Enable TX output */
1045 +       snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0);
1046 +
1047 +       /* Power on */
1048 +       snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0);
1049 +
1050 +       /* set sampling frequency status bits */
1051 +       snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq);
1052 +
1053 +       return snd_soc_dai_set_bclk_ratio(cpu_dai,64);
1054 +}
1055 +
1056 +/* machine stream operations */
1057 +static struct snd_soc_ops snd_rpi_justboom_digi_ops = {
1058 +       .hw_params = snd_rpi_justboom_digi_hw_params,
1059 +        .startup = snd_rpi_justboom_digi_startup,
1060 +        .shutdown = snd_rpi_justboom_digi_shutdown,
1061 +};
1062 +
1063 +static struct snd_soc_dai_link snd_rpi_justboom_digi_dai[] = {
1064 +{
1065 +       .name           = "JustBoom Digi",
1066 +       .stream_name    = "JustBoom Digi HiFi",
1067 +       .cpu_dai_name   = "bcm2708-i2s.0",
1068 +       .codec_dai_name = "wm8804-spdif",
1069 +       .platform_name  = "bcm2708-i2s.0",
1070 +       .codec_name     = "wm8804.1-003b",
1071 +       .dai_fmt        = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
1072 +                               SND_SOC_DAIFMT_CBM_CFM,
1073 +       .ops            = &snd_rpi_justboom_digi_ops,
1074 +       .init           = snd_rpi_justboom_digi_init,
1075 +},
1076 +};
1077 +
1078 +/* audio machine driver */
1079 +static struct snd_soc_card snd_rpi_justboom_digi = {
1080 +       .name         = "snd_rpi_justboom_digi",
1081 +       .owner        = THIS_MODULE,
1082 +       .dai_link     = snd_rpi_justboom_digi_dai,
1083 +       .num_links    = ARRAY_SIZE(snd_rpi_justboom_digi_dai),
1084 +};
1085 +
1086 +static int snd_rpi_justboom_digi_probe(struct platform_device *pdev)
1087 +{
1088 +       int ret = 0;
1089 +
1090 +       snd_rpi_justboom_digi.dev = &pdev->dev;
1091 +
1092 +       if (pdev->dev.of_node) {
1093 +           struct device_node *i2s_node;
1094 +           struct snd_soc_dai_link *dai = &snd_rpi_justboom_digi_dai[0];
1095 +           i2s_node = of_parse_phandle(pdev->dev.of_node,
1096 +                                       "i2s-controller", 0);
1097 +
1098 +           if (i2s_node) {
1099 +                       dai->cpu_dai_name = NULL;
1100 +                       dai->cpu_of_node = i2s_node;
1101 +                       dai->platform_name = NULL;
1102 +                       dai->platform_of_node = i2s_node;
1103 +           }
1104 +       }
1105 +
1106 +       ret = snd_soc_register_card(&snd_rpi_justboom_digi);
1107 +       if (ret)
1108 +               dev_err(&pdev->dev,
1109 +                       "snd_soc_register_card() failed: %d\n", ret);
1110 +
1111 +       return ret;
1112 +}
1113 +
1114 +static int snd_rpi_justboom_digi_remove(struct platform_device *pdev)
1115 +{
1116 +       return snd_soc_unregister_card(&snd_rpi_justboom_digi);
1117 +}
1118 +
1119 +static const struct of_device_id snd_rpi_justboom_digi_of_match[] = {
1120 +       { .compatible = "justboom,justboom-digi", },
1121 +       {},
1122 +};
1123 +MODULE_DEVICE_TABLE(of, snd_rpi_justboom_digi_of_match);
1124 +
1125 +static struct platform_driver snd_rpi_justboom_digi_driver = {
1126 +       .driver = {
1127 +               .name   = "snd-rpi-justboom-digi",
1128 +               .owner  = THIS_MODULE,
1129 +               .of_match_table = snd_rpi_justboom_digi_of_match,
1130 +       },
1131 +       .probe          = snd_rpi_justboom_digi_probe,
1132 +       .remove         = snd_rpi_justboom_digi_remove,
1133 +};
1134 +
1135 +module_platform_driver(snd_rpi_justboom_digi_driver);
1136 +
1137 +MODULE_AUTHOR("Milan Neskovic <info@justboom.co>");
1138 +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card");
1139 +MODULE_LICENSE("GPL v2");