]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: ov02c10: Fix the horizontal flip control
authorHans de Goede <johannes.goede@oss.qualcomm.com>
Mon, 8 Dec 2025 14:32:58 +0000 (15:32 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 6 Jan 2026 08:33:32 +0000 (09:33 +0100)
During sensor calibration I noticed that with the hflip control set to
false/disabled the image was mirrored.

The horizontal flip control is inverted and needs to be set to 1 to not
flip. This is something which seems to be common with various recent
Omnivision sensors, the ov01a10 and ov08x40 also have an inverted
mirror control.

Invert the hflip control to fix the sensor mirroring by default.

Fixes: b7cd2ba3f692 ("media: ov02c10: Support hflip and vflip")
Cc: stable@vger.kernel.org
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Tested-by: Sebastian Reichel <sre@kernel.org> # T14s Gen6 Snapdragon
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ov02c10.c

index 384c2f0b16086de19b4b15f27bb0022b0f815ed9..f912ae1420408fef61d4205bc12a7d7184c9f629 100644 (file)
@@ -170,7 +170,7 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
        {0x3816, 0x01},
        {0x3817, 0x01},
 
-       {0x3820, 0xa0},
+       {0x3820, 0xa8},
        {0x3821, 0x00},
        {0x3822, 0x80},
        {0x3823, 0x08},
@@ -462,9 +462,9 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
 
        case V4L2_CID_HFLIP:
                cci_write(ov02c10->regmap, OV02C10_ISP_X_WIN_CONTROL,
-                         ctrl->val ? 1 : 2, &ret);
+                         ctrl->val ? 2 : 1, &ret);
                cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
-                               BIT(3), ov02c10->hflip->val << 3, &ret);
+                               BIT(3), ctrl->val ? 0 : BIT(3), &ret);
                break;
 
        case V4L2_CID_VFLIP: