]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: ov08x40: Fix the horizontal flip control
authorHao Yao <hao.yao@intel.com>
Fri, 25 Apr 2025 04:33:25 +0000 (12:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:17 +0000 (15:37 -0500)
[ Upstream commit c7df6f339af94689fdc433887f9fbb480bf8a4ed ]

The datasheet of ov08x40 doesn't match the hardware behavior.
0x3821[2] == 1 is the original state and 0 the horizontal flip enabled.

Signed-off-by: Hao Yao <hao.yao@intel.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Tested-by: Hans de Goede <hansg@kernel.org> # ThinkPad X1 Carbon Gen 12 & Gen 13
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov08x40.c

index e0094305ca2ab5c2ab64157dcd6c768f9f2ae8bc..90887fc54fb0ea72ffe5f2b097509fb9a8f1f42b 100644 (file)
@@ -1648,7 +1648,7 @@ static int ov08x40_set_ctrl_hflip(struct ov08x40 *ov08x, u32 ctrl_val)
 
        return ov08x40_write_reg(ov08x, OV08X40_REG_MIRROR,
                                 OV08X40_REG_VALUE_08BIT,
-                                ctrl_val ? val | BIT(2) : val & ~BIT(2));
+                                ctrl_val ? val & ~BIT(2) : val | BIT(2));
 }
 
 static int ov08x40_set_ctrl_vflip(struct ov08x40 *ov08x, u32 ctrl_val)