Skip to content

Commit 40b4625

Browse files
committed
drivers: video: dcmipp: Define video device for each pipe
Define a video device for each pipe instead for the main dcmipp device since the pipe is the device that communicates with application (zephyr,camera chosen node), not the dcmipp device. This helps to enable camera controls as well. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent 7fd20b9 commit 40b4625

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/video/video_stm32_dcmipp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,8 @@ static void stm32_dcmipp_isr(const struct device *dev)
15881588
HAL_DCMIPP_IRQHandler(&dcmipp->hdcmipp);
15891589
}
15901590

1591+
#define SOURCE_DEV(inst) DEVICE_DT_GET(DT_NODE_REMOTE_DEVICE(DT_INST_ENDPOINT_BY_ID(inst, 0, 0)))
1592+
15911593
#define DCMIPP_PIPE_INIT_DEFINE(node_id, inst) \
15921594
static struct stm32_dcmipp_pipe_data stm32_dcmipp_pipe_##node_id = { \
15931595
.id = DT_NODE_CHILD_IDX(node_id), \
@@ -1598,9 +1600,9 @@ static void stm32_dcmipp_isr(const struct device *dev)
15981600
&stm32_dcmipp_pipe_##node_id, \
15991601
&stm32_dcmipp_config_##inst, \
16001602
POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, \
1601-
&stm32_dcmipp_driver_api);
1602-
1603-
#define SOURCE_DEV(inst) DEVICE_DT_GET(DT_NODE_REMOTE_DEVICE(DT_INST_ENDPOINT_BY_ID(inst, 0, 0)))
1603+
&stm32_dcmipp_driver_api); \
1604+
\
1605+
VIDEO_DEVICE_DEFINE(dcmipp_##inst_pipe_##node_id, DEVICE_DT_GET(node_id), SOURCE_DEV(inst));
16041606

16051607
#if defined(STM32_DCMIPP_HAS_CSI)
16061608
#define STM32_DCMIPP_CSI_DT_PARAMS(inst) \
@@ -1685,8 +1687,6 @@ static void stm32_dcmipp_isr(const struct device *dev)
16851687
POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, \
16861688
NULL); \
16871689
\
1688-
STM32_DCMIPP_PIPES(inst) \
1689-
\
1690-
VIDEO_DEVICE_DEFINE(dcmipp_##inst, DEVICE_DT_INST_GET(inst), SOURCE_DEV(inst));
1690+
STM32_DCMIPP_PIPES(inst)
16911691

16921692
DT_INST_FOREACH_STATUS_OKAY(STM32_DCMIPP_INIT)

0 commit comments

Comments
 (0)