aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2022-05-16 23:40:32 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2022-05-17 15:11:22 +0200
commit20ea6adbf199097c4f5f591ffee088340630dae4 (patch)
treed6719d95e136611a1c25bbf7789652d6d402779d /target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch
parentbca05bd072180dc38ef740b37ded9572a6db1981 (diff)
downloadupstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.gz
upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.bz2
upstream-20ea6adbf199097c4f5f591ffee088340630dae4.zip
bcm27xx: add support for linux v5.15
Build system: x86_64 Build-tested: bcm2708, bcm2709, bcm2710, bcm2711 Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B Signed-off-by: Marty Jones <mj8263788@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch b/target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch
new file mode 100644
index 0000000000..e4eb53f664
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.15/950-0825-media-i2c-imx258-Set-pixel_rate-range-to-the-same-as.patch
@@ -0,0 +1,59 @@
+From 3d314e1c554ea4cc64dcdd5e227767a518b7dcb2 Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Fri, 1 Apr 2022 18:54:12 +0100
+Subject: [PATCH] media: i2c: imx258: Set pixel_rate range to the same
+ as the value
+
+With a read only control there is limited point in advertising
+a minimum and maximum for the control, so change to set the
+value, min, and max all to the selected pixel rate.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+---
+ drivers/media/i2c/imx258.c | 18 +++++++-----------
+ 1 file changed, 7 insertions(+), 11 deletions(-)
+
+--- a/drivers/media/i2c/imx258.c
++++ b/drivers/media/i2c/imx258.c
+@@ -1237,7 +1237,8 @@ static int imx258_set_pad_format(struct
+
+ link_freq = imx258->link_freq_menu_items[mode->link_freq_index];
+ pixel_rate = link_freq_to_pixel_rate(link_freq, imx258->nlanes);
+- __v4l2_ctrl_s_ctrl_int64(imx258->pixel_rate, pixel_rate);
++ __v4l2_ctrl_modify_range(imx258->pixel_rate, pixel_rate,
++ pixel_rate, 1, pixel_rate);
+ /* Update limits and set FPS to default */
+ vblank_def = imx258->cur_mode->vts_def -
+ imx258->cur_mode->height;
+@@ -1546,8 +1547,7 @@ static int imx258_init_controls(struct i
+ struct v4l2_ctrl_handler *ctrl_hdlr;
+ s64 vblank_def;
+ s64 vblank_min;
+- s64 pixel_rate_min;
+- s64 pixel_rate_max;
++ s64 pixel_rate;
+ int ret;
+
+ ctrl_hdlr = &imx258->ctrl_handler;
+@@ -1567,17 +1567,13 @@ static int imx258_init_controls(struct i
+ if (imx258->link_freq)
+ imx258->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
+
+- pixel_rate_max =
+- link_freq_to_pixel_rate(imx258->link_freq_menu_items[0],
+- imx258->nlanes);
+- pixel_rate_min =
+- link_freq_to_pixel_rate(imx258->link_freq_menu_items[1],
+- imx258->nlanes);
++ pixel_rate = link_freq_to_pixel_rate(imx258->link_freq_menu_items[0],
++ imx258->nlanes);
+ /* By default, PIXEL_RATE is read only */
+ imx258->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &imx258_ctrl_ops,
+ V4L2_CID_PIXEL_RATE,
+- pixel_rate_min, pixel_rate_max,
+- 1, pixel_rate_max);
++ pixel_rate, pixel_rate,
++ 1, pixel_rate);
+
+
+ vblank_def = imx258->cur_mode->vts_def - imx258->cur_mode->height;