aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c4
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c58
-rw-r--r--drivers/media/video/saa7134/saa7134.h9
3 files changed, 68 insertions, 3 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 7278150fb58e..3a4c59e7ca07 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2285,6 +2285,10 @@ struct saa7134_board saa7134_boards[] = {
2285 }}, 2285 }},
2286 .mpeg = SAA7134_MPEG_EMPRESS, 2286 .mpeg = SAA7134_MPEG_EMPRESS,
2287 .video_out = CCIR656, 2287 .video_out = CCIR656,
2288 .vid_port_opts = ( SET_T_CODE_POLARITY_NON_INVERTED |
2289 SET_CLOCK_NOT_DELAYED |
2290 SET_CLOCK_INVERTED |
2291 SET_VSYNC_OFF ),
2288 }, 2292 },
2289 [SAA7134_BOARD_RTD_VFG7330] = { 2293 [SAA7134_BOARD_RTD_VFG7330] = {
2290 .name = "RTD Embedded Technologies VFG7330", 2294 .name = "RTD Embedded Technologies VFG7330",
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 }
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index e907d86da7b5..9dfd45bed92b 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -199,6 +199,14 @@ struct saa7134_format {
199#define SAA7134_MAXBOARDS 8 199#define SAA7134_MAXBOARDS 8
200#define SAA7134_INPUT_MAX 8 200#define SAA7134_INPUT_MAX 8
201 201
202/* ----------------------------------------------------------- */
203/* Video Output Port Register Initialization Options */
204
205#define SET_T_CODE_POLARITY_NON_INVERTED (1 << 0)
206#define SET_CLOCK_NOT_DELAYED (1 << 1)
207#define SET_CLOCK_INVERTED (1 << 2)
208#define SET_VSYNC_OFF (1 << 3)
209
202struct saa7134_input { 210struct saa7134_input {
203 char *name; 211 char *name;
204 unsigned int vmux; 212 unsigned int vmux;
@@ -234,6 +242,7 @@ struct saa7134_board {
234 /* peripheral I/O */ 242 /* peripheral I/O */
235 enum saa7134_video_out video_out; 243 enum saa7134_video_out video_out;
236 enum saa7134_mpeg_type mpeg; 244 enum saa7134_mpeg_type mpeg;
245 unsigned int vid_port_opts;
237}; 246};
238 247
239#define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name) 248#define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name)