Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vino.h
Go to the documentation of this file.
1 /*
2  * Driver for the VINO (Video In No Out) system found in SGI Indys.
3  *
4  * This file is subject to the terms and conditions of the GNU General Public
5  * License version 2 as published by the Free Software Foundation.
6  *
7  * Copyright (C) 1999 Ulf Karlsson <[email protected]>
8  * Copyright (C) 2003 Ladislav Michl <[email protected]>
9  */
10 
11 #ifndef _VINO_H_
12 #define _VINO_H_
13 
14 #define VINO_BASE 0x00080000 /* Vino is in the EISA address space,
15  * but it is not an EISA bus card */
16 #define VINO_PAGE_SIZE 4096
17 
20  volatile u32 alpha;
21 
22 #define VINO_CLIP_X(x) ((x) & 0x3ff) /* bits 0:9 */
23 #define VINO_CLIP_ODD(x) (((x) & 0x1ff) << 10) /* bits 10:18 */
24 #define VINO_CLIP_EVEN(x) (((x) & 0x1ff) << 19) /* bits 19:27 */
26  volatile u32 clip_start;
28  volatile u32 clip_end;
29 
30 #define VINO_FRAMERT_FULL 0xfff
31 #define VINO_FRAMERT_PAL (1<<0) /* 0=NTSC 1=PAL */
32 #define VINO_FRAMERT_RT(x) (((x) & 0xfff) << 1) /* bits 1:12 */
34  volatile u32 frame_rate;
35 
37  volatile u32 field_counter;
39  volatile u32 line_size;
41  volatile u32 line_count;
43  volatile u32 page_index;
45  volatile u32 next_4_desc;
47  volatile u32 start_desc_tbl;
48 
49 #define VINO_DESC_JUMP (1<<30)
50 #define VINO_DESC_STOP (1<<31)
51 #define VINO_DESC_VALID (1<<32)
53  volatile u32 desc_0;
55  volatile u32 desc_1;
57  volatile u32 desc_2;
59  volatile u32 desc_3;
60 
62  volatile u32 fifo_thres;
64  volatile u32 fifo_read;
66  volatile u32 fifo_write;
67 };
68 
69 struct sgi_vino {
70 #define VINO_CHIP_ID 0xb
71 #define VINO_REV_NUM(x) ((x) & 0x0f)
72 #define VINO_ID_VALUE(x) (((x) & 0xf0) >> 4)
74  volatile u32 rev_id;
75 
76 #define VINO_CTRL_LITTLE_ENDIAN (1<<0)
77 #define VINO_CTRL_A_EOF_INT (1<<1) /* Field transferred int */
78 #define VINO_CTRL_A_FIFO_INT (1<<2) /* FIFO overflow int */
79 #define VINO_CTRL_A_EOD_INT (1<<3) /* End of desc table int */
80 #define VINO_CTRL_A_INT (VINO_CTRL_A_EOF_INT | \
81  VINO_CTRL_A_FIFO_INT | \
82  VINO_CTRL_A_EOD_INT)
83 #define VINO_CTRL_B_EOF_INT (1<<4) /* Field transferred int */
84 #define VINO_CTRL_B_FIFO_INT (1<<5) /* FIFO overflow int */
85 #define VINO_CTRL_B_EOD_INT (1<<6) /* End of desc table int */
86 #define VINO_CTRL_B_INT (VINO_CTRL_B_EOF_INT | \
87  VINO_CTRL_B_FIFO_INT | \
88  VINO_CTRL_B_EOD_INT)
89 #define VINO_CTRL_A_DMA_ENBL (1<<7)
90 #define VINO_CTRL_A_INTERLEAVE_ENBL (1<<8)
91 #define VINO_CTRL_A_SYNC_ENBL (1<<9)
92 #define VINO_CTRL_A_SELECT (1<<10) /* 1=D1 0=Philips */
93 #define VINO_CTRL_A_RGB (1<<11) /* 1=RGB 0=YUV */
94 #define VINO_CTRL_A_LUMA_ONLY (1<<12)
95 #define VINO_CTRL_A_DEC_ENBL (1<<13) /* Decimation */
96 #define VINO_CTRL_A_DEC_SCALE_MASK 0x1c000 /* bits 14:17 */
97 #define VINO_CTRL_A_DEC_SCALE_SHIFT (14)
98 #define VINO_CTRL_A_DEC_HOR_ONLY (1<<17) /* Horizontal only */
99 #define VINO_CTRL_A_DITHER (1<<18) /* 24 -> 8 bit dither */
100 #define VINO_CTRL_B_DMA_ENBL (1<<19)
101 #define VINO_CTRL_B_INTERLEAVE_ENBL (1<<20)
102 #define VINO_CTRL_B_SYNC_ENBL (1<<21)
103 #define VINO_CTRL_B_SELECT (1<<22) /* 1=D1 0=Philips */
104 #define VINO_CTRL_B_RGB (1<<23) /* 1=RGB 0=YUV */
105 #define VINO_CTRL_B_LUMA_ONLY (1<<24)
106 #define VINO_CTRL_B_DEC_ENBL (1<<25) /* Decimation */
107 #define VINO_CTRL_B_DEC_SCALE_MASK 0x1c000000 /* bits 26:28 */
108 #define VINO_CTRL_B_DEC_SCALE_SHIFT (26)
109 #define VINO_CTRL_B_DEC_HOR_ONLY (1<<29) /* Decimation horizontal only */
110 #define VINO_CTRL_B_DITHER (1<<30) /* ChanB 24 -> 8 bit dither */
112  volatile u32 control;
114 #define VINO_INTSTAT_A_EOF (1<<0) /* Field transferred int */
115 #define VINO_INTSTAT_A_FIFO (1<<1) /* FIFO overflow int */
116 #define VINO_INTSTAT_A_EOD (1<<2) /* End of desc table int */
117 #define VINO_INTSTAT_A (VINO_INTSTAT_A_EOF | \
118  VINO_INTSTAT_A_FIFO | \
119  VINO_INTSTAT_A_EOD)
120 #define VINO_INTSTAT_B_EOF (1<<3) /* Field transferred int */
121 #define VINO_INTSTAT_B_FIFO (1<<4) /* FIFO overflow int */
122 #define VINO_INTSTAT_B_EOD (1<<5) /* End of desc table int */
123 #define VINO_INTSTAT_B (VINO_INTSTAT_B_EOF | \
124  VINO_INTSTAT_B_FIFO | \
125  VINO_INTSTAT_B_EOD)
127  volatile u32 intr_status;
130  volatile u32 i2c_control;
132  volatile u32 i2c_data;
135  struct sgi_vino_channel b;
136 };
137 
138 #endif