diff --git a/boards/shields/st_b_cams_imx_mb1854/st_b_cams_imx_mb1854.overlay b/boards/shields/st_b_cams_imx_mb1854/st_b_cams_imx_mb1854.overlay index cdf7185b70116..5399867bfc737 100644 --- a/boards/shields/st_b_cams_imx_mb1854/st_b_cams_imx_mb1854.overlay +++ b/boards/shields/st_b_cams_imx_mb1854/st_b_cams_imx_mb1854.overlay @@ -10,7 +10,7 @@ / { chosen { - zephyr,camera = &csi_capture_port; + zephyr,camera = &pipe_main; }; imx335_input_clock: imx335-input-clock { diff --git a/boards/shields/st_mb1897_cam/st_mb1897_cam.overlay b/boards/shields/st_mb1897_cam/st_mb1897_cam.overlay index 61dc9cedb0671..61a54ceade3e6 100644 --- a/boards/shields/st_mb1897_cam/st_mb1897_cam.overlay +++ b/boards/shields/st_mb1897_cam/st_mb1897_cam.overlay @@ -9,7 +9,7 @@ / { chosen { - zephyr,camera = &csi_capture_port; + zephyr,camera = &pipe_dump; }; }; diff --git a/boards/st/stm32mp135f_dk/stm32mp135f_dk.dts b/boards/st/stm32mp135f_dk/stm32mp135f_dk.dts index 98cf9d03c713c..9588b2044fcb9 100644 --- a/boards/st/stm32mp135f_dk/stm32mp135f_dk.dts +++ b/boards/st/stm32mp135f_dk/stm32mp135f_dk.dts @@ -188,20 +188,14 @@ csi_interface: &dcmipp { &dcmipp_pixclk_pb7 &dcmipp_vsync_pg9 &dcmipp_hsync_ph8>; pinctrl-names = "default"; - ports { - port@0 { - dcmipp_ep_in: endpoint { - bus-width = <8>; - hsync-active = <0>; - vsync-active = <0>; - pclk-sample = <0>; - bus-type = ; - remote-endpoint-label = "mipid02_2"; - }; - }; - - port@1 { - csi_capture_port: endpoint { }; + port { + dcmipp_ep_in: endpoint { + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <0>; + bus-type = ; + remote-endpoint-label = "mipid02_2"; }; }; }; diff --git a/boards/st/stm32n6570_dk/stm32n6570_dk_common.dtsi b/boards/st/stm32n6570_dk/stm32n6570_dk_common.dtsi index 797c5a94c4b0e..3514bdb138767 100644 --- a/boards/st/stm32n6570_dk/stm32n6570_dk_common.dtsi +++ b/boards/st/stm32n6570_dk/stm32n6570_dk_common.dtsi @@ -459,13 +459,7 @@ zephyr_udc0: &usbotg_hs1 { }; csi_interface: &dcmipp { - ports { - port@0 { - csi_ep_in: endpoint { }; - }; - - port@1 { - csi_capture_port: endpoint@1 { }; - }; + port { + csi_ep_in: endpoint { }; }; }; diff --git a/drivers/video/video_stm32_dcmipp.c b/drivers/video/video_stm32_dcmipp.c index a7c182a89e22d..5afe16b3ea99d 100644 --- a/drivers/video/video_stm32_dcmipp.c +++ b/drivers/video/video_stm32_dcmipp.c @@ -1620,65 +1620,63 @@ static void stm32_dcmipp_isr(const struct device *dev) #define STM32_DCMIPP_CSI_DT_PARAMS(inst) #endif -#define STM32_DCMIPP_INIT(inst) \ - static void stm32_dcmipp_irq_config_##inst(const struct device *dev) \ - { \ - IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \ - stm32_dcmipp_isr, DEVICE_DT_INST_GET(inst), 0); \ - irq_enable(DT_INST_IRQN(inst)); \ - } \ - \ - static struct stm32_dcmipp_data stm32_dcmipp_data_##inst = { \ - .hdcmipp = { \ - .Instance = (DCMIPP_TypeDef *)DT_INST_REG_ADDR(inst), \ - }, \ - .source_fmt = { \ - .pixelformat = \ - VIDEO_FOURCC_FROM_STR( \ - CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT), \ - .width = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH, \ - .height = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \ - }, \ - }; \ - \ - PINCTRL_DT_INST_DEFINE(inst); \ - \ - static const struct stm32_dcmipp_config stm32_dcmipp_config_##inst = { \ - .dcmipp_pclken = \ - {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bus), \ - .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bits)}, \ - .dcmipp_pclken_ker = \ - {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, bus), \ - .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, bits)}, \ - .irq_config = stm32_dcmipp_irq_config_##inst, \ - .pctrl = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ - .source_dev = SOURCE_DEV(inst), \ - .reset_dcmipp = RESET_DT_SPEC_INST_GET_BY_IDX(inst, 0), \ - .bus_type = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), bus_type, \ - VIDEO_BUS_TYPE_PARALLEL), \ - STM32_DCMIPP_CSI_DT_PARAMS(inst) \ - .parallel.vs_polarity = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), \ - vsync_active, 0) ? \ - DCMIPP_VSPOLARITY_HIGH : \ - DCMIPP_VSPOLARITY_LOW, \ - .parallel.hs_polarity = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(n, 0, 0), \ - hsync_active, 0) ? \ - DCMIPP_HSPOLARITY_HIGH : \ - DCMIPP_HSPOLARITY_LOW, \ - .parallel.pck_polarity = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), \ - pclk_sample, 0) ? \ - DCMIPP_PCKPOLARITY_RISING : \ - DCMIPP_PCKPOLARITY_FALLING, \ - }; \ - \ - DEVICE_DT_INST_DEFINE(inst, &stm32_dcmipp_init, \ - NULL, &stm32_dcmipp_data_##inst, \ - &stm32_dcmipp_config_##inst, \ - POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, \ - NULL); \ - \ - DT_FOREACH_CHILD_VARGS(DT_INST_PORT_BY_ID(inst, 1), DCMIPP_PIPE_INIT_DEFINE, inst); \ - \ +#define STM32_DCMIPP_INIT(inst) \ + static void stm32_dcmipp_irq_config_##inst(const struct device *dev) \ + { \ + IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), stm32_dcmipp_isr, \ + DEVICE_DT_INST_GET(inst), 0); \ + irq_enable(DT_INST_IRQN(inst)); \ + } \ + \ + static struct stm32_dcmipp_data stm32_dcmipp_data_##inst = { \ + .hdcmipp = \ + { \ + .Instance = (DCMIPP_TypeDef *)DT_INST_REG_ADDR(inst), \ + }, \ + .source_fmt = \ + { \ + .pixelformat = VIDEO_FOURCC_FROM_STR( \ + CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT), \ + .width = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH, \ + .height = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \ + }, \ + }; \ + \ + PINCTRL_DT_INST_DEFINE(inst); \ + \ + static const struct stm32_dcmipp_config stm32_dcmipp_config_##inst = { \ + .dcmipp_pclken = {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bus), \ + .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bits)}, \ + .dcmipp_pclken_ker = {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, \ + bus), \ + .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, \ + bits)}, \ + .irq_config = stm32_dcmipp_irq_config_##inst, \ + .pctrl = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ + .source_dev = SOURCE_DEV(inst), \ + .reset_dcmipp = RESET_DT_SPEC_INST_GET_BY_IDX(inst, 0), \ + .bus_type = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), bus_type, \ + VIDEO_BUS_TYPE_PARALLEL), \ + STM32_DCMIPP_CSI_DT_PARAMS(inst).parallel.vs_polarity = \ + DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), vsync_active, 0) \ + ? DCMIPP_VSPOLARITY_HIGH \ + : DCMIPP_VSPOLARITY_LOW, \ + .parallel.hs_polarity = \ + DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), hsync_active, 0) \ + ? DCMIPP_HSPOLARITY_HIGH \ + : DCMIPP_HSPOLARITY_LOW, \ + .parallel.pck_polarity = \ + DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), pclk_sample, 0) \ + ? DCMIPP_PCKPOLARITY_RISING \ + : DCMIPP_PCKPOLARITY_FALLING, \ + }; \ + \ + DEVICE_DT_INST_DEFINE(inst, &stm32_dcmipp_init, NULL, &stm32_dcmipp_data_##inst, \ + &stm32_dcmipp_config_##inst, POST_KERNEL, \ + CONFIG_VIDEO_INIT_PRIORITY, NULL); \ + \ + DT_FOREACH_CHILD_VARGS(DT_INST_CHILD(inst, pipes), DCMIPP_PIPE_INIT_DEFINE, inst); \ + \ VIDEO_DEVICE_DEFINE(dcmipp_##inst, DEVICE_DT_INST_GET(inst), SOURCE_DEV(inst)); DT_INST_FOREACH_STATUS_OKAY(STM32_DCMIPP_INIT) diff --git a/dts/arm/st/mp13/stm32mp135.dtsi b/dts/arm/st/mp13/stm32mp135.dtsi index 61a92c628164e..0184921e39ca1 100644 --- a/dts/arm/st/mp13/stm32mp135.dtsi +++ b/dts/arm/st/mp13/stm32mp135.dtsi @@ -21,25 +21,20 @@ resets = <&rctl STM32_RESET(APB4, 1)>; status = "disabled"; - ports { + pipes { + compatible = "st,stm32-dcmipp-pipes"; #address-cells = <1>; #size-cells = <0>; - port@0 { + pipe_dump: pipe@0 { reg = <0>; - - endpoint { - remote-endpoint-label = ""; - bus-type = ; - }; }; + }; - port@1 { - reg = <1>; - - dcmipp_pipe_dump: endpoint { - compatible = "st,stm32-dcmipp-pipe"; - }; + port { + endpoint { + remote-endpoint-label = ""; + bus-type = ; }; }; }; diff --git a/dts/arm/st/n6/stm32n6.dtsi b/dts/arm/st/n6/stm32n6.dtsi index eb29851f307a9..36a0113fcc79b 100644 --- a/dts/arm/st/n6/stm32n6.dtsi +++ b/dts/arm/st/n6/stm32n6.dtsi @@ -717,39 +717,28 @@ <&rctl STM32_RESET(APB5, 6)>; status = "disabled"; - ports { + pipes { + compatible = "st,stm32-dcmipp-pipes"; #address-cells = <1>; #size-cells = <0>; - port@0 { + pipe_dump: pipe@0 { reg = <0>; - - endpoint { - remote-endpoint-label = ""; - bus-type = ; - }; }; - port@1 { - #address-cells = <1>; - #size-cells = <0>; - + pipe_main: pipe@1 { reg = <1>; + }; - dcmipp_pipe_dump: endpoint@0 { - compatible = "st,stm32-dcmipp-pipe"; - reg = <0>; - }; - - dcmipp_pipe_main: endpoint@1 { - compatible = "st,stm32-dcmipp-pipe"; - reg = <1>; - }; + pipe_aux: pipe@2 { + reg = <2>; + }; + }; - dcmipp_pipe_aux: endpoint@2 { - compatible = "st,stm32-dcmipp-pipe"; - reg = <2>; - }; + port { + endpoint { + remote-endpoint-label = ""; + bus-type = ; }; }; }; diff --git a/dts/bindings/video/st,stm32-dcmipp.yaml b/dts/bindings/video/st,stm32-dcmipp.yaml index 125554dad72e4..7aaaa8521e0c7 100644 --- a/dts/bindings/video/st,stm32-dcmipp.yaml +++ b/dts/bindings/video/st,stm32-dcmipp.yaml @@ -48,9 +48,8 @@ properties: child-binding: child-binding: - child-binding: - include: video-interfaces.yaml + include: video-interfaces.yaml - properties: - bus-type: - required: true + properties: + bus-type: + required: true