Skip to content

Commit 045a59c

Browse files
committed
dts: flatten video's ports { port@0 { endpoint@0 { ... }; }; };
This change removes the "port@0 { ... };" block, making the devicetree less nested while systematically including the "ports { ... };" root block. In practice, this looks like only adding an "s" to "port" blocks, but the changes are also semantic. Complex configurations are still possible with this scheme: video@10380000 { ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; #address-cells = <1>; #size-cells = <0>; endpoint@0 { reg = <0>; remote-endpoint = <&other>; }; endpoint@1 { reg = <1>; remote-endpoint = <&other>; }; }; port@1 { reg = <1>; #address-cells = <1>; #size-cells = <0>; endpoint@0 { reg = <0>; remote-endpoint = <&other>; }; }; }; }; Is turned into something like this: video@10380000 { ports { #address-cells = <2>; #size-cells = <0>; endpoint@00 { reg = <0 0>; data-lanes = <0 1 2 3>; remote-endpoint = <&other>; }; endpoint@01 { reg = <0 1>; data-lanes = <4 5 6 7>; remote-endpoint = <&other>; }; endpoint@10 { reg = <1 0>; data-lanes = <0 1 2 3>; remote-endpoint = <&other>; }; }; }; Which helps simpler device to be simpler, and allows more complex device with arbitrary number of nesting to remain simple. Both very-nested and completely flat (1 port 1 endpoint) look exactly the same way, which helps with use of generic macros to traverse the devicetree across all video devices. The use of "ports { ... };" is required so that the "#address-cells" property can be different between "ports" and i.e. "display-timings". This prevents to apply devicetree properties to an entire port, affecting each of its endpoint, but in the Linux source, this was only used once, in imx8mp-tqma8mpql-mba8mpxl-lvds-g133han01.dtso. Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent 34c84ec commit 045a59c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

boards/madmachine/mm_swiftio/mm_swiftio.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
reset-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
115115

116-
port {
116+
ports {
117117
ov7725_ep_out: endpoint {
118118
remote-endpoint = <&csi_ep_in>;
119119
};
@@ -196,7 +196,7 @@
196196
pinctrl-0 = <&pinmux_csi>;
197197
pinctrl-names = "default";
198198

199-
port {
199+
ports {
200200
csi_ep_in: endpoint {
201201
remote-endpoint = <&ov7725_ep_out>;
202202
};

boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292

9393
panel {
9494
compatible = "rocktech,rk043fn02h-ct";
95-
port {
95+
ports {
9696
lcd_panel_in: endpoint {
9797
remote-endpoint = <&lcd_panel_out>;
9898
};
@@ -135,7 +135,7 @@ arduino_serial: &lpuart3 {
135135
pinctrl-0 = <&pinmux_lcdif>;
136136
pinctrl-names = "default";
137137
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
138-
port {
138+
ports {
139139
lcd_panel_out: endpoint {
140140
remote-endpoint = <&lcd_panel_in>;
141141
};

boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
panel {
101101
compatible = "rocktech,rk043fn02h-ct";
102-
port {
102+
ports {
103103
lcd_panel_in: endpoint {
104104
remote-endpoint = <&lcd_panel_out>;
105105
};
@@ -137,7 +137,7 @@ arduino_serial: &lpuart3 {
137137
pinctrl-0 = <&pinmux_lcdif>;
138138
pinctrl-names = "default";
139139
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
140-
port {
140+
ports {
141141
lcd_panel_out: endpoint {
142142
remote-endpoint = <&lcd_panel_in>;
143143
};

boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
panel {
105105
compatible = "rocktech,rk043fn02h-ct";
106-
port {
106+
ports {
107107
lcd_panel_in: endpoint {
108108
remote-endpoint = <&lcd_panel_out>;
109109
};
@@ -136,7 +136,7 @@ arduino_i2c: &lpi2c1 {};
136136
pinctrl-0 = <&pinmux_lcdif>;
137137
pinctrl-names = "default";
138138
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
139-
port {
139+
ports {
140140
lcd_panel_out: endpoint {
141141
remote-endpoint = <&lcd_panel_in>;
142142
};
@@ -154,7 +154,7 @@ arduino_i2c: &lpi2c1 {};
154154
reg = <0x48>;
155155
status = "okay";
156156

157-
port {
157+
ports {
158158
mt9m114_ep_out: endpoint {
159159
remote-endpoint = <&csi_ep_in>;
160160
};
@@ -276,7 +276,7 @@ zephyr_udc0: &usb1 {
276276
pinctrl-0 = <&pinmux_csi>;
277277
pinctrl-names = "default";
278278

279-
port {
279+
ports {
280280
csi_ep_in: endpoint {
281281
remote-endpoint = <&mt9m114_ep_out>;
282282
};

dts/bindings/video/st,stm32-dcmi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ description: |
2424
STM32_DMA_MEM_INC | STM32_DMA_PERIPH_8BITS | STM32_DMA_MEM_32BITS |
2525
STM32_DMA_PRIORITY_HIGH) STM32_DMA_FIFO_1_4>;
2626
27-
port {
27+
ports {
2828
dcmi_ep_in: endpoint {
2929
remote-endpoint = <&ov2640_ep_out>;
3030
};

0 commit comments

Comments
 (0)