Skip to content

Commit 85f9ed0

Browse files
bemug-stpelwell
authored andcommitted
overlays: Add vd55g1 and vd65g4 camera sensors overlays
Provide two device trees : vd55g1 is monochrome, while vd65g4 is RGB. Factorize most of the definitions in vd55g1_vd65g4-overlay.dtsi and describe the overlays in README. Support both cam0 and cam1 interfaces with raspberry pi __overrides__ mechanism. Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
1 parent 67dba93 commit 85f9ed0

File tree

5 files changed

+184
-0
lines changed

5 files changed

+184
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
346346
vc4-kms-v3d-pi4.dtbo \
347347
vc4-kms-v3d-pi5.dtbo \
348348
vc4-kms-vga666.dtbo \
349+
vd55g1.dtbo \
349350
vd56g3.dtbo \
351+
vd65g4.dtbo \
350352
vd66gy.dtbo \
351353
vec-gpio-pi5.dtbo \
352354
vga666.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5866,6 +5866,21 @@ Params: ddc Enables GPIOs 0&1 as the I2C to read the EDID
58665866
GPIOs, therefore level shifters are required.
58675867

58685868

5869+
Name: vd55g1
5870+
Info: ST VD55G1 camera module.
5871+
Uses Unicam 1, which is the standard camera connector on most Pi
5872+
variants.
5873+
Load: dtoverlay=vd55g1,<param>=<val>
5874+
Params: rotation Mounting rotation of the camera sensor (0 or
5875+
180, default 0)
5876+
orientation Sensor orientation (0 = front, 1 = rear,
5877+
2 = external, default external)
5878+
media-controller Configure use of Media Controller API for
5879+
configuring the sensor (default on)
5880+
cam0 Adopt the default configuration for CAM0 on a
5881+
Compute Module (CSI0, i2c_vc, and cam0_reg).
5882+
5883+
58695884
Name: vd56g3
58705885
Info: ST VD56G3 camera module.
58715886
Uses Unicam 1, which is the standard camera connector on most Pi
@@ -5881,6 +5896,21 @@ Params: rotation Mounting rotation of the camera sensor (0 or
58815896
Compute Module (CSI0, i2c_vc, and cam0_reg).
58825897

58835898

5899+
Name: vd65g4
5900+
Info: ST VD65G4 camera module.
5901+
Uses Unicam 1, which is the standard camera connector on most Pi
5902+
variants.
5903+
Load: dtoverlay=vd65g4,<param>=<val>
5904+
Params: rotation Mounting rotation of the camera sensor (0 or
5905+
180, default 0)
5906+
orientation Sensor orientation (0 = front, 1 = rear,
5907+
2 = external, default external)
5908+
media-controller Configure use of Media Controller API for
5909+
configuring the sensor (default on)
5910+
cam0 Adopt the default configuration for CAM0 on a
5911+
Compute Module (CSI0, i2c_vc, and cam0_reg).
5912+
5913+
58845914
Name: vd66gy
58855915
Info: ST VD66GY camera module.
58865916
Uses Unicam 1, which is the standard camera connector on most Pi
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for VD55G1 camera module on VC I2C bus
3+
4+
/dts-v1/;
5+
/plugin/;
6+
7+
#include <dt-bindings/gpio/gpio.h>
8+
#include "vd55g1_vd65g4-overlay.dtsi"
9+
10+
/{
11+
compatible = "brcm,bcm2835";
12+
13+
// Fragment numbers deliberately high to avoid conflicts with the
14+
// included vd55g1_vd65g4 overlay file.
15+
16+
fragment@101 {
17+
target = <&cam_node>;
18+
__overlay__ {
19+
compatible = "st,vd55g1";
20+
};
21+
};
22+
};
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/dts-v1/;
3+
/plugin/;
4+
5+
/{
6+
compatible = "brcm,bcm2835";
7+
8+
fragment@0 {
9+
target = <&i2c0if>;
10+
__overlay__ {
11+
status = "okay";
12+
};
13+
};
14+
15+
clk_frag: fragment@1 {
16+
target = <&cam1_clk>;
17+
__overlay__ {
18+
status = "okay";
19+
clock-frequency = <12000000>;
20+
};
21+
};
22+
23+
fragment@2 {
24+
target = <&i2c0mux>;
25+
__overlay__ {
26+
status = "okay";
27+
};
28+
};
29+
30+
i2c_frag: fragment@3 {
31+
target = <&i2c_csi_dsi>;
32+
__overlay__ {
33+
#address-cells = <1>;
34+
#size-cells = <0>;
35+
status = "okay";
36+
37+
cam_node: cam@10 {
38+
reg = <0x10>;
39+
status = "disabled";
40+
41+
clocks = <&cam1_clk>;
42+
clock-names = "xclk";
43+
44+
vana-supply = <&cam1_reg>; /* 2.8v */
45+
vddio-supply = <&cam_dummy_reg>; /* 1.8v */
46+
vcore-supply = <&cam_dummy_reg>; /* 1.2v */
47+
48+
rotation = <0>;
49+
orientation = <2>;
50+
51+
st,leds = <2>;
52+
53+
port {
54+
cam_endpoint: endpoint {
55+
clock-lanes = <0>;
56+
data-lanes = <1>;
57+
clock-noncontinuous;
58+
link-frequencies =
59+
/bits/ 64 <600000000>;
60+
lane-polarities = <1 1>;
61+
};
62+
};
63+
};
64+
};
65+
};
66+
67+
csi_frag: fragment@4 {
68+
target = <&csi1>;
69+
csi: __overlay__ {
70+
status = "okay";
71+
72+
port {
73+
csi_ep: endpoint {
74+
remote-endpoint = <&cam_endpoint>;
75+
clock-lanes = <0>;
76+
data-lanes = <1>;
77+
clock-noncontinuous;
78+
};
79+
};
80+
};
81+
};
82+
83+
fragment@5 {
84+
target = <&csi1>;
85+
__dormant__ {
86+
compatible = "brcm,bcm2835-unicam-legacy";
87+
};
88+
};
89+
90+
__overrides__ {
91+
rotation = <&cam_node>,"rotation:0";
92+
orientation = <&cam_node>,"orientation:0";
93+
media-controller = <0>,"!5";
94+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
95+
<&csi_frag>, "target:0=",<&csi0>,
96+
<&clk_frag>, "target:0=",<&cam0_clk>,
97+
<&cam_node>, "clocks:0=",<&cam0_clk>,
98+
<&cam_node>, "vana-supply:0=",<&cam0_reg>;
99+
};
100+
};
101+
102+
&cam_node {
103+
status = "okay";
104+
};
105+
106+
&cam_endpoint {
107+
remote-endpoint = <&csi_ep>;
108+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for VD65G4 camera module on VC I2C bus
3+
4+
/dts-v1/;
5+
/plugin/;
6+
7+
#include <dt-bindings/gpio/gpio.h>
8+
#include "vd55g1_vd65g4-overlay.dtsi"
9+
10+
/{
11+
compatible = "brcm,bcm2835";
12+
13+
// Fragment numbers deliberately high to avoid conflicts with the
14+
// included vd55g1_vd65g4 overlay file.
15+
16+
fragment@101 {
17+
target = <&cam_node>;
18+
__overlay__ {
19+
compatible = "st,vd65g4";
20+
};
21+
};
22+
};

0 commit comments

Comments
 (0)