Skip to content

Commit 9df43d4

Browse files
6by9pelwell
authored andcommitted
dtoverlays: Add option to select camera as on CAM0 of CM
Parameterise the overlays so that they can have an optional cam0 parameter to switch to i2c_vc and csi0. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 7a43536 commit 9df43d4

14 files changed

+221
-213
lines changed

arch/arm/boot/dts/bcm2708-rpi-cm.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
&cam1_reg {
1414
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
15+
status = "disabled";
1516
};
1617

1718
cam0_reg: &cam0_regulator {

arch/arm/boot/dts/bcm2708-rpi-cm.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
act_led_gpio = <&act_led>,"gpios:4";
1515
act_led_activelow = <&act_led>,"gpios:8";
1616
act_led_trigger = <&act_led>,"linux,default-trigger";
17+
cam0_reg = <&cam0_reg>,"status";
18+
cam0_reg_gpio = <&cam0_reg>,"gpios:4";
19+
cam1_reg = <&cam1_reg>,"status";
20+
cam1_reg_gpio = <&cam1_reg>,"gpios:4";
1721
};
1822
};

arch/arm/boot/dts/bcm2710-rpi-cm3.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
&cam1_reg {
1414
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
15+
status = "disabled";
1516
};
1617

1718
cam0_reg: &cam0_regulator {
@@ -137,5 +138,9 @@ cam0_reg: &cam0_regulator {
137138
act_led_gpio = <&act_led>,"gpios:4";
138139
act_led_activelow = <&act_led>,"gpios:8";
139140
act_led_trigger = <&act_led>,"linux,default-trigger";
141+
cam0_reg = <&cam0_reg>,"status";
142+
cam0_reg_gpio = <&cam0_reg>,"gpios:4";
143+
cam1_reg = <&cam1_reg>,"status";
144+
cam1_reg_gpio = <&cam1_reg>,"gpios:4";
140145
};
141146
};

arch/arm/boot/dts/bcm2711-rpi-cm4s.dts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,6 @@
162162
bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1";
163163
};
164164

165-
cam1_reg: cam1_reg {
166-
compatible = "regulator-fixed";
167-
regulator-name = "cam1-regulator";
168-
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
169-
enable-active-high;
170-
status = "disabled";
171-
};
172-
cam0_reg: cam0_reg {
173-
compatible = "regulator-fixed";
174-
regulator-name = "cam0-regulator";
175-
gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
176-
enable-active-high;
177-
status = "disabled";
178-
};
179-
180165
aliases {
181166
serial0 = &uart0;
182167
mmc0 = &emmc2;
@@ -399,6 +384,16 @@
399384
brcm,disable-headphones = <1>;
400385
};
401386

387+
&cam1_reg {
388+
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
389+
status = "disabled";
390+
};
391+
392+
cam0_reg: &cam0_regulator {
393+
gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
394+
status = "disabled";
395+
};
396+
402397
/ {
403398
__overrides__ {
404399
act_led_gpio = <&act_led>,"gpios:4";

arch/arm/boot/dts/overlays/README

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ Params:
144144
See /sys/kernel/debug/raspberrypi_axi_monitor
145145
for the results.
146146

147+
cam0_reg Enables CAM 0 regulator. CM1 & 3 only.
148+
149+
cam0_reg_gpio Set GPIO for CAM 0 regulator. Default 30.
150+
CM1 & 3 only.
151+
152+
cam1_reg Enables CAM 1 regulator. CM1 & 3 only.
153+
154+
cam1_reg_gpio Set GPIO for CAM 1 regulator. Default 2.
155+
CM1 & 3 only.
156+
147157
eee Enable Energy Efficient Ethernet support for
148158
compatible devices (default "on"). See also
149159
"tx_lpi_timer". Pi3B+ only.
@@ -1845,6 +1855,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
18451855
2 = external, default external)
18461856
media-controller Configure use of Media Controller API for
18471857
configuring the sensor (default on)
1858+
cam0 Adopt the default configuration for CAM0 on a
1859+
Compute Module (CSI0, i2c_vc, and cam0_reg).
18481860

18491861

18501862
Name: imx290
@@ -1867,6 +1879,8 @@ Params: 4lane Enable 4 CSI2 lanes. This requires a Compute
18671879
180, default 0)
18681880
media-controller Configure use of Media Controller API for
18691881
configuring the sensor (default on)
1882+
cam0 Adopt the default configuration for CAM0 on a
1883+
Compute Module (CSI0, i2c_vc, and cam0_reg).
18701884

