1 From 9e31e8ce44ef11cabcb1b95830e1fdd8a9655ad3 Mon Sep 17 00:00:00 2001
2 From: j-schambacher <joerg@hifiberry.com>
3 Date: Mon, 11 Mar 2024 15:32:28 +0100
4 Subject: [PATCH 1290/1295] Overlays:Add specific clk-producer/-consumer
5 overlays for Hifiberry DAC+
7 As the easy switching of the I2S module bewteen clock producer/consumer
8 on the PI5 is not possible, two specific DT-overlays are introduced.
9 The DAC+PRO boards with onboard clocks use the -PRO overlay, the boards
10 without oscillators the -STD version.
11 The "hifiberry-dacplus,slave" parameter in the -STD overlay disables
12 the automatic clock detection inside the hifiberry-dacplus driver.
14 The former hifiberry-dacplus overlay is kept for compatibility but
17 Signed-off-by: j-schambacher <joerg@hifiberry.com>
19 arch/arm/boot/dts/overlays/Makefile | 2 +
20 arch/arm/boot/dts/overlays/README | 42 ++++++++++++
21 .../hifiberry-dacplus-pro-overlay.dts | 64 ++++++++++++++++++
22 .../hifiberry-dacplus-std-overlay.dts | 65 +++++++++++++++++++
23 4 files changed, 173 insertions(+)
24 create mode 100644 arch/arm/boot/dts/overlays/hifiberry-dacplus-pro-overlay.dts
25 create mode 100644 arch/arm/boot/dts/overlays/hifiberry-dacplus-std-overlay.dts
27 --- a/arch/arm/boot/dts/overlays/Makefile
28 +++ b/arch/arm/boot/dts/overlays/Makefile
29 @@ -90,6 +90,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
31 hifiberry-dac8x.dtbo \
32 hifiberry-dacplus.dtbo \
33 + hifiberry-dacplus-pro.dtbo \
34 + hifiberry-dacplus-std.dtbo \
35 hifiberry-dacplusadc.dtbo \
36 hifiberry-dacplusadcpro.dtbo \
37 hifiberry-dacplusdsp.dtbo \
38 --- a/arch/arm/boot/dts/overlays/README
39 +++ b/arch/arm/boot/dts/overlays/README
40 @@ -1801,6 +1801,48 @@ Params: 24db_digital_gain Allow ga
41 are switched off at all times.
44 +Name: hifiberry-dacplus-pro
45 +Info: Configures the HifiBerry DAC+ PRO audio card (onboard clocks)
46 +Load: dtoverlay=hifiberry-dacplus-pro,<param>=<val>
47 +Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
48 + Digital volume control. Enable with
49 + "dtoverlay=hifiberry-dacplus,24db_digital_gain"
50 + (The default behaviour is that the Digital
51 + volume control is limited to a maximum of
52 + 0dB. ie. it can attenuate but not provide
53 + gain. For most users, this will be desired
54 + as it will prevent clipping. By appending
55 + the 24dB_digital_gain parameter, the Digital
56 + volume control will allow up to 24dB of
57 + gain. If this parameter is enabled, it is the
58 + responsibility of the user to ensure that
59 + the Digital volume control is set to a value
60 + that does not result in clipping/distortion!)
61 + leds_off If set to 'true' the onboard indicator LEDs
62 + are switched off at all times.
65 +Name: hifiberry-dacplus-std
66 +Info: Configures the HifiBerry DAC+ standard audio card (no onboard clocks)
67 +Load: dtoverlay=hifiberry-dacplus-std,<param>=<val>
68 +Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec
69 + Digital volume control. Enable with
70 + "dtoverlay=hifiberry-dacplus,24db_digital_gain"
71 + (The default behaviour is that the Digital
72 + volume control is limited to a maximum of
73 + 0dB. ie. it can attenuate but not provide
74 + gain. For most users, this will be desired
75 + as it will prevent clipping. By appending
76 + the 24dB_digital_gain parameter, the Digital
77 + volume control will allow up to 24dB of
78 + gain. If this parameter is enabled, it is the
79 + responsibility of the user to ensure that
80 + the Digital volume control is set to a value
81 + that does not result in clipping/distortion!)
82 + leds_off If set to 'true' the onboard indicator LEDs
83 + are switched off at all times.
86 Name: hifiberry-dacplusadc
87 Info: Configures the HifiBerry DAC+ADC audio card
88 Load: dtoverlay=hifiberry-dacplusadc,<param>=<val>
90 +++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-pro-overlay.dts
92 +// Definitions for HiFiBerry DAC+ PRO, with onboard clocks
97 + compatible = "brcm,bcm2835";
102 + dacpro_osc: dacpro_osc {
103 + compatible = "hifiberry,dacpro-clk";
104 + #clock-cells = <0>;
109 + frag1: fragment@1 {
110 + target = <&i2s_clk_consumer>;
119 + #address-cells = <1>;
124 + #sound-dai-cells = <0>;
125 + compatible = "ti,pcm5122";
127 + clocks = <&dacpro_osc>;
128 + AVDD-supply = <&vdd_3v3_reg>;
129 + DVDD-supply = <&vdd_3v3_reg>;
130 + CPVDD-supply = <&vdd_3v3_reg>;
134 + compatible = "ti,tpa6130a2";
136 + status = "disabled";
143 + hifiberry_dacplus: __overlay__ {
144 + compatible = "hifiberry,hifiberry-dacplus";
145 + i2s-controller = <&i2s_clk_consumer>;
151 + 24db_digital_gain =
152 + <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
153 + leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
157 +++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-std-overlay.dts
159 +// Definitions for HiFiBerry DAC+ Standard w/o onboard clocks
164 + compatible = "brcm,bcm2835";
169 + dacpro_osc: dacpro_osc {
170 + compatible = "hifiberry,dacpro-clk";
171 + #clock-cells = <0>;
177 + target = <&i2s_clk_producer>;
186 + #address-cells = <1>;
191 + #sound-dai-cells = <0>;
192 + compatible = "ti,pcm5122";
194 + clocks = <&dacpro_osc>;
195 + AVDD-supply = <&vdd_3v3_reg>;
196 + DVDD-supply = <&vdd_3v3_reg>;
197 + CPVDD-supply = <&vdd_3v3_reg>;
201 + compatible = "ti,tpa6130a2";
203 + status = "disabled";
210 + hifiberry_dacplus: __overlay__ {
211 + compatible = "hifiberry,hifiberry-dacplus";
212 + i2s-controller = <&i2s_clk_producer>;
213 + hifiberry-dacplus,slave;
219 + 24db_digital_gain =
220 + <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
221 + leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";