1 From d53eb90044c19ba22b51978fcb007d9b5200b83a Mon Sep 17 00:00:00 2001
2 From: Eugen Hristev <eugen.hristev@microchip.com>
3 Date: Tue, 13 Apr 2021 12:57:19 +0200
4 Subject: [PATCH 177/247] media: atmel: atmel-isc: create callback for DPC
5 submodule product specific
7 The DPC submodule is a part of the atmel-isc pipeline, and stands for
8 Defective Pixel Correction. Its purpose is to detect defective pixels and
9 correct them if possible with the help of adjacent pixels.
10 Create a product specific callback for initializing the DPC submodule
12 For sama5d2 product, this module does not exist, thus this function is a noop.
14 [hverkuil: made isc_sama5d2_config_dpc static]
16 Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
17 Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
18 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
20 drivers/media/platform/atmel/atmel-isc-base.c | 1 +
21 drivers/media/platform/atmel/atmel-isc.h | 3 +++
22 drivers/media/platform/atmel/atmel-sama5d2-isc.c | 6 ++++++
23 3 files changed, 10 insertions(+)
25 --- a/drivers/media/platform/atmel/atmel-isc-base.c
26 +++ b/drivers/media/platform/atmel/atmel-isc-base.c
27 @@ -659,6 +659,7 @@ static void isc_set_pipeline(struct isc_
28 regmap_bulk_write(regmap, ISC_GAM_GENTRY, gamma, GAMMA_ENTRIES);
29 regmap_bulk_write(regmap, ISC_GAM_RENTRY, gamma, GAMMA_ENTRIES);
31 + isc->config_dpc(isc);
35 --- a/drivers/media/platform/atmel/atmel-isc.h
36 +++ b/drivers/media/platform/atmel/atmel-isc.h
37 @@ -220,6 +220,8 @@ struct isc_reg_offsets {
38 * @max_width: maximum frame width, dependent on the internal RAM
39 * @max_height: maximum frame height, dependent on the internal RAM
41 + * @config_dpc: pointer to a function that initializes product
42 + * specific DPC module
43 * @config_csc: pointer to a function that initializes product
45 * @config_cbc: pointer to a function that initializes product
46 @@ -299,6 +301,7 @@ struct isc_device {
50 + void (*config_dpc)(struct isc_device *isc);
51 void (*config_csc)(struct isc_device *isc);
52 void (*config_cbc)(struct isc_device *isc);
53 void (*config_cc)(struct isc_device *isc);
54 --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
55 +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
56 @@ -107,6 +107,11 @@ static void isc_sama5d2_config_ctrls(str
57 v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, -2048, 2047, 1, 256);
60 +static void isc_sama5d2_config_dpc(struct isc_device *isc)
62 + /* This module is not present on sama5d2 pipeline */
65 /* Gamma table with gamma 1/2.2 */
66 static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = {
67 /* 0 --> gamma 1/1.8 */
68 @@ -273,6 +278,7 @@ static int atmel_isc_probe(struct platfo
69 isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
70 isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
72 + isc->config_dpc = isc_sama5d2_config_dpc;
73 isc->config_csc = isc_sama5d2_config_csc;
74 isc->config_cbc = isc_sama5d2_config_cbc;
75 isc->config_cc = isc_sama5d2_config_cc;