bcm27xx: switch to 5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0658-overlays-Add-overlay-for-imx378-sensor.patch
1 From 07dad18a058170c0bfd38fd1f0eb21407efcbafb Mon Sep 17 00:00:00 2001
2 From: David Plowman <david.plowman@raspberrypi.com>
3 Date: Tue, 29 Jun 2021 14:41:15 +0100
4 Subject: [PATCH] overlays: Add overlay for imx378 sensor
5
6 This is based off a common overlay which is now also used by the
7 imx477 sensor.
8
9 Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 9 ++
13 arch/arm/boot/dts/overlays/imx378-overlay.dts | 10 ++
14 arch/arm/boot/dts/overlays/imx477-overlay.dts | 109 +-----------------
15 .../boot/dts/overlays/imx477_378-overlay.dtsi | 108 +++++++++++++++++
16 5 files changed, 131 insertions(+), 106 deletions(-)
17 create mode 100644 arch/arm/boot/dts/overlays/imx378-overlay.dts
18 create mode 100644 arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
19
20 --- a/arch/arm/boot/dts/overlays/Makefile
21 +++ b/arch/arm/boot/dts/overlays/Makefile
22 @@ -94,6 +94,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
23 ilitek251x.dtbo \
24 imx219.dtbo \
25 imx290.dtbo \
26 + imx378.dtbo \
27 imx477.dtbo \
28 iqaudio-codec.dtbo \
29 iqaudio-dac.dtbo \
30 --- a/arch/arm/boot/dts/overlays/README
31 +++ b/arch/arm/boot/dts/overlays/README
32 @@ -1674,6 +1674,15 @@ Params: 4lane Enable 4
33 mono Denote that the module is a mono sensor.
34
35
36 +Name: imx378
37 +Info: Sony IMX378 camera module.
38 + Uses Unicam 1, which is the standard camera connector on most Pi
39 + variants.
40 +Load: dtoverlay=imx378,<param>=<val>
41 +Params: rotation Mounting rotation of the camera sensor (0 or
42 + 180, default 180)
43 +
44 +
45 Name: imx477
46 Info: Sony IMX477 camera module.
47 Uses Unicam 1, which is the standard camera connector on most Pi
48 --- /dev/null
49 +++ b/arch/arm/boot/dts/overlays/imx378-overlay.dts
50 @@ -0,0 +1,10 @@
51 +// SPDX-License-Identifier: GPL-2.0-only
52 +// Definitions for IMX378 camera module on VC I2C bus
53 +/dts-v1/;
54 +/plugin/;
55 +
56 +#include "imx477_378-overlay.dtsi"
57 +
58 +&imx477 {
59 + compatible = "sony,imx378";
60 +};
61 --- a/arch/arm/boot/dts/overlays/imx477-overlay.dts
62 +++ b/arch/arm/boot/dts/overlays/imx477-overlay.dts
63 @@ -3,111 +3,8 @@
64 /dts-v1/;
65 /plugin/;
66
67 -#include <dt-bindings/gpio/gpio.h>
68 +#include "imx477_378-overlay.dtsi"
69
70 -/{
71 - compatible = "brcm,bcm2835";
72 -
73 - fragment@0 {
74 - target = <&i2c_csi_dsi>;
75 - __overlay__ {
76 - #address-cells = <1>;
77 - #size-cells = <0>;
78 - status = "okay";
79 -
80 - imx477: imx477@1a {
81 - compatible = "sony,imx477";
82 - reg = <0x1a>;
83 - status = "okay";
84 -
85 - clocks = <&imx477_clk>;
86 - clock-names = "xclk";
87 -
88 - VANA-supply = <&cam1_reg>; /* 2.8v */
89 - VDIG-supply = <&imx477_vdig>; /* 1.05v */
90 - VDDL-supply = <&imx477_vddl>; /* 1.8v */
91 -
92 - rotation = <180>;
93 -
94 - port {
95 - imx477_0: endpoint {
96 - remote-endpoint = <&csi1_ep>;
97 - clock-lanes = <0>;
98 - data-lanes = <1 2>;
99 - clock-noncontinuous;
100 - link-frequencies =
101 - /bits/ 64 <450000000>;
102 - };
103 - };
104 - };
105 - };
106 - };
107 -
108 - fragment@1 {
109 - target = <&csi1>;
110 - __overlay__ {
111 - status = "okay";
112 -
113 - port {
114 - csi1_ep: endpoint {
115 - remote-endpoint = <&imx477_0>;
116 - clock-lanes = <0>;
117 - data-lanes = <1 2>;
118 - clock-noncontinuous;
119 - };
120 - };
121 - };
122 - };
123 -
124 - fragment@2 {
125 - target = <&i2c0if>;
126 - __overlay__ {
127 - status = "okay";
128 - };
129 - };
130 -
131 - fragment@3 {
132 - target-path="/";
133 - __overlay__ {
134 - imx477_vdig: fixedregulator@0 {
135 - compatible = "regulator-fixed";
136 - regulator-name = "imx477_vdig";
137 - regulator-min-microvolt = <1050000>;
138 - regulator-max-microvolt = <1050000>;
139 - };
140 - imx477_vddl: fixedregulator@1 {
141 - compatible = "regulator-fixed";
142 - regulator-name = "imx477_vddl";
143 - regulator-min-microvolt = <1800000>;
144 - regulator-max-microvolt = <1800000>;
145 - };
146 - imx477_clk: camera-clk {
147 - compatible = "fixed-clock";
148 - #clock-cells = <0>;
149 - clock-frequency = <24000000>;
150 - };
151 - };
152 - };
153 -
154 - fragment@4 {
155 - target = <&i2c0mux>;
156 - __overlay__ {
157 - status = "okay";
158 - };
159 - };
160 -
161 - fragment@5 {
162 - target = <&cam1_reg>;
163 - __overlay__ {
164 - status = "okay";
165 - regulator-name = "imx477_vana";
166 - startup-delay-us = <300000>;
167 - regulator-min-microvolt = <2800000>;
168 - regulator-max-microvolt = <2800000>;
169 - };
170 - };
171 -
172 - __overrides__ {
173 - rotation = <&imx477>,"rotation:0";
174 - };
175 +&imx477 {
176 + compatible = "sony,imx477";
177 };
178 --- /dev/null
179 +++ b/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
180 @@ -0,0 +1,108 @@
181 +// SPDX-License-Identifier: GPL-2.0-only
182 +// Definitions for IMX477 camera module on VC I2C bus
183 +
184 +/{
185 + compatible = "brcm,bcm2835";
186 +
187 + fragment@0 {
188 + target = <&i2c_csi_dsi>;
189 + __overlay__ {
190 + #address-cells = <1>;
191 + #size-cells = <0>;
192 + status = "okay";
193 +
194 + imx477: imx477@1a {
195 + reg = <0x1a>;
196 + status = "okay";
197 +
198 + clocks = <&imx477_clk>;
199 + clock-names = "xclk";
200 +
201 + VANA-supply = <&cam1_reg>; /* 2.8v */
202 + VDIG-supply = <&imx477_vdig>; /* 1.05v */
203 + VDDL-supply = <&imx477_vddl>; /* 1.8v */
204 +
205 + rotation = <180>;
206 +
207 + port {
208 + imx477_0: endpoint {
209 + remote-endpoint = <&csi1_ep>;
210 + clock-lanes = <0>;
211 + data-lanes = <1 2>;
212 + clock-noncontinuous;
213 + link-frequencies =
214 + /bits/ 64 <450000000>;
215 + };
216 + };
217 + };
218 + };
219 + };
220 +
221 + fragment@1 {
222 + target = <&csi1>;
223 + __overlay__ {
224 + status = "okay";
225 +
226 + port {
227 + csi1_ep: endpoint {
228 + remote-endpoint = <&imx477_0>;
229 + clock-lanes = <0>;
230 + data-lanes = <1 2>;
231 + clock-noncontinuous;
232 + };
233 + };
234 + };
235 + };
236 +
237 + fragment@2 {
238 + target = <&i2c0if>;
239 + __overlay__ {
240 + status = "okay";
241 + };
242 + };
243 +
244 + fragment@3 {
245 + target-path="/";
246 + __overlay__ {
247 + imx477_vdig: fixedregulator@0 {
248 + compatible = "regulator-fixed";
249 + regulator-name = "imx477_vdig";
250 + regulator-min-microvolt = <1050000>;
251 + regulator-max-microvolt = <1050000>;
252 + };
253 + imx477_vddl: fixedregulator@1 {
254 + compatible = "regulator-fixed";
255 + regulator-name = "imx477_vddl";
256 + regulator-min-microvolt = <1800000>;
257 + regulator-max-microvolt = <1800000>;
258 + };
259 + imx477_clk: camera-clk {
260 + compatible = "fixed-clock";
261 + #clock-cells = <0>;
262 + clock-frequency = <24000000>;
263 + };
264 + };
265 + };
266 +
267 + fragment@4 {
268 + target = <&i2c0mux>;
269 + __overlay__ {
270 + status = "okay";
271 + };
272 + };
273 +
274 + fragment@5 {
275 + target = <&cam1_reg>;
276 + __overlay__ {
277 + status = "okay";
278 + regulator-name = "imx477_vana";
279 + startup-delay-us = <300000>;
280 + regulator-min-microvolt = <2800000>;
281 + regulator-max-microvolt = <2800000>;
282 + };
283 + };
284 +
285 + __overrides__ {
286 + rotation = <&imx477>,"rotation:0";
287 + };
288 +};