This is an automated email from the ASF dual-hosted git repository.

simbit18 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit cb2d472992cdb4b99a852e6dc227ffb202d4498d
Author: raiden00pl <[email protected]>
AuthorDate: Thu Nov 26 10:34:36 2026 +0100

    boards/stm32n6570-dk: Register /dev/video at bring-up.
    
    The board registered the IMX335 and the DCMIPP, but /dev/video was
    only created when an application called capture_initialize().  Create
    it at bring-up, so applications just open it.
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: raiden00pl <[email protected]>
---
 .../platforms/arm/stm32n6/boards/stm32n6570-dk/index.rst  |  2 +-
 boards/arm/stm32n6/stm32n6570-dk/src/stm32_bringup.c      |  2 +-
 boards/arm/stm32n6/stm32n6570-dk/src/stm32_camera.c       | 15 +++++++++++++--
 boards/arm/stm32n6/stm32n6570-dk/src/stm32n6570-dk.h      |  4 ++--
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/Documentation/platforms/arm/stm32n6/boards/stm32n6570-dk/index.rst 
b/Documentation/platforms/arm/stm32n6/boards/stm32n6570-dk/index.rst
index 651ccf07799..616a80ffee7 100644
--- a/Documentation/platforms/arm/stm32n6/boards/stm32n6570-dk/index.rst
+++ b/Documentation/platforms/arm/stm32n6/boards/stm32n6570-dk/index.rst
@@ -190,7 +190,7 @@ The MB1854 module (Sony IMX335) is on the CSI-2 host (two 
lanes) and I2C1
 DCMIPP converts the raw frames to RGB565 and scales them, with automatic
 exposure (``CONFIG_STM32_DCMIPP_AE``) and white balance
 (``CONFIG_STM32_DCMIPP_AWB``), switched off with ``V4L2_CID_EXPOSURE_AUTO``
-and ``V4L2_CID_AUTO_WHITE_BALANCE``.
+and ``V4L2_CID_AUTO_WHITE_BALANCE``.  The board registers ``/dev/video``.
 
 Time-of-flight sensor
 =====================
diff --git a/boards/arm/stm32n6/stm32n6570-dk/src/stm32_bringup.c 
b/boards/arm/stm32n6/stm32n6570-dk/src/stm32_bringup.c
index 6562fc5d197..01cce9b76d2 100644
--- a/boards/arm/stm32n6/stm32n6570-dk/src/stm32_bringup.c
+++ b/boards/arm/stm32n6/stm32n6570-dk/src/stm32_bringup.c
@@ -175,7 +175,7 @@ int stm32_bringup(void)
 #endif
 
 #if defined(CONFIG_STM32_DCMIPP) && defined(CONFIG_VIDEO_IMX335)
-  /* Register the IMX335 camera and the DCMIPP */
+  /* Register the IMX335 camera, the DCMIPP and /dev/video */
 
   ret = stm32_camera_initialize();
   if (ret < 0)
diff --git a/boards/arm/stm32n6/stm32n6570-dk/src/stm32_camera.c 
b/boards/arm/stm32n6/stm32n6570-dk/src/stm32_camera.c
index 6f0f99cc18d..3260541b6be 100644
--- a/boards/arm/stm32n6/stm32n6570-dk/src/stm32_camera.c
+++ b/boards/arm/stm32n6/stm32n6570-dk/src/stm32_camera.c
@@ -34,6 +34,10 @@
 #include <nuttx/video/imgsensor.h>
 #include <nuttx/video/imx335.h>
 
+#if defined(CONFIG_STM32_DCMIPP) && defined(CONFIG_VIDEO_IMX335)
+#  include <nuttx/video/v4l2_cap.h>
+#endif
+
 #include "stm32_gpio.h"
 #include "stm32_i2c.h"
 #include "stm32_dcmipp.h"
@@ -145,7 +149,7 @@ void stm32_camera_power(void)
  *
  * Description:
  *   Power the camera module, release the IMX335 reset and register the
- *   sensor and the DCMIPP.
+ *   sensor, the DCMIPP and /dev/video.
  *
  * Input Parameters:
  *   None.
@@ -159,6 +163,7 @@ int stm32_camera_initialize(void)
 {
   FAR struct i2c_master_s *i2c;
   FAR struct imgsensor_s *sensor;
+  int ret;
 
   /* Power the module, then release the sensor reset */
 
@@ -180,7 +185,13 @@ int stm32_camera_initialize(void)
 
   /* The DCMIPP registers itself in front of the raw sensor */
 
-  return stm32_dcmipp_initialize(&g_camera_config, sensor);
+  ret = stm32_dcmipp_initialize(&g_camera_config, sensor);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  return capture_initialize("/dev/video");
 }
 
 #endif /* HAVE_IMX335 */
diff --git a/boards/arm/stm32n6/stm32n6570-dk/src/stm32n6570-dk.h 
b/boards/arm/stm32n6/stm32n6570-dk/src/stm32n6570-dk.h
index 9ad89b08b9d..206c27d9744 100644
--- a/boards/arm/stm32n6/stm32n6570-dk/src/stm32n6570-dk.h
+++ b/boards/arm/stm32n6/stm32n6570-dk/src/stm32n6570-dk.h
@@ -198,8 +198,8 @@ void stm32_camera_power(void);
  * Name: stm32_camera_initialize
  *
  * Description:
- *   Power up the camera module and register the IMX335 sensor and the
- *   DCMIPP capture interface.
+ *   Power up the camera module and register the IMX335 sensor, the
+ *   DCMIPP capture interface and /dev/video.
  *
  ****************************************************************************/
 

Reply via email to