aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/sh_mobile_ceu_camera.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-10-16 18:50:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:25:43 -0400
commitdd54203b485e79b558aa5a7262ee8ddb17d74c98 (patch)
treec1449ce15551524e2be8978f3b40bb7e32f3cb1e /drivers/media/video/sh_mobile_ceu_camera.c
parent50c616fd0b43f50379aa70da96fd350312367367 (diff)
V4L/DVB (9242): video: add sh_mobile_ceu comments
This patch adds CEU hardware block comments to the sh_mobile_ceu driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/sh_mobile_ceu_camera.c')
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c79
1 files changed, 46 insertions, 33 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 76838091dc66..7a7268c43dc2 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -40,39 +40,39 @@
40 40
41/* register offsets for sh7722 / sh7723 */ 41/* register offsets for sh7722 / sh7723 */
42 42
43#define CAPSR 0x00 43#define CAPSR 0x00 /* Capture start register */
44#define CAPCR 0x04 44#define CAPCR 0x04 /* Capture control register */
45#define CAMCR 0x08 45#define CAMCR 0x08 /* Capture interface control register */
46#define CMCYR 0x0c 46#define CMCYR 0x0c /* Capture interface cycle register */
47#define CAMOR 0x10 47#define CAMOR 0x10 /* Capture interface offset register */
48#define CAPWR 0x14 48#define CAPWR 0x14 /* Capture interface width register */
49#define CAIFR 0x18 49#define CAIFR 0x18 /* Capture interface input format register */
50#define CSTCR 0x20 /* not on sh7723 */ 50#define CSTCR 0x20 /* Camera strobe control register (<= sh7722) */
51#define CSECR 0x24 /* not on sh7723 */ 51#define CSECR 0x24 /* Camera strobe emission count register (<= sh7722) */
52#define CRCNTR 0x28 52#define CRCNTR 0x28 /* CEU register control register */
53#define CRCMPR 0x2c 53#define CRCMPR 0x2c /* CEU register forcible control register */
54#define CFLCR 0x30 54#define CFLCR 0x30 /* Capture filter control register */
55#define CFSZR 0x34 55#define CFSZR 0x34 /* Capture filter size clip register */
56#define CDWDR 0x38 56#define CDWDR 0x38 /* Capture destination width register */
57#define CDAYR 0x3c 57#define CDAYR 0x3c /* Capture data address Y register */
58#define CDACR 0x40 58#define CDACR 0x40 /* Capture data address C register */
59#define CDBYR 0x44 59#define CDBYR 0x44 /* Capture data bottom-field address Y register */
60#define CDBCR 0x48 60#define CDBCR 0x48 /* Capture data bottom-field address C register */
61#define CBDSR 0x4c 61#define CBDSR 0x4c /* Capture bundle destination size register */
62#define CFWCR 0x5c 62#define CFWCR 0x5c /* Firewall operation control register */
63#define CLFCR 0x60 63#define CLFCR 0x60 /* Capture low-pass filter control register */
64#define CDOCR 0x64 64#define CDOCR 0x64 /* Capture data output control register */
65#define CDDCR 0x68 65#define CDDCR 0x68 /* Capture data complexity level register */
66#define CDDAR 0x6c 66#define CDDAR 0x6c /* Capture data complexity level address register */
67#define CEIER 0x70 67#define CEIER 0x70 /* Capture event interrupt enable register */
68#define CETCR 0x74 68#define CETCR 0x74 /* Capture event flag clear register */
69#define CSTSR 0x7c 69#define CSTSR 0x7c /* Capture status register */
70#define CSRTR 0x80 70#define CSRTR 0x80 /* Capture software reset register */
71#define CDSSR 0x84 71#define CDSSR 0x84 /* Capture data size register */
72#define CDAYR2 0x90 72#define CDAYR2 0x90 /* Capture data address Y register 2 */
73#define CDACR2 0x94 73#define CDACR2 0x94 /* Capture data address C register 2 */
74#define CDBYR2 0x98 74#define CDBYR2 0x98 /* Capture data bottom-field address Y register 2 */
75#define CDBCR2 0x9c 75#define CDBCR2 0x9c /* Capture data bottom-field address C register 2 */
76 76
77static DEFINE_MUTEX(camera_lock); 77static DEFINE_MUTEX(camera_lock);
78 78
@@ -391,6 +391,19 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
391 ceu_write(pcdev, CFLCR, 0); /* data fetch mode - no scaling */ 391 ceu_write(pcdev, CFLCR, 0); /* data fetch mode - no scaling */
392 ceu_write(pcdev, CFSZR, (icd->height << 16) | cfszr_width); 392 ceu_write(pcdev, CFSZR, (icd->height << 16) | cfszr_width);
393 ceu_write(pcdev, CLFCR, 0); /* data fetch mode - no lowpass filter */ 393 ceu_write(pcdev, CLFCR, 0); /* data fetch mode - no lowpass filter */
394
395 /* A few words about byte order (observed in Big Endian mode)
396 *
397 * In data fetch mode bytes are received in chunks of 8 bytes.
398 * D0, D1, D2, D3, D4, D5, D6, D7 (D0 received first)
399 *
400 * The data is however by default written to memory in reverse order:
401 * D7, D6, D5, D4, D3, D2, D1, D0 (D7 written to lowest byte)
402 *
403 * The lowest three bits of CDOCR allows us to do swapping,
404 * right now we swap the data bytes to the following order:
405 * D1, D0, D3, D2, D5, D4, D7, D6
406 */
394 ceu_write(pcdev, CDOCR, 0x00000016); 407 ceu_write(pcdev, CDOCR, 0x00000016);
395 408
396 ceu_write(pcdev, CDWDR, cdwdr_width); 409 ceu_write(pcdev, CDWDR, cdwdr_width);