Commit 7218905a authored by Eugen Hristev's avatar Eugen Hristev Committed by Mauro Carvalho Chehab

media: i2c: imx274: implement enum_mbus_code

Current driver supports only SRGGB 10 bit RAW bayer format.
Add the enum_mbus_code implementation to report this format supported.

 # v4l2-ctl -d /dev/v4l-subdev3 --list-subdev-mbus-codes
ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0)
        0x300f: MEDIA_BUS_FMT_SRGGB10_1X10
 #
Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 358ed66b
......@@ -1909,7 +1909,21 @@ static int imx274_set_frame_interval(struct stimx274 *priv,
return err;
}
static int imx274_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{
if (code->index > 0)
return -EINVAL;
/* only supported format in the driver is Raw 10 bits SRGGB */
code->code = MEDIA_BUS_FMT_SRGGB10_1X10;
return 0;
}
static const struct v4l2_subdev_pad_ops imx274_pad_ops = {
.enum_mbus_code = imx274_enum_mbus_code,
.get_fmt = imx274_get_fmt,
.set_fmt = imx274_set_fmt,
.get_selection = imx274_get_selection,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment