From 045a59c107597e7f4dbbfaf44bd496c78899067c Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Fri, 17 May 2024 14:32:14 +0200 Subject: [PATCH] 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 --- boards/madmachine/mm_swiftio/mm_swiftio.dts | 4 ++-- boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts | 4 ++-- boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts | 4 ++-- boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts | 8 ++++---- dts/bindings/video/st,stm32-dcmi.yaml | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/boards/madmachine/mm_swiftio/mm_swiftio.dts b/boards/madmachine/mm_swiftio/mm_swiftio.dts index e4212cd8294c6..9697393f16a6b 100644 --- a/boards/madmachine/mm_swiftio/mm_swiftio.dts +++ b/boards/madmachine/mm_swiftio/mm_swiftio.dts @@ -113,7 +113,7 @@ reset-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>; - port { + ports { ov7725_ep_out: endpoint { remote-endpoint = <&csi_ep_in>; }; @@ -196,7 +196,7 @@ pinctrl-0 = <&pinmux_csi>; pinctrl-names = "default"; - port { + ports { csi_ep_in: endpoint { remote-endpoint = <&ov7725_ep_out>; }; diff --git a/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts index 4bd6b5bb44116..519232cd57f03 100644 --- a/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/nxp/mimxrt1050_evk/mimxrt1050_evk.dts @@ -92,7 +92,7 @@ panel { compatible = "rocktech,rk043fn02h-ct"; - port { + ports { lcd_panel_in: endpoint { remote-endpoint = <&lcd_panel_out>; }; @@ -135,7 +135,7 @@ arduino_serial: &lpuart3 { pinctrl-0 = <&pinmux_lcdif>; pinctrl-names = "default"; backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>; - port { + ports { lcd_panel_out: endpoint { remote-endpoint = <&lcd_panel_in>; }; diff --git a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts index 08eb8541432c4..16e7c21ea91c6 100644 --- a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts @@ -99,7 +99,7 @@ panel { compatible = "rocktech,rk043fn02h-ct"; - port { + ports { lcd_panel_in: endpoint { remote-endpoint = <&lcd_panel_out>; }; @@ -137,7 +137,7 @@ arduino_serial: &lpuart3 { pinctrl-0 = <&pinmux_lcdif>; pinctrl-names = "default"; backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>; - port { + ports { lcd_panel_out: endpoint { remote-endpoint = <&lcd_panel_in>; }; diff --git a/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts b/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts index 7351659dd87ff..c1a4b14cfb452 100644 --- a/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts +++ b/boards/nxp/mimxrt1064_evk/mimxrt1064_evk.dts @@ -103,7 +103,7 @@ panel { compatible = "rocktech,rk043fn02h-ct"; - port { + ports { lcd_panel_in: endpoint { remote-endpoint = <&lcd_panel_out>; }; @@ -136,7 +136,7 @@ arduino_i2c: &lpi2c1 {}; pinctrl-0 = <&pinmux_lcdif>; pinctrl-names = "default"; backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>; - port { + ports { lcd_panel_out: endpoint { remote-endpoint = <&lcd_panel_in>; }; @@ -154,7 +154,7 @@ arduino_i2c: &lpi2c1 {}; reg = <0x48>; status = "okay"; - port { + ports { mt9m114_ep_out: endpoint { remote-endpoint = <&csi_ep_in>; }; @@ -276,7 +276,7 @@ zephyr_udc0: &usb1 { pinctrl-0 = <&pinmux_csi>; pinctrl-names = "default"; - port { + ports { csi_ep_in: endpoint { remote-endpoint = <&mt9m114_ep_out>; }; diff --git a/dts/bindings/video/st,stm32-dcmi.yaml b/dts/bindings/video/st,stm32-dcmi.yaml index 8381ae0acaf25..e19377e8de389 100644 --- a/dts/bindings/video/st,stm32-dcmi.yaml +++ b/dts/bindings/video/st,stm32-dcmi.yaml @@ -24,7 +24,7 @@ description: | STM32_DMA_MEM_INC | STM32_DMA_PERIPH_8BITS | STM32_DMA_MEM_32BITS | STM32_DMA_PRIORITY_HIGH) STM32_DMA_FIFO_1_4>; - port { + ports { dcmi_ep_in: endpoint { remote-endpoint = <&ov2640_ep_out>; };