1 From 96936a6753a13dea5a8f66de949e6594dd82ce22 Mon Sep 17 00:00:00 2001
2 From: Eugen Hristev <eugen.hristev@microchip.com>
3 Date: Tue, 13 Apr 2021 12:57:20 +0200
4 Subject: [PATCH 178/247] media: atmel: atmel-isc: create callback for GAM
5 submodule product specific
7 The GAM submodule is a part of the atmel-isc pipeline, and stands for
8 Gamma Correction. It is used to apply the gamma curve to the incoming pixels.
9 Create a product specific callback for initializing the GAM submodule
11 For sama5d2 product, there is no special configuration at this moment,
12 thus this function is a noop.
14 [hverkuil: made isc_sama5d2_config_gam 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 @@ -663,6 +663,7 @@ static void isc_set_pipeline(struct isc_
31 + isc->config_gam(isc);
34 static int isc_update_profile(struct isc_device *isc)
35 --- a/drivers/media/platform/atmel/atmel-isc.h
36 +++ b/drivers/media/platform/atmel/atmel-isc.h
37 @@ -228,6 +228,8 @@ struct isc_reg_offsets {
39 * @config_cc: pointer to a function that initializes product
41 + * @config_gam: pointer to a function that initializes product
42 + * specific GAMMA module
43 * @config_ctrls: pointer to a functoin that initializes product
44 * specific v4l2 controls.
46 @@ -305,6 +307,7 @@ struct isc_device {
47 void (*config_csc)(struct isc_device *isc);
48 void (*config_cbc)(struct isc_device *isc);
49 void (*config_cc)(struct isc_device *isc);
50 + void (*config_gam)(struct isc_device *isc);
52 void (*config_ctrls)(struct isc_device *isc,
53 const struct v4l2_ctrl_ops *ops);
54 --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
55 +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
56 @@ -112,6 +112,11 @@ static void isc_sama5d2_config_dpc(struc
57 /* This module is not present on sama5d2 pipeline */
60 +static void isc_sama5d2_config_gam(struct isc_device *isc)
62 + /* No specific gamma configuration */
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 @@ -282,6 +287,7 @@ static int atmel_isc_probe(struct platfo
69 isc->config_csc = isc_sama5d2_config_csc;
70 isc->config_cbc = isc_sama5d2_config_cbc;
71 isc->config_cc = isc_sama5d2_config_cc;
72 + isc->config_gam = isc_sama5d2_config_gam;
73 isc->config_ctrls = isc_sama5d2_config_ctrls;
75 isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;