Skip to content

Commit

Permalink
media: mt9m111: set all mbus format field when G_FMT and S_FMT ioctls
Browse files Browse the repository at this point in the history
This driver doesn't set all members of mbus format field when the
VIDIOC_SUBDEV_{S,G}_FMT ioctls are called.

This is detected by v4l2-compliance.

Cc: Enrico Scholz <[email protected]>
Cc: Michael Grzeschik <[email protected]>
Cc: Marco Felsch <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mita authored and mchehab committed Jan 25, 2019
1 parent 49410d3 commit 2e1566a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/i2c/mt9m111.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ static int mt9m111_get_fmt(struct v4l2_subdev *sd,
mf->code = mt9m111->fmt->code;
mf->colorspace = mt9m111->fmt->colorspace;
mf->field = V4L2_FIELD_NONE;
mf->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
mf->quantization = V4L2_QUANTIZATION_DEFAULT;
mf->xfer_func = V4L2_XFER_FUNC_DEFAULT;

return 0;
}
Expand Down Expand Up @@ -670,6 +673,10 @@ static int mt9m111_set_fmt(struct v4l2_subdev *sd,

mf->code = fmt->code;
mf->colorspace = fmt->colorspace;
mf->field = V4L2_FIELD_NONE;
mf->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
mf->quantization = V4L2_QUANTIZATION_DEFAULT;
mf->xfer_func = V4L2_XFER_FUNC_DEFAULT;

if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
cfg->try_fmt = *mf;
Expand Down

0 comments on commit 2e1566a

Please sign in to comment.