Commit 1a3ac5d5 authored by Eugen Hristev's avatar Eugen Hristev Committed by Mauro Carvalho Chehab

media: atmel: atmel-isc: add HIS to register offsets

The HIS submodule is a part of the atmel-isc pipeline, and stands for
Histogram. This module performs a color histogram that can be read and used
by the main processor.
Add his to the reg offsets struct.
This will allow different products to have a different reg offset for this
particular module.
Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 40ee17d1
...@@ -686,12 +686,13 @@ static void isc_set_histogram(struct isc_device *isc, bool enable) ...@@ -686,12 +686,13 @@ static void isc_set_histogram(struct isc_device *isc, bool enable)
struct isc_ctrls *ctrls = &isc->ctrls; struct isc_ctrls *ctrls = &isc->ctrls;
if (enable) { if (enable) {
regmap_write(regmap, ISC_HIS_CFG, regmap_write(regmap, ISC_HIS_CFG + isc->offsets.his,
ISC_HIS_CFG_MODE_GR | ISC_HIS_CFG_MODE_GR |
(isc->config.sd_format->cfa_baycfg (isc->config.sd_format->cfa_baycfg
<< ISC_HIS_CFG_BAYSEL_SHIFT) | << ISC_HIS_CFG_BAYSEL_SHIFT) |
ISC_HIS_CFG_RAR); ISC_HIS_CFG_RAR);
regmap_write(regmap, ISC_HIS_CTRL, ISC_HIS_CTRL_EN); regmap_write(regmap, ISC_HIS_CTRL + isc->offsets.his,
ISC_HIS_CTRL_EN);
regmap_write(regmap, ISC_INTEN, ISC_INT_HISDONE); regmap_write(regmap, ISC_INTEN, ISC_INT_HISDONE);
ctrls->hist_id = ISC_HIS_CFG_MODE_GR; ctrls->hist_id = ISC_HIS_CFG_MODE_GR;
isc_update_profile(isc); isc_update_profile(isc);
...@@ -700,7 +701,8 @@ static void isc_set_histogram(struct isc_device *isc, bool enable) ...@@ -700,7 +701,8 @@ static void isc_set_histogram(struct isc_device *isc, bool enable)
ctrls->hist_stat = HIST_ENABLED; ctrls->hist_stat = HIST_ENABLED;
} else { } else {
regmap_write(regmap, ISC_INTDIS, ISC_INT_HISDONE); regmap_write(regmap, ISC_INTDIS, ISC_INT_HISDONE);
regmap_write(regmap, ISC_HIS_CTRL, ISC_HIS_CTRL_DIS); regmap_write(regmap, ISC_HIS_CTRL + isc->offsets.his,
ISC_HIS_CTRL_DIS);
ctrls->hist_stat = HIST_DISABLED; ctrls->hist_stat = HIST_DISABLED;
} }
...@@ -1836,7 +1838,8 @@ static void isc_awb_work(struct work_struct *w) ...@@ -1836,7 +1838,8 @@ static void isc_awb_work(struct work_struct *w)
ctrls->awb = ISC_WB_NONE; ctrls->awb = ISC_WB_NONE;
} }
} }
regmap_write(regmap, ISC_HIS_CFG, hist_id | baysel | ISC_HIS_CFG_RAR); regmap_write(regmap, ISC_HIS_CFG + isc->offsets.his,
hist_id | baysel | ISC_HIS_CFG_RAR);
isc_update_profile(isc); isc_update_profile(isc);
/* if awb has been disabled, we don't need to start another histogram */ /* if awb has been disabled, we don't need to start another histogram */
if (ctrls->awb) if (ctrls->awb)
......
...@@ -224,6 +224,8 @@ ...@@ -224,6 +224,8 @@
#define ISC_RLP_CFG_MODE_YYCC_LIMITED 0xc #define ISC_RLP_CFG_MODE_YYCC_LIMITED 0xc
#define ISC_RLP_CFG_MODE_MASK GENMASK(3, 0) #define ISC_RLP_CFG_MODE_MASK GENMASK(3, 0)
/* Offset for HIS register specific to sama5d2 product */
#define ISC_SAMA5D2_HIS_OFFSET 0
/* Histogram Control Register */ /* Histogram Control Register */
#define ISC_HIS_CTRL 0x000003d4 #define ISC_HIS_CTRL 0x000003d4
......
...@@ -151,6 +151,7 @@ struct isc_ctrls { ...@@ -151,6 +151,7 @@ struct isc_ctrls {
* @sub422: Offset for the SUB422 register * @sub422: Offset for the SUB422 register
* @sub420: Offset for the SUB420 register * @sub420: Offset for the SUB420 register
* @rlp: Offset for the RLP register * @rlp: Offset for the RLP register
* @his: Offset for the HIS related registers
*/ */
struct isc_reg_offsets { struct isc_reg_offsets {
u32 csc; u32 csc;
...@@ -158,6 +159,7 @@ struct isc_reg_offsets { ...@@ -158,6 +159,7 @@ struct isc_reg_offsets {
u32 sub422; u32 sub422;
u32 sub420; u32 sub420;
u32 rlp; u32 rlp;
u32 his;
}; };
/* /*
......
...@@ -235,6 +235,7 @@ static int atmel_isc_probe(struct platform_device *pdev) ...@@ -235,6 +235,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET; isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET; isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET; isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET;
isc->offsets.his = ISC_SAMA5D2_HIS_OFFSET;
/* sama5d2-isc - 8 bits per beat */ /* sama5d2-isc - 8 bits per beat */
isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8; isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment