Commit 6ac98b41 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

media: ov5640: Add BGR888 format

Add support for BGR888 image format.

No existing media bus codes describe exactly the way data is transferred
on the CSI-2 bus. This is not a new issue, the CSI-2 YUV422 8-bit format
is described by MEDIA_BUS_FMT_UYVY8_1X16 which is an arbitrary
convention and not an exact match. Use the MEDIA_BUS_FMT_BGR888_1X24 to
follow the same convention, based on the order in which bits are
transmitted over the CSI-2 bus when producing images in RGB24 format.
Signed-off-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 0a43fcd7
...@@ -225,6 +225,10 @@ static const struct ov5640_pixfmt { ...@@ -225,6 +225,10 @@ static const struct ov5640_pixfmt {
.code = MEDIA_BUS_FMT_RGB565_1X16, .code = MEDIA_BUS_FMT_RGB565_1X16,
.colorspace = V4L2_COLORSPACE_SRGB, .colorspace = V4L2_COLORSPACE_SRGB,
.bpp = 16, .bpp = 16,
}, {
.code = MEDIA_BUS_FMT_BGR888_1X24,
.colorspace = V4L2_COLORSPACE_SRGB,
.bpp = 24,
}, { }, {
.code = MEDIA_BUS_FMT_SBGGR8_1X8, .code = MEDIA_BUS_FMT_SBGGR8_1X8,
.colorspace = V4L2_COLORSPACE_SRGB, .colorspace = V4L2_COLORSPACE_SRGB,
...@@ -2940,6 +2944,11 @@ static int ov5640_set_framefmt(struct ov5640_dev *sensor, ...@@ -2940,6 +2944,11 @@ static int ov5640_set_framefmt(struct ov5640_dev *sensor,
fmt = 0x61; fmt = 0x61;
mux = OV5640_FMT_MUX_RGB; mux = OV5640_FMT_MUX_RGB;
break; break;
case MEDIA_BUS_FMT_BGR888_1X24:
/* BGR888: RGB */
fmt = 0x23;
mux = OV5640_FMT_MUX_RGB;
break;
case MEDIA_BUS_FMT_JPEG_1X8: case MEDIA_BUS_FMT_JPEG_1X8:
/* YUV422, YUYV */ /* YUV422, YUYV */
fmt = 0x30; fmt = 0x30;
......
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