]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: ov5647: Tidy up PIXEL_RATE control
authorJai Luthra <jai.luthra@ideasonboard.com>
Mon, 22 Dec 2025 08:15:40 +0000 (13:45 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 14 Jan 2026 22:33:03 +0000 (23:33 +0100)
The pixel rate control is marked as read-only by the framework itself,
so no need to mark it explicitly in the driver. Also, we can set the ops
to NULL to avoid checking for it in the s_ctrl implementation.

Suggested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ov5647.c

index d4a13e17692ff178e9dc257bcca0e44c92705825..7003c9922c5be666b4322c8d1dd0a2893c86f253 100644 (file)
@@ -1190,12 +1190,6 @@ static int ov5647_s_ctrl(struct v4l2_ctrl *ctrl)
                ret = ov5647_write(sd, OV5647_REG_ISPCTRL3D,
                                   ov5647_test_pattern_val[ctrl->val]);
                break;
-
-       /* Read-only, but we adjust it based on mode. */
-       case V4L2_CID_PIXEL_RATE:
-               /* Read-only, but we adjust it based on mode. */
-               break;
-
        case V4L2_CID_HFLIP:
                /* There's an in-built hflip in the sensor, so account for that here. */
                ret = ov5647_s_flip(sd, OV5647_REG_TIMING_TC_H, !ctrl->val);
@@ -1262,7 +1256,7 @@ static int ov5647_init_controls(struct ov5647 *sensor)
                          V4L2_CID_ANALOGUE_GAIN, 16, 1023, 1, 32);
 
        /* By default, PIXEL_RATE is read only, but it does change per mode */
-       sensor->pixel_rate = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
+       sensor->pixel_rate = v4l2_ctrl_new_std(&sensor->ctrls, NULL,
                                               V4L2_CID_PIXEL_RATE,
                                               sensor->mode->pixel_rate,
                                               sensor->mode->pixel_rate, 1,
@@ -1301,7 +1295,6 @@ static int ov5647_init_controls(struct ov5647 *sensor)
        if (sensor->ctrls.error)
                goto handler_free;
 
-       sensor->pixel_rate->flags |= V4L2_CTRL_FLAG_READ_ONLY;
        sensor->sd.ctrl_handler = &sensor->ctrls;
 
        return 0;