linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: ov08x40: Fix the horizontal flip control
@ 2025-04-25  4:33 Hao Yao
  2025-04-25  6:10 ` Stanislaw Gruszka
  2025-08-29 14:48 ` Hans de Goede
  0 siblings, 2 replies; 3+ messages in thread
From: Hao Yao @ 2025-04-25  4:33 UTC (permalink / raw)
  To: linux-media
  Cc: Jason Chen, Bingbu Cao, Sakari Ailus, Mauro Carvalho Chehab,
	Hans de Goede, arun.t, 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 <hao.yao@intel.com>
---
 drivers/media/i2c/ov08x40.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov08x40.c b/drivers/media/i2c/ov08x40.c
index cf0e41fc3071..17112c02408a 100644
--- a/drivers/media/i2c/ov08x40.c
+++ b/drivers/media/i2c/ov08x40.c
@@ -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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: ov08x40: Fix the horizontal flip control
  2025-04-25  4:33 [PATCH] media: ov08x40: Fix the horizontal flip control Hao Yao
@ 2025-04-25  6:10 ` Stanislaw Gruszka
  2025-08-29 14:48 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2025-04-25  6:10 UTC (permalink / raw)
  To: Hao Yao
  Cc: linux-media, Jason Chen, Bingbu Cao, Sakari Ailus,
	Mauro Carvalho Chehab, Hans de Goede, arun.t

On Fri, Apr 25, 2025 at 12:33:25PM +0800, Hao Yao wrote:
> 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: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>

Regards
Stanislaw

> ---
>  drivers/media/i2c/ov08x40.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov08x40.c b/drivers/media/i2c/ov08x40.c
> index cf0e41fc3071..17112c02408a 100644
> --- a/drivers/media/i2c/ov08x40.c
> +++ b/drivers/media/i2c/ov08x40.c
> @@ -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)
> -- 
> 2.43.0
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: ov08x40: Fix the horizontal flip control
  2025-04-25  4:33 [PATCH] media: ov08x40: Fix the horizontal flip control Hao Yao
  2025-04-25  6:10 ` Stanislaw Gruszka
@ 2025-08-29 14:48 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2025-08-29 14:48 UTC (permalink / raw)
  To: Hao Yao, linux-media
  Cc: Jason Chen, Bingbu Cao, Sakari Ailus, Mauro Carvalho Chehab,
	arun.t

Hi,

On 25-Apr-25 6:33 AM, Hao Yao wrote:
> 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>

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 <hansg@kernel.org>
Tested-by: Hans de Goede <hansg@kernel.org> # ThinkPad X1 Carbon Gen 12 & Gen 13

Regards,

Hans


> ---
>  drivers/media/i2c/ov08x40.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov08x40.c b/drivers/media/i2c/ov08x40.c
> index cf0e41fc3071..17112c02408a 100644
> --- a/drivers/media/i2c/ov08x40.c
> +++ b/drivers/media/i2c/ov08x40.c
> @@ -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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-29 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25  4:33 [PATCH] media: ov08x40: Fix the horizontal flip control Hao Yao
2025-04-25  6:10 ` Stanislaw Gruszka
2025-08-29 14:48 ` Hans de Goede

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).