summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/tc358743.c
diff options
context:
space:
mode:
authorDave Stevenson <dave.stevenson@raspberrypi.org>2017-06-02 09:18:12 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-07 09:29:48 -0300
commit3cb0fe6f74e566b1e4df81f518db16cedb268fc5 (patch)
treedf06c1f9f03dc57bfc8f1f967d97754447e0eefa /drivers/media/i2c/tc358743.c
parenta7a04b5b2c6e060c80cd9617b351ffbd618fc587 (diff)
downloadlinux-riscv-3cb0fe6f74e566b1e4df81f518db16cedb268fc5.tar.gz
linux-riscv-3cb0fe6f74e566b1e4df81f518db16cedb268fc5.tar.bz2
linux-riscv-3cb0fe6f74e566b1e4df81f518db16cedb268fc5.zip
[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>
Diffstat (limited to 'drivers/media/i2c/tc358743.c')
-rw-r--r--drivers/media/i2c/tc358743.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 8f8bb9ee3e6d..6ba65c783161 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -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)
@@ -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,