From: "Antonio Vázquez Blanco" <antoniovazquezblanco@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Daniel Scally <dan.scally@ideasonboard.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] media: i2c: Clarify that gain is Analogue gain in OV7251
Date: Sat, 7 Nov 2026 12:45:49 +0100 [thread overview]
Message-ID: <20261107114549.21301-1-antoniovazquezblanco@gmail.com> (raw)
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
reply other threads:[~2026-11-07 11:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261107114549.21301-1-antoniovazquezblanco@gmail.com \
--to=antoniovazquezblanco@gmail.com \
--cc=dan.scally@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®