bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-1290-Overlays-Add-specific-clk-producer-consumer-overlays.patch
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+
6
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.
13
14 The former hifiberry-dacplus overlay is kept for compatibility but
15 will be deprecated.
16
17 Signed-off-by: j-schambacher <joerg@hifiberry.com>
18 ---
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
26
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) += \
30 hifiberry-dac.dtbo \
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.
42
43
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.
63 +
64 +
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.
84 +
85 +
86 Name: hifiberry-dacplusadc
87 Info: Configures the HifiBerry DAC+ADC audio card
88 Load: dtoverlay=hifiberry-dacplusadc,<param>=<val>
89 --- /dev/null
90 +++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-pro-overlay.dts
91 @@ -0,0 +1,64 @@
92 +// Definitions for HiFiBerry DAC+ PRO, with onboard clocks
93 +/dts-v1/;
94 +/plugin/;
95 +
96 +/ {
97 + compatible = "brcm,bcm2835";
98 +
99 + fragment@0 {
100 + target-path = "/";
101 + __overlay__ {
102 + dacpro_osc: dacpro_osc {
103 + compatible = "hifiberry,dacpro-clk";
104 + #clock-cells = <0>;
105 + };
106 + };
107 + };
108 +
109 + frag1: fragment@1 {
110 + target = <&i2s_clk_consumer>;
111 + __overlay__ {
112 + status = "okay";
113 + };
114 + };
115 +
116 + fragment@2 {
117 + target = <&i2c1>;
118 + __overlay__ {
119 + #address-cells = <1>;
120 + #size-cells = <0>;
121 + status = "okay";
122 +
123 + pcm5122@4d {
124 + #sound-dai-cells = <0>;
125 + compatible = "ti,pcm5122";
126 + reg = <0x4d>;
127 + clocks = <&dacpro_osc>;
128 + AVDD-supply = <&vdd_3v3_reg>;
129 + DVDD-supply = <&vdd_3v3_reg>;
130 + CPVDD-supply = <&vdd_3v3_reg>;
131 + status = "okay";
132 + };
133 + hpamp: hpamp@60 {
134 + compatible = "ti,tpa6130a2";
135 + reg = <0x60>;
136 + status = "disabled";
137 + };
138 + };
139 + };
140 +
141 + fragment@3 {
142 + target = <&sound>;
143 + hifiberry_dacplus: __overlay__ {
144 + compatible = "hifiberry,hifiberry-dacplus";
145 + i2s-controller = <&i2s_clk_consumer>;
146 + status = "okay";
147 + };
148 + };
149 +
150 + __overrides__ {
151 + 24db_digital_gain =
152 + <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
153 + leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
154 + };
155 +};
156 --- /dev/null
157 +++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-std-overlay.dts
158 @@ -0,0 +1,65 @@
159 +// Definitions for HiFiBerry DAC+ Standard w/o onboard clocks
160 +/dts-v1/;
161 +/plugin/;
162 +
163 +/ {
164 + compatible = "brcm,bcm2835";
165 +
166 + fragment@0 {
167 + target-path = "/";
168 + __overlay__ {
169 + dacpro_osc: dacpro_osc {
170 + compatible = "hifiberry,dacpro-clk";
171 + #clock-cells = <0>;
172 + };
173 + };
174 + };
175 +
176 + fragment@1 {
177 + target = <&i2s_clk_producer>;
178 + __overlay__ {
179 + status = "okay";
180 + };
181 + };
182 +
183 + fragment@2 {
184 + target = <&i2c1>;
185 + __overlay__ {
186 + #address-cells = <1>;
187 + #size-cells = <0>;
188 + status = "okay";
189 +
190 + pcm5122@4d {
191 + #sound-dai-cells = <0>;
192 + compatible = "ti,pcm5122";
193 + reg = <0x4d>;
194 + clocks = <&dacpro_osc>;
195 + AVDD-supply = <&vdd_3v3_reg>;
196 + DVDD-supply = <&vdd_3v3_reg>;
197 + CPVDD-supply = <&vdd_3v3_reg>;
198 + status = "okay";
199 + };
200 + hpamp: hpamp@60 {
201 + compatible = "ti,tpa6130a2";
202 + reg = <0x60>;
203 + status = "disabled";
204 + };
205 + };
206 + };
207 +
208 + fragment@3 {
209 + target = <&sound>;
210 + hifiberry_dacplus: __overlay__ {
211 + compatible = "hifiberry,hifiberry-dacplus";
212 + i2s-controller = <&i2s_clk_producer>;
213 + hifiberry-dacplus,slave;
214 + status = "okay";
215 + };
216 + };
217 +
218 + __overrides__ {
219 + 24db_digital_gain =
220 + <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
221 + leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
222 + };
223 +};