18711885

18721886
Name: imx378
@@ -1880,6 +1894,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
18801894
2 = external, default external)
18811895
media-controller Configure use of Media Controller API for
18821896
configuring the sensor (default on)
1897+
cam0 Adopt the default configuration for CAM0 on a
1898+
Compute Module (CSI0, i2c_vc, and cam0_reg).
18831899

18841900

18851901
Name: imx477
@@ -1893,6 +1909,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
18931909
2 = external, default external)
18941910
media-controller Configure use of Media Controller API for
18951911
configuring the sensor (default on)
1912+
cam0 Adopt the default configuration for CAM0 on a
1913+
Compute Module (CSI0, i2c_vc, and cam0_reg).
18961914

18971915

18981916
Name: imx519
@@ -1906,6 +1924,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
19061924
2 = external, default external)
19071925
media-controller Configure use of Media Controller API for
19081926
configuring the sensor (default on)
1927+
cam0 Adopt the default configuration for CAM0 on a
1928+
Compute Module (CSI0, i2c_vc, and cam0_reg).
19091929

19101930

19111931
Name: iqaudio-codec
@@ -1972,6 +1992,8 @@ Info: Infineon irs1125 TOF camera module.
19721992
Load: dtoverlay=irs1125,<param>=<val>
19731993
Params: media-controller Configure use of Media Controller API for
19741994
configuring the sensor (default off)
1995+
cam0 Adopt the default configuration for CAM0 on a
1996+
Compute Module (CSI0, i2c_vc, and cam0_reg).
19751997

19761998

19771999
Name: jedec-spi-nor
@@ -2385,6 +2407,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
23852407
2 = external, default external)
23862408
media-controller Configure use of Media Controller API for
23872409
configuring the sensor (default on)
2410+
cam0 Adopt the default configuration for CAM0 on a
2411+
Compute Module (CSI0, i2c_vc, and cam0_reg).
23882412

23892413

23902414
Name: ov7251
@@ -2398,6 +2422,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
23982422
2 = external, default external)
23992423
media-controller Configure use of Media Controller API for
24002424
configuring the sensor (default off)
2425+
cam0 Adopt the default configuration for CAM0 on a
2426+
Compute Module (CSI0, i2c_vc, and cam0_reg).
24012427

24022428

24032429
Name: ov9281
@@ -2411,6 +2437,8 @@ Params: rotation Mounting rotation of the camera sensor (0 or
24112437
2 = external, default external)
24122438
media-controller Configure use of Media Controller API for
24132439
configuring the sensor (default on)
2440+
cam0 Adopt the default configuration for CAM0 on a
2441+
Compute Module (CSI0, i2c_vc, and cam0_reg).
24142442

24152443

