summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/atmel/atmel-isc-regs.h
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2019-04-15 10:13:49 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-21 07:14:02 -0400
commit73c1a577b83999f3bd208bbc6955f21d82b7f9ac (patch)
treebade54f769b99228a08d9c01c0d6a6ffc532829d /drivers/media/platform/atmel/atmel-isc-regs.h
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff)
downloadlinux-stable-73c1a577b83999f3bd208bbc6955f21d82b7f9ac.tar.gz
linux-stable-73c1a577b83999f3bd208bbc6955f21d82b7f9ac.tar.bz2
linux-stable-73c1a577b83999f3bd208bbc6955f21d82b7f9ac.zip
media: atmel: atmel-isc: reworked white balance feature
Reworked auto white balance feature (awb) to cope with all four channels. Implemented stretching and grey world algorithms. Using the histogram, the ISC will auto adjust the white balance during frame captures. Because each histogram needs a frame, it will take 4 frames for one adjustment. When the gains were updated by previous code, the registers for the gains were updated only on new streaming start. Now, after each full histogram the registers are updated with new gains. Also, on previous code, if the streaming stopped but not all 3 histograms finished, a new histogram was started either way. This used to lead to an error "timeout to update profile" when streaming was stopped. According to the hardware, histogram can only work together with the capture, not independently. 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+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/atmel/atmel-isc-regs.h')
-rw-r--r--drivers/media/platform/atmel/atmel-isc-regs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/platform/atmel/atmel-isc-regs.h b/drivers/media/platform/atmel/atmel-isc-regs.h
index 8f7f8efc71a7..c1283fb21bf6 100644
--- a/drivers/media/platform/atmel/atmel-isc-regs.h
+++ b/drivers/media/platform/atmel/atmel-isc-regs.h
@@ -100,13 +100,15 @@
#define ISC_WB_O_RGR 0x00000060
/* ISC White Balance Offset for B, GB Register */
-#define ISC_WB_O_BGR 0x00000064
+#define ISC_WB_O_BGB 0x00000064
/* ISC White Balance Gain for R, GR Register */
#define ISC_WB_G_RGR 0x00000068
/* ISC White Balance Gain for B, GB Register */
-#define ISC_WB_G_BGR 0x0000006c
+#define ISC_WB_G_BGB 0x0000006c
+
+#define ISC_WB_O_ZERO_VAL (1 << 13)
/* ISC Color Filter Array Control Register */
#define ISC_CFA_CTRL 0x00000070