Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13332
b: refs/heads/master
c: 2f8d4f5
h: refs/heads/master
v: v3
  • Loading branch information
Robert W. Boone authored and Linus Torvalds committed Nov 9, 2005
1 parent 85d5997 commit 3958c41
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd35a6b454818e01f761622e9ac5824ce2d7baf5
refs/heads/master: 2f8d4f5139fe7817f43202d8ee2f4b68ac53e58f
4 changes: 4 additions & 0 deletions trunk/drivers/media/video/saa7134/saa7134-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,10 @@ struct saa7134_board saa7134_boards[] = {
}},
.mpeg = SAA7134_MPEG_EMPRESS,
.video_out = CCIR656,
.vid_port_opts = ( SET_T_CODE_POLARITY_NON_INVERTED |
SET_CLOCK_NOT_DELAYED |
SET_CLOCK_INVERTED |
SET_VSYNC_OFF ),
},
[SAA7134_BOARD_RTD_VFG7330] = {
.name = "RTD Embedded Technologies VFG7330",
Expand Down
58 changes: 55 additions & 3 deletions trunk/drivers/media/video/saa7134/saa7134-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,43 @@ MODULE_PARM_DESC(noninterlaced,"video input is noninterlaced");
#define dprintk(fmt, arg...) if (video_debug) \
printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)

/* ------------------------------------------------------------------ */
/* Defines for Video Output Port Register at address 0x191 */

/* Bit 0: VIP code T bit polarity */

#define VP_T_CODE_P_NON_INVERTED 0x00
#define VP_T_CODE_P_INVERTED 0x01

/* ------------------------------------------------------------------ */
/* Defines for Video Output Port Register at address 0x195 */

/* Bit 2: Video output clock delay control */

#define VP_CLK_CTRL2_NOT_DELAYED 0x00
#define VP_CLK_CTRL2_DELAYED 0x04

/* Bit 1: Video output clock invert control */

#define VP_CLK_CTRL1_NON_INVERTED 0x00
#define VP_CLK_CTRL1_INVERTED 0x02

/* ------------------------------------------------------------------ */
/* Defines for Video Output Port Register at address 0x196 */

/* Bits 2 to 0: VSYNC pin video vertical sync type */

#define VP_VS_TYPE_MASK 0x07

#define VP_VS_TYPE_OFF 0x00
#define VP_VS_TYPE_V123 0x01
#define VP_VS_TYPE_V_ITU 0x02
#define VP_VS_TYPE_VGATE_L 0x03
#define VP_VS_TYPE_RESERVED1 0x04
#define VP_VS_TYPE_RESERVED2 0x05
#define VP_VS_TYPE_F_ITU 0x06
#define VP_VS_TYPE_SC_FID 0x07

/* ------------------------------------------------------------------ */
/* data structs for video */

Expand Down Expand Up @@ -2294,13 +2331,28 @@ int saa7134_video_init1(struct saa7134_dev *dev)
if (saa7134_boards[dev->board].video_out) {
/* enable video output */
int vo = saa7134_boards[dev->board].video_out;
int video_reg;
unsigned int vid_port_opts = saa7134_boards[dev->board].vid_port_opts;
saa_writeb(SAA7134_VIDEO_PORT_CTRL0, video_out[vo][0]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_out[vo][1]);
video_reg = video_out[vo][1];
if (vid_port_opts & SET_T_CODE_POLARITY_NON_INVERTED)
video_reg &= ~VP_T_CODE_P_INVERTED;
saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_reg);
saa_writeb(SAA7134_VIDEO_PORT_CTRL2, video_out[vo][2]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL4, video_out[vo][4]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL5, video_out[vo][5]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL6, video_out[vo][6]);
video_reg = video_out[vo][5];
if (vid_port_opts & SET_CLOCK_NOT_DELAYED)
video_reg &= ~VP_CLK_CTRL2_DELAYED;
if (vid_port_opts & SET_CLOCK_INVERTED)
video_reg |= VP_CLK_CTRL1_INVERTED;
saa_writeb(SAA7134_VIDEO_PORT_CTRL5, video_reg);
video_reg = video_out[vo][6];
if (vid_port_opts & SET_VSYNC_OFF) {
video_reg &= ~VP_VS_TYPE_MASK;
video_reg |= VP_VS_TYPE_OFF;
}
saa_writeb(SAA7134_VIDEO_PORT_CTRL6, video_reg);
saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]);
}
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/media/video/saa7134/saa7134.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ struct saa7134_format {
#define SAA7134_MAXBOARDS 8
#define SAA7134_INPUT_MAX 8

/* ----------------------------------------------------------- */
/* Video Output Port Register Initialization Options */

#define SET_T_CODE_POLARITY_NON_INVERTED (1 << 0)
#define SET_CLOCK_NOT_DELAYED (1 << 1)
#define SET_CLOCK_INVERTED (1 << 2)
#define SET_VSYNC_OFF (1 << 3)

struct saa7134_input {
char *name;
unsigned int vmux;
Expand Down Expand Up @@ -234,6 +242,7 @@ struct saa7134_board {
/* peripheral I/O */
enum saa7134_video_out video_out;
enum saa7134_mpeg_type mpeg;
unsigned int vid_port_opts;
};

#define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name)
Expand Down

0 comments on commit 3958c41

Please sign in to comment.