Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebcff5fc authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2: replace enum_mbus_fmt by enum_mbus_code



Replace all calls to the enum_mbus_fmt video op by the pad
enum_mbus_code op and remove the duplicate video op.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kamil Debski <k.debski@samsung.com>
Acked-by: default avatarPrabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 90874cd6
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -262,13 +262,14 @@ static int adv7170_s_routing(struct v4l2_subdev *sd,
	return 0;
}

static int adv7170_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
				u32 *code)
static int adv7170_enum_mbus_code(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_mbus_code_enum *code)
{
	if (index >= ARRAY_SIZE(adv7170_codes))
	if (code->pad || code->index >= ARRAY_SIZE(adv7170_codes))
		return -EINVAL;

	*code = adv7170_codes[index];
	code->code = adv7170_codes[code->index];
	return 0;
}

@@ -323,11 +324,15 @@ static const struct v4l2_subdev_video_ops adv7170_video_ops = {
	.s_routing = adv7170_s_routing,
	.s_mbus_fmt = adv7170_s_fmt,
	.g_mbus_fmt = adv7170_g_fmt,
	.enum_mbus_fmt  = adv7170_enum_fmt,
};

static const struct v4l2_subdev_pad_ops adv7170_pad_ops = {
	.enum_mbus_code = adv7170_enum_mbus_code,
};

static const struct v4l2_subdev_ops adv7170_ops = {
	.video = &adv7170_video_ops,
	.pad = &adv7170_pad_ops,
};

/* ----------------------------------------------------------------------- */
+10 −5
Original line number Diff line number Diff line
@@ -300,13 +300,14 @@ static int adv7175_s_routing(struct v4l2_subdev *sd,
	return 0;
}

static int adv7175_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
				u32 *code)
static int adv7175_enum_mbus_code(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_mbus_code_enum *code)
{
	if (index >= ARRAY_SIZE(adv7175_codes))
	if (code->pad || code->index >= ARRAY_SIZE(adv7175_codes))
		return -EINVAL;

	*code = adv7175_codes[index];
	code->code = adv7175_codes[code->index];
	return 0;
}

@@ -376,12 +377,16 @@ static const struct v4l2_subdev_video_ops adv7175_video_ops = {
	.s_routing = adv7175_s_routing,
	.s_mbus_fmt = adv7175_s_fmt,
	.g_mbus_fmt = adv7175_g_fmt,
	.enum_mbus_fmt  = adv7175_enum_fmt,
};

static const struct v4l2_subdev_pad_ops adv7175_pad_ops = {
	.enum_mbus_code = adv7175_enum_mbus_code,
};

static const struct v4l2_subdev_ops adv7175_ops = {
	.core = &adv7175_core_ops,
	.video = &adv7175_video_ops,
	.pad = &adv7175_pad_ops,
};

/* ----------------------------------------------------------------------- */
+10 −5
Original line number Diff line number Diff line
@@ -420,13 +420,14 @@ static int adv7183_g_input_status(struct v4l2_subdev *sd, u32 *status)
	return 0;
}

static int adv7183_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index,
				u32 *code)
static int adv7183_enum_mbus_code(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_mbus_code_enum *code)
{
	if (index > 0)
	if (code->pad || code->index > 0)
		return -EINVAL;

	*code = MEDIA_BUS_FMT_UYVY8_2X8;
	code->code = MEDIA_BUS_FMT_UYVY8_2X8;
	return 0;
}

@@ -514,16 +515,20 @@ static const struct v4l2_subdev_video_ops adv7183_video_ops = {
	.s_routing = adv7183_s_routing,
	.querystd = adv7183_querystd,
	.g_input_status = adv7183_g_input_status,
	.enum_mbus_fmt = adv7183_enum_mbus_fmt,
	.try_mbus_fmt = adv7183_try_mbus_fmt,
	.s_mbus_fmt = adv7183_s_mbus_fmt,
	.g_mbus_fmt = adv7183_g_mbus_fmt,
	.s_stream = adv7183_s_stream,
};

static const struct v4l2_subdev_pad_ops adv7183_pad_ops = {
	.enum_mbus_code = adv7183_enum_mbus_code,
};

static const struct v4l2_subdev_ops adv7183_ops = {
	.core = &adv7183_core_ops,
	.video = &adv7183_video_ops,
	.pad = &adv7183_pad_ops,
};

static int adv7183_probe(struct i2c_client *client,
+6 −5
Original line number Diff line number Diff line
@@ -1867,13 +1867,14 @@ static int adv7842_s_routing(struct v4l2_subdev *sd,
	return 0;
}

static int adv7842_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned int index,
				 u32 *code)
static int adv7842_enum_mbus_code(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_mbus_code_enum *code)
{
	if (index)
	if (code->pad || code->index)
		return -EINVAL;
	/* Good enough for now */
	*code = MEDIA_BUS_FMT_FIXED;
	code->code = MEDIA_BUS_FMT_FIXED;
	return 0;
}

@@ -2809,7 +2810,6 @@ static const struct v4l2_subdev_video_ops adv7842_video_ops = {
	.s_dv_timings = adv7842_s_dv_timings,
	.g_dv_timings = adv7842_g_dv_timings,
	.query_dv_timings = adv7842_query_dv_timings,
	.enum_mbus_fmt = adv7842_enum_mbus_fmt,
	.g_mbus_fmt = adv7842_g_mbus_fmt,
	.try_mbus_fmt = adv7842_g_mbus_fmt,
	.s_mbus_fmt = adv7842_g_mbus_fmt,
@@ -2820,6 +2820,7 @@ static const struct v4l2_subdev_pad_ops adv7842_pad_ops = {
	.set_edid = adv7842_set_edid,
	.enum_dv_timings = adv7842_enum_dv_timings,
	.dv_timings_cap = adv7842_dv_timings_cap,
	.enum_mbus_code = adv7842_enum_mbus_code,
};

static const struct v4l2_subdev_ops adv7842_ops = {
+10 −5
Original line number Diff line number Diff line
@@ -118,13 +118,14 @@ static int ak881x_s_mbus_fmt(struct v4l2_subdev *sd,
	return ak881x_try_g_mbus_fmt(sd, mf);
}

static int ak881x_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned int index,
				u32 *code)
static int ak881x_enum_mbus_code(struct v4l2_subdev *sd,
		struct v4l2_subdev_pad_config *cfg,
		struct v4l2_subdev_mbus_code_enum *code)
{
	if (index)
	if (code->pad || code->index)
		return -EINVAL;

	*code = MEDIA_BUS_FMT_YUYV8_2X8;
	code->code = MEDIA_BUS_FMT_YUYV8_2X8;
	return 0;
}

@@ -215,14 +216,18 @@ static struct v4l2_subdev_video_ops ak881x_subdev_video_ops = {
	.g_mbus_fmt	= ak881x_try_g_mbus_fmt,
	.try_mbus_fmt	= ak881x_try_g_mbus_fmt,
	.cropcap	= ak881x_cropcap,
	.enum_mbus_fmt	= ak881x_enum_mbus_fmt,
	.s_std_output	= ak881x_s_std_output,
	.s_stream	= ak881x_s_stream,
};

static const struct v4l2_subdev_pad_ops ak881x_subdev_pad_ops = {
	.enum_mbus_code = ak881x_enum_mbus_code,
};

static struct v4l2_subdev_ops ak881x_subdev_ops = {
	.core	= &ak881x_subdev_core_ops,
	.video	= &ak881x_subdev_video_ops,
	.pad	= &ak881x_subdev_pad_ops,
};

static int ak881x_probe(struct i2c_client *client,
Loading