linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Bobrowicz <sam@elite-embedded.com>
To: linux-media@vger.kernel.org
Cc: Sam Bobrowicz <sam@elite-embedded.com>
Subject: [PATCH 4/4] media: ov5640: Add additional media bus formats
Date: Mon,  8 Oct 2018 23:48:02 -0700	[thread overview]
Message-ID: <1539067682-60604-5-git-send-email-sam@elite-embedded.com> (raw)
In-Reply-To: <1539067682-60604-1-git-send-email-sam@elite-embedded.com>

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>
---
 drivers/media/i2c/ov5640.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index a50d884..ca9de56 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -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, },
 };
@@ -2069,10 +2071,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;
-- 
2.7.4

  parent reply	other threads:[~2018-10-09 14:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09  6:47 [PATCH 0/4] ov5640: small fixes for compatibility Sam Bobrowicz
2018-10-09  6:47 ` [PATCH 1/4] media: ov5640: fix resolution update Sam Bobrowicz
2018-10-10 10:58   ` jacopo mondi
2018-10-10 12:41     ` Laurent Pinchart
2018-10-15 15:13       ` Hugues FRUCHET
2018-10-15 15:24         ` jacopo mondi
2018-10-16  8:49           ` Hugues FRUCHET
2018-10-16 12:15         ` Laurent Pinchart
2018-10-16 18:14           ` Samuel Bobrowicz
2018-10-09  6:48 ` [PATCH 2/4] media: ov5640: fix get_light_freq on auto Sam Bobrowicz
2018-10-10  8:49   ` jacopo mondi
2018-10-09  6:48 ` [PATCH 3/4] media: ov5640: Don't access ctrl regs when off Sam Bobrowicz
2018-10-10  8:48   ` jacopo mondi
2018-10-09  6:48 ` Sam Bobrowicz [this message]
2018-11-16 13:18   ` [PATCH 4/4] media: ov5640: Add additional media bus formats Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1539067682-60604-5-git-send-email-sam@elite-embedded.com \
    --to=sam@elite-embedded.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).