Skip to content

Commit e4ae7fd

Browse files
committed
dts: rpi: Factorize common definitions vd55g1_vd65g4-overlay.dtsi
Now on part with rpi overlay definition for easier maintainance. See raspberrypi/linux#7189 All common code is factorized in vd55g1_vd65g4-overlay.dtsi. Every pcb overlay includes vd55g1_vd65g4-overlay.dtsi, adds its corresponding compatible, and optionnaly adds extra required properties. Contrary to rpi kernel, the C preprocessor '#include' instruction has been replaced by '/include/' dtc instruction to avoid running gcc, allowing to build overlays outside of the Linux kernel environnement in a standalone way. Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
1 parent ea7ed5b commit e4ae7fd

File tree

4 files changed

+140
-282
lines changed

4 files changed

+140
-282
lines changed

dts/rpi/pcb1637_vd55g1.dts

Lines changed: 9 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,21 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for VD55G1 camera module on VC I2C bus
3+
24
/dts-v1/;
35
/plugin/;
46

7+
/include/ "vd55g1_vd65g4-overlay.dtsi"
8+
59
/{
610
compatible = "brcm,bcm2835";
711

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-
};
12+
// Fragment numbers deliberately high to avoid conflicts with the
13+
// included vd55g1_vd65g4 overlay file.
2914

