Skip to content

Commit 04fcc16

Browse files
johanneskpopcornmix
authored andcommitted
Allow simultaneous use of JustBoom DAC and Digi
Signed-off-by: Johannes Krude <[email protected]>
1 parent d7668dc commit 04fcc16

File tree

11 files changed

+371
-0
lines changed

11 files changed

+371
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
8686
iqaudio-digi-wm8804-audio.dtbo \
8787
irs1125.dtbo \
8888
jedec-spi-nor.dtbo \
89+
justboom-both.dtbo \
8990
justboom-dac.dtbo \
9091
justboom-digi.dtbo \
9192
ltc294x.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,26 @@ Params: flash-spi<n>-<m> Enables flash device on SPI<n>, CS#<m>.
13881388
on SPI<n>, CS#<m>.
13891389

13901390

1391+
Name: justboom-both
1392+
Info: Simultaneous usage of an justboom-dac and justboom-digi based
1393+
card
1394+
Load: dtoverlay=justboom-both,<param>=<val>
1395+
Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
1396+
Digital volume control. Enable with
1397+
"dtoverlay=justboom-dac,24db_digital_gain"
1398+
(The default behaviour is that the Digital
1399+
volume control is limited to a maximum of
1400+
0dB. ie. it can attenuate but not provide
1401+
gain. For most users, this will be desired
1402+
as it will prevent clipping. By appending
1403+
the 24dB_digital_gain parameter, the Digital
1404+
volume control will allow up to 24dB of
1405+
gain. If this parameter is enabled, it is the
1406+
responsibility of the user to ensure that
1407+
the Digital volume control is set to a value
1408+
that does not result in clipping/distortion!)
1409+
1410+
13911411
Name: justboom-dac
13921412
Info: Configures the JustBoom DAC HAT, Amp HAT, DAC Zero and Amp Zero audio
13931413
cards
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
// Definitions for JustBoom Both (Digi+DAC)
3+
/dts-v1/;
4+
/plugin/;
5+
6+
/ {
7+
compatible = "brcm,bcm2835";
8+
9+
fragment@0 {
10+
target = <&i2s>;
11+
__overlay__ {
12+
status = "okay";
13+
};
14+
};
15+
16+
fragment@1 {
17+
target = <&i2c1>;
18+
__overlay__ {
19+
#address-cells = <1>;
20+
#size-cells = <0>;
21+
status = "okay";
22+
23+
wm8804@3b {
24+
#sound-dai-cells = <0>;
25+
compatible = "wlf,wm8804";
26+
reg = <0x3b>;
27+
PVDD-supply = <&vdd_3v3_reg>;
28+
DVDD-supply = <&vdd_3v3_reg>;
29+
status = "okay";
30+
};
31+
};
32+
};
33+
34+
fragment@2 {
35+
target = <&i2c1>;
36+
__overlay__ {
37+
#address-cells = <1>;
38+
#size-cells = <0>;
39+
status = "okay";
40+
41+
pcm5122@4d {
42+
#sound-dai-cells = <0>;
43+
compatible = "ti,pcm5122";
44+
reg = <0x4d>;
45+
AVDD-supply = <&vdd_3v3_reg>;
46+
DVDD-supply = <&vdd_3v3_reg>;
47+
CPVDD-supply = <&vdd_3v3_reg>;
48+
status = "okay";
49+
};
50+
};
51+
};
52+
53+
fragment@3 {
54+
target = <&sound>;
55+
frag3: __overlay__ {
56+
compatible = "justboom,justboom-both";
57+
i2s-controller = <&i2s>;
58+
status = "okay";
59+
};
60+
};
61+
62+
__overrides__ {
63+
24db_digital_gain = <&frag3>,"justboom,24db_digital_gain?";
64+
};
65+
};

arch/arm/configs/bcm2709_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
957957
CONFIG_SND_BCM2708_SOC_RPI_CIRRUS=m
958958
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
959959
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
960+
CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH=m
960961
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
961962
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
962963
CONFIG_SND_BCM2708_SOC_IQAUDIO_CODEC=m

arch/arm/configs/bcm2711_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
933933
CONFIG_SND_BCM2708_SOC_RPI_CIRRUS=m
934934
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
935935
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
936+
CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH=m
936937
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
937938
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
938939
CONFIG_SND_BCM2708_SOC_IQAUDIO_CODEC=m

arch/arm/configs/bcmrpi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
949949
CONFIG_SND_BCM2708_SOC_RPI_CIRRUS=m
950950
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
951951
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
952+
CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH=m
952953
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
953954
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
954955
CONFIG_SND_BCM2708_SOC_IQAUDIO_CODEC=m

arch/arm64/configs/bcm2711_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
960960
CONFIG_SND_BCM2708_SOC_RPI_CIRRUS=m
961961
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
962962
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
963+
CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH=m
963964
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
964965
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
965966
CONFIG_SND_BCM2708_SOC_IQAUDIO_CODEC=m

arch/arm64/configs/bcmrpi3_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m
799799
CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
800800
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
801801
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
802+
CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH=m
802803
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
803804
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
804805
CONFIG_SND_BCM2708_SOC_IQAUDIO_CODEC=m

sound/soc/bcm/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ config SND_BCM2708_SOC_RPI_PROTO
105105
help
106106
Say Y or M if you want to add support for Audio Codec Board PROTO (WM8731).
107107

108+
config SND_BCM2708_SOC_JUSTBOOM_BOTH
109+
tristate "Support for simultaneous JustBoom Digi and JustBoom DAC"
110+
depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
111+
select SND_SOC_WM8804
112+
select SND_SOC_PCM512x
113+
help
114+
Say Y or M if you want to add support for simultaneous
115+
JustBoom Digi and JustBoom DAC.
116+
117+
This is not the right choice if you only have one but both of
118+
these cards.
119+
108120
config SND_BCM2708_SOC_JUSTBOOM_DAC
109121
tristate "Support for JustBoom DAC"
110122
depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S

sound/soc/bcm/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o
1717
snd-soc-hifiberry-dacplusadc-objs := hifiberry_dacplusadc.o
1818
snd-soc-hifiberry-dacplusadcpro-objs := hifiberry_dacplusadcpro.o
1919
snd-soc-hifiberry-dacplusdsp-objs := hifiberry_dacplusdsp.o
20+
snd-soc-justboom-both-objs := justboom-both.o
2021
snd-soc-justboom-dac-objs := justboom-dac.o
2122
snd-soc-rpi-cirrus-objs := rpi-cirrus.o
2223
snd-soc-rpi-proto-objs := rpi-proto.o
@@ -43,6 +44,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o
4344
obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUSADC) += snd-soc-hifiberry-dacplusadc.o
4445
obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUSADCPRO) += snd-soc-hifiberry-dacplusadcpro.o
4546
obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUSDSP) += snd-soc-hifiberry-dacplusdsp.o
47+
obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_BOTH) += snd-soc-justboom-both.o
4648
obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC) += snd-soc-justboom-dac.o
4749
obj-$(CONFIG_SND_BCM2708_SOC_RPI_CIRRUS) += snd-soc-rpi-cirrus.o
4850
obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o

0 commit comments

Comments
 (0)