mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-13 20:01:55 +00:00
45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
From 7e961d09676b6f42c1c86989e5734a5da5b0234b Mon Sep 17 00:00:00 2001
|
|
From: David Plowman <david.plowman@raspberrypi.com>
|
|
Date: Wed, 8 Sep 2021 14:15:17 +0100
|
|
Subject: [PATCH 498/634] media: i2c: imx477: Allow control of on-sensor DPC
|
|
|
|
A module parameter "dpc_enable" is added to allow the control of the
|
|
sensor's on-board DPC (Defective Pixel Correction) function.
|
|
|
|
This is a global setting to be configured before using the sensor;
|
|
there is no intention that this would ever be changed on-the-fly.
|
|
|
|
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
|
|
---
|
|
drivers/media/i2c/imx477.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/drivers/media/i2c/imx477.c b/drivers/media/i2c/imx477.c
|
|
index ba03c68e64a0..96486a7f007c 100644
|
|
--- a/drivers/media/i2c/imx477.c
|
|
+++ b/drivers/media/i2c/imx477.c
|
|
@@ -21,6 +21,10 @@
|
|
#include <media/v4l2-fwnode.h>
|
|
#include <media/v4l2-mediabus.h>
|
|
|
|
+static int dpc_enable = 1;
|
|
+module_param(dpc_enable, int, 0644);
|
|
+MODULE_PARM_DESC(dpc_enable, "Enable on-sensor DPC");
|
|
+
|
|
#define IMX477_REG_VALUE_08BIT 1
|
|
#define IMX477_REG_VALUE_16BIT 2
|
|
|
|
@@ -1713,6 +1717,10 @@ static int imx477_start_streaming(struct imx477 *imx477)
|
|
return ret;
|
|
}
|
|
|
|
+ /* Set on-sensor DPC. */
|
|
+ imx477_write_reg(imx477, 0x0b05, IMX477_REG_VALUE_08BIT, !!dpc_enable);
|
|
+ imx477_write_reg(imx477, 0x0b06, IMX477_REG_VALUE_08BIT, !!dpc_enable);
|
|
+
|
|
/* Apply customized values from user */
|
|
ret = __v4l2_ctrl_handler_setup(imx477->sd.ctrl_handler);
|
|
if (ret)
|
|
--
|
|
2.33.1
|
|
|