Skip to content

Commit 67dba93

Browse files
bemug-stpelwell
authored andcommitted
overlays: Add vd56g3 and vd66gy camera sensors overlays
Provide two device trees : vd56g3 is monochrome, while vd66gy is RGB. Factorize most of the definitions in vd56g3_vd66gy-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 1663120 commit 67dba93

File tree

5 files changed

+182
-0
lines changed

5 files changed

+182
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
346346
vc4-kms-v3d-pi4.dtbo \
347347
vc4-kms-v3d-pi5.dtbo \
348348
vc4-kms-vga666.dtbo \
349+
vd56g3.dtbo \
350+
vd66gy.dtbo \
349351
vec-gpio-pi5.dtbo \
350352
vga666.dtbo \
351353
vl805.dtbo \

arch/arm/boot/dts/overlays/README

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

58685868

5869+
Name: vd56g3
5870+
Info: ST VD56G3 camera module.
5871+
Uses Unicam 1, which is the standard camera connector on most Pi
5872+
variants.
5873+
Load: dtoverlay=vd56g3,<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+
5884+
Name: vd66gy
5885+
Info: ST VD66GY camera module.
5886+
Uses Unicam 1, which is the standard camera connector on most Pi
5887+
variants.
5888+
Load: dtoverlay=vd66gy,<param>=<val>
5889+
Params: rotation Mounting rotation of the camera sensor (0 or
5890+
180, default 0)
5891+
orientation Sensor orientation (0 = front, 1 = rear,
5892+
2 = external, default external)
5893+
media-controller Configure use of Media Controller API for
5894+
configuring the sensor (default on)
5895+
cam0 Adopt the default configuration for CAM0 on a
5896+
Compute Module (CSI0, i2c_vc, and cam0_reg).
5897+
5898+
58695899
Name: vec-gpio-pi5
58705900
Info: Overlay to output composite video as an 8-bit digital code over GPIO
58715901
pins 4-11, for Raspberry Pi 5 series only. Requires composite video
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 VD56G3 camera module on VC I2C bus
3+
4+
/dts-v1/;
5+
/plugin/;
6+
7+
#include <dt-bindings/gpio/gpio.h>
8+
#include "vd56g3_vd66gy-overlay.dtsi"
9+
10+
/{
11+
compatible = "brcm,bcm2835";
12+
13+
// Fragment numbers deliberately high to avoid conflicts with the
14+
// included vd56g3_vd66gy overlay file.
15+
16+
fragment@101 {
17+
target = <&cam_node>;
18+
__overlay__ {
19+
compatible = "st,vd56g3";
20+
};
21+
};
22+
};
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
port {
52+
cam_endpoint: endpoint {
53+
clock-lanes = <0>;
54+
data-lanes = <1 2>;
55+
clock-noncontinuous;
56+
link-frequencies =
57+
/bits/ 64 <402000000>;
58+
lane-polarities = <1 1 1>;
59+
};
60+
};
61+
};
62+
};
63+
};
64+
65+
csi_frag: fragment@4 {
66+
target = <&csi1>;
67+
csi: __overlay__ {
68+
status = "okay";
69+
70+
port {
71+
csi_ep: endpoint {
72+
remote-endpoint = <&cam_endpoint>;
73+
clock-lanes = <0>;
74+
data-lanes = <1 2>;
75+
clock-noncontinuous;
76+
};
77+
};
78+
};
79+
};
80+
81+
fragment@5 {
82+
target = <&csi1>;
83+
__dormant__ {
84+
compatible = "brcm,bcm2835-unicam-legacy";
85+
};
86+
};
87+
88+
__overrides__ {
89+
rotation = <&cam_node>,"rotation:0";
90+
orientation = <&cam_node>,"orientation:0";
91+
media-controller = <0>,"!5";
92+
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
93+
<&csi_frag>, "target:0=",<&csi0>,
94+
<&clk_frag>, "target:0=",<&cam0_clk>,
95+
<&cam_node>, "clocks:0=",<&cam0_clk>,
96+
<&cam_node>, "vana-supply:0=",<&cam0_reg>;
97+
};
98+
};
99+
100+
&cam_node {
101+
status = "okay";
102+
};
103+
104+
&cam_endpoint {
105+
remote-endpoint = <&csi_ep>;
106+
};
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 VD66GY camera module on VC I2C bus
3+
4+
/dts-v1/;
5+
/plugin/;
6+
7+
#include <dt-bindings/gpio/gpio.h>
8+
#include "vd56g3_vd66gy-overlay.dtsi"
9+
10+
/{
11+
compatible = "brcm,bcm2835";
12+
13+
// Fragment numbers deliberately high to avoid conflicts with the
14+
// included vd56g3_vd66gy overlay file.
15+
16+
fragment@101 {
17+
target = <&cam_node>;
18+
__overlay__ {
19+
compatible = "st,vd66gy";
20+
};
21+
};
22+
};

0 commit comments

Comments
 (0)