Skip to content

Commit

Permalink
[media] tc358743: Add enum_mbus_code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
6by9 authored and mchehab committed Jun 7, 2017
1 parent a7a04b5 commit 3cb0fe6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/media/i2c/tc358743.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,23 @@ static int tc358743_s_stream(struct v4l2_subdev *sd, int enable)

/* --------------- PAD OPS --------------- */

static int tc358743_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
{
switch (code->index) {
case 0:
code->code = MEDIA_BUS_FMT_RGB888_1X24;
break;
case 1:
code->code = MEDIA_BUS_FMT_UYVY8_1X16;
break;
default:
return -EINVAL;
}
return 0;
}

static int tc358743_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *format)
Expand Down Expand Up @@ -1643,6 +1660,7 @@ static const struct v4l2_subdev_video_ops tc358743_video_ops = {
};

static const struct v4l2_subdev_pad_ops tc358743_pad_ops = {
.enum_mbus_code = tc358743_enum_mbus_code,
.set_fmt = tc358743_set_fmt,
.get_fmt = tc358743_get_fmt,
.get_edid = tc358743_g_edid,
Expand Down

0 comments on commit 3cb0fe6

Please sign in to comment.