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