aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2022-09-15 17:09:28 +0300
committerHauke Mehrtens <hauke@hauke-m.de>2022-10-22 00:51:25 +0200
commiteb758a8fec2cee24e528008052fa2bd58482ca3a (patch)
treec4ea2a0e7246cc62314258cf6b1b8a5ad80f8df0 /target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch
parentc5c37886cff1705ba9be9b33df3ab121bd27fe6b (diff)
downloadupstream-eb758a8fec2cee24e528008052fa2bd58482ca3a.tar.gz
upstream-eb758a8fec2cee24e528008052fa2bd58482ca3a.tar.bz2
upstream-eb758a8fec2cee24e528008052fa2bd58482ca3a.zip
at91: kernel v5.15: copy config and patches from 5.10
Copy kernel config and patches from 5.10. Along with it individual targets' config-default from 5.10 has been moved to config-5.10. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Diffstat (limited to 'target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch')
-rw-r--r--target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch b/target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch
new file mode 100644
index 0000000000..35c839692c
--- /dev/null
+++ b/target/linux/at91/patches-5.15/176-media-atmel-atmel-isc-create-product-specific-v4l2-c.patch
@@ -0,0 +1,86 @@
+From 0a75c502eac4f2ef71b6c3e0b3a01db1b3c37ba9 Mon Sep 17 00:00:00 2001
+From: Eugen Hristev <eugen.hristev@microchip.com>
+Date: Tue, 13 Apr 2021 12:57:18 +0200
+Subject: [PATCH 176/247] media: atmel: atmel-isc: create product specific v4l2
+ controls config
+
+Create product specific callback for initializing v4l2 controls.
+Call this from v4l2 controls init function.
+
+[hverkuil: made isc_sama5d2_config_ctrls static]
+
+Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+---
+ drivers/media/platform/atmel/atmel-isc-base.c | 5 +++--
+ drivers/media/platform/atmel/atmel-isc.h | 5 +++++
+ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 12 ++++++++++++
+ 3 files changed, 20 insertions(+), 2 deletions(-)
+
+--- a/drivers/media/platform/atmel/atmel-isc-base.c
++++ b/drivers/media/platform/atmel/atmel-isc-base.c
+@@ -2051,11 +2051,12 @@ static int isc_ctrl_init(struct isc_devi
+ if (ret < 0)
+ return ret;
+
++ /* Initialize product specific controls. For example, contrast */
++ isc->config_ctrls(isc, ops);
++
+ ctrls->brightness = 0;
+- ctrls->contrast = 256;
+
+ v4l2_ctrl_new_std(hdl, ops, V4L2_CID_BRIGHTNESS, -1024, 1023, 1, 0);
+- v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, -2048, 2047, 1, 256);
+ v4l2_ctrl_new_std(hdl, ops, V4L2_CID_GAMMA, 0, isc->gamma_max, 1,
+ isc->gamma_max);
+ isc->awb_ctrl = v4l2_ctrl_new_std(hdl, &isc_awb_ops,
+--- a/drivers/media/platform/atmel/atmel-isc.h
++++ b/drivers/media/platform/atmel/atmel-isc.h
+@@ -226,6 +226,8 @@ struct isc_reg_offsets {
+ * specific CBC module
+ * @config_cc: pointer to a function that initializes product
+ * specific CC module
++ * @config_ctrls: pointer to a functoin that initializes product
++ * specific v4l2 controls.
+ *
+ * @offsets: struct holding the product specific register offsets
+ */
+@@ -300,6 +302,9 @@ struct isc_device {
+ void (*config_csc)(struct isc_device *isc);
+ void (*config_cbc)(struct isc_device *isc);
+ void (*config_cc)(struct isc_device *isc);
++
++ void (*config_ctrls)(struct isc_device *isc,
++ const struct v4l2_ctrl_ops *ops);
+ };
+
+ struct isc_reg_offsets offsets;
+--- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
++++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
+@@ -96,6 +96,17 @@ static void isc_sama5d2_config_cc(struct
+ regmap_write(regmap, ISC_CC_BB_OB, (1 << 8));
+ }
+
++static void isc_sama5d2_config_ctrls(struct isc_device *isc,
++ const struct v4l2_ctrl_ops *ops)
++{
++ struct isc_ctrls *ctrls = &isc->ctrls;
++ struct v4l2_ctrl_handler *hdl = &ctrls->handler;
++
++ ctrls->contrast = 256;
++
++ v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, -2048, 2047, 1, 256);
++}
++
+ /* Gamma table with gamma 1/2.2 */
+ static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = {
+ /* 0 --> gamma 1/1.8 */
+@@ -265,6 +276,7 @@ static int atmel_isc_probe(struct platfo
+ isc->config_csc = isc_sama5d2_config_csc;
+ isc->config_cbc = isc_sama5d2_config_cbc;
+ isc->config_cc = isc_sama5d2_config_cc;
++ isc->config_ctrls = isc_sama5d2_config_ctrls;
+
+ isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
+ isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;