diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2019-01-22 11:42:59 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-01-25 11:02:04 -0200 |
commit | adbd2969afbb9868f9a480cee4234455577a93c8 (patch) | |
tree | ad3c73c964a333e64671f518f92f08536a9870ee /drivers/media | |
parent | 61c1baa63430b391f09dce6b6cd2390293c4bcd6 (diff) |
media: ov2640: fix initial try format
Set initial try format with default configuration instead of current one.
Fixes: 8d3b307a150a ("media: ov2640: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY")
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/ov2640.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index 37e7c986af86..83031cfc7914 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -1011,14 +1011,14 @@ static int ov2640_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg) { #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct ov2640_priv *priv = to_ov2640(client); struct v4l2_mbus_framefmt *try_fmt = v4l2_subdev_get_try_format(sd, cfg, 0); + const struct ov2640_win_size *win = + ov2640_select_win(SVGA_WIDTH, SVGA_HEIGHT); - try_fmt->width = priv->win->width; - try_fmt->height = priv->win->height; - try_fmt->code = priv->cfmt_code; + try_fmt->width = win->width; + try_fmt->height = win->height; + try_fmt->code = MEDIA_BUS_FMT_UYVY8_2X8; try_fmt->colorspace = V4L2_COLORSPACE_SRGB; try_fmt->field = V4L2_FIELD_NONE; try_fmt->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; |