1 From 3d314e1c554ea4cc64dcdd5e227767a518b7dcb2 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Fri, 1 Apr 2022 18:54:12 +0100
4 Subject: [PATCH] media: i2c: imx258: Set pixel_rate range to the same
7 With a read only control there is limited point in advertising
8 a minimum and maximum for the control, so change to set the
9 value, min, and max all to the selected pixel rate.
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 drivers/media/i2c/imx258.c | 18 +++++++-----------
14 1 file changed, 7 insertions(+), 11 deletions(-)
16 --- a/drivers/media/i2c/imx258.c
17 +++ b/drivers/media/i2c/imx258.c
18 @@ -1237,7 +1237,8 @@ static int imx258_set_pad_format(struct
20 link_freq = imx258->link_freq_menu_items[mode->link_freq_index];
21 pixel_rate = link_freq_to_pixel_rate(link_freq, imx258->nlanes);
22 - __v4l2_ctrl_s_ctrl_int64(imx258->pixel_rate, pixel_rate);
23 + __v4l2_ctrl_modify_range(imx258->pixel_rate, pixel_rate,
24 + pixel_rate, 1, pixel_rate);
25 /* Update limits and set FPS to default */
26 vblank_def = imx258->cur_mode->vts_def -
27 imx258->cur_mode->height;
28 @@ -1546,8 +1547,7 @@ static int imx258_init_controls(struct i
29 struct v4l2_ctrl_handler *ctrl_hdlr;
37 ctrl_hdlr = &imx258->ctrl_handler;
38 @@ -1567,17 +1567,13 @@ static int imx258_init_controls(struct i
39 if (imx258->link_freq)
40 imx258->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
43 - link_freq_to_pixel_rate(imx258->link_freq_menu_items[0],
46 - link_freq_to_pixel_rate(imx258->link_freq_menu_items[1],
48 + pixel_rate = link_freq_to_pixel_rate(imx258->link_freq_menu_items[0],
50 /* By default, PIXEL_RATE is read only */
51 imx258->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &imx258_ctrl_ops,
53 - pixel_rate_min, pixel_rate_max,
55 + pixel_rate, pixel_rate,
59 vblank_def = imx258->cur_mode->vts_def - imx258->cur_mode->height;