6d7203b3bc3ea79193b73ff1eed33f65dc3a12c6
[openwrt/staging/blogic.git] /
1 From f8b75a1bcdbf2b5cc591079cafad3b94cc74ff48 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Sat, 20 Nov 2021 14:43:29 +0000
4 Subject: [PATCH] dtoverlays: Convert the camera sensor overlays to use
5 the new regs and clks.
6
7 Now that we have regulators and clocks defined in the base DT for
8 image sensors, switch the overlays to use them.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 arch/arm/boot/dts/overlays/imx219-overlay.dts | 40 ++++---------------
13 .../boot/dts/overlays/imx290_327-overlay.dtsi | 40 ++++---------------
14 .../boot/dts/overlays/imx477_378-overlay.dtsi | 31 +++-----------
15 arch/arm/boot/dts/overlays/imx519-overlay.dts | 38 +++---------------
16 arch/arm/boot/dts/overlays/ov5647-overlay.dts | 18 +++++----
17 arch/arm/boot/dts/overlays/ov7251-overlay.dts | 37 +++--------------
18 arch/arm/boot/dts/overlays/ov9281-overlay.dts | 39 ++++--------------
19 7 files changed, 50 insertions(+), 193 deletions(-)
20
21 --- a/arch/arm/boot/dts/overlays/imx219-overlay.dts
22 +++ b/arch/arm/boot/dts/overlays/imx219-overlay.dts
23 @@ -20,12 +20,12 @@
24 reg = <0x10>;
25 status = "okay";
26
27 - clocks = <&imx219_clk>;
28 + clocks = <&cam1_clk>;
29 clock-names = "xclk";
30
31 VANA-supply = <&cam1_reg>; /* 2.8v */
32 - VDIG-supply = <&imx219_vdig>; /* 1.8v */
33 - VDDL-supply = <&imx219_vddl>; /* 1.2v */
34 + VDIG-supply = <&cam_dummy_reg>; /* 1.8v */
35 + VDDL-supply = <&cam_dummy_reg>; /* 1.2v */
36
37 rotation = <180>;
38 orientation = <2>;
39 @@ -68,26 +68,10 @@
40 };
41
42 fragment@3 {
43 - target-path="/";
44 + target = <&cam1_clk>;
45 __overlay__ {
46 - imx219_vdig: fixedregulator@1 {
47 - compatible = "regulator-fixed";
48 - regulator-name = "imx219_vdig";
49 - regulator-min-microvolt = <1800000>;
50 - regulator-max-microvolt = <1800000>;
51 - };
52 - imx219_vddl: fixedregulator@2 {
53 - compatible = "regulator-fixed";
54 - regulator-name = "imx219_vddl";
55 - regulator-min-microvolt = <1200000>;
56 - regulator-max-microvolt = <1200000>;
57 - };
58 -
59 - imx219_clk: camera-clk {
60 - compatible = "fixed-clock";
61 - #clock-cells = <0>;
62 - clock-frequency = <24000000>;
63 - };
64 + status = "okay";
65 + clock-frequency = <24000000>;
66 };
67 };
68
69 @@ -99,16 +83,6 @@
70 };
71
72 fragment@5 {
73 - target = <&cam1_reg>;
74 - __overlay__ {
75 - status = "okay";
76 - regulator-name = "imx219_vana";
77 - regulator-min-microvolt = <2800000>;
78 - regulator-max-microvolt = <2800000>;
79 - };
80 - };
81 -
82 - fragment@6 {
83 target = <&csi1>;
84 __overlay__ {
85 brcm,media-controller;
86 @@ -118,6 +92,6 @@
87 __overrides__ {
88 rotation = <&imx219>,"rotation:0";
89 orientation = <&imx219>,"orientation:0";
90 - media-controller = <0>,"=6";
91 + media-controller = <0>,"=5";
92 };
93 };
94 --- a/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
95 +++ b/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
96 @@ -20,7 +20,7 @@
97 reg = <0x1a>;
98 status = "okay";
99
100 - clocks = <&imx290_clk>;
101 + clocks = <&cam1_clk>;
102 clock-names = "xclk";
103 clock-frequency = <37125000>;
104
105 @@ -28,8 +28,8 @@
106 orientation = <2>;
107
108 vdda-supply = <&cam1_reg>; /* 2.8v */
109 - vdddo-supply = <&imx290_vdddo>; /* 1.8v */
110 - vddd-supply = <&imx290_vddd>; /* 1.5v */
111 + vdddo-supply = <&cam_dummy_reg>; /* 1.8v */
112 + vddd-supply = <&cam_dummy_reg>; /* 1.5v */
113
114 port {
115 imx290_0: endpoint {
116 @@ -62,26 +62,10 @@
117 };
118
119 fragment@3 {
120 - target-path="/";
121 + target = <&cam1_clk>;
122 __overlay__ {
123 - imx290_vdddo: fixedregulator@1 {
124 - compatible = "regulator-fixed";
125 - regulator-name = "imx290_vdddo";
126 - regulator-min-microvolt = <1800000>;
127 - regulator-max-microvolt = <1800000>;
128 - };
129 - imx290_vddd: fixedregulator@2 {
130 - compatible = "regulator-fixed";
131 - regulator-name = "imx290_vddd";
132 - regulator-min-microvolt = <1500000>;
133 - regulator-max-microvolt = <1500000>;
134 - };
135 -
136 - imx290_clk: camera-clk {
137 - compatible = "fixed-clock";
138 - #clock-cells = <0>;
139 - clock-frequency = <37125000>;
140 - };
141 + status = "okay";
142 + clock-frequency = <37125000>;
143 };
144 };
145
146 @@ -92,16 +76,6 @@
147 };
148 };
149
150 - fragment@5 {
151 - target = <&cam1_reg>;
152 - __overlay__ {
153 - status = "okay";
154 - regulator-name = "imx290_vdda";
155 - regulator-min-microvolt = <2800000>;
156 - regulator-max-microvolt = <2800000>;
157 - };
158 - };
159 -
160 fragment@6 {
161 target = <&imx290_0>;
162 __overlay__ {
163 @@ -143,7 +117,7 @@
164
165 __overrides__ {
166 4lane = <0>, "-6+7-8+9";
167 - clock-frequency = <&imx290_clk>,"clock-frequency:0",
168 + clock-frequency = <&cam1_clk>,"clock-frequency:0",
169 <&imx290>,"clock-frequency:0";
170 rotation = <&imx290>,"rotation:0";
171 orientation = <&imx290>,"orientation:0";
172 --- a/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
173 +++ b/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
174 @@ -15,12 +15,12 @@
175 reg = <0x1a>;
176 status = "okay";
177
178 - clocks = <&imx477_clk>;
179 + clocks = <&cam1_clk>;
180 clock-names = "xclk";
181
182 VANA-supply = <&cam1_reg>; /* 2.8v */
183 - VDIG-supply = <&imx477_vdig>; /* 1.05v */
184 - VDDL-supply = <&imx477_vddl>; /* 1.8v */
185 + VDIG-supply = <&cam_dummy_reg>; /* 1.05v */
186 + VDDL-supply = <&cam_dummy_reg>; /* 1.8v */
187
188 rotation = <180>;
189 orientation = <2>;
190 @@ -63,25 +63,10 @@
191 };
192
193 fragment@3 {
194 - target-path="/";
195 + target = <&cam1_clk>;
196 __overlay__ {
197 - imx477_vdig: fixedregulator@0 {
198 - compatible = "regulator-fixed";
199 - regulator-name = "imx477_vdig";
200 - regulator-min-microvolt = <1050000>;
201 - regulator-max-microvolt = <1050000>;
202 - };
203 - imx477_vddl: fixedregulator@1 {
204 - compatible = "regulator-fixed";
205 - regulator-name = "imx477_vddl";
206 - regulator-min-microvolt = <1800000>;
207 - regulator-max-microvolt = <1800000>;
208 - };
209 - imx477_clk: camera-clk {
210 - compatible = "fixed-clock";
211 - #clock-cells = <0>;
212 - clock-frequency = <24000000>;
213 - };
214 + clock-frequency = <24000000>;
215 + status = "okay";
216 };
217 };
218
219 @@ -95,11 +80,7 @@
220 fragment@5 {
221 target = <&cam1_reg>;
222 __overlay__ {
223 - status = "okay";
224 - regulator-name = "imx477_vana";
225 startup-delay-us = <300000>;
226 - regulator-min-microvolt = <2800000>;
227 - regulator-max-microvolt = <2800000>;
228 };
229 };
230
231 --- a/arch/arm/boot/dts/overlays/imx519-overlay.dts
232 +++ b/arch/arm/boot/dts/overlays/imx519-overlay.dts
233 @@ -20,12 +20,12 @@
234 reg = <0x1a>;
235 status = "okay";
236
237 - clocks = <&imx519_clk>;
238 + clocks = <&cam1_clk>;
239 clock-names = "xclk";
240
241 VANA-supply = <&cam1_reg>; /* 2.8v */
242 - VDIG-supply = <&imx519_vdig>; /* 1.8v */
243 - VDDL-supply = <&imx519_vddl>; /* 1.2v */
244 + VDIG-supply = <&cam_dummy_reg>; /* 1.8v */
245 + VDDL-supply = <&cam_dummy_reg>; /* 1.2v */
246
247 rotation = <0>;
248 orientation = <2>;
249 @@ -68,26 +68,10 @@
250 };
251
252 fragment@3 {
253 - target-path="/";
254 + target = <&cam1_clk>;
255 __overlay__ {
256 - imx519_vdig: fixedregulator@1 {
257 - compatible = "regulator-fixed";
258 - regulator-name = "imx519_vdig";
259 - regulator-min-microvolt = <1800000>;
260 - regulator-max-microvolt = <1800000>;
261 - };
262 - imx519_vddl: fixedregulator@2 {
263 - compatible = "regulator-fixed";
264 - regulator-name = "imx519_vddl";
265 - regulator-min-microvolt = <1200000>;
266 - regulator-max-microvolt = <1200000>;
267 - };
268 -
269 - imx519_clk: camera-clk {
270 - compatible = "fixed-clock";
271 - #clock-cells = <0>;
272 - clock-frequency = <24000000>;
273 - };
274 + clock-frequency = <24000000>;
275 + status = "okay";
276 };
277 };
278
279 @@ -98,16 +82,6 @@
280 };
281 };
282
283 - fragment@5 {
284 - target = <&cam1_reg>;
285 - __overlay__ {
286 - status = "okay";
287 - regulator-name = "imx519_vana";
288 - regulator-min-microvolt = <2800000>;
289 - regulator-max-microvolt = <2800000>;
290 - };
291 - };
292 -
293 fragment@6 {
294 target = <&csi1>;
295 __overlay__ {
296 --- a/arch/arm/boot/dts/overlays/ov5647-overlay.dts
297 +++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts
298 @@ -19,7 +19,7 @@
299 status = "okay";
300
301 pwdn-gpios = <&gpio 41 1>, <&gpio 32 1>;
302 - clocks = <&ov5647_clk>;
303 + clocks = <&cam1_clk>;
304
305 rotation = <0>;
306 orientation = <2>;
307 @@ -77,13 +77,10 @@
308 };
309
310 fragment@5 {
311 - target-path = "/";
312 + target = <&cam1_clk>;
313 __overlay__ {
314 - ov5647_clk: camera-clk {
315 - compatible = "fixed-clock";
316 - #clock-cells = <0>;
317 - clock-frequency = <25000000>;
318 - };
319 + status = "okay";
320 + clock-frequency = <25000000>;
321 };
322 };
323
324 @@ -94,6 +91,13 @@
325 };
326 };
327
328 + fragment@7 {
329 + target = <&cam1_reg>;
330 + __overlay__ {
331 + status = "disabled";
332 + };
333 + };
334 +
335 __overrides__ {
336 rotation = <&ov5647>,"rotation:0";
337 orientation = <&ov5647>,"orientation:0";
338 --- a/arch/arm/boot/dts/overlays/ov7251-overlay.dts
339 +++ b/arch/arm/boot/dts/overlays/ov7251-overlay.dts
340 @@ -20,13 +20,13 @@
341 reg = <0x60>;
342 status = "okay";
343
344 - clocks = <&ov7251_clk>;
345 + clocks = <&cam1_clk>;
346 clock-names = "xclk";
347 clock-frequency = <24000000>;
348
349 - vdddo-supply = <&ov7251_dovdd>;
350 + vdddo-supply = <&cam_dummy_reg>;
351 vdda-supply = <&cam1_reg>;
352 - vddd-supply = <&ov7251_dvdd>;
353 + vddd-supply = <&cam_dummy_reg>;
354
355 rotation = <0>;
356 orientation = <2>;
357 @@ -67,25 +67,10 @@
358 };
359
360 fragment@3 {
361 - target-path="/";
362 + target = <&cam1_clk>;
363 __overlay__ {
364 - ov7251_dovdd: fixedregulator@1 {
365 - compatible = "regulator-fixed";
366 - regulator-name = "ov7251_dovdd";
367 - regulator-min-microvolt = <1800000>;
368 - regulator-max-microvolt = <1800000>;
369 - };
370 - ov7251_dvdd: fixedregulator@2 {
371 - compatible = "regulator-fixed";
372 - regulator-name = "ov7251_dvdd";
373 - regulator-min-microvolt = <1200000>;
374 - regulator-max-microvolt = <1200000>;
375 - };
376 - ov7251_clk: ov7251-clk {
377 - compatible = "fixed-clock";
378 - #clock-cells = <0>;
379 - clock-frequency = <24000000>;
380 - };
381 + status = "okay";
382 + clock-frequency = <24000000>;
383 };
384 };
385
386 @@ -96,16 +81,6 @@
387 };
388 };
389
390 - fragment@5 {
391 - target = <&cam1_reg>;
392 - __overlay__ {
393 - status = "okay";
394 - regulator-name = "ov7251_avdd";
395 - regulator-min-microvolt = <2800000>;
396 - regulator-max-microvolt = <2800000>;
397 - };
398 - };
399 -
400 fragment@6 {
401 target = <&csi1>;
402 __dormant__ {
403 --- a/arch/arm/boot/dts/overlays/ov9281-overlay.dts
404 +++ b/arch/arm/boot/dts/overlays/ov9281-overlay.dts
405 @@ -20,12 +20,12 @@
406 reg = <0x60>;
407 status = "okay";
408
409 - clocks = <&ov9281_clk>;
410 + clocks = <&cam1_clk>;
411 clock-names = "xvclk";
412
413 avdd-supply = <&cam1_reg>;
414 - dovdd-supply = <&ov9281_dovdd>;
415 - dvdd-supply = <&ov9281_dvdd>;
416 + dovdd-supply = <&cam_dummy_reg>;
417 + dvdd-supply = <&cam_dummy_reg>;
418
419 rotation = <0>;
420 orientation = <2>;
421 @@ -67,25 +67,10 @@
422 };
423
424 fragment@3 {
425 - target-path="/";
426 + target = <&cam1_clk>;
427 __overlay__ {
428 - ov9281_dovdd: fixedregulator@1 {
429 - compatible = "regulator-fixed";
430 - regulator-name = "ov9281_dovdd";
431 - regulator-min-microvolt = <1800000>;
432 - regulator-max-microvolt = <1800000>;
433 - };
434 - ov9281_dvdd: fixedregulator@2 {
435 - compatible = "regulator-fixed";
436 - regulator-name = "ov9281_dvdd";
437 - regulator-min-microvolt = <1200000>;
438 - regulator-max-microvolt = <1200000>;
439 - };
440 - ov9281_clk: ov9281-clk {
441 - compatible = "fixed-clock";
442 - #clock-cells = <0>;
443 - clock-frequency = <24000000>;
444 - };
445 + status = "okay";
446 + clock-frequency = <24000000>;
447 };
448 };
449
450 @@ -97,16 +82,6 @@
451 };
452
453 fragment@5 {
454 - target = <&cam1_reg>;
455 - __overlay__ {
456 - status = "okay";
457 - regulator-name = "ov9281_avdd";
458 - regulator-min-microvolt = <2800000>;
459 - regulator-max-microvolt = <2800000>;
460 - };
461 - };
462 -
463 - fragment@6 {
464 target = <&csi1>;
465 __overlay__ {
466 brcm,media-controller;
467 @@ -116,6 +91,6 @@
468 __overrides__ {
469 rotation = <&ov9281>,"rotation:0";
470 orientation = <&ov9281>,"orientation:0";
471 - media-controller = <0>,"=6";
472 + media-controller = <0>,"=5";
473 };
474 };