Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[pandora-kernel.git] / drivers / staging / xgifb / vb_struct.h
1 #ifndef _VB_STRUCT_
2 #define _VB_STRUCT_
3
4 #ifdef _INITNEW_
5 #define EXTERN
6 #else
7 #define EXTERN extern
8 #endif
9
10
11
12
13 typedef struct _XGI_PanelDelayTblStruct
14 {
15  UCHAR timer[2];
16 } XGI_PanelDelayTblStruct;
17
18 typedef struct _XGI_LCDDataStruct
19 {
20  USHORT RVBHCMAX;
21  USHORT RVBHCFACT;
22  USHORT VGAHT;
23  USHORT VGAVT;
24  USHORT LCDHT;
25  USHORT LCDVT;
26 } XGI_LCDDataStruct;
27
28
29 typedef struct _XGI_LVDSCRT1HDataStruct
30 {
31  UCHAR Reg[8];
32 } XGI_LVDSCRT1HDataStruct;
33 typedef struct _XGI_LVDSCRT1VDataStruct
34 {
35  UCHAR Reg[7];
36 } XGI_LVDSCRT1VDataStruct;
37
38
39 typedef struct _XGI_TVDataStruct
40 {
41  USHORT RVBHCMAX;
42  USHORT RVBHCFACT;
43  USHORT VGAHT;
44  USHORT VGAVT;
45  USHORT TVHDE;
46  USHORT TVVDE;
47  USHORT RVBHRS;
48  UCHAR FlickerMode;
49  USHORT HALFRVBHRS;
50  UCHAR RY1COE;
51  UCHAR RY2COE;
52  UCHAR RY3COE;
53  UCHAR RY4COE;
54 } XGI_TVDataStruct;
55
56 typedef struct _XGI_LVDSDataStruct
57 {
58  USHORT VGAHT;
59  USHORT VGAVT;
60  USHORT LCDHT;
61  USHORT LCDVT;
62 } XGI_LVDSDataStruct;
63
64 typedef struct _XGI_LVDSDesStruct
65 {
66  USHORT LCDHDES;
67  USHORT LCDVDES;
68 } XGI_LVDSDesStruct;
69
70 typedef struct _XGI_LVDSCRT1DataStruct
71 {
72  UCHAR CR[15];
73 } XGI_LVDSCRT1DataStruct;
74
75 /*add for LCDA*/
76
77
78 typedef struct _XGI_StStruct
79 {
80  UCHAR St_ModeID;
81  USHORT St_ModeFlag;
82  UCHAR St_StTableIndex;
83  UCHAR St_CRT2CRTC;
84  UCHAR St_CRT2CRTC2;
85  UCHAR St_ResInfo;
86  UCHAR VB_StTVFlickerIndex;
87  UCHAR VB_StTVEdgeIndex;
88  UCHAR VB_StTVYFilterIndex;
89 } XGI_StStruct;
90
91 typedef struct _XGI_StandTableStruct
92 {
93  UCHAR CRT_COLS;
94  UCHAR ROWS;
95  UCHAR CHAR_HEIGHT;
96  USHORT CRT_LEN;
97  UCHAR SR[4];
98  UCHAR MISC;
99  UCHAR CRTC[0x19];
100  UCHAR ATTR[0x14];
101  UCHAR GRC[9];
102 } XGI_StandTableStruct;
103
104 typedef struct _XGI_ExtStruct
105 {
106  UCHAR Ext_ModeID;
107  USHORT Ext_ModeFlag;
108  USHORT Ext_ModeInfo;
109  USHORT Ext_Point;
110  USHORT Ext_VESAID;
111  UCHAR Ext_VESAMEMSize;
112  UCHAR Ext_RESINFO;
113  UCHAR VB_ExtTVFlickerIndex;
114  UCHAR VB_ExtTVEdgeIndex;
115  UCHAR VB_ExtTVYFilterIndex;
116  UCHAR REFindex;
117 } XGI_ExtStruct;
118
119 typedef struct _XGI_Ext2Struct
120 {
121  USHORT Ext_InfoFlag;
122  UCHAR Ext_CRT1CRTC;
123  UCHAR Ext_CRTVCLK;
124  UCHAR Ext_CRT2CRTC;
125  UCHAR Ext_CRT2CRTC2;
126  UCHAR  ModeID;
127  USHORT XRes;
128  USHORT YRes;
129  /* USHORT ROM_OFFSET; */
130 } XGI_Ext2Struct;
131
132
133 typedef struct _XGI_MCLKDataStruct
134 {
135  UCHAR SR28,SR29,SR2A;
136  USHORT CLOCK;
137 } XGI_MCLKDataStruct;
138
139 typedef struct _XGI_ECLKDataStruct
140 {
141  UCHAR SR2E,SR2F,SR30;
142  USHORT CLOCK;
143 } XGI_ECLKDataStruct;
144
145 typedef struct _XGI_VCLKDataStruct
146 {
147  UCHAR SR2B,SR2C;
148  USHORT CLOCK;
149 } XGI_VCLKDataStruct;
150
151 typedef struct _XGI_VBVCLKDataStruct
152 {
153  UCHAR Part4_A,Part4_B;
154  USHORT CLOCK;
155 } XGI_VBVCLKDataStruct;
156
157 typedef struct _XGI_StResInfoStruct
158 {
159  USHORT HTotal;
160  USHORT VTotal;
161 } XGI_StResInfoStruct;
162
163 typedef struct _XGI_ModeResInfoStruct
164 {
165  USHORT HTotal;
166  USHORT VTotal;
167  UCHAR  XChar;
168  UCHAR  YChar;
169 } XGI_ModeResInfoStruct;
170
171 typedef struct _XGI_LCDNBDesStruct
172 {
173   UCHAR NB[12];
174 } XGI_LCDNBDesStruct;
175  /*add for new UNIVGABIOS*/
176 typedef struct _XGI_LCDDesStruct
177 {
178  USHORT LCDHDES;
179  USHORT LCDHRS;
180  USHORT LCDVDES;
181  USHORT LCDVRS;
182 } XGI_LCDDesStruct;
183
184 typedef struct _XGI_LCDDataTablStruct
185 {
186  UCHAR  PANELID;
187  USHORT MASK;
188  USHORT CAP;
189  USHORT DATAPTR;
190 } XGI_LCDDataTablStruct;
191
192 typedef struct _XGI_TVTablDataStruct
193 {
194  USHORT MASK;
195  USHORT CAP;
196  USHORT DATAPTR;
197 } XGI_TVDataTablStruct;
198
199 typedef struct _XGI330_LCDDesDataStruct
200 {
201  USHORT LCDHDES;
202  USHORT LCDHRS;
203  USHORT LCDVDES;
204  USHORT LCDVRS;
205 } XGI330_LCDDataDesStruct;
206
207
208 typedef struct _XGI330_LVDSDataStruct
209 {
210  USHORT VGAHT;
211  USHORT VGAVT;
212  USHORT LCDHT;
213  USHORT LCDVT;
214 } XGI330_LVDSDataStruct;
215
216 typedef struct _XGI330_LCDDesDataStruct2
217 {
218  USHORT LCDHDES;
219  USHORT LCDHRS;
220  USHORT LCDVDES;
221  USHORT LCDVRS;
222  USHORT LCDHSync;
223  USHORT LCDVSync;
224 } XGI330_LCDDataDesStruct2;
225
226 typedef struct _XGI330_LCDDataStruct
227 {
228  USHORT RVBHCMAX;
229  USHORT RVBHCFACT;
230  USHORT VGAHT;
231  USHORT VGAVT;
232  USHORT LCDHT;
233  USHORT LCDVT;
234 } XGI330_LCDDataStruct;
235
236
237 typedef struct _XGI330_TVDataStruct
238 {
239  USHORT RVBHCMAX;
240  USHORT RVBHCFACT;
241  USHORT VGAHT;
242  USHORT VGAVT;
243  USHORT TVHDE;
244  USHORT TVVDE;
245  USHORT RVBHRS;
246  UCHAR FlickerMode;
247  USHORT HALFRVBHRS;
248 } XGI330_TVDataStruct;
249
250 typedef struct _XGI330_LCDDataTablStruct
251 {
252  UCHAR  PANELID;
253  USHORT MASK;
254  USHORT CAP;
255  USHORT DATAPTR;
256 } XGI330_LCDDataTablStruct;
257
258 typedef struct _XGI330_TVDataTablStruct
259 {
260  USHORT MASK;
261  USHORT CAP;
262  USHORT DATAPTR;
263 } XGI330_TVDataTablStruct;
264
265
266 typedef struct _XGI330_CHTVDataStruct
267 {
268  USHORT VGAHT;
269  USHORT VGAVT;
270  USHORT LCDHT;
271  USHORT LCDVT;
272 } XGI330_CHTVDataStruct;
273
274 typedef struct _XGI_TimingHStruct
275 {
276   UCHAR data[8];
277 } XGI_TimingHStruct;
278
279 typedef struct _XGI_TimingVStruct
280 {
281   UCHAR data[7];
282 } XGI_TimingVStruct;
283
284 typedef struct _XGI_CH7007TV_TimingHStruct
285 {
286   UCHAR data[10];
287 } XGI_CH7007TV_TimingHStruct;
288
289 typedef struct _XGI_CH7007TV_TimingVStruct
290 {
291   UCHAR data[10];
292 } XGI_CH7007TV_TimingVStruct;
293
294 typedef struct _XGI_XG21CRT1Struct
295 {
296  UCHAR ModeID,CR02,CR03,CR15,CR16;
297 } XGI_XG21CRT1Struct;
298
299 typedef struct _XGI330_CHTVRegDataStruct
300 {
301  UCHAR Reg[16];
302 } XGI330_CHTVRegDataStruct;
303
304 typedef struct _XGI330_LCDCapStruct
305 {
306                 UCHAR      LCD_ID;
307                 USHORT     LCD_Capability;
308                 UCHAR      LCD_SetFlag;
309                 UCHAR      LCD_DelayCompensation;
310                 UCHAR      LCD_HSyncWidth;
311                 UCHAR      LCD_VSyncWidth;
312                 UCHAR      LCD_VCLK;
313                 UCHAR      LCDA_VCLKData1;
314                 UCHAR      LCDA_VCLKData2;
315                 UCHAR      LCUCHAR_VCLKData1;
316                 UCHAR      LCUCHAR_VCLKData2;
317                 UCHAR      PSC_S1;
318                 UCHAR      PSC_S2;
319                 UCHAR      PSC_S3;
320                 UCHAR      PSC_S4;
321                 UCHAR      PSC_S5;
322                 UCHAR      PWD_2B;
323                 UCHAR      PWD_2C;
324                 UCHAR      PWD_2D;
325                 UCHAR      PWD_2E;
326                 UCHAR      PWD_2F;
327                 UCHAR      Spectrum_31;
328                 UCHAR      Spectrum_32;
329                 UCHAR      Spectrum_33;
330                 UCHAR      Spectrum_34;
331 } XGI330_LCDCapStruct;
332
333 typedef struct _XGI21_LVDSCapStruct
334 {
335                 USHORT     LVDS_Capability;
336                 USHORT     LVDSHT;
337                 USHORT     LVDSVT;
338                 USHORT     LVDSHDE;
339                 USHORT     LVDSVDE;
340                 USHORT     LVDSHFP;
341                 USHORT     LVDSVFP;
342                 USHORT     LVDSHSYNC;
343                 USHORT     LVDSVSYNC;
344                 UCHAR      VCLKData1;
345                 UCHAR      VCLKData2;
346                 UCHAR      PSC_S1;
347                 UCHAR      PSC_S2;
348                 UCHAR      PSC_S3;
349                 UCHAR      PSC_S4;
350                 UCHAR      PSC_S5;
351 } XGI21_LVDSCapStruct;
352
353 typedef struct _XGI_CRT1TableStruct
354 {
355   UCHAR CR[16];
356 } XGI_CRT1TableStruct;
357
358
359 typedef struct _XGI330_VCLKDataStruct
360 {
361     UCHAR SR2B,SR2C;
362     USHORT CLOCK;
363 } XGI330_VCLKDataStruct;
364
365 typedef struct _XGI301C_Tap4TimingStruct
366 {
367     USHORT DE;
368     UCHAR  Reg[64];   /* C0-FF */
369 } XGI301C_Tap4TimingStruct;
370
371 typedef struct _XGI_New_StandTableStruct
372 {
373         UCHAR  CRT_COLS;
374         UCHAR  ROWS;
375         UCHAR  CHAR_HEIGHT;
376         USHORT CRT_LEN;
377         UCHAR  SR[4];
378         UCHAR  MISC;
379         UCHAR  CRTC[0x19];
380         UCHAR  ATTR[0x14];
381         UCHAR  GRC[9];
382 } XGI_New_StandTableStruct;
383
384 typedef UCHAR DRAM8Type[8];
385 typedef UCHAR DRAM4Type[4];
386 typedef UCHAR DRAM32Type[32];
387 typedef UCHAR DRAM2Type[2];
388
389 typedef struct _VB_DEVICE_INFO  VB_DEVICE_INFO;
390 typedef VB_DEVICE_INFO *        PVB_DEVICE_INFO;
391
392 struct _VB_DEVICE_INFO
393 {
394     BOOLEAN  ISXPDOS;
395     ULONG   P3c4,P3d4,P3c0,P3ce,P3c2,P3cc;
396     ULONG   P3ca,P3c6,P3c7,P3c8,P3c9,P3da;
397     ULONG   Part0Port,Part1Port,Part2Port;
398     ULONG   Part3Port,Part4Port,Part5Port;
399     USHORT   RVBHCFACT,RVBHCMAX,RVBHRS;
400     USHORT   VGAVT,VGAHT,VGAVDE,VGAHDE;
401     USHORT   VT,HT,VDE,HDE;
402     USHORT   LCDHRS,LCDVRS,LCDHDES,LCDVDES;
403
404     USHORT   ModeType;
405     USHORT   IF_DEF_LVDS,IF_DEF_TRUMPION,IF_DEF_DSTN;/* ,IF_DEF_FSTN; add for dstn */
406     USHORT   IF_DEF_CRT2Monitor,IF_DEF_VideoCapture;
407     USHORT   IF_DEF_LCDA,IF_DEF_CH7017,IF_DEF_YPbPr,IF_DEF_ScaleLCD,IF_DEF_OEMUtil,IF_DEF_PWD;
408     USHORT   IF_DEF_ExpLink;
409     USHORT   IF_DEF_CH7005,IF_DEF_HiVision;
410     USHORT   IF_DEF_CH7007; /* Billy 2007/05/03 */
411     USHORT   LCDResInfo,LCDTypeInfo, VBType;/*301b*/
412     USHORT   VBInfo,TVInfo,LCDInfo, Set_VGAType;
413     USHORT   VBExtInfo;/*301lv*/
414     USHORT   SetFlag;
415     USHORT   NewFlickerMode;
416     USHORT   SelectCRT2Rate;
417
418     PUCHAR ROMAddr;
419     PUCHAR FBAddr;
420     ULONG BaseAddr;
421     ULONG RelIO;
422
423     DRAM4Type  *CR6B;
424     DRAM4Type  *CR6E;
425     DRAM32Type *CR6F;
426     DRAM2Type  *CR89;
427
428     DRAM8Type  *SR15; /* pointer : point to array */
429     DRAM8Type  *CR40;
430     UCHAR  *pSoftSetting;
431     UCHAR  *pOutputSelect;
432
433     USHORT *pRGBSenseData;
434     USHORT *pRGBSenseData2; /*301b*/
435     USHORT *pVideoSenseData;
436     USHORT *pVideoSenseData2;
437     USHORT *pYCSenseData;
438     USHORT *pYCSenseData2;
439
440     UCHAR  *pSR07;
441     UCHAR  *CR49;
442     UCHAR  *pSR1F;
443     UCHAR  *AGPReg;
444     UCHAR  *SR16;
445     UCHAR  *pSR21;
446     UCHAR  *pSR22;
447     UCHAR  *pSR23;
448     UCHAR  *pSR24;
449     UCHAR  *SR25;
450     UCHAR  *pSR31;
451     UCHAR  *pSR32;
452     UCHAR  *pSR33;
453     UCHAR  *pSR36;      /* alan 12/07/2006 */
454     UCHAR  *pCRCF;
455     UCHAR  *pCRD0;      /* alan 12/07/2006 */
456     UCHAR  *pCRDE;      /* alan 12/07/2006 */
457     UCHAR  *pCR8F;      /* alan 12/07/2006 */
458     UCHAR  *pSR40;      /* alan 12/07/2006 */
459     UCHAR  *pSR41;      /* alan 12/07/2006 */
460     UCHAR  *pDVOSetting;
461     UCHAR  *pCR2E;
462     UCHAR  *pCR2F;
463     UCHAR  *pCR46;
464     UCHAR  *pCR47;
465     UCHAR  *pCRT2Data_1_2;
466     UCHAR  *pCRT2Data_4_D;
467     UCHAR  *pCRT2Data_4_E;
468     UCHAR  *pCRT2Data_4_10;
469     XGI_MCLKDataStruct  *MCLKData;
470     XGI_ECLKDataStruct  *ECLKData;
471
472     UCHAR   *XGI_TVDelayList;
473     UCHAR   *XGI_TVDelayList2;
474     UCHAR   *CHTVVCLKUNTSC;
475     UCHAR   *CHTVVCLKONTSC;
476     UCHAR   *CHTVVCLKUPAL;
477     UCHAR   *CHTVVCLKOPAL;
478     UCHAR   *NTSCTiming;
479     UCHAR   *PALTiming;
480     UCHAR   *HiTVExtTiming;
481     UCHAR   *HiTVSt1Timing;
482     UCHAR   *HiTVSt2Timing;
483     UCHAR   *HiTVTextTiming;
484     UCHAR   *YPbPr750pTiming;
485     UCHAR   *YPbPr525pTiming;
486     UCHAR   *YPbPr525iTiming;
487     UCHAR   *HiTVGroup3Data;
488     UCHAR   *HiTVGroup3Simu;
489     UCHAR   *HiTVGroup3Text;
490     UCHAR   *Ren525pGroup3;
491     UCHAR   *Ren750pGroup3;
492     UCHAR   *ScreenOffset;
493     UCHAR   *pXGINew_DRAMTypeDefinition;
494     UCHAR   *pXGINew_I2CDefinition ;
495     UCHAR   *pXGINew_CR97 ;
496
497     XGI330_LCDCapStruct  *LCDCapList;
498     XGI21_LVDSCapStruct  *XG21_LVDSCapList;
499
500     XGI_TimingHStruct  *TimingH;
501     XGI_TimingVStruct  *TimingV;
502
503     XGI_StStruct          *SModeIDTable;
504     XGI_StandTableStruct  *StandTable;
505     XGI_ExtStruct         *EModeIDTable;
506     XGI_Ext2Struct        *RefIndex;
507     /* XGINew_CRT1TableStruct *CRT1Table; */
508     XGI_CRT1TableStruct    *XGINEWUB_CRT1Table;
509     XGI_VCLKDataStruct    *VCLKData;
510     XGI_VBVCLKDataStruct  *VBVCLKData;
511     XGI_StResInfoStruct   *StResInfo;
512     XGI_ModeResInfoStruct *ModeResInfo;
513     XGI_XG21CRT1Struct    *UpdateCRT1;
514 };  /* _VB_DEVICE_INFO */
515
516
517 typedef struct
518 {
519     USHORT    Horizontal_ACTIVE;
520     USHORT    Horizontal_FP;
521     USHORT    Horizontal_SYNC;
522     USHORT    Horizontal_BP;
523     USHORT    Vertical_ACTIVE;
524     USHORT    Vertical_FP;
525     USHORT    Vertical_SYNC;
526     USHORT    Vertical_BP;
527     double    DCLK;
528     UCHAR     FrameRate;
529     UCHAR     Interlace;
530     USHORT    Margin;
531 } TimingInfo;
532
533 #define _VB_STRUCT_
534 #endif /* _VB_STRUCT_ */