[PATCH 07/10] media: i2c: ov9282: drop redundant vblank field
From: Richard Leitner
Date: Mon Sep 14 2026 - 15:31:12 EST
The ov9282 main struct has a dedicated vblank field which was only used
to duplicate the value of the vblank v4l2 control.
Therefore drop this struct field.
Signed-off-by: Richard Leitner <richard.leitner@xxxxxxxxx>
---
drivers/media/i2c/ov9282.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index 632184e76b9bd..28f8b05b4c09e 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -193,7 +193,6 @@ struct ov9282_mode {
* @again_ctrl: Pointer to analog gain control
* @pixel_rate: Pointer to pixel rate control
* @flash_duration: Pointer to flash duration control
- * @vblank: Vertical blanking in lines
* @noncontinuous_clock: Selection of CSI2 noncontinuous clock mode
* @cur_mode: Pointer to current selected sensor mode
* @code: Mbus code currently selected
@@ -216,7 +215,6 @@ struct ov9282 {
};
struct v4l2_ctrl *pixel_rate;
struct v4l2_ctrl *flash_duration;
- u32 vblank;
bool noncontinuous_clock;
const struct ov9282_mode *cur_mode;
u32 code;
@@ -646,17 +644,13 @@ static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl)
switch (ctrl->id) {
case V4L2_CID_VBLANK:
- ov9282->vblank = ov9282->vblank_ctrl->val;
-
+ lpfr = ctrl->val + ov9282->cur_mode->height;
dev_dbg(ov9282->dev, "Received vblank %u, new lpfr %u",
- ov9282->vblank,
- ov9282->vblank + ov9282->cur_mode->height);
+ ctrl->val, lpfr);
ret = __v4l2_ctrl_modify_range(ov9282->exp_ctrl,
OV9282_EXPOSURE_MIN,
- ov9282->vblank +
- ov9282->cur_mode->height -
- OV9282_EXPOSURE_OFFSET,
+ lpfr - OV9282_EXPOSURE_OFFSET,
1, OV9282_EXPOSURE_DEFAULT);
if (ret)
return ret;
@@ -704,7 +698,7 @@ static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl)
ret = ov9282_update_exp_gain(ov9282, exposure, analog_gain);
break;
case V4L2_CID_VBLANK:
- lpfr = ov9282->vblank + ov9282->cur_mode->height;
+ lpfr = ctrl->val + ov9282->cur_mode->height;
ret = cci_write(ov9282->regmap, OV9282_REG_LPFR, lpfr, NULL);
break;
case V4L2_CID_HFLIP:
@@ -1412,7 +1406,6 @@ static int ov9282_probe(struct i2c_client *client)
/* Set default mode to first mode */
ov9282->cur_mode = &supported_modes[DEFAULT_MODE];
ov9282->code = MEDIA_BUS_FMT_Y10_1X10;
- ov9282->vblank = ov9282->cur_mode->vblank;
ret = ov9282_init_controls(ov9282);
if (ret) {
--
2.53.0