30-
i2c_frag: fragment@100 {
31-
target = <&i2c_csi_dsi>;
15+
fragment@101 {
16+
target = <&cam_node>;
3217
__overlay__ {
33-
#address-cells = <1>;
34-
#size-cells = <0>;
35-
status = "okay";
36-
37-
cam_node: vd55g1@10 {
38-
compatible = "st,vd55g1";
39-
reg = <0x10>;
40-
status = "disabled";
41-
42-
clocks = <&cam1_clk>;
43-
clock-names = "xclk";
44-
45-
vana-supply = <&cam1_reg>; /* 2.8v */
46-
vddio-supply = <&cam_dummy_reg>; /* 1.8v */
47-
vcore-supply = <&cam_dummy_reg>; /* 1.2v */
48-
49-
rotation = <0>;
50-
orientation = <2>;
51-
52-
st,leds = <2>;
53-
54-
port {
55-
cam_endpoint: endpoint {
56-
clock-lanes = <0>;
57-
data-lanes = <1>;
58-
clock-noncontinuous;
59-
link-frequencies =
60-
/bits/ 64 <600000000>;
61-
};
62-
};
63-
};
64-
};
65-
};
66-
67-
csi_frag: fragment@101 {
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@102 {
84-
target = <&csi1>;
85-
__dormant__ {
86-
compatible = "brcm,bcm2835-unicam-legacy";
18+
compatible = "st,vd55g1";
8719
};
8820
};
89-
90-
__overrides__ {
91-
rotation = <&cam_node>,"rotation:0";
92-
orientation = <&cam_node>,"orientation:0";
93-
media-controller = <0>,"!102";
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>;
10821
};

dts/rpi/pcb4189_vd55g1.dts

Lines changed: 12 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,28 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for VD55G1 camera module on VC I2C bus
3+
24
/dts-v1/;
35
/plugin/;
46

7+
/include/ "vd55g1_vd65g4-overlay.dtsi"
8+
59
/{
610
compatible = "brcm,bcm2835";
711

8-
fragment@0 {
9-
target = <&i2c0if>;
10-
__overlay__ {
11-
status = "okay";
12-
};
13-
};
12+
// Fragment numbers deliberately high to avoid conflicts with the
13+
// included vd55g1_vd65g4 overlay file.
1414

15-
clk_frag: fragment@1 {
16-
target = <&cam1_clk>;
15+
fragment@101 {
16+
target = <&cam_node>;
1717
__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@100 {
31-
target = <&i2c_csi_dsi>;
32-
__overlay__ {
33-
#address-cells = <1>;
34-
#size-cells = <0>;
35-
status = "okay";
36-
37-
cam_node: vd55g1@10 {
38-
compatible = "st,vd55g1";
39-
reg = <0x10>;
40-
status = "disabled";
41-
42-
clocks = <&cam1_clk>;
43-
clock-names = "xclk";
44-
45-
vana-supply = <&cam1_reg>; /* 2.8v */
46-
vddio-supply = <&cam_dummy_reg>; /* 1.8v */
47-
vcore-supply = <&cam_dummy_reg>; /* 1.2v */
48-
49-
rotation = <0>;
50-
orientation = <2>;
51-
52-
st,leds = <2>;
53-
54-
port {
55-
cam_endpoint: endpoint {
56-
clock-lanes = <0>;
57-
data-lanes = <1>;
58-
clock-noncontinuous;
59-
link-frequencies =
60-
/bits/ 64 <600000000>;
61-
lane-polarities = <1 1>;
62-
};
63-
};
64-
};
65-
};
66-
};
67-
68-
csi_frag: fragment@101 {
69-
target = <&csi1>;
70-
csi: __overlay__ {
71-
status = "okay";
72-
73-
port {
74-
csi_ep: endpoint {
75-
remote-endpoint = <&cam_endpoint>;
76-
clock-lanes = <0>;
77-
data-lanes = <1>;
78-
clock-noncontinuous;
79-
};
80-
};
18+
compatible = "st,vd55g1";
8119
};
8220
};
8321

8422
fragment@102 {
85-
target = <&csi1>;
86-
__dormant__ {
87-
compatible = "brcm,bcm2835-unicam-legacy";
23+
target = <&cam_endpoint>;
24+
__overlay__ {
25+
lane-polarities = <1 1>;
8826
};
8927
};
90-
91-
__overrides__ {
92-
rotation = <&cam_node>,"rotation:0";
93-
orientation = <&cam_node>,"orientation:0";
94-
media-controller = <0>,"!102";
95-
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
96-
<&csi_frag>, "target:0=",<&csi0>,
97-
<&clk_frag>, "target:0=",<&cam0_clk>,
98-
<&cam_node>, "clocks:0=",<&cam0_clk>,
99-
<&cam_node>, "vana-supply:0=",<&cam0_reg>;
100-
};
101-
};
102-
103-
&cam_node {
104-
status = "okay";
105-
};
106-
107-
&cam_endpoint {
108-
remote-endpoint = <&csi_ep>;
10928
};

dts/rpi/pcb4511_vd65g4.dts

Lines changed: 12 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,28 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
// Definitions for VD65G4 camera module on VC I2C bus
3+
24
/dts-v1/;
35
/plugin/;
46

7+
/include/ "vd55g1_vd65g4-overlay.dtsi"
8+
59
/{
610
compatible = "brcm,bcm2835";
711

8-
fragment@0 {
9-
target = <&i2c0if>;
10-
__overlay__ {
11-
status = "okay";
12-
};
13-
};
12+
// Fragment numbers deliberately high to avoid conflicts with the
13+
// included vd55g1_vd65g4 overlay file.
1414

15-
clk_frag: fragment@1 {
16-
target = <&cam1_clk>;
15+
fragment@101 {
16+
target = <&cam_node>;
1717
__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@100 {
31-
target = <&i2c_csi_dsi>;
32-
__overlay__ {
33-
#address-cells = <1>;
34-
#size-cells = <0>;
35-
status = "okay";
36-
37-
cam_node: vd65g4@10 {
38-
compatible = "st,vd65g4";
39-
reg = <0x10>;
40-
status = "disabled";
41-
42-
clocks = <&cam1_clk>;
43-
clock-names = "xclk";
44-
45-
vana-supply = <&cam1_reg>; /* 2.8v */
46-
vddio-supply = <&cam_dummy_reg>; /* 1.8v */
47-
vcore-supply = <&cam_dummy_reg>; /* 1.2v */
48-
49-
rotation = <0>;
50-
orientation = <2>;
51-
52-
st,leds = <2>;
53-
54-
port {
55-
cam_endpoint: endpoint {
56-
clock-lanes = <0>;
57-
data-lanes = <1>;
58-
clock-noncontinuous;
59-
link-frequencies =
60-
/bits/ 64 <600000000>;
61-
lane-polarities = <1 1>;
62-
};
63-
};
64-
};
65-
};
66-
};
67-
68-
csi_frag: fragment@101 {
69-
target = <&csi1>;
70-
csi: __overlay__ {
71-
status = "okay";
72-
73-
port {
74-
csi_ep: endpoint {
75-
remote-endpoint = <&cam_endpoint>;
76-
clock-lanes = <0>;
77-
data-lanes = <1>;
78-
clock-noncontinuous;
79-
};
80-
};
18+
compatible = "st,vd65g4";
8119
};
8220
};
8321

8422
fragment@102 {
85-
target = <&csi1>;
86-
__dormant__ {
87-
compatible = "brcm,bcm2835-unicam-legacy";
23+
target = <&cam_endpoint>;
24+
__overlay__ {
25+
lane-polarities = <1 1>;
8826
};
8927
};
90-
91-
__overrides__ {
92-
rotation = <&cam_node>,"rotation:0";
93-
orientation = <&cam_node>,"orientation:0";
94-
media-controller = <0>,"!102";
95-
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
96-
<&csi_frag>, "target:0=",<&csi0>,
97-
<&clk_frag>, "target:0=",<&cam0_clk>,
98-
<&cam_node>, "clocks:0=",<&cam0_clk>,
99-
<&cam_node>, "vana-supply:0=",<&cam0_reg>;
100-
};
101-
};
102-
103-
&cam_node {
104-
status = "okay";
105-
};
106-
107-
&cam_endpoint {
108-
remote-endpoint = <&csi_ep>;
10928
};

0 commit comments

Comments
 (0)