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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251118-b4-rpi-ov5647-v2-15-5e78e7cb7f9b@ideasonboard.com>
Date: Tue, 18 Nov 2025 17:33:08 +0530
From: Jai Luthra <jai.luthra@...asonboard.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>, 
 Dave Stevenson <dave.stevenson@...pberrypi.com>, 
 Jacopo Mondi <jacopo@...ndi.org>, 
 Mauro Carvalho Chehab <mchehab@...nel.org>, 
 Naushir Patuck <naush@...pberrypi.com>, Rob Herring <robh@...nel.org>, 
 Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org, 
 devicetree@...r.kernel.org, 
 Mauro Carvalho Chehab <mchehab+huawei@...nel.org>, 
 Kieran Bingham <kieran.bingham@...asonboard.com>, 
 David Plowman <david.plowman@...pberrypi.com>, 
 Laurent Pinchart <laurent.pinchart@...asonboard.com>, 
 Peter Robinson <pbrobinson@...il.com>, Stefan Wahren <wahrenst@....net>, 
 "Ivan T. Ivanov" <iivanov@...e.de>, 
 Jacopo Mondi <jacopo.mondi@...asonboard.com>, 
 Jai Luthra <jai.luthra@...asonboard.com>
Subject: [PATCH v2 15/16] media: i2c: ov5647: Tidy up PIXEL_RATE control

The pixel rate control is marked as read-only by the framework itself,
so no need to mark it explicitly in the driver. Also, we can set the ops
to NULL to avoid checking for it in the s_ctrl implementation.

Suggested-by: Jacopo Mondi <jacopo.mondi@...asonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@...asonboard.com>
---
 drivers/media/i2c/ov5647.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 3a2c25a6b6808bf1289a2357ac5b79bf6bf99daa..71107d74f2900b39233a52b29a229282bd087963 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1195,12 +1195,6 @@ static int ov5647_s_ctrl(struct v4l2_ctrl *ctrl)
 		ret = ov5647_write(sd, OV5647_REG_ISPCTRL3D,
 				   ov5647_test_pattern_val[ctrl->val]);
 		break;
-
-	/* Read-only, but we adjust it based on mode. */
-	case V4L2_CID_PIXEL_RATE:
-		/* Read-only, but we adjust it based on mode. */
-		break;
-
 	case V4L2_CID_HFLIP:
 		/* There's an in-built hflip in the sensor, so account for that here. */
 		ov5647_s_flip(sd, OV5647_REG_TIMING_TC_H, !ctrl->val);
@@ -1267,7 +1261,7 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 			  V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1, 32);
 
 	/* By default, PIXEL_RATE is read only, but it does change per mode */
-	sensor->pixel_rate = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
+	sensor->pixel_rate = v4l2_ctrl_new_std(&sensor->ctrls, NULL,
 					       V4L2_CID_PIXEL_RATE,
 					       sensor->mode->pixel_rate,
 					       sensor->mode->pixel_rate, 1,
@@ -1306,7 +1300,6 @@ static int ov5647_init_controls(struct ov5647 *sensor)
 	if (sensor->ctrls.error)
 		goto handler_free;
 
-	sensor->pixel_rate->flags |= V4L2_CTRL_FLAG_READ_ONLY;
 	sensor->sd.ctrl_handler = &sensor->ctrls;
 
 	return 0;

-- 
2.51.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