lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2ad7377b-19df-412f-9925-40bcc232cafb@kernel.org>
Date: Thu, 21 Aug 2025 09:33:20 +0100
From: Bryan O'Donoghue <bod@...nel.org>
To: Sebastian Reichel <sre@...nel.org>, Hans de Goede <hansg@...nel.org>,
 Sakari Ailus <sakari.ailus@...ux.intel.com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>,
 Heimir Thor Sverrisson <heimir.sverrisson@...il.com>,
 Hans Verkuil <hverkuil@...nel.org>
Cc: Frederic Stuyk <fstuyk@...box.com>, linux-media@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] media: ov02c10: Support hflip and vflip

On 20/08/2025 01:13, Sebastian Reichel wrote:
> Support horizontal and vertical flip, which is necessary to handle
> upside-down mounted sensors.
> 
> Suggested-by: Bryan O'Donoghue <bod@...nel.org>
> Signed-off-by: Sebastian Reichel <sre@...nel.org>
> ---
>   drivers/media/i2c/ov02c10.c | 25 ++++++++++++++++++++++++-
>   1 file changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index 3a02fce0a9bc0ca3ab87defe3eefd04efb4012e7..103d007415348a8bd31a09e518de23f5fd77c618 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -384,6 +384,8 @@ struct ov02c10 {
>   	struct v4l2_ctrl *vblank;
>   	struct v4l2_ctrl *hblank;
>   	struct v4l2_ctrl *exposure;
> +	struct v4l2_ctrl *hflip;
> +	struct v4l2_ctrl *vflip;
> 
>   	struct clk *img_clk;
>   	struct gpio_desc *reset;
> @@ -462,6 +464,16 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
>   		ret = ov02c10_test_pattern(ov02c10, ctrl->val);
>   		break;
> 
> +	case V4L2_CID_HFLIP:
> +		cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
> +				BIT(3), ov02c10->hflip->val << 3, &ret);
> +		break;
> +
> +	case V4L2_CID_VFLIP:
> +		cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
> +				BIT(4), ov02c10->vflip->val << 4, &ret);
> +		break;
> +
>   	default:
>   		ret = -EINVAL;
>   		break;
> @@ -486,7 +498,7 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
>   	s64 exposure_max, h_blank, pixel_rate;
>   	int ret;
> 
> -	v4l2_ctrl_handler_init(ctrl_hdlr, 10);
> +	v4l2_ctrl_handler_init(ctrl_hdlr, 12);
> 
>   	ov02c10->link_freq = v4l2_ctrl_new_int_menu(ctrl_hdlr,
>   						    &ov02c10_ctrl_ops,
> @@ -537,6 +549,17 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
>   					      exposure_max,
>   					      OV02C10_EXPOSURE_STEP,
>   					      exposure_max);
> +
> +	ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
> +					   V4L2_CID_HFLIP, 0, 1, 1, 0);
> +	if (ov02c10->hflip)
> +		ov02c10->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
> +
> +	ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
> +					   V4L2_CID_VFLIP, 0, 1, 1, 0);
> +	if (ov02c10->vflip)
> +		ov02c10->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
> +
>   	v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
>   				     V4L2_CID_TEST_PATTERN,
>   				     ARRAY_SIZE(ov02c10_test_pattern_menu) - 1,
> 
> --
> 2.50.1
> 
Reviewed-by: Bryan O'Donoghue <bod@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