Skip to content

Commit abec21d

Browse files
j-schambacherpopcornmix
authored andcommitted
Overlays:Add specific clk-producer/-consumer overlays for Hifiberry DAC+
As the easy switching of the I2S module bewteen clock producer/consumer on the PI5 is not possible, two specific DT-overlays are introduced. The DAC+PRO boards with onboard clocks use the -PRO overlay, the boards without oscillators the -STD version. The "hifiberry-dacplus,slave" parameter in the -STD overlay disables the automatic clock detection inside the hifiberry-dacplus driver. The former hifiberry-dacplus overlay is kept for compatibility but will be deprecated. Signed-off-by: j-schambacher <[email protected]>
1 parent b541c45 commit abec21d

File tree

4 files changed

+173
-0
lines changed

4 files changed

+173
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
9191
hifiberry-dac.dtbo \
9292
hifiberry-dac8x.dtbo \
9393
hifiberry-dacplus.dtbo \
94+
hifiberry-dacplus-pro.dtbo \
95+
hifiberry-dacplus-std.dtbo \
9496
hifiberry-dacplusadc.dtbo \
9597
hifiberry-dacplusadcpro.dtbo \
9698
hifiberry-dacplusdsp.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,48 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
18191819
are switched off at all times.
18201820

18211821

1822+
Name: hifiberry-dacplus-pro
1823+
Info: Configures the HifiBerry DAC+ PRO audio card (onboard clocks)
1824+
Load: dtoverlay=hifiberry-dacplus-pro,<param>=<val>
1825+
Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
1826+
Digital volume control. Enable with
1827+
"dtoverlay=hifiberry-dacplus,24db_digital_gain"
1828+
(The default behaviour is that the Digital
1829+
volume control is limited to a maximum of
1830+
0dB. ie. it can attenuate but not provide
1831+
gain. For most users, this will be desired
1832+
as it will prevent clipping. By appending
1833+
the 24dB_digital_gain parameter, the Digital
1834+
volume control will allow up to 24dB of
1835+
gain. If this parameter is enabled, it is the
1836+
responsibility of the user to ensure that
1837+
the Digital volume control is set to a value
1838+
that does not result in clipping/distortion!)
1839+
leds_off If set to 'true' the onboard indicator LEDs
1840+
are switched off at all times.
1841+
1842+
1843+
Name: hifiberry-dacplus-std
1844+
Info: Configures the HifiBerry DAC+ standard audio card (no onboard clocks)
1845+
Load: dtoverlay=hifiberry-dacplus-std,<param>=<val>
1846+
Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
1847+
Digital volume control. Enable with
1848+
"dtoverlay=hifiberry-dacplus,24db_digital_gain"
1849+
(The default behaviour is that the Digital
1850+
volume control is limited to a maximum of
1851+
0dB. ie. it can attenuate but not provide
1852+
gain. For most users, this will be desired
1853+
as it will prevent clipping. By appending
1854+
the 24dB_digital_gain parameter, the Digital
1855+
volume control will allow up to 24dB of
1856+
gain. If this parameter is enabled, it is the
1857+
responsibility of the user to ensure that
1858+
the Digital volume control is set to a value
1859+
that does not result in clipping/distortion!)
1860+
leds_off If set to 'true' the onboard indicator LEDs
1861+
are switched off at all times.
1862+
1863+
18221864
Name: hifiberry-dacplusadc
18231865
Info: Configures the HifiBerry DAC+ADC audio card
18241866
Load: dtoverlay=hifiberry-dacplusadc,<param>=<val>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Definitions for HiFiBerry DAC+ PRO, with onboard clocks
2+
/dts-v1/;
3+
/plugin/;
4+
5+
/ {
6+
compatible = "brcm,bcm2835";
7+
8+
fragment@0 {
9+
target-path = "/";
10+
__overlay__ {
11+
dacpro_osc: dacpro_osc {
12+
compatible = "hifiberry,dacpro-clk";
13+
#clock-cells = <0>;
14+
};
15+
};
16+
};
17+
18+
frag1: fragment@1 {
19+
target = <&i2s_clk_consumer>;
20+
__overlay__ {
21+
status = "okay";
22+
};
23+
};
24+
25+
fragment@2 {
26+
target = <&i2c1>;
27+
__overlay__ {
28+
#address-cells = <1>;
29+
#size-cells = <0>;
30+
status = "okay";
31+
32+
pcm5122@4d {
33+
#sound-dai-cells = <0>;
34+
compatible = "ti,pcm5122";
35+
reg = <0x4d>;
36+
clocks = <&dacpro_osc>;
37+
AVDD-supply = <&vdd_3v3_reg>;
38+
DVDD-supply = <&vdd_3v3_reg>;
39+
CPVDD-supply = <&vdd_3v3_reg>;
40+
status = "okay";
41+
};
42+
hpamp: hpamp@60 {
43+
compatible = "ti,tpa6130a2";
44+
reg = <0x60>;
45+
status = "disabled";
46+
};
47+
};
48+
};
49+
50+
fragment@3 {
51+
target = <&sound>;
52+
hifiberry_dacplus: __overlay__ {
53+
compatible = "hifiberry,hifiberry-dacplus";
54+
i2s-controller = <&i2s_clk_consumer>;
55+
status = "okay";
56+
};
57+
};
58+
59+
__overrides__ {
60+
24db_digital_gain =
61+
<&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
62+
leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
63+
};
64+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Definitions for HiFiBerry DAC+ Standard w/o onboard clocks
2+
/dts-v1/;
3+
/plugin/;
4+
5+
/ {
6+
compatible = "brcm,bcm2835";
7+
8+
fragment@0 {
9+
target-path = "/";
10+
__overlay__ {
11+
dacpro_osc: dacpro_osc {
12+
compatible = "hifiberry,dacpro-clk";
13+
#clock-cells = <0>;
14+
};
15+
};
16+
};
17+
18+
fragment@1 {
19+
target = <&i2s_clk_producer>;
20+
__overlay__ {
21+
status = "okay";
22+
};
23+
};
24+
25+
fragment@2 {
26+
target = <&i2c1>;
27+
__overlay__ {
28+
#address-cells = <1>;
29+
#size-cells = <0>;
30+
status = "okay";
31+
32+
pcm5122@4d {
33+
#sound-dai-cells = <0>;
34+
compatible = "ti,pcm5122";
35+
reg = <0x4d>;
36+
clocks = <&dacpro_osc>;
37+
AVDD-supply = <&vdd_3v3_reg>;
38+
DVDD-supply = <&vdd_3v3_reg>;
39+
CPVDD-supply = <&vdd_3v3_reg>;
40+
status = "okay";
41+
};
42+
hpamp: hpamp@60 {
43+
compatible = "ti,tpa6130a2";
44+
reg = <0x60>;
45+
status = "disabled";
46+
};
47+
};
48+
};
49+
50+
fragment@3 {
51+
target = <&sound>;
52+
hifiberry_dacplus: __overlay__ {
53+
compatible = "hifiberry,hifiberry-dacplus";
54+
i2s-controller = <&i2s_clk_producer>;
55+
hifiberry-dacplus,slave;
56+
status = "okay";
57+
};
58+
};
59+
60+
__overrides__ {
61+
24db_digital_gain =
62+
<&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
63+
leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
64+
};
65+
};

0 commit comments

Comments
 (0)