]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
media: ov5640: Add additional media bus formats
authorSam Bobrowicz <sam@elite-embedded.com>
Thu, 11 Oct 2018 16:23:30 +0000 (09:23 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 15 Oct 2018 06:17:54 +0000 (08:17 +0200)
Add support for 1X16 yuv media bus formats (v4l2_mbus_framefmt).
These formats are equivalent to the 2X8 formats that are already
supported, both of which accurately describe the data present on
the CSI2 interface. This change will increase compatibility with
CSI2 RX drivers that only advertise support for the 1X16 formats.

Signed-off-by: Sam Bobrowicz <sam@elite-embedded.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/i2c/ov5640.c

index dfce92d66469397440b96e841868da0877d78478..a48729314df209f1e9342709b7de555bcddbd916 100644 (file)
@@ -125,6 +125,8 @@ static const struct ov5640_pixfmt ov5640_formats[] = {
        { MEDIA_BUS_FMT_JPEG_1X8, V4L2_COLORSPACE_JPEG, },
        { MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_SRGB, },
        { MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_SRGB, },
+       { MEDIA_BUS_FMT_UYVY8_1X16, V4L2_COLORSPACE_SRGB, },
+       { MEDIA_BUS_FMT_YUYV8_1X16, V4L2_COLORSPACE_SRGB, },
        { MEDIA_BUS_FMT_RGB565_2X8_LE, V4L2_COLORSPACE_SRGB, },
        { MEDIA_BUS_FMT_RGB565_2X8_BE, V4L2_COLORSPACE_SRGB, },
 };
@@ -2340,10 +2342,12 @@ static int ov5640_set_framefmt(struct ov5640_dev *sensor,
 
        switch (format->code) {
        case MEDIA_BUS_FMT_UYVY8_2X8:
+       case MEDIA_BUS_FMT_UYVY8_1X16:
                /* YUV422, UYVY */
                val = 0x3f;
                break;
        case MEDIA_BUS_FMT_YUYV8_2X8:
+       case MEDIA_BUS_FMT_YUYV8_1X16:
                /* YUV422, YUYV */
                val = 0x30;
                break;