mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: i2c: Clarify that gain is Analogue gain in OV7251
@ 2026-11-07 11:45 Antonio Vázquez Blanco
  0 siblings, 0 replies; only message in thread
From: Antonio Vázquez Blanco @ 2026-11-07 11:45 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab
  Cc: Daniel Scally, linux-media, linux-kernel

From: Daniel Scally <dan.scally@ideasonboard.com>

Update the control ID for the gain control in the ov7251 driver to
V4L2_CID_ANALOGUE_GAIN.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
---
Notes:

This patch is not mine. It has been carried out of tree in the linux-surface
patch set since 2023 (patches/<ver>/0013-cameras.patch) and has never been
sent here as far as I can find. Daniel's Signed-off-by is from the original;
I am passing it on and have added mine. Daniel, if you would rather send it
yourself, or if there is a reason it was never submitted, please say so and
I will drop it.

One deviation from the original: the second hunk now wraps, because leaving
the call on one line puts it at 82 columns and the media subsystem asks for
checkpatch --strict --max-line-length=80. The wrap follows the style used in
commit d938b2f29be6 for ov8865.

Testing: Surface Pro 4, which has three OmniVision sensors on one IPU3,
ov8865 (INT347A), ov5693 (INT33BE) and ov7251 (INT347E). With this patch the
ov7251 subdev reports

  analogue_gain 0x009e0903 (int) : min=16 max=1023 step=1 default=16

matching the other two. Without it ov7251 is the only one of the three that
reports plain gain for the same kind of control, which is the inconsistency
this fixes on real hardware.

Built with W=1, no new warnings. checkpatch --strict --max-line-length=80
clean. Based on media/next at 7.4-rc1.

 drivers/media/i2c/ov7251.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index fce6344b5120..6ec979c5fb35 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1052,7 +1052,7 @@ static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_EXPOSURE:
 		ret = ov7251_set_exposure(ov7251, ctrl->val);
 		break;
-	case V4L2_CID_GAIN:
+	case V4L2_CID_ANALOGUE_GAIN:
 		ret = ov7251_set_gain(ov7251, ctrl->val);
 		break;
 	case V4L2_CID_TEST_PATTERN:
@@ -1580,7 +1580,8 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251)
 	ov7251->exposure = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
 					     V4L2_CID_EXPOSURE, 1, 32, 1, 32);
 	ov7251->gain = v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
-					 V4L2_CID_GAIN, 16, 1023, 1, 16);
+					 V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1,
+					 16);
 	v4l2_ctrl_new_std_menu_items(&ov7251->ctrls, &ov7251_ctrl_ops,
 				     V4L2_CID_TEST_PATTERN,
 				     ARRAY_SIZE(ov7251_test_pattern_menu) - 1,
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-07 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07 11:45 [PATCH] media: i2c: Clarify that gain is Analogue gain in OV7251 Antonio Vázquez Blanco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®