From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: linux-media@vger.kernel.org
Cc: Michael Riesch <michael.riesch@collabora.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Gerald Loacker <gerald.loacker@wolfvision.net>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH v2 5/5] media: i2c: imx415: Cluster horizontal and vertical flip controls
Date: Fri, 10 Apr 2026 09:19:44 +0300 [thread overview]
Message-ID: <20260410061944.241480-6-eagle.alexander923@gmail.com> (raw)
In-Reply-To: <20260410061944.241480-1-eagle.alexander923@gmail.com>
Wrap the hflip and vflip control pointers in an anonymous struct
and add a v4l2_ctrl_cluster(2, &sensor->hflip) call.
Clustering ensures that both controls are handled together by the
control framework, which is appropriate because changing one flip
setting does not invalidate the other, but they may need to be
applied atomically. This also prevents potential inconsistencies
when the control handler updates them.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
drivers/media/i2c/imx415.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/imx415.c b/drivers/media/i2c/imx415.c
index ec0239ccf5fc..d72d2cd2fd6d 100644
--- a/drivers/media/i2c/imx415.c
+++ b/drivers/media/i2c/imx415.c
@@ -668,8 +668,10 @@ struct imx415 {
struct v4l2_ctrl_handler ctrls;
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
- struct v4l2_ctrl *hflip;
- struct v4l2_ctrl *vflip;
+ struct {
+ struct v4l2_ctrl *hflip;
+ struct v4l2_ctrl *vflip;
+ };
struct v4l2_ctrl *exposure;
unsigned int cur_mode;
@@ -949,6 +951,7 @@ static int imx415_ctrls_init(struct imx415 *sensor)
V4L2_CID_HFLIP, 0, 1, 1, 0);
sensor->vflip = v4l2_ctrl_new_std(&sensor->ctrls, &imx415_ctrl_ops,
V4L2_CID_VFLIP, 0, 1, 1, 0);
+ v4l2_ctrl_cluster(2, &sensor->hflip);
v4l2_ctrl_new_std_menu_items(&sensor->ctrls, &imx415_ctrl_ops,
V4L2_CID_TEST_PATTERN,
--
2.52.0
next prev parent reply other threads:[~2026-04-10 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 6:19 [PATCH v2 0/5] media: i2c: imx415: driver improvements and fixes Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 1/5] media: i2c: imx415: Add missing ADBIT1 register for 10/12-bit output Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 2/5] media: i2c: imx415: Add missing CSI-2 timing configurations for all lane rates Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 3/5] media: i2c: imx415: Add missing 4-lane CSI-2 timing configurations Alexander Shiyan
2026-04-10 6:19 ` [PATCH v2 4/5] media: i2c: imx415: Fix control handler initial count Alexander Shiyan
2026-04-10 6:19 ` Alexander Shiyan [this message]
2026-04-17 12:23 ` [PATCH v2 0/5] media: i2c: imx415: driver improvements and fixes Michael Riesch
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=20260410061944.241480-6-eagle.alexander923@gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=gerald.loacker@wolfvision.net \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michael.riesch@collabora.com \
--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