You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2020/06/14 23:10:57 UTC

[incubator-nuttx] branch master updated (02ad0e9 -> c6c0214)

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

masayuki pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 02ad0e9  drivers/leds/ncp5623c&pca9635pw: Fix nxstyle issues.
     new 8fdfb74  drivers: video: fix uninitialized variables
     new c6c0214  boards: arm: cxd56: initilize the video stream driver from the board

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c | 15 +++++++++++++--
 drivers/video/video.c                            | 15 +++++++++++----
 include/nuttx/video/video.h                      |  5 ++---
 3 files changed, 26 insertions(+), 9 deletions(-)


[incubator-nuttx] 01/02: drivers: video: fix uninitialized variables

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8fdfb745d62957a4f3f1a53a19cf299798f3201e
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Sun Jun 14 15:41:57 2020 +0200

    drivers: video: fix uninitialized variables
    
    Fix the build error by initializing the variables before we perform
    th querry for the ext control.
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 drivers/video/video.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/video/video.c b/drivers/video/video.c
index 2be1530..922c64c 100644
--- a/drivers/video/video.c
+++ b/drivers/video/video.c
@@ -1035,8 +1035,14 @@ static int video_queryctrl(FAR struct v4l2_queryctrl *ctrl)
 
   /* Replace to VIDIOC_QUERY_EXT_CTRL format */
 
-  ext_ctrl.ctrl_class = ctrl->ctrl_class;
-  ext_ctrl.id         = ctrl->id;
+  ext_ctrl.ctrl_class     = ctrl->ctrl_class;
+  ext_ctrl.id             = ctrl->id;
+  ext_ctrl.type           = ctrl->type;
+  ext_ctrl.minimum        = ctrl->minimum;
+  ext_ctrl.maximum        = ctrl->maximum;
+  ext_ctrl.step           = ctrl->step;
+  ext_ctrl.default_value  = ctrl->default_value;
+  ext_ctrl.flags          = ctrl->flags;
 
   ret = video_query_ext_ctrl(&ext_ctrl);
 


[incubator-nuttx] 02/02: boards: arm: cxd56: initilize the video stream driver from the board

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c6c0214f9a0e29fe563060069979d0cebf474d95
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Jun 11 16:03:33 2020 +0200

    boards: arm: cxd56: initilize the video stream driver from the board
    
    The video stream driver must be intialized from the board to comply with NuttX
    
    NOTE:
    Please remove the initalization from any camera example
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c | 15 +++++++++++++--
 drivers/video/video.c                            |  5 +++--
 include/nuttx/video/video.h                      |  5 ++---
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
index 019d2f6..2b87f38 100644
--- a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
+++ b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
@@ -203,6 +203,9 @@ int cxd56_bringup(void)
 {
   struct pm_cpu_wakelock_s wlock;
   int ret;
+#ifdef CONFIG_VIDEO_ISX012
+  FAR const struct video_devops_s *devops;
+#endif
 
   ret = nsh_cpucom_initialize();
   if (ret < 0)
@@ -359,14 +362,22 @@ int cxd56_bringup(void)
       _err("ERROR: Failed to initialize ISX012 board. %d\n", errno);
     }
 
-  g_video_devops = isx012_initialize();
-  if (g_video_devops == NULL)
+  devops  = isx012_initialize();
+  if (devops == NULL)
     {
       _err("ERROR: Failed to populate ISX012 devops. %d\n", errno);
       ret = ERROR;
     }
 #endif /* CONFIG_VIDEO_ISX012 */
 
+#ifdef CONFIG_VIDEO_STREAM
+  ret = video_initialize("/dev/video", devops);
+  if (ret < 0)
+    {
+      _err("ERROR: Failed to initialize video stream driver. \n");
+    }
+#endif
+
   /* In order to prevent Hi-Z from being input to the SD Card controller,
    * Initialize SDIO pins to GPIO low output with internal pull-down.
    */
diff --git a/drivers/video/video.c b/drivers/video/video.c
index 922c64c..506d7ac 100644
--- a/drivers/video/video.c
+++ b/drivers/video/video.c
@@ -222,7 +222,7 @@ static int video_s_ext_ctrls(FAR struct video_mng_s *priv,
  * Public Data
  ****************************************************************************/
 
-FAR const struct video_devops_s *g_video_devops;
+static const struct video_devops_s *g_video_devops;
 
 /****************************************************************************
  * Private Data
@@ -1495,7 +1495,8 @@ static int video_unregister(FAR video_mng_t *v_mgr)
  * Public Functions
  ****************************************************************************/
 
-int video_initialize(FAR const char *devpath)
+int video_initialize(FAR const char *devpath,
+                     FAR const struct video_devops_s *devops)
 {
   if (is_initialized)
     {
diff --git a/include/nuttx/video/video.h b/include/nuttx/video/video.h
index f403281..b83c04f 100644
--- a/include/nuttx/video/video.h
+++ b/include/nuttx/video/video.h
@@ -625,8 +625,6 @@ struct v4l2_ext_controls
  * Public Data
  ****************************************************************************/
 
-extern FAR const struct video_devops_s *g_video_devops;
-
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
@@ -639,7 +637,8 @@ extern FAR const struct video_devops_s *g_video_devops;
  *  negative value is returned.
  */
 
-int video_initialize(FAR const char *devpath);
+int video_initialize(FAR const char *devpath,
+                     FAR const struct video_devops_s *devops);
 
 /* Uninitialize video driver.
  *