[PATCH v2 7/8] media: i2c: ov9282: drop redundant vblank field

From: Richard Leitner

Date: Wed Oct 14 2026 - 02:57:24 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.

Reviewed-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>
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 5114fbf28a26c..f877cb9e78c38 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -196,7 +196,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
@@ -219,7 +218,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;
@@ -629,17 +627,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;
@@ -666,7 +660,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:
@@ -1382,7 +1376,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