1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/bcm27xx/patches-5.15/950-0351-media-i2c-imx290-Handle-exposure-correctly-when-vbla.patch

43 lines
1.4 KiB
Diff
Raw Normal View History

2022-04-22 15:00:47 +00:00
From 0fc6dce34cce94465ae49b11cb2528ef64885d54 Mon Sep 17 00:00:00 2001
2021-11-24 17:32:01 +00:00
From: David Plowman <david.plowman@raspberrypi.com>
Date: Thu, 18 Feb 2021 11:58:29 +0000
2022-04-22 15:00:47 +00:00
Subject: [PATCH 351/828] media: i2c: imx290: Handle exposure correctly when
2021-11-24 17:32:01 +00:00
vblank changes
When vblank changes we must modify the exposure range. Also, with this
sensor, the effective exposure time implicitly changes when vblank
does, so we have to reset it after every vblank update.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
drivers/media/i2c/imx290.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
2022-04-22 15:00:47 +00:00
@@ -618,6 +618,24 @@ static int imx290_set_vmax(struct imx290
2021-11-24 17:32:01 +00:00
if (ret)
dev_err(imx290->dev, "Unable to write vmax\n");
+ /*
+ * Changing vblank changes the allowed range for exposure.
+ * We don't supply the current exposure as default here as it
+ * may lie outside the new range. We will reset it just below.
+ */
+ __v4l2_ctrl_modify_range(imx290->exposure,
+ IMX290_EXPOSURE_MIN,
+ vmax - 2,
+ IMX290_EXPOSURE_STEP,
+ vmax - 2);
+
+ /*
+ * Becuse of the way exposure works for this sensor, updating
+ * vblank causes the effective exposure to change, so we must
+ * set it back to the "new" correct value.
+ */
+ imx290_set_exposure(imx290, imx290->exposure->val);
+
return ret;
}