From 5028998860d2c56cfdc422bfc9c7e043ca739589 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Wed, 15 May 2024 22:32:09 +0000 Subject: [PATCH] samples: video: capture: add support for SMARTDMA Add support for using the SMARTDMA engine on the FRDM-MCXN947 board with the video capture sample. Signed-off-by: Daniel DeGrasse --- .../subsys/video/capture/boards/frdm_mcxn947_cpu0.conf | 5 +++++ samples/subsys/video/capture/src/main.c | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 samples/subsys/video/capture/boards/frdm_mcxn947_cpu0.conf diff --git a/samples/subsys/video/capture/boards/frdm_mcxn947_cpu0.conf b/samples/subsys/video/capture/boards/frdm_mcxn947_cpu0.conf new file mode 100644 index 000000000000000..4a604bc267ef25b --- /dev/null +++ b/samples/subsys/video/capture/boards/frdm_mcxn947_cpu0.conf @@ -0,0 +1,5 @@ +CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=40000 +CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=2 +# Workaround for issue where SDMA driver needs to start before camera, so that +# clock output will be generated for camera device +CONFIG_CHECK_INIT_PRIORITIES=n diff --git a/samples/subsys/video/capture/src/main.c b/samples/subsys/video/capture/src/main.c index b195e6d75a74e27..2cc51dfba1dd4a0 100644 --- a/samples/subsys/video/capture/src/main.c +++ b/samples/subsys/video/capture/src/main.c @@ -42,6 +42,15 @@ int main(void) return 0; } + video = dev; +#elif defined(CONFIG_VIDEO_MCUX_SDMA) + const struct device *const dev = DEVICE_DT_GET_ONE(nxp_video_smartdma); + + if (!device_is_ready(dev)) { + LOG_ERR("%s: device not ready.\n", dev->name); + return 0; + } + video = dev; #endif