media: atmel: atmel-isc: create callback for RLP submodule product specific

The RLP submodule is a part of the atmel-isc pipeline, and stands for
Rounding,Limiting and Packaging. It used to extract specific data from the
ISC pipeline. For example if we want to output greyscale 8 bit, we would
use limiting to 8 bits, and packaging to Luma component only.

Create a product specific callback for initializing the RLP submodule
of the pipeline

[hverkuil: made isc_sama5d2_config_rlp 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>
This commit is contained in:
Eugen Hristev 2021-04-13 12:57:21 +02:00 committed by Mauro Carvalho Chehab
parent e48848a6af
commit ef9b777968
3 changed files with 15 additions and 4 deletions

View File

@ -719,11 +719,10 @@ static void isc_set_histogram(struct isc_device *isc, bool enable)
static int isc_configure(struct isc_device *isc) static int isc_configure(struct isc_device *isc)
{ {
struct regmap *regmap = isc->regmap; struct regmap *regmap = isc->regmap;
u32 pfe_cfg0, rlp_mode, dcfg, mask, pipeline; u32 pfe_cfg0, dcfg, mask, pipeline;
struct isc_subdev_entity *subdev = isc->current_subdev; struct isc_subdev_entity *subdev = isc->current_subdev;
pfe_cfg0 = isc->config.sd_format->pfe_cfg0_bps; pfe_cfg0 = isc->config.sd_format->pfe_cfg0_bps;
rlp_mode = isc->config.rlp_cfg_mode;
pipeline = isc->config.bits_pipeline; pipeline = isc->config.bits_pipeline;
dcfg = isc->config.dcfg_imode | isc->dcfg; dcfg = isc->config.dcfg_imode | isc->dcfg;
@ -736,8 +735,7 @@ static int isc_configure(struct isc_device *isc)
regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0); regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0);
regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp, isc->config_rlp(isc);
ISC_RLP_CFG_MODE_MASK, rlp_mode);
regmap_write(regmap, ISC_DCFG + isc->offsets.dma, dcfg); regmap_write(regmap, ISC_DCFG + isc->offsets.dma, dcfg);

View File

@ -231,6 +231,8 @@ struct isc_reg_offsets {
* specific CC module * specific CC module
* @config_gam: pointer to a function that initializes product * @config_gam: pointer to a function that initializes product
* specific GAMMA module * specific GAMMA module
* @config_rlp: pointer to a function that initializes product
* specific RLP module
* @config_ctrls: pointer to a functoin that initializes product * @config_ctrls: pointer to a functoin that initializes product
* specific v4l2 controls. * specific v4l2 controls.
* *
@ -309,6 +311,7 @@ struct isc_device {
void (*config_cbc)(struct isc_device *isc); void (*config_cbc)(struct isc_device *isc);
void (*config_cc)(struct isc_device *isc); void (*config_cc)(struct isc_device *isc);
void (*config_gam)(struct isc_device *isc); void (*config_gam)(struct isc_device *isc);
void (*config_rlp)(struct isc_device *isc);
void (*config_ctrls)(struct isc_device *isc, void (*config_ctrls)(struct isc_device *isc,
const struct v4l2_ctrl_ops *ops); const struct v4l2_ctrl_ops *ops);

View File

@ -117,6 +117,15 @@ static void isc_sama5d2_config_gam(struct isc_device *isc)
/* No specific gamma configuration */ /* No specific gamma configuration */
} }
static void isc_sama5d2_config_rlp(struct isc_device *isc)
{
struct regmap *regmap = isc->regmap;
u32 rlp_mode = isc->config.rlp_cfg_mode;
regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp,
ISC_RLP_CFG_MODE_MASK, rlp_mode);
}
/* Gamma table with gamma 1/2.2 */ /* Gamma table with gamma 1/2.2 */
static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = { static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = {
/* 0 --> gamma 1/1.8 */ /* 0 --> gamma 1/1.8 */
@ -267,6 +276,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cbc = isc_sama5d2_config_cbc;
isc->config_cc = isc_sama5d2_config_cc; isc->config_cc = isc_sama5d2_config_cc;
isc->config_gam = isc_sama5d2_config_gam; isc->config_gam = isc_sama5d2_config_gam;
isc->config_rlp = isc_sama5d2_config_rlp;
isc->config_ctrls = isc_sama5d2_config_ctrls; isc->config_ctrls = isc_sama5d2_config_ctrls;
isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET; isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;