public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Saikiran <bjsaikiran@gmail.com>
To: linux-media@vger.kernel.org
Cc: hansg@kernel.org, bod@kernel.org, sakari.ailus@linux.intel.com,
	mchehab@kernel.org, Saikiran <bjsaikiran@gmail.com>
Subject: [PATCH] media: i2c: ov02c10: Fix incorrect Bayer pattern to SGRBG10
Date: Sat, 24 Jan 2026 13:13:39 +0530	[thread overview]
Message-ID: <20260124074402.7165-2-bjsaikiran@gmail.com> (raw)
In-Reply-To: <20260124074402.7165-1-bjsaikiran@gmail.com>

The OV02C10 driver incorrectly reports SBGGR10 Bayer pattern, but
the actual sensor hardware outputs SGRBG10 (Green-Red-Blue-Green).
This mismatch causes severe green color tint in all captured images.

The correct pattern was determined through:
1. Testing on Lenovo Yoga Slim 7x (Snapdragon X Elite)
2. Comparison of all four Bayer patterns (SBGGR10, SGBRG10, SGRBG10, SRGGB10)
3. Visual verification with libcamera/qcam showing natural colors with SGRBG10

Without this fix, the camera produces unusable images with overwhelming
green tint regardless of lighting conditions or camera application used.

Tested-on: Lenovo Yoga Slim 7x (Snapdragon X Elite)
Signed-off-by: Saikiran <bjsaikiran@gmail.com>
---
 drivers/media/i2c/ov02c10.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index f156f647081f..cf93d36032e1 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -577,7 +577,7 @@ static void ov02c10_update_pad_format(const struct ov02c10_mode *mode,
 {
 	fmt->width = mode->width;
 	fmt->height = mode->height;
-	fmt->code = MEDIA_BUS_FMT_SBGGR10_1X10;
+	fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
 	fmt->field = V4L2_FIELD_NONE;
 }
 
@@ -732,7 +732,7 @@ static int ov02c10_enum_mbus_code(struct v4l2_subdev *sd,
 	if (code->index > 0)
 		return -EINVAL;
 
-	code->code = MEDIA_BUS_FMT_SBGGR10_1X10;
+	code->code = MEDIA_BUS_FMT_SGRBG10_1X10;
 
 	return 0;
 }
@@ -744,7 +744,7 @@ static int ov02c10_enum_frame_size(struct v4l2_subdev *sd,
 	if (fse->index >= ARRAY_SIZE(supported_modes))
 		return -EINVAL;
 
-	if (fse->code != MEDIA_BUS_FMT_SBGGR10_1X10)
+	if (fse->code != MEDIA_BUS_FMT_SGRBG10_1X10)
 		return -EINVAL;
 
 	fse->min_width = supported_modes[fse->index].width;
-- 
2.51.0


  reply	other threads:[~2026-01-24  7:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-24  7:43 [PATCH 0/2] Fix OV02C10 camera color and stability issues Saikiran
2026-01-24  7:43 ` Saikiran [this message]
2026-01-26 10:15   ` [PATCH] media: i2c: ov02c10: Fix incorrect Bayer pattern to SGRBG10 Hans de Goede
2026-01-24  7:43 ` [PATCH] media: i2c: ov02c10: Fix race condition in remove and relax reset timings Saikiran
2026-01-26 10:16   ` Hans de Goede

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=20260124074402.7165-2-bjsaikiran@gmail.com \
    --to=bjsaikiran@gmail.com \
    --cc=bod@kernel.org \
    --cc=hansg@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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