xref: /linux/drivers/usb/misc/sisusbvga/sisusb_struct.h (revision 5e8d780d745c1619aba81fe7166c5a4b5cad2b84)
1 /*
2  * General structure definitions for universal mode switching modules
3  *
4  * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
5  *
6  * If distributed as part of the Linux kernel, the following license terms
7  * apply:
8  *
9  * * This program is free software; you can redistribute it and/or modify
10  * * it under the terms of the GNU General Public License as published by
11  * * the Free Software Foundation; either version 2 of the named License,
12  * * or any later version.
13  * *
14  * * This program is distributed in the hope that it will be useful,
15  * * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * * GNU General Public License for more details.
18  * *
19  * * You should have received a copy of the GNU General Public License
20  * * along with this program; if not, write to the Free Software
21  * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
22  *
23  * Otherwise, the following license terms apply:
24  *
25  * * Redistribution and use in source and binary forms, with or without
26  * * modification, are permitted provided that the following conditions
27  * * are met:
28  * * 1) Redistributions of source code must retain the above copyright
29  * *    notice, this list of conditions and the following disclaimer.
30  * * 2) Redistributions in binary form must reproduce the above copyright
31  * *    notice, this list of conditions and the following disclaimer in the
32  * *    documentation and/or other materials provided with the distribution.
33  * * 3) The name of the author may not be used to endorse or promote products
34  * *    derived from this software without specific prior written permission.
35  * *
36  * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
37  * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
39  * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
40  * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41  * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
42  * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
43  * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44  * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
45  * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  *
47  * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
48  *
49  */
50 
51 #ifndef _SISUSB_STRUCT_H_
52 #define _SISUSB_STRUCT_H_
53 
54 struct SiS_St {
55 	unsigned char	St_ModeID;
56 	unsigned short	St_ModeFlag;
57 	unsigned char	St_StTableIndex;
58 	unsigned char	St_CRT2CRTC;
59 	unsigned char	St_ResInfo;
60 	unsigned char	VB_StTVFlickerIndex;
61 	unsigned char	VB_StTVEdgeIndex;
62 	unsigned char	VB_StTVYFilterIndex;
63 	unsigned char	St_PDC;
64 };
65 
66 struct SiS_StandTable
67 {
68 	unsigned char	CRT_COLS;
69 	unsigned char	ROWS;
70 	unsigned char	CHAR_HEIGHT;
71 	unsigned short	CRT_LEN;
72 	unsigned char	SR[4];
73 	unsigned char	MISC;
74 	unsigned char	CRTC[0x19];
75 	unsigned char	ATTR[0x14];
76 	unsigned char	GRC[9];
77 };
78 
79 struct SiS_StResInfo_S {
80 	unsigned short	HTotal;
81 	unsigned short	VTotal;
82 };
83 
84 struct SiS_Ext
85 {
86 	unsigned char	Ext_ModeID;
87 	unsigned short	Ext_ModeFlag;
88 	unsigned short	Ext_VESAID;
89 	unsigned char	Ext_RESINFO;
90 	unsigned char	VB_ExtTVFlickerIndex;
91 	unsigned char	VB_ExtTVEdgeIndex;
92 	unsigned char	VB_ExtTVYFilterIndex;
93 	unsigned char	VB_ExtTVYFilterIndexROM661;
94 	unsigned char	REFindex;
95 	char		ROMMODEIDX661;
96 };
97 
98 struct SiS_Ext2
99 {
100 	unsigned short	Ext_InfoFlag;
101 	unsigned char	Ext_CRT1CRTC;
102 	unsigned char	Ext_CRTVCLK;
103 	unsigned char	Ext_CRT2CRTC;
104 	unsigned char	Ext_CRT2CRTC_NS;
105 	unsigned char	ModeID;
106 	unsigned short	XRes;
107 	unsigned short	YRes;
108 	unsigned char	Ext_PDC;
109 	unsigned char	Ext_FakeCRT2CRTC;
110 	unsigned char	Ext_FakeCRT2Clk;
111 };
112 
113 struct SiS_CRT1Table
114 {
115 	unsigned char	CR[17];
116 };
117 
118 struct SiS_VCLKData
119 {
120 	unsigned char	SR2B,SR2C;
121 	unsigned short	CLOCK;
122 };
123 
124 struct SiS_ModeResInfo
125 {
126 	unsigned short	HTotal;
127 	unsigned short	VTotal;
128 	unsigned char	XChar;
129 	unsigned char	YChar;
130 };
131 
132 struct SiS_Private
133 {
134 	void *sisusb;
135 
136 	unsigned long IOAddress;
137 
138 	unsigned long SiS_P3c4;
139 	unsigned long SiS_P3d4;
140 	unsigned long SiS_P3c0;
141 	unsigned long SiS_P3ce;
142 	unsigned long SiS_P3c2;
143 	unsigned long SiS_P3ca;
144 	unsigned long SiS_P3c6;
145 	unsigned long SiS_P3c7;
146 	unsigned long SiS_P3c8;
147 	unsigned long SiS_P3c9;
148 	unsigned long SiS_P3cb;
149 	unsigned long SiS_P3cc;
150 	unsigned long SiS_P3cd;
151 	unsigned long SiS_P3da;
152 	unsigned long SiS_Part1Port;
153 
154 	unsigned char	SiS_MyCR63;
155 	unsigned short	SiS_CRT1Mode;
156 	unsigned short	SiS_ModeType;
157 	unsigned short	SiS_SetFlag;
158 
159 	const struct SiS_StandTable	*SiS_StandTable;
160 	const struct SiS_St		*SiS_SModeIDTable;
161 	const struct SiS_Ext		*SiS_EModeIDTable;
162 	const struct SiS_Ext2		*SiS_RefIndex;
163 	const struct SiS_CRT1Table	*SiS_CRT1Table;
164 	const struct SiS_VCLKData	*SiS_VCLKData;
165 	const struct SiS_ModeResInfo	*SiS_ModeResInfo;
166 };
167 
168 #endif
169 
170