Skip to content

Commit 3cb0fe6

Browse files
6by9mchehab
authored andcommitted
[media] tc358743: Add enum_mbus_code
There was no way to query the supported mbus formats from this driver. enum_mbus_code is the function to expose that, so implement it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1 parent a7a04b5 commit 3cb0fe6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/media/i2c/tc358743.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,23 @@ static int tc358743_s_stream(struct v4l2_subdev *sd, int enable)
14741474

14751475
/* --------------- PAD OPS --------------- */
14761476

1477+
static int tc358743_enum_mbus_code(struct v4l2_subdev *sd,
1478+
struct v4l2_subdev_pad_config *cfg,
1479+
struct v4l2_subdev_mbus_code_enum *code)
1480+
{
1481+
switch (code->index) {
1482+
case 0:
1483+
code->code = MEDIA_BUS_FMT_RGB888_1X24;
1484+
break;
1485+
case 1:
1486+
code->code = MEDIA_BUS_FMT_UYVY8_1X16;
1487+
break;
1488+
default:
1489+
return -EINVAL;
1490+
}
1491+
return 0;
1492+
}
1493+
14771494
static int tc358743_get_fmt(struct v4l2_subdev *sd,
14781495
struct v4l2_subdev_pad_config *cfg,
14791496
struct v4l2_subdev_format *format)
@@ -1643,6 +1660,7 @@ static const struct v4l2_subdev_video_ops tc358743_video_ops = {
16431660
};
16441661

16451662
static const struct v4l2_subdev_pad_ops tc358743_pad_ops = {
1663+
.enum_mbus_code = tc358743_enum_mbus_code,
16461664
.set_fmt = tc358743_set_fmt,
16471665
.get_fmt = tc358743_get_fmt,
16481666
.get_edid = tc358743_g_edid,

0 commit comments

Comments
 (0)