media: atomisp: Remove atomisp_video_init() parametrization
authorHans de Goede <hdegoede@redhat.com>
Mon, 15 May 2023 18:08:05 +0000 (19:08 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:02:57 +0000 (15:02 +0100)
Now that we only have a single /dev/video# node it is no longer
necessary for atomisp_video_init() to be parametrized.

Remove its parameters and while at it also change the name
from the single /dev/video# node from "ATOMISP ISP PREVIEW output"
to "ATOMISP video output".

Link: https://lore.kernel.org/r/20230518153733.195306-4-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp_subdev.c
drivers/staging/media/atomisp/pci/atomisp_subdev.h
drivers/staging/media/atomisp/pci/atomisp_v4l2.c
drivers/staging/media/atomisp/pci/atomisp_v4l2.h

index fb42c27..36e441d 100644 (file)
@@ -537,7 +537,7 @@ static int atomisp_open(struct file *file)
 
        atomisp_subdev_init_struct(asd);
        /* Ensure that a mode is set */
-       v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode);
+       v4l2_ctrl_s_ctrl(asd->run_mode, ATOMISP_RUN_MODE_PREVIEW);
 
        pipe->users++;
        mutex_unlock(&isp->mutex);
index 8b99805..c2ae77c 100644 (file)
@@ -898,7 +898,7 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd)
        if (ret)
                return ret;
 
-       ret = atomisp_video_init(&asd->video_out, "PREVIEW", ATOMISP_RUN_MODE_PREVIEW);
+       ret = atomisp_video_init(&asd->video_out);
        if (ret < 0)
                return ret;
 
index dc6970b..cd82554 100644 (file)
@@ -67,8 +67,6 @@ struct atomisp_video_pipe {
        /* Filled through atomisp_get_css_frame_info() on queue setup */
        struct ia_css_frame_info frame_info;
 
-       /* Store here the initial run mode */
-       unsigned int default_run_mode;
        /* Set from streamoff to disallow queuing further buffers in CSS */
        bool stopping;
 
index e78c738..b2b5a61 100644 (file)
@@ -333,34 +333,22 @@ const struct atomisp_dfs_config dfs_config_cht_soc = {
        .dfs_table_size = ARRAY_SIZE(dfs_rules_cht_soc),
 };
 
-int atomisp_video_init(struct atomisp_video_pipe *video, const char *name,
-                      unsigned int run_mode)
+int atomisp_video_init(struct atomisp_video_pipe *video)
 {
        int ret;
-       const char *direction;
-
-       switch (video->type) {
-       case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-               direction = "output";
-               video->pad.flags = MEDIA_PAD_FL_SINK;
-               video->vdev.fops = &atomisp_fops;
-               video->vdev.ioctl_ops = &atomisp_ioctl_ops;
-               video->vdev.lock = &video->isp->mutex;
-               break;
-       default:
-               return -EINVAL;
-       }
 
+       video->pad.flags = MEDIA_PAD_FL_SINK;
        ret = media_entity_pads_init(&video->vdev.entity, 1, &video->pad);
        if (ret < 0)
                return ret;
 
        /* Initialize the video device. */
-       snprintf(video->vdev.name, sizeof(video->vdev.name),
-                "ATOMISP ISP %s %s", name, direction);
+       strscpy(video->vdev.name, "ATOMISP video output", sizeof(video->vdev.name));
+       video->vdev.fops = &atomisp_fops;
+       video->vdev.ioctl_ops = &atomisp_ioctl_ops;
+       video->vdev.lock = &video->isp->mutex;
        video->vdev.release = video_device_release_empty;
        video_set_drvdata(&video->vdev, video->isp);
-       video->default_run_mode = run_mode;
 
        return 0;
 }
index ccf1c0a..c8ee3ad 100644 (file)
@@ -26,8 +26,7 @@ struct v4l2_device;
 struct atomisp_device;
 struct firmware;
 
-int atomisp_video_init(struct atomisp_video_pipe *video, const char *name,
-                      unsigned int run_mode);
+int atomisp_video_init(struct atomisp_video_pipe *video);
 void atomisp_video_unregister(struct atomisp_video_pipe *video);
 const struct firmware *atomisp_load_firmware(struct atomisp_device *isp);
 int atomisp_csi_lane_config(struct atomisp_device *isp);