Commit 45b4ab38 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: Remove atomisp_video_init() parametrization

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: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 9af6100f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;

+0 −2
Original line number Diff line number Diff line
@@ -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;

+6 −18
Original line number Diff line number Diff line
@@ -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;
	}

	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;
}
+1 −2
Original line number Diff line number Diff line
@@ -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);