1 From 7782ca4dcb10a244ae476126220890a0843c439e Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 6 Jan 2021 17:28:57 +0000
4 Subject: [PATCH] dt: Add a camera regulator node to all downstream Pi
7 The current firmware fixup of camera sensor overlays is not
8 particularly nice, and it stops you being able to load them
10 It's also incompatible with creating a simple DT that can be
11 loaded for both CAM1 and CAM0 on a CM as they would both
12 try to claim the one GPIO.
14 Almost all sensors have a hook of some form for a regulator, so
15 it's relatively straightforward to convert them all to use a
16 fixed regulator with GPIO control.
18 Add a fixed regulator node for each platform with the GPIO
19 correctly configured for the camera shutdown line. (The LED line
22 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
24 arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 5 +++++
25 arch/arm/boot/dts/bcm2708-rpi-b-rev1.dts | 5 +++++
26 arch/arm/boot/dts/bcm2708-rpi-b.dts | 5 +++++
27 arch/arm/boot/dts/bcm2708-rpi-cm.dts | 15 +++++++++++++++
28 arch/arm/boot/dts/bcm2708-rpi-zero-w.dts | 5 +++++
29 arch/arm/boot/dts/bcm2708-rpi-zero.dts | 5 +++++
30 arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 5 +++++
31 arch/arm/boot/dts/bcm2710-rpi-2-b.dts | 5 +++++
32 arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts | 5 +++++
33 arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 5 +++++
34 arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 15 +++++++++++++++
35 arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 5 +++++
36 arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 8 ++++++++
37 arch/arm/boot/dts/bcm283x-rpi-cam1-regulator.dtsi | 10 ++++++++++
38 14 files changed, 98 insertions(+)
39 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-cam1-regulator.dtsi
41 --- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
42 +++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
44 #include "bcm283x-rpi-smsc9514.dtsi"
45 #include "bcm283x-rpi-csi1-2lane.dtsi"
46 #include "bcm283x-rpi-i2c0mux_0_28.dtsi"
47 +#include "bcm283x-rpi-cam1-regulator.dtsi"
50 compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
52 pinctrl-0 = <&audio_pins>;
56 + gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
61 act_led_gpio = <&act_led>,"gpios:4";
62 --- a/arch/arm/boot/dts/bcm2708-rpi-b-rev1.dts
63 +++ b/arch/arm/boot/dts/bcm2708-rpi-b-rev1.dts
65 #include "bcm2708-rpi.dtsi"
66 #include "bcm283x-rpi-smsc9512.dtsi"
67 #include "bcm283x-rpi-csi1-2lane.dtsi"
68 +#include "bcm283x-rpi-cam1-regulator.dtsi"
71 compatible = "raspberrypi,model-b", "brcm,bcm2835";
72 @@ -118,6 +119,10 @@ i2c_csi_dsi: &i2c1 {
73 pinctrl-0 = <&audio_pins>;
77 + gpio = <&gpio 27 GPIO_ACTIVE_HIGH>;
82 act_led_gpio = <&act_led>,"gpios:4";
83 --- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
84 +++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
86 #include "bcm283x-rpi-smsc9512.dtsi"
87 #include "bcm283x-rpi-csi1-2lane.dtsi"
88 #include "bcm283x-rpi-i2c0mux_0_28.dtsi"
89 +#include "bcm283x-rpi-cam1-regulator.dtsi"
92 compatible = "raspberrypi,model-b", "brcm,bcm2835";
94 pinctrl-0 = <&audio_pins>;
98 + gpio = <&gpio 21 GPIO_ACTIVE_HIGH>;
103 act_led_gpio = <&act_led>,"gpios:4";
104 --- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts
105 +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts
108 compatible = "raspberrypi,compute-module", "brcm,bcm2835";
109 model = "Raspberry Pi Compute Module";
111 + cam1_reg: cam1_reg {
112 + compatible = "regulator-fixed";
113 + regulator-name = "cam1-regulator";
114 + gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
115 + enable-active-high;
116 + status = "disabled";
118 + cam0_reg: cam0_reg {
119 + compatible = "regulator-fixed";
120 + regulator-name = "cam0-regulator";
121 + gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
122 + enable-active-high;
123 + status = "disabled";
128 --- a/arch/arm/boot/dts/bcm2708-rpi-zero-w.dts
129 +++ b/arch/arm/boot/dts/bcm2708-rpi-zero-w.dts
131 #include "bcm283x-rpi-csi1-2lane.dtsi"
132 #include "bcm283x-rpi-i2c0mux_0_28.dtsi"
133 #include "bcm2708-rpi-bt.dtsi"
134 +#include "bcm283x-rpi-cam1-regulator.dtsi"
137 compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
139 brcm,disable-headphones = <1>;
143 + gpio = <&gpio 44 GPIO_ACTIVE_HIGH>;
148 act_led_gpio = <&act_led>,"gpios:4";
149 --- a/arch/arm/boot/dts/bcm2708-rpi-zero.dts
150 +++ b/arch/arm/boot/dts/bcm2708-rpi-zero.dts
152 #include "bcm2708-rpi.dtsi"
153 #include "bcm283x-rpi-csi1-2lane.dtsi"
154 #include "bcm283x-rpi-i2c0mux_0_28.dtsi"
155 +#include "bcm283x-rpi-cam1-regulator.dtsi"
158 compatible = "raspberrypi,model-zero", "brcm,bcm2835";
160 brcm,disable-headphones = <1>;
164 + gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
169 act_led_gpio = <&act_led>,"gpios:4";
170 --- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
171 +++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
173 #include "bcm283x-rpi-smsc9514.dtsi"
174 #include "bcm283x-rpi-csi1-2lane.dtsi"
175 #include "bcm283x-rpi-i2c0mux_0_28.dtsi"
176 +#include "bcm283x-rpi-cam1-regulator.dtsi"
179 compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
181 pinctrl-0 = <&audio_pins>;
185 + gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
190 act_led_gpio = <&act_led>,"gpios:4";
191 --- a/arch/arm/boot/dts/bcm2710-rpi-2-b.dts
192 +++ b/arch/arm/boot/dts/bcm2710-rpi-2-b.dts
194 #include "bcm283x-rpi-smsc9514.dtsi"
195 #include "bcm283x-rpi-csi1-2lane.dtsi"
196 #include "bcm283x-rpi-i2c0mux_0_28.dtsi"
197 +#include "bcm283x-rpi-cam1-regulator.dtsi"
200 compatible = "raspberrypi,2-model-b-rev2", "brcm,bcm2837";
202 pinctrl-0 = <&audio_pins>;
206 + gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
211 act_led_gpio = <&act_led>,"gpios:4";
212 --- a/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts
213 +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts
215 #include "bcm283x-rpi-csi1-2lane.dtsi"
216 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
217 #include "bcm271x-rpi-bt.dtsi"
218 +#include "bcm283x-rpi-cam1-regulator.dtsi"
221 compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
223 microchip,downshift-after = <2>;
227 + gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
232 act_led_gpio = <&act_led>,"gpios:4";
233 --- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
234 +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
236 #include "bcm283x-rpi-csi1-2lane.dtsi"
237 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
238 #include "bcm271x-rpi-bt.dtsi"
239 +#include "bcm283x-rpi-cam1-regulator.dtsi"
242 compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
244 pinctrl-0 = <&audio_pins>;
248 + gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
253 act_led_gpio = <&act_led>,"gpios:4";
254 --- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
255 +++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
258 compatible = "raspberrypi,3-compute-module", "brcm,bcm2837";
259 model = "Raspberry Pi Compute Module 3";
261 + cam1_reg: cam1_reg {
262 + compatible = "regulator-fixed";
263 + regulator-name = "cam1-regulator";
264 + gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
265 + enable-active-high;
266 + status = "disabled";
268 + cam0_reg: cam0_reg {
269 + compatible = "regulator-fixed";
270 + regulator-name = "cam0-regulator";
271 + gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
272 + enable-active-high;
273 + status = "disabled";
278 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
279 +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
281 #include "bcm2711-rpi.dtsi"
282 #include "bcm283x-rpi-csi1-2lane.dtsi"
283 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
284 +#include "bcm283x-rpi-cam1-regulator.dtsi"
289 pinctrl-0 = <&audio_pins>;
293 + gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
298 act_led_gpio = <&act_led>,"gpios:4";
299 --- a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
300 +++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
304 /delete-node/ wifi-pwrseq;
306 + cam0_reg: cam1_reg: cam1_reg {
307 + compatible = "regulator-fixed";
308 + regulator-name = "cam1-reg";
309 + gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
310 + enable-active-high;
311 + status = "disabled";
317 +++ b/arch/arm/boot/dts/bcm283x-rpi-cam1-regulator.dtsi
319 +// SPDX-License-Identifier: GPL-2.0
322 + cam1_reg: cam1_reg {
323 + compatible = "regulator-fixed";
324 + regulator-name = "cam1-reg";
325 + enable-active-high;
326 + status = "disabled";