24162444
Name: papirus
@@ -3393,6 +3421,8 @@ Params: 4lane Use 4 lanes (only applicable to Compute Modules
33933421
are supported by the driver.
33943422
media-controller Configure use of Media Controller API for
33953423
configuring the sensor (default off)
3424+
cam0 Adopt the default configuration for CAM0 on a
3425+
Compute Module (CSI0, i2c_vc, and cam0_reg).
33963426

33973427

33983428
Name: tc358743-audio

arch/arm/boot/dts/overlays/imx219-overlay.dts

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@
99
compatible = "brcm,bcm2835";
1010

1111
fragment@0 {
12+
target = <&i2c0if>;
13+
__overlay__ {
14+
status = "okay";
15+
};
16+
};
17+
18+
clk_frag: fragment@1 {
19+
target = <&cam1_clk>;
20+
__overlay__ {
21+
status = "okay";
22+
clock-frequency = <24000000>;
23+
};
24+
};
25+
26+
fragment@2 {
27+
target = <&i2c0mux>;
28+
__overlay__ {
29+
status = "okay";
30+
};
31+
};
32+
33+
i2c_frag: fragment@100 {
1234
target = <&i2c_csi_dsi>;
1335
__overlay__ {
1436
#address-cells = <1>;
@@ -32,7 +54,7 @@
3254

3355
port {
3456
imx219_0: endpoint {
35-
remote-endpoint = <&csi1_ep>;
57+
remote-endpoint = <&csi_ep>;
3658
clock-lanes = <0>;
3759
data-lanes = <1 2>;
3860
clock-noncontinuous;
@@ -44,13 +66,14 @@
4466
};
4567
};
4668

47-
fragment@1 {
69+
csi_frag: fragment@101 {
4870
target = <&csi1>;
49-
__overlay__ {
71+
csi: __overlay__ {
5072
status = "okay";
73+
brcm,media-controller;
5174

5275
port {
53-
csi1_ep: endpoint {
76+
csi_ep: endpoint {
5477
remote-endpoint = <&imx219_0>;
5578
clock-lanes = <0>;
5679
data-lanes = <1 2>;
@@ -60,38 +83,14 @@
6083
};
6184
};
6285

63-
fragment@2 {
64-
target = <&i2c0if>;
65-
__overlay__ {
66-
status = "okay";
67-
};
68-
};
69-
70-
fragment@3 {
71-
target = <&cam1_clk>;
72-
__overlay__ {
73-
status = "okay";
74-
clock-frequency = <24000000>;
75-
};
76-
};
77-
78-
fragment@4 {
79-
target = <&i2c0mux>;
80-
__overlay__ {
81-
status = "okay";
82-
};
83-
};
84-
85-
fragment@5 {
86-
target = <&csi1>;
87-
__overlay__ {
88-
brcm,media-controller;
89-
};
90-
};
91-
9286
__overrides__ {
9387
rotation = <&imx219>,"rotation:0";
9488
orientation = <&imx219>,"orientation:0";
95-
media-controller = <0>,"=5";
89+
media-controller = <&csi>,"brcm,media-controller?";
90+
cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
91+
<&csi_frag>, "target:0=",<&csi0>,
92+
<&clk_frag>, "target:0=",<&cam0_clk>,
93+
<&imx219>, "clocks:0=",<&cam0_clk>,
94+
<&imx219>, "VANA-supply:0=",<&cam0_reg>;
9695
};
9796
};

arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/{
1010
compatible = "brcm,bcm2835";
1111

12-
fragment@0 {
12+
i2c_frag: fragment@0 {
1313
target = <&i2c_csi_dsi>;
1414
__overlay__ {
1515
#address-cells = <1>;
@@ -41,10 +41,11 @@
4141
};
4242
};
4343

44-
fragment@1 {
44+
csi_frag: fragment@1 {
4545
target = <&csi1>;
46-
__overlay__ {
46+
csi: __overlay__ {
4747
status = "okay";
48+
brcm,media-controller;
4849

4950
port {
5051
csi1_ep: endpoint {
@@ -61,9 +62,9 @@
6162
};
6263
};
6364

64-
fragment@3 {
65+
clk_frag: fragment@3 {
6566
target = <&cam1_clk>;
66-
__overlay__ {
67+
cam_clk: __overlay__ {
6768
status = "okay";
6869
clock-frequency = <37125000>;
6970
};
@@ -108,19 +109,17 @@
108109
};
109110
};
110111

111-
fragment@10 {
112-
target = <&csi1>;
113-
__overlay__ {
114-
brcm,media-controller;
115-
};
116-
};
117-
118112
__overrides__ {
119113
4lane = <0>, "-6+7-8+9";
120-
clock-frequency = <&cam1_clk>,"clock-frequency:0",
114+
clock-frequency = <&cam_clk>,"clock-frequency:0",
121115
<&imx290>,"clock-frequency:0";
122116
rotation = <&imx290>,"rotation:0";
123117
orientation = <&imx290>,"orientation:0";
124-
media-controller = <0>,"=10";
118+
media-controller = <&csi>,"brcm,media-controller?";
119+
cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
120+
<&csi_frag>, "target:0=",<&csi0>,
121+
<&clk_frag>, "target:0=",<&cam0_clk>,
122+
<&imx290>, "clocks:0=",<&cam0_clk>,
123+
<&imx290>, "vdda-supply:0=",<&cam0_reg>;
125124
};
126125
};

0 commit comments

Comments
 (0)