3 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef _VIDEO_AD7177_H_
9 #define _VIDEO_AD7177_H_
11 /* #define VIDEO_DEBUG_DISABLE_COLORS 0 */
13 #define VIDEO_ENCODER_NAME "Analog Devices AD7177"
15 #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... */
18 #define VIDEO_MODE_YUYV /* The only mode supported by this encoder */
20 #define VIDEO_MODE_BPP 16
23 #define VIDEO_ACTIVE_COLS 720
24 #define VIDEO_ACTIVE_ROWS 576
25 #define VIDEO_VISIBLE_COLS 640
26 #define VIDEO_VISIBLE_ROWS 480
29 #ifdef VIDEO_MODE_NTSC
30 #define VIDEO_ACTIVE_COLS 720
31 #define VIDEO_ACTIVE_ROWS 525
32 #define VIDEO_VISIBLE_COLS 640
33 #define VIDEO_VISIBLE_ROWS 400
37 video_encoder_data[] = {
38 #ifdef VIDEO_MODE_NTSC
39 0x04, /* Mode Register 0 */
40 #ifdef VIDEO_DEBUG_COLORBARS
43 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 */
63 #endif /* VIDEO_MODE_NTSC */
66 #ifdef VIDEO_MODE_RGB_OUT
68 0x69, /* Mode Register 0 */
69 #ifdef VIDEO_DEBUG_COLORBARS
70 0xc0, /* Mode Register 1 (c0) */
72 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 */
92 #else /* ! VIDEO_MODE_RGB_OUT */
94 0x09, /* Mode Register 0 (was 01) */
95 #ifdef VIDEO_DEBUG_COLORBARS
98 0x59, /* Mode Register 1 (was 58) */
99 #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 */
105 0x02, /* Timing Register 0 (was a) */
106 0x00, /* Extended Captioning 0 */
107 0x00, /* Extended Captioning 1 */
108 0x00, /* Closed Captioning 0 */
109 0x00, /* Closed Captioning 1 */
110 0x00, /* Timing Register 1 */
111 #ifdef VIDEO_DEBUG_LOWPOWER
112 #ifdef VIDEO_DEBUG_DISABLE_COLORS
113 0x98, /* Mode Register 2 */
115 0x88, /* Mode Register 2 */
116 #endif /* VIDEO_DEBUG_DISABLE_COLORS */
117 #else /* ! VIDEO_DEBUG_LOWPOWER */
118 #ifdef VIDEO_DEBUG_DISABLE_COLORS
119 0x18, /* Mode Register 2 */
121 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 */
133 #endif /* _VIDEO_AD7177_H_ */