diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2017-04-16 19:35:46 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-19 14:01:43 +0200 |
commit | d72b196f96e2afad1656c9332da7ffe3b07e17cb (patch) | |
tree | 05e5c7cc21705733df3529badae77c0f42937fed /drivers/media | |
parent | [media] ov2640: fix vflip control (diff) | |
download | linux-d72b196f96e2afad1656c9332da7ffe3b07e17cb.tar.xz linux-d72b196f96e2afad1656c9332da7ffe3b07e17cb.zip |
[media] ov2640: add support for MEDIA_BUS_FMT_YVYU8_2X8 and MEDIA_BUS_FMT_VYUY8_2X8
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/ov2640.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index 6709e4de12ca..4a2ae24f8722 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -634,6 +634,8 @@ static const struct regval_list ov2640_rgb565_le_regs[] = { static u32 ov2640_codes[] = { MEDIA_BUS_FMT_YUYV8_2X8, MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_YVYU8_2X8, + MEDIA_BUS_FMT_VYUY8_2X8, MEDIA_BUS_FMT_RGB565_2X8_BE, MEDIA_BUS_FMT_RGB565_2X8_LE, }; @@ -798,6 +800,7 @@ static int ov2640_set_params(struct i2c_client *client, { struct ov2640_priv *priv = to_ov2640(client); const struct regval_list *selected_cfmt_regs; + u8 val; int ret; /* select win */ @@ -823,6 +826,14 @@ static int ov2640_set_params(struct i2c_client *client, dev_dbg(&client->dev, "%s: Selected cfmt UYVY", __func__); selected_cfmt_regs = ov2640_uyvy_regs; break; + case MEDIA_BUS_FMT_YVYU8_2X8: + dev_dbg(&client->dev, "%s: Selected cfmt YVYU", __func__); + selected_cfmt_regs = ov2640_yuyv_regs; + break; + case MEDIA_BUS_FMT_VYUY8_2X8: + dev_dbg(&client->dev, "%s: Selected cfmt VYUY", __func__); + selected_cfmt_regs = ov2640_uyvy_regs; + break; } /* reset hardware */ @@ -855,6 +866,11 @@ static int ov2640_set_params(struct i2c_client *client, ret = ov2640_write_array(client, selected_cfmt_regs); if (ret < 0) goto err; + val = (code == MEDIA_BUS_FMT_YVYU8_2X8) + || (code == MEDIA_BUS_FMT_VYUY8_2X8) ? CTRL0_VFIRST : 0x00; + ret = ov2640_mask_set(client, CTRL0, CTRL0_VFIRST, val); + if (ret < 0) + goto err; priv->cfmt_code = code; @@ -917,6 +933,8 @@ static int ov2640_set_fmt(struct v4l2_subdev *sd, case MEDIA_BUS_FMT_RGB565_2X8_LE: case MEDIA_BUS_FMT_YUYV8_2X8: case MEDIA_BUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: break; default: mf->code = MEDIA_BUS_FMT_UYVY8_2X8; |