blob: 38436d641471fa065ff39a091f0b0d083e36aa57 [file] [log] [blame]
wdenkfe8c2802002-11-03 00:38:21 +00001/*
2 * (C) Copyright 2000
3 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
4 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenkfe8c2802002-11-03 00:38:21 +00006 */
7
8#ifndef _VIDEO_AD7177_H_
9#define _VIDEO_AD7177_H_
10
wdenk8564acf2003-07-14 22:13:32 +000011/* #define VIDEO_DEBUG_DISABLE_COLORS 0 */
wdenkfe8c2802002-11-03 00:38:21 +000012
13#define VIDEO_ENCODER_NAME "Analog Devices AD7177"
14
wdenk8564acf2003-07-14 22:13:32 +000015#define VIDEO_ENCODER_I2C_RATE 100000 /* Max rate is 100 kHz */
16#define VIDEO_ENCODER_CB_Y_CR_Y /* Use CB Y CR Y format... */
wdenkfe8c2802002-11-03 00:38:21 +000017
18#define VIDEO_MODE_YUYV /* The only mode supported by this encoder */
wdenk8564acf2003-07-14 22:13:32 +000019#undef VIDEO_MODE_RGB
wdenkfe8c2802002-11-03 00:38:21 +000020#define VIDEO_MODE_BPP 16
21
wdenk8564acf2003-07-14 22:13:32 +000022#ifdef VIDEO_MODE_PAL
wdenkfe8c2802002-11-03 00:38:21 +000023#define VIDEO_ACTIVE_COLS 720
24#define VIDEO_ACTIVE_ROWS 576
25#define VIDEO_VISIBLE_COLS 640
26#define VIDEO_VISIBLE_ROWS 480
27#endif
28
wdenk8564acf2003-07-14 22:13:32 +000029#ifdef VIDEO_MODE_NTSC
wdenkfe8c2802002-11-03 00:38:21 +000030#define VIDEO_ACTIVE_COLS 720
31#define VIDEO_ACTIVE_ROWS 525
32#define VIDEO_VISIBLE_COLS 640
33#define VIDEO_VISIBLE_ROWS 400
34#endif
35
36static unsigned char
37 video_encoder_data[] = {
38#ifdef VIDEO_MODE_NTSC
wdenk8564acf2003-07-14 22:13:32 +000039 0x04, /* Mode Register 0 */
wdenkfe8c2802002-11-03 00:38:21 +000040#ifdef VIDEO_DEBUG_COLORBARS
41 0xc2,
42#else
wdenk8564acf2003-07-14 22:13:32 +000043 0x42, /* Mode Register 1 */
44#endif /* VIDEO_DEBUG_COLORBARS */
45 0x16, /* Subcarrier Freq 0 */
46 0x7c, /* Subcarrier Freq 1 */
47 0xf0, /* Subcarrier Freq 2 */
48 0x21, /* Subcarrier Freq 3 */
49 0x00, /* Subcarrier phase */
50 0x02, /* Timing Register 0 */
51 0x00, /* Extended Captioning 0 */
52 0x00, /* Extended Captioning 1 */
53 0x00, /* Closed Captioning 0 */
54 0x00, /* Closed Captioning 1 */
55 0x00, /* Timing Register 1 */
56 0x08, /* Mode Register 2 */
57 0x00, /* Pedestal Register 0 */
58 0x00, /* Pedestal Register 1 */
59 0x00, /* Pedestal Register 2 */
60 0x00, /* Pedestal Register 3 */
61 0x08, /* Mode Register 3 */
wdenkfe8c2802002-11-03 00:38:21 +000062
wdenk8564acf2003-07-14 22:13:32 +000063#endif /* VIDEO_MODE_NTSC */
64
wdenkfe8c2802002-11-03 00:38:21 +000065#ifdef VIDEO_MODE_PAL
66#ifdef VIDEO_MODE_RGB_OUT
67
wdenk8564acf2003-07-14 22:13:32 +000068 0x69, /* Mode Register 0 */
wdenkfe8c2802002-11-03 00:38:21 +000069#ifdef VIDEO_DEBUG_COLORBARS
wdenk8564acf2003-07-14 22:13:32 +000070 0xc0, /* Mode Register 1 (c0) */
wdenkfe8c2802002-11-03 00:38:21 +000071#else
wdenk8564acf2003-07-14 22:13:32 +000072 0x40, /* Mode Register 1 (c0) */
73#endif /* VIDEO_DEBUG_COLORBARS */
74 0xcb, /* Subcarrier Freq 0 */
75 0x8a, /* Subcarrier Freq 1 */
76 0x09, /* Subcarrier Freq 2 */
77 0x2a, /* Subcarrier Freq 3 */
78 0x00, /* Subcarrier phase */
79 0x02, /* Timing Register 0 */
80 0x00, /* Extended Captioning 0 */
81 0x00, /* Extended Captioning 1 */
82 0x00, /* Closed Captioning 0 */
83 0x00, /* Closed Captioning 1 */
84 0x00, /* Timing Register 1 */
85 0x28, /* Mode Register 2 */
86 0x00, /* Pedestal Register 0 */
87 0x00, /* Pedestal Register 1 */
88 0x00, /* Pedestal Register 2 */
89 0x00, /* Pedestal Register 3 */
90 0x08, /* Mode Register 3 */
wdenkfe8c2802002-11-03 00:38:21 +000091
wdenk8564acf2003-07-14 22:13:32 +000092#else /* ! VIDEO_MODE_RGB_OUT */
wdenkfe8c2802002-11-03 00:38:21 +000093
wdenk8bde7f72003-06-27 21:31:46 +000094 0x09, /* Mode Register 0 (was 01) */
wdenkfe8c2802002-11-03 00:38:21 +000095#ifdef VIDEO_DEBUG_COLORBARS
wdenk8564acf2003-07-14 22:13:32 +000096 0xd8, /* */
wdenkfe8c2802002-11-03 00:38:21 +000097#else
wdenk8bde7f72003-06-27 21:31:46 +000098 0x59, /* Mode Register 1 (was 58) */
wdenk8564acf2003-07-14 22:13:32 +000099#endif /* VIDEO_DEBUG_COLORBARS */
100 0xcb, /* Subcarrier Freq 0 */
101 0x8a, /* Subcarrier Freq 1 */
102 0x09, /* Subcarrier Freq 2 */
103 0x2a, /* Subcarrier Freq 3 */
104 0x00, /* Subcarrier phase */
wdenk8bde7f72003-06-27 21:31:46 +0000105 0x02, /* Timing Register 0 (was a) */
wdenk8564acf2003-07-14 22:13:32 +0000106 0x00, /* Extended Captioning 0 */
107 0x00, /* Extended Captioning 1 */
108 0x00, /* Closed Captioning 0 */
109 0x00, /* Closed Captioning 1 */
110 0x00, /* Timing Register 1 */
wdenkfe8c2802002-11-03 00:38:21 +0000111#ifdef VIDEO_DEBUG_LOWPOWER
112#ifdef VIDEO_DEBUG_DISABLE_COLORS
wdenk8564acf2003-07-14 22:13:32 +0000113 0x98, /* Mode Register 2 */
wdenkfe8c2802002-11-03 00:38:21 +0000114#else
wdenk8564acf2003-07-14 22:13:32 +0000115 0x88, /* Mode Register 2 */
116#endif /* VIDEO_DEBUG_DISABLE_COLORS */
117#else /* ! VIDEO_DEBUG_LOWPOWER */
wdenkfe8c2802002-11-03 00:38:21 +0000118#ifdef VIDEO_DEBUG_DISABLE_COLORS
wdenk8564acf2003-07-14 22:13:32 +0000119 0x18, /* Mode Register 2 */
wdenkfe8c2802002-11-03 00:38:21 +0000120#else
wdenk8564acf2003-07-14 22:13:32 +0000121 0x08, /* Mode Register 2 */
122#endif /* VIDEO_DEBUG_DISABLE_COLORS */
123#endif /* VIDEO_DEBUG_LOWPOWER */
124 0x00, /* Pedestal Register 0 */
125 0x00, /* Pedestal Register 1 */
126 0x00, /* Pedestal Register 2 */
127 0x00, /* Pedestal Register 3 */
128 0x08 /* Mode Register 3 */
129#endif /* VIDEO_MODE_RGB_OUT */
130#endif /* VIDEO_MODE_PAL */
wdenkfe8c2802002-11-03 00:38:21 +0000131 } ;
132
wdenk8564acf2003-07-14 22:13:32 +0000133#endif /* _VIDEO_AD7177_H_ */