media: ov08x40: Fix the horizontal flip control
PATCH 1/1 media: ov08x40: Fix the horizontal flip control
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 <[email protected]>
--- drivers/media/i2c/ov08x40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ov08x40.c +1 -1
@@ -1627,7 +1627,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)
Signature · 1 line
2.43.0
Quoted 4 lines · Hao Yao
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 <[email protected]>
Reviewed-by Stanislaw Gruszka <[email protected]>
Regards
Stanislaw
Quoted 21 lines
--- drivers/media/i2c/ov08x40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/ov08x40.c +1
-1@@ -1627,7 +1627,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)Signature · 1 line
2.43.0
Hi,
Quoted 4 lines · Hao Yao
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 <[email protected]>
Thanks, patch looks good to me and I've successfully tested this on a ThinkPad X1 Carbon Gen 12 & Gen 13 where the image indeed used to be mirrored.
Reviewed-by Hans de Goede <[email protected]>
Regards,
Hans
Quoted 17 lines
--- drivers/media/i2c/ov08x40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/ov08x40.c +1
-1@@ -1627,7 +1627,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)