[PATCH v2 25/25] media: i2c: imx283: Simplify VFLIP control setting
From: Kieran Bingham
Date: Fri Feb 13 2026 - 09:10:31 EST
The VFLIP control is configured through the MDVREV bit of the HTRIMMING
register.
Simplify the conditional branch from 5 lines to 3 by determining the
trim value which must always include setting the HTRIMMING_EN bit,
and conditionally set the MDVREV before applying it to the hardware.
Signed-off-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
---
drivers/media/i2c/imx283.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c
index f0ede67921d9..1698754ea059 100644
--- a/drivers/media/i2c/imx283.c
+++ b/drivers/media/i2c/imx283.c
@@ -948,13 +948,11 @@ static int imx283_set_ctrl(struct v4l2_ctrl *ctrl)
* VFLIP is managed by BIT(0) of IMX283_REG_HTRIMMING address, hence
* both need to be set simultaneously.
*/
- if (ctrl->val) {
- cci_write(imx283->cci, IMX283_REG_HTRIMMING,
- IMX283_HTRIMMING_EN | IMX283_MDVREV, &ret);
- } else {
- cci_write(imx283->cci, IMX283_REG_HTRIMMING,
- IMX283_HTRIMMING_EN, &ret);
- }
+ u8 trim = IMX283_HTRIMMING_EN;
+
+ trim |= ctrl->val ? IMX283_MDVREV : 0;
+ cci_write(imx283->cci, IMX283_REG_HTRIMMING, trim, &ret);
+
break;
case V4L2_CID_TEST_PATTERN:
--
2.52.0