aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorRobert W. Boone <rboone@rtd.com>2005-11-09 00:37:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:15 -0500
commit2f8d4f5139fe7817f43202d8ee2f4b68ac53e58f (patch)
treeafaef8b0ba1a9a2cb6f5f12dd4f43945080e4be7 /drivers/media/video/saa7134/saa7134-video.c
parentfd35a6b454818e01f761622e9ac5824ce2d7baf5 (diff)
[PATCH] v4l: 719: implement some differences in video output port
- Implement some differences in video output port Signed-off-by: Robert W. Boone <rboone@rtd.com> Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c58
1 files changed, 55 insertions, 3 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index cd1f70fffdec..cd5545b2d60b 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -48,6 +48,43 @@ MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced");
48 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) 48 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
49 49
50/* ------------------------------------------------------------------ */ 50/* ------------------------------------------------------------------ */
51/* Defines for Video Output Port Register at address 0x191 */
52
53/* Bit 0: VIP code T bit polarity */
54
55#define VP_T_CODE_P_NON_INVERTED 0x00
56#define VP_T_CODE_P_INVERTED 0x01
57
58/* ------------------------------------------------------------------ */
59/* Defines for Video Output Port Register at address 0x195 */
60
61/* Bit 2: Video output clock delay control */
62
63#define VP_CLK_CTRL2_NOT_DELAYED 0x00
64#define VP_CLK_CTRL2_DELAYED 0x04
65
66/* Bit 1: Video output clock invert control */
67
68#define VP_CLK_CTRL1_NON_INVERTED 0x00
69#define VP_CLK_CTRL1_INVERTED 0x02
70
71/* ------------------------------------------------------------------ */
72/* Defines for Video Output Port Register at address 0x196 */
73
74/* Bits 2 to 0: VSYNC pin video vertical sync type */
75
76#define VP_VS_TYPE_MASK 0x07
77
78#define VP_VS_TYPE_OFF 0x00
79#define VP_VS_TYPE_V123 0x01
80#define VP_VS_TYPE_V_ITU 0x02
81#define VP_VS_TYPE_VGATE_L 0x03
82#define VP_VS_TYPE_RESERVED1 0x04
83#define VP_VS_TYPE_RESERVED2 0x05
84#define VP_VS_TYPE_F_ITU 0x06
85#define VP_VS_TYPE_SC_FID 0x07
86
87/* ------------------------------------------------------------------ */
51/* data structs for video */ 88/* data structs for video */
52 89
53static int video_out[][9] = { 90static int video_out[][9] = {
@@ -2294,13 +2331,28 @@ int saa7134_video_init1(struct saa7134_dev *dev)
2294 if (saa7134_boards[dev->board].video_out) { 2331 if (saa7134_boards[dev->board].video_out) {
2295 /* enable video output */ 2332 /* enable video output */
2296 int vo = saa7134_boards[dev->board].video_out; 2333 int vo = saa7134_boards[dev->board].video_out;
2334 int video_reg;
2335 unsigned int vid_port_opts = saa7134_boards[dev->board].vid_port_opts;
2297 saa_writeb(SAA7134_VIDEO_PORT_CTRL0, video_out[vo][0]); 2336 saa_writeb(SAA7134_VIDEO_PORT_CTRL0, video_out[vo][0]);
2298 saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_out[vo][1]); 2337 video_reg = video_out[vo][1];
2338 if (vid_port_opts & SET_T_CODE_POLARITY_NON_INVERTED)
2339 video_reg &= ~VP_T_CODE_P_INVERTED;
2340 saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_reg);
2299 saa_writeb(SAA7134_VIDEO_PORT_CTRL2, video_out[vo][2]); 2341 saa_writeb(SAA7134_VIDEO_PORT_CTRL2, video_out[vo][2]);
2300 saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]); 2342 saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]);
2301 saa_writeb(SAA7134_VIDEO_PORT_CTRL4, video_out[vo][4]); 2343 saa_writeb(SAA7134_VIDEO_PORT_CTRL4, video_out[vo][4]);
2302 saa_writeb(SAA7134_VIDEO_PORT_CTRL5, video_out[vo][5]); 2344 video_reg = video_out[vo][5];
2303 saa_writeb(SAA7134_VIDEO_PORT_CTRL6, video_out[vo][6]); 2345 if (vid_port_opts & SET_CLOCK_NOT_DELAYED)
2346 video_reg &= ~VP_CLK_CTRL2_DELAYED;
2347 if (vid_port_opts & SET_CLOCK_INVERTED)
2348 video_reg |= VP_CLK_CTRL1_INVERTED;
2349 saa_writeb(SAA7134_VIDEO_PORT_CTRL5, video_reg);
2350 video_reg = video_out[vo][6];
2351 if (vid_port_opts & SET_VSYNC_OFF) {
2352 video_reg &= ~VP_VS_TYPE_MASK;
2353 video_reg |= VP_VS_TYPE_OFF;
2354 }
2355 saa_writeb(SAA7134_VIDEO_PORT_CTRL6, video_reg);
2304 saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]); 2356 saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]);
2305 saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]); 2357 saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]);
2306 } 2358 }