1 /* $XFree86$ */
2 /* $XdotOrg$ */
3 /*
4  * Register settings for SiS 315/330 series
5  *
6  * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
7  *
8  * If distributed as part of the Linux kernel, the following license terms
9  * apply:
10  *
11  * * This program is free software; you can redistribute it and/or modify
12  * * it under the terms of the GNU General Public License as published by
13  * * the Free Software Foundation; either version 2 of the named License,
14  * * or any later version.
15  * *
16  * * This program is distributed in the hope that it will be useful,
17  * * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * * GNU General Public License for more details.
20  * *
21  * * You should have received a copy of the GNU General Public License
22  * * along with this program; if not, write to the Free Software
23  * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24  *
25  * Otherwise, the following license terms apply:
26  *
27  * * Redistribution and use in source and binary forms, with or without
28  * * modification, are permitted provided that the following conditions
29  * * are met:
30  * * 1) Redistributions of source code must retain the above copyright
31  * *    notice, this list of conditions and the following disclaimer.
32  * * 2) Redistributions in binary form must reproduce the above copyright
33  * *    notice, this list of conditions and the following disclaimer in the
34  * *    documentation and/or other materials provided with the distribution.
35  * * 3) The name of the author may not be used to endorse or promote products
36  * *    derived from this software without specific prior written permission.
37  * *
38  * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
39  * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40  * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
41  * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
42  * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43  * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44  * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
45  * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46  * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
47  * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48  *
49  * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
50  *
51  */
52 
53 static const SiS_StStruct SiS310_SModeIDTable[]=
54 {
55 	{0x01,0x9208,0x01,0x00,0x00,0x00,0x01,0x00, 0x40},
56 	{0x01,0x1210,0x14,0x01,0x01,0x00,0x01,0x00, 0x40},
57 	{0x01,0x1010,0x17,0x02,0x02,0x00,0x01,0x01, 0x40},
58 	{0x03,0x8208,0x03,0x00,0x00,0x00,0x01,0x02, 0x40},
59 	{0x03,0x0210,0x16,0x01,0x01,0x00,0x01,0x02, 0x40},
60 	{0x03,0x0010,0x18,0x02,0x02,0x00,0x01,0x03, 0x40},
61 	{0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x04, 0x40},
62 	{0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x05, 0x40},
63 	{0x07,0x0000,0x07,0x03,0x03,0x00,0x01,0x03, 0x40},
64 	{0x07,0x0000,0x19,0x02,0x02,0x00,0x01,0x03, 0x40},
65 	{0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x04, 0x40},
66 	{0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x05, 0x40},
67 	{0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x05, 0x40},
68 	{0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x05, 0x40},
69 	{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x05, 0x40},
70 	{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x05, 0x40},
71 	{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x04, 0x40},
72 	{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x05, 0x40},
73 	{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x05, 0x40},
74 	{0xff,0x0000,0x00,0x00,0x00,0x00,0x00,0x00, 0x40}
75 };
76 
77 static const SiS_ExtStruct  SiS310_EModeIDTable[]=
78 {
79 	{0x6a,0x2212,0x0102,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x? */
80 	{0x2e,0x0a1b,0x0101,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x8 */
81         {0x2f,0x0a1b,0x0100,SIS_RI_640x400,  0x00,0x00,0x05,0x05,0x10, 0}, /* 640x400x8 */
82 	{0x30,0x2a1b,0x0103,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x8 */
83         {0x31,0x4a1b,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x8 */
84 	{0x32,0x4a1b,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x8 */
85 	{0x33,0x4a1d,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x16 */
86 	{0x34,0x6a1d,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x16 */
87 	{0x35,0x4a1f,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x32 */
88 	{0x36,0x6a1f,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x32 */
89 	{0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x? */
90 	{0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x8 */
91 	{0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x8 */
92 	{0x3c,0x0e3b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x8 */
93 	{0x3d,0x0e7d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x16 */
94 	{0x40,0x9a1c,0x010d,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x15 */
95 	{0x41,0x9a1d,0x010e,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x16 */
96 	{0x43,0x0a1c,0x0110,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2},
97 	{0x44,0x0a1d,0x0111,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x16 */
98 	{0x46,0x2a1c,0x0113,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3},
99 	{0x47,0x2a1d,0x0114,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x16 */
100 	{0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13, 4},
101 	{0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x16 */
102 	{0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8},
103 	{0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x16 */
104 	{0x50,0x9a1b,0x0132,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x8  */
105 	{0x51,0xba1b,0x0133,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x8  */
106   	{0x52,0xba1b,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x8  */
107 	{0x56,0x9a1d,0x0135,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x16 */
108 	{0x57,0xba1d,0x0136,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x16 */
109  	{0x58,0xba1d,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x16 */
110 	{0x59,0x9a1b,0x0138,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x8  */
111 	{0x5a,0x021b,0x0138,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x8  fstn */
112 	{0x5b,0x0a1d,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x16 fstn */
113 	{0x5c,0xba1f,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x32 */
114 	{0x5d,0x0a1d,0x0139,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10, 0},
115 	{0x5e,0x0a1f,0x0000,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10, 0}, /* 640x400x32 */
116 	{0x62,0x0a3f,0x013a,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x32 */
117 	{0x63,0x2a3f,0x013b,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x32 */
118 	{0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x32 */
119 	{0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x32 */
120 	{0x66,0x0eff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x32 */
121 	{0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x8 */
122 	{0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x16 */
123 	{0x6b,0x07ff,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x32 */
124 	{0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x8 */
125 	{0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x16 */
126 	{0x6e,0x07ff,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x32 */
127 	{0x70,0x6a1b,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x8 */
128 	{0x71,0x4a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x8 */
129 	{0x74,0x4a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x16 */
130 	{0x75,0x0a3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x16 */
131 	{0x76,0x6a1f,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x32 */
132 	{0x77,0x4a1f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x32 */
133 	{0x78,0x0a3f,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x32 */
134 	{0x79,0x0a3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x8 */
135 	{0x7a,0x6a1d,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x16 */
136 	{0x7c,0x0e3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x8 */
137 	{0x7d,0x0e7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x16 */
138 	{0x7e,0x0eff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x32 */
139 	{0x23,0x0e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x8 */
140 	{0x24,0x0e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x16 */
141 	{0x25,0x0eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x32 */
142 	{0x26,0x0e3b,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x8 */
143 	{0x27,0x0e7d,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x16 */
144 	{0x28,0x0eff,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x32*/
145 	{0x29,0x4e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1}, /* 1152x864 */
146 	{0x2a,0x4e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1},
147 	{0x2b,0x4e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1},
148 	{0x39,0x6a1b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45,-1}, /* 848x480 */
149 	{0x3b,0x6a3d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45,-1},
150 	{0x3e,0x6a7f,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45,-1},
151 	{0x3f,0x6a1b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47,-1}, /* 856x480 */
152 	{0x42,0x6a3d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47,-1},
153 	{0x45,0x6a7f,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47,-1},
154 	{0x48,0x6a1b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1}, /* 1360x768 */
155 	{0x4b,0x6a3d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1},
156 	{0x4e,0x6a7f,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1},
157 	{0x4f,0x9a1f,0x0000,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x32 */
158 	{0x53,0x9a1f,0x0000,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x32 */
159 	{0x54,0xba1f,0x0000,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x32 */
160 	{0x5f,0x6a1b,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a,-1}, /* 768x576 */
161 	{0x60,0x6a1d,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a,-1},
162 	{0x61,0x6a1f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a,-1},
163 	{0x14,0x0e1b,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7}, /* 1280x800 */
164 	{0x15,0x0e3d,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7},
165 	{0x16,0x0e7f,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7},
166 	{0x17,0x0e1b,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9}, /* 1680x1050 */
167 	{0x18,0x0e3d,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9},
168 	{0x19,0x0e7f,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9},
169 	{0xff,0x0000,0x0000,0,               0x00,0x00,0x00,0x00,0x00,-1}
170 };
171 
172 static const SiS_Ext2Struct SiS310_RefIndex[]=
173 {
174 	{0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0x40}, /* 0x0 */
175 	{0x0067,0x0e,0x04,0x05,0x05,0x6a, 800, 600, 0x40}, /* 0x1 */
176 	{0x0067,0x0f,0x08,0x48,0x05,0x6a, 800, 600, 0x40}, /* 0x2 */
177 	{0x0067,0x10,0x07,0x8b,0x05,0x6a, 800, 600, 0x40}, /* 0x3 */
178 	{0x0047,0x11,0x0a,0x00,0x05,0x6a, 800, 600, 0x40}, /* 0x4 */
179 	{0x0047,0x12,0x0d,0x00,0x05,0x6a, 800, 600, 0x40}, /* 0x5 */
180 	{0x0047,0x13,0x13,0x00,0x05,0x6a, 800, 600, 0x20}, /* 0x6 */
181 	{0x0107,0x14,0x1c,0x00,0x05,0x6a, 800, 600, 0x20}, /* 0x7 */
182 	{0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0x40}, /* 0x8 */
183 	{0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0x40}, /* 0x9 */
184 	{0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0x40}, /* 0xa */
185 	{0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0x40}, /* 0xb */
186 	{0xc047,0x09,0x05,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xc */
187 	{0xc047,0x0a,0x09,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xd */
188 	{0xc047,0x0b,0x0e,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xe */
189 	{0xc047,0x0c,0x15,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xf */
190 	{0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0x30}, /* 0x10 */
191 	{0xc06f,0x3c,0x01,0x06,0x13,0x31, 720, 480, 0x30}, /* 0x11 */
192 	{0x006f,0x3d,0x03,0x06,0x14,0x32, 720, 576, 0x30}, /* 0x12 */
193 	{0x0087,0x15,0x06,0x00,0x06,0x37,1024, 768, 0x30}, /* 0x13 */
194 	{0xc877,0x16,0x0b,0x06,0x06,0x37,1024, 768, 0x20}, /* 0x14 */
195 	{0xc067,0x17,0x0f,0x49,0x06,0x37,1024, 768, 0x20}, /* 0x15 */
196 	{0x0067,0x18,0x11,0x00,0x06,0x37,1024, 768, 0x20}, /* 0x16 */
197 	{0x0047,0x19,0x16,0x8c,0x06,0x37,1024, 768, 0x20}, /* 0x17 */
198 	{0x0107,0x1a,0x1b,0x00,0x06,0x37,1024, 768, 0x10}, /* 0x18 */
199 	{0x0107,0x1b,0x1f,0x00,0x06,0x37,1024, 768, 0x10}, /* 0x19 */
200 	{0x0087,0x1c,0x11,0x00,0x07,0x3a,1280,1024, 0x30}, /* 0x1a */
201 	{0x0137,0x1d,0x19,0x07,0x07,0x3a,1280,1024, 0x00}, /* 0x1b */
202 	{0x0107,0x1e,0x1e,0x00,0x07,0x3a,1280,1024, 0x00}, /* 0x1c */
203 	{0x0207,0x1f,0x20,0x00,0x07,0x3a,1280,1024, 0x00}, /* 0x1d */
204 	{0x0227,0x20,0x21,0x09,0x09,0x3c,1600,1200, 0x00}, /* 0x1e */
205 	{0x0407,0x21,0x22,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x1f */
206 	{0x0407,0x22,0x23,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x20 */
207 	{0x0407,0x23,0x25,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x21 */
208 	{0x0007,0x24,0x26,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x22 */
209 	{0x0007,0x25,0x2c,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x23 */
210 	{0x0007,0x26,0x34,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x24 */
211 	{0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0x30}, /* 0x25 */
212 	{0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0x30}, /* 0x26 */
213 	{0x007f,0x02,0x04,0x05,0x05,0x51, 400, 300, 0x30}, /* 0x27 */
214 	{0xc077,0x03,0x0b,0x06,0x06,0x52, 512, 384, 0x30}, /* 0x28 */
215 	{0x8007,0x27,0x27,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x29 */
216 	{0x4007,0x28,0x29,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2a */
217 	{0x4007,0x29,0x2e,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2b */
218 	{0x4007,0x2a,0x30,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2c */
219 	{0x4007,0x2b,0x35,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2d */
220 	{0x4005,0x2c,0x39,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2e */
221 	{0x4007,0x2d,0x2b,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x2f */
222 	{0x4007,0x2e,0x31,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x30 */
223 	{0x4007,0x2f,0x33,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x31 */
224 	{0x4007,0x30,0x37,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x32 */
225 	{0x4005,0x31,0x38,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x33 */
226 	{0x0077,0x32,0x40,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x34 */
227 	{0x0047,0x33,0x07,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x35 */
228 	{0x0047,0x34,0x0a,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x36 */
229 	{0x0077,0x35,0x0b,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x37 */
230 	{0x0047,0x36,0x11,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x38 */
231 	{0x0047,0x37,0x16,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x39 */
232 	{0x1137,0x38,0x19,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3a */
233 	{0x1107,0x39,0x1e,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3b */
234 	{0x1307,0x3a,0x20,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3c */
235 	{0x0127,0x3b,0x19,0x08,0x0a,0x7c,1280, 960, 0x30}, /* 0x3d */
236 	{0x0227,0x4c,0x59,0x08,0x0a,0x7c,1280, 960, 0x20}, /* 0x3e */
237 	{0xc07f,0x4e,0x00,0x06,0x04,0x5a, 320, 240, 0x30}, /* 0x3f */    /* FSTN 320x240 */
238         {0x0077,0x42,0x5b,0x08,0x11,0x23,1280, 768, 0x30}, /* 0x40 */    /* 0x5b was 0x12 */
239 	{0x0127,0x43,0x4d,0x08,0x0b,0x26,1400,1050, 0x30}, /* 0x41 */
240 	{0x0207,0x4b,0x5a,0x08,0x0b,0x26,1400,1050, 0x30}, /* 0x42 1400x1050-75Hz */
241 	{0x0127,0x44,0x19,0x00,0x1a,0x29,1152, 864, 0x30}, /* 0x43 1152x864-75Hz  */
242 	{0x0127,0x4a,0x1e,0x00,0x1a,0x29,1152, 864, 0x30}, /* 0x44 1152x864-85Hz  */
243 	{0x0087,0x45,0x57,0x00,0x16,0x39, 848, 480, 0x30}, /* 0x45 848x480-38Hzi  */
244 	{0xc067,0x46,0x55,0x0b,0x16,0x39, 848, 480, 0x30}, /* 0x46 848x480-60Hz   */
245 	{0x0087,0x47,0x57,0x00,0x17,0x3f, 856, 480, 0x30}, /* 0x47 856x480-38Hzi  */
246 	{0xc067,0x48,0x57,0x00,0x17,0x3f, 856, 480, 0x30}, /* 0x48 856x480-60Hz   */
247 	{0x0067,0x49,0x58,0x0c,0x1b,0x48,1360, 768, 0x30}, /* 0x49 1360x768-60Hz  */
248 	{0x006f,0x4d,0x03,0x06,0x15,0x5f, 768, 576, 0x30}, /* 0x4a 768x576-56Hz   */
249 	{0x0067,0x4f,0x5c,0x08,0x0d,0x14,1280, 800, 0x30}, /* 0x4b 1280x800-60Hz  */
250 	{0x0067,0x50,0x5d,0x0c,0x0e,0x17,1680,1050, 0x30}, /* 0x4c 1680x1050-60Hz */
251 	{0xffff,0x00,0x00,0x00,0x00,0x00,   0,   0,    0}
252 };
253 
254 static const SiS_CRT1TableStruct SiS310_CRT1Table[]=
255 {
256  {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,
257    0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,
258    0x00}}, /* 0x0 */
259  {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e,
260    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
261    0x00}}, /* 0x1 */
262  {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0,
263    0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x05,
264    0x01}}, /* 0x2 */
265  {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
266    0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
267    0x01}}, /* 0x3 */
268  {{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
269    0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x05,
270    0x00}}, /* 0x4 */
271 #if 0
272  {{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
273    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
274    0x00}}, /* 0x5 */
275 #endif
276  {{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e,    /* 0x05 - corrected 640x480-60 */
277    0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05,
278    0x00}},
279 #if 0
280  {{0x63,0x4f,0x50,0x86,0x56,0x9b,0x06,0x3e,
281    0xe8,0x8b,0xdf,0xe7,0xff,0x10,0x00,0x01,
282    0x00}}, /* 0x6 */
283 #endif
284  {{0x63,0x4f,0x4f,0x87,0x56,0x9b,0x06,0x3e,    /* 0x06 - corrected 640x480-72 */
285    0xe8,0x8a,0xdf,0xe7,0x07,0x00,0x00,0x01,
286    0x00}},
287  {{0x64,0x4f,0x4f,0x88,0x55,0x9d,0xf2,0x1f,
288    0xe0,0x83,0xdf,0xdf,0xf3,0x10,0x00,0x01,
289    0x00}}, /* 0x7 */
290  {{0x63,0x4f,0x4f,0x87,0x5a,0x81,0xfb,0x1f,
291    0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,
292    0x00}}, /* 0x8 */
293  {{0x65,0x4f,0x4f,0x89,0x58,0x80,0xfb,0x1f,
294    0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,  /* Corrected VBE */
295    0x61}}, /* 0x9 */
296  {{0x65,0x4f,0x4f,0x89,0x58,0x80,0x01,0x3e,
297    0xe0,0x83,0xdf,0xdf,0x02,0x00,0x00,0x05,
298    0x61}}, /* 0xa */
299  {{0x67,0x4f,0x4f,0x8b,0x58,0x81,0x0d,0x3e,
300    0xe0,0x83,0xdf,0xdf,0x0e,0x00,0x00,0x05,  /* Corrected VBE */
301    0x61}}, /* 0xb */
302  {{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f,
303    0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01,  /* Corrected VDE, VBE */
304    0x00}}, /* 0xc */
305  {{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0,
306    0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05,
307    0x01}}, /* 0xd */
308  {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xf0,
309    0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x06,
310    0x01}}, /* 0xe */
311  {{0x7d,0x63,0x63,0x81,0x6e,0x1d,0x98,0xf0,
312    0x7c,0x82,0x57,0x57,0x99,0x00,0x00,0x06,
313    0x01}}, /* 0xf */
314  {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xf0,
315    0x58,0x8b,0x57,0x57,0x70,0x20,0x00,0x06,
316    0x01}}, /* 0x10 */
317  {{0x7e,0x63,0x63,0x82,0x6b,0x13,0x75,0xf0,
318    0x58,0x8b,0x57,0x57,0x76,0x20,0x00,0x06,
319    0x01}}, /* 0x11 */
320  {{0x81,0x63,0x63,0x85,0x6d,0x18,0x7a,0xf0,
321    0x58,0x8b,0x57,0x57,0x7b,0x20,0x00,0x06,
322    0x61}}, /* 0x12 */
323  {{0x83,0x63,0x63,0x87,0x6e,0x19,0x81,0xf0,
324    0x58,0x8b,0x57,0x57,0x82,0x20,0x00,0x06,
325    0x61}}, /* 0x13 */
326  {{0x85,0x63,0x63,0x89,0x6f,0x1a,0x91,0xf0,
327    0x58,0x8b,0x57,0x57,0x92,0x20,0x00,0x06,
328    0x61}}, /* 0x14 */
329  {{0x99,0x7f,0x7f,0x9d,0x84,0x1a,0x96,0x1f,
330    0x7f,0x83,0x7f,0x7f,0x97,0x10,0x00,0x02,
331    0x00}}, /* 0x15 */
332  {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
333    0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
334    0x01}}, /* 0x16 */
335  {{0xa1,0x7f,0x7f,0x85,0x86,0x97,0x24,0xf5,
336    0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
337    0x01}}, /* 0x17 */
338  {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf5,
339    0x00,0x83,0xff,0xff,0x1f,0x10,0x00,0x02,
340    0x01}}, /* 0x18 */
341  {{0xa7,0x7f,0x7f,0x8b,0x89,0x95,0x26,0xf5,
342    0x00,0x83,0xff,0xff,0x27,0x10,0x00,0x02,
343    0x01}}, /* 0x19 */
344  {{0xa9,0x7f,0x7f,0x8d,0x8c,0x9a,0x2c,0xf5,
345    0x00,0x83,0xff,0xff,0x2d,0x14,0x00,0x02,
346    0x62}}, /* 0x1a */
347  {{0xab,0x7f,0x7f,0x8f,0x8d,0x9b,0x35,0xf5,
348    0x00,0x83,0xff,0xff,0x36,0x14,0x00,0x02,
349    0x62}}, /* 0x1b */
350  {{0xcf,0x9f,0x9f,0x93,0xb2,0x01,0x14,0xba,
351    0x00,0x83,0xff,0xff,0x15,0x00,0x00,0x03,
352    0x00}}, /* 0x1c */
353  {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0x5a,
354    0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07,
355    0x01}}, /* 0x1d */
356  {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0x5a,
357    0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07,
358    0x01}}, /* 0x1e */
359  {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0x5a,
360    0x00,0x83,0xff,0xff,0x2f,0x09,0x00,0x07,
361    0x01}}, /* 0x1f */
362  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
363    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
364    0x00}}, /* 0x20 */
365  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
366    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
367    0x00}}, /* 0x21 @ 4084 */
368  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
369    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
370    0x00}}, /* 0x22 */
371  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
372    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
373    0x00}}, /* 0x23 */
374  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
375    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
376    0x00}}, /* 0x24 */
377  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
378    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
379    0x00}}, /* 0x25 */
380  {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
381    0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
382    0x00}}, /* 0x26 */
383  {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f,
384    0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01,
385    0x00}}, /* 0x27 */
386  {{0x43,0xef,0xef,0x87,0x06,0x00,0xd4,0x1f,
387    0xa0,0x83,0x9f,0x9f,0xd5,0x1f,0x41,0x05,
388    0x63}}, /* 0x28 */
389  {{0x45,0xef,0xef,0x89,0x07,0x01,0xd9,0x1f,
390    0xa0,0x83,0x9f,0x9f,0xda,0x1f,0x41,0x05,
391    0x63}}, /* 0x29 */
392  {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f,
393    0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01,
394    0x00}}, /* 0x2a */
395  {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f,
396    0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01,
397    0x00}}, /* 0x2b */
398  {{0x40,0xef,0xef,0x84,0x03,0x1d,0xda,0x1f,
399    0xa0,0x83,0x9f,0x9f,0xdb,0x1f,0x41,0x01,
400    0x00}}, /* 0x2c */
401  {{0x59,0xff,0xff,0x9d,0x17,0x13,0x33,0xba,
402    0x00,0x83,0xff,0xff,0x34,0x0f,0x41,0x05,
403    0x44}}, /* 0x2d */
404  {{0x5b,0xff,0xff,0x9f,0x18,0x14,0x38,0xba,
405    0x00,0x83,0xff,0xff,0x39,0x0f,0x41,0x05,
406    0x44}}, /* 0x2e */
407  {{0x5b,0xff,0xff,0x9f,0x18,0x14,0x3d,0xba,
408    0x00,0x83,0xff,0xff,0x3e,0x0f,0x41,0x05,
409    0x44}}, /* 0x2f */
410  {{0x5d,0xff,0xff,0x81,0x19,0x95,0x41,0xba,
411    0x00,0x84,0xff,0xff,0x42,0x0f,0x41,0x05,
412    0x44}}, /* 0x30 */
413  {{0x55,0xff,0xff,0x99,0x0d,0x0c,0x3e,0xba,
414    0x00,0x84,0xff,0xff,0x3f,0x0f,0x41,0x05,
415    0x00}}, /* 0x31 */
416  {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba,
417    0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06,
418    0x01}}, /* 0x32 */
419  {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba,
420    0x26,0x89,0xdf,0xdf,0x6f,0x00,0x00,0x06,
421    0x01}}, /* 0x33 */
422  {{0x7f,0x63,0x63,0x82,0x6b,0x13,0x75,0xba,
423    0x29,0x8c,0xdf,0xdf,0x75,0x00,0x00,0x06,
424    0x01}}, /* 0x34 */
425  {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf1,
426    0xaf,0x85,0x3f,0x3f,0x25,0x30,0x00,0x02,
427    0x01}}, /* 0x35 */
428  {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1,
429    0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02,
430    0x01}}, /* 0x36 */
431  {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1,   /* 95 was 15 - illegal HBE! */
432    0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02,
433    0x01}}, /* 0x37 */
434  {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4,
435    0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07,
436    0x01}}, /* 0x38 */
437  {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xd4,
438    0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07,
439    0x01}}, /* 0x39 */
440  {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4,
441    0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07,
442    0x01}}, /* 0x3a */
443 #if 0
444  {{0xdc,0x9f,0x9f,0x00,0xab,0x19,0xe6,0xef,	/* 1280x960 - invalid */
445    0xc0,0xc3,0xbf,0xbf,0xe7,0x10,0x00,0x07,
446    0x01}}, /* 0x3b */
447 #endif
448  {{0xdc,0x9f,0x9f,0x80,0xaf,0x9d,0xe6,0xff,	/* 1280x960-60 - corrected */
449    0xc0,0x83,0xbf,0xbf,0xe7,0x10,0x00,0x07,
450    0x01}}, /* 0x3b */
451  {{0x6b,0x59,0x59,0x8f,0x5e,0x8c,0x0b,0x3e,
452    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
453    0x00}}, /* 0x3c */
454  {{0x7b,0x59,0x63,0x9f,0x6a,0x93,0x6f,0xf0,
455    0x58,0x8a,0x3f,0x57,0x70,0x20,0x00,0x05,
456    0x01}}, /* 0x3d */
457  {{0x86,0x6a,0x6a,0x8a,0x74,0x06,0x8c,0x15,
458    0x4f,0x83,0xef,0xef,0x8d,0x30,0x00,0x02,
459    0x00}}, /* 0x3e */
460  {{0x81,0x6a,0x6a,0x85,0x70,0x00,0x0f,0x3e,
461    0xeb,0x8e,0xdf,0xdf,0x10,0x00,0x00,0x02,
462    0x00}}, /* 0x3f */
463  {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1,
464    0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02,
465    0x01}},  /* 0x40 */
466  {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
467    0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
468    0x01}},  /* 0x41 */
469  {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x20,0xf5,
470    0x03,0x88,0xff,0xff,0x21,0x10,0x00,0x07,
471    0x01}},  /* 0x42 */
472  {{0xe6,0xae,0xae,0x8a,0xbd,0x90,0x3d,0x10,
473    0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x00,0x03,
474    0x00}},  /* 0x43 */
475  {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* 1152x864-75 */
476    0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07,
477    0x01}},  /* 0x44 */
478  {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* 848x480-38i */
479    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
480    0x00}},  /* 0x45 */
481  {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* 848x480-60 */
482    0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06,
483    0x00}},  /* 0x46 */
484  {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* 856x480-38i */
485    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
486    0x00}},  /* 0x47 */
487  {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* 856x480-60 */
488    0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
489    0x00}},  /* 0x48 */
490  {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* 1360x768-60 */
491    0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03,
492    0x01}},  /* 0x49 */
493  {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* 1152x864-84  */
494    0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03,
495    0x01}},  /* 0x4a */
496  {{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* 1400x1050-75  */
497    0x1b,0x87,0x19,0x1a,0x41,0x0f,0x00,0x03,
498    0x00}},  /* 0x4b */
499  {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* 1280x960-85 */
500    0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07,
501    0x01}},  /* 0x4c */
502  {{0x7b,0x5f,0x63,0x9f,0x6a,0x93,0x6f,0xf0, /* 768x576 */
503    0x58,0x8a,0x3f,0x57,0x70,0x20,0x00,0x05,
504    0x01}},  /* 0x4d */
505  {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e, /* FSTN 320x480, TEMP - possibly invalid */
506    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
507    0x00}},  /* 0x4e */
508  {{0xcd,0x9f,0x9f,0x91,0xab,0x1c,0x3a,0xff, /* 1280x800-60 */
509    0x20,0x83,0x1f,0x1f,0x3b,0x10,0x00,0x07,
510    0x21}},  /* 0x4f */
511  {{0x15,0xd1,0xd1,0x99,0xe2,0x19,0x3d,0x10, /* 1680x1050-60 */
512    0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x01,0x0c,
513    0x20}}   /* 0x50 */
514 };
515 
516 static const SiS_MCLKDataStruct SiS310_MCLKData_0_315[] =
517 {
518 	{ 0x3b,0x22,0x01,143},
519 	{ 0x5c,0x23,0x01,166},
520 	{ 0x5c,0x23,0x01,166},
521 	{ 0x5c,0x23,0x01,166},
522 	{ 0x5c,0x23,0x01,166},
523 	{ 0x5c,0x23,0x01,166},
524 	{ 0x5c,0x23,0x01,166},
525 	{ 0x5c,0x23,0x01,166}
526 };
527 
528 static const SiS_MCLKDataStruct SiS310_MCLKData_0_650[] =
529 {
530 	{ 0x5a,0x64,0x82, 66},
531 	{ 0xb3,0x45,0x82, 83},
532 	{ 0x37,0x61,0x82,100},
533 	{ 0x37,0x22,0x82,133},
534 	{ 0x37,0x61,0x82,100},
535 	{ 0x37,0x22,0x82,133},
536 	{ 0x37,0x22,0x82,133},
537 	{ 0x37,0x22,0x82,133}
538 };
539 
540 static const SiS_MCLKDataStruct SiS310_MCLKData_0_330[] =
541 {
542 	{ 0x5c,0x23,0x01,166},
543 	{ 0x5c,0x23,0x01,166},
544 	{ 0x7c,0x08,0x01,200},
545 	{ 0x79,0x06,0x01,250},
546 	{ 0x7c,0x08,0x01,200},
547 	{ 0x7c,0x08,0x01,200},
548 	{ 0x7c,0x08,0x01,200},
549 	{ 0x79,0x06,0x01,250}
550 };
551 
552 static const SiS_MCLKDataStruct SiS310_MCLKData_0_660[] =
553 {
554 	{ 0x5c,0x23,0x82,166},
555 	{ 0x5c,0x23,0x82,166},
556 	{ 0x37,0x21,0x82,200},
557 	{ 0x37,0x22,0x82,133},
558 	{ 0x29,0x21,0x82,150},
559 	{ 0x5c,0x23,0x82,166},
560 	{ 0x65,0x23,0x82,183},
561 	{ 0x37,0x21,0x82,200}
562 };
563 
564 static const SiS_MCLKDataStruct SiS310_MCLKData_0_760[] =
565 {
566 	{ 0x37,0x22,0x82,133},
567 	{ 0x5c,0x23,0x82,166},
568 	{ 0x65,0x23,0x82,183},
569 	{ 0x7c,0x08,0x82,200},
570 	{ 0x29,0x21,0x82,150},
571 	{ 0x5c,0x23,0x82,166},
572 	{ 0x65,0x23,0x82,183},
573 	{ 0x37,0x21,0x82,200}
574 };
575 
576 static const SiS_MCLKDataStruct SiS310_MCLKData_1[] = /* ECLK */
577 {
578         { 0x29,0x21,0x82,150},
579 	{ 0x5c,0x23,0x82,166},
580 	{ 0x65,0x23,0x82,183},
581 	{ 0x37,0x21,0x82,200},
582 	{ 0x37,0x22,0x82,133},
583 	{ 0x37,0x22,0x82,133},
584 	{ 0x37,0x22,0x82,133},
585 	{ 0x37,0x22,0x82,133}
586 };
587 
588 static SiS_VCLKDataStruct SiS310_VCLKData[]=
589 {
590 	{ 0x1b,0xe1, 25}, /* 0x00 */
591 	{ 0x4e,0xe4, 28}, /* 0x01 */
592 	{ 0x57,0xe4, 31}, /* 0x02 */
593 	{ 0xc3,0xc8, 36}, /* 0x03 */
594 	{ 0x42,0xe2, 40}, /* 0x04 */
595 	{ 0xfe,0xcd, 43}, /* 0x05 */
596 	{ 0x5d,0xc4, 44}, /* 0x06 */
597 	{ 0x52,0xe2, 49}, /* 0x07 */
598 	{ 0x53,0xe2, 50}, /* 0x08 */
599 	{ 0x74,0x67, 52}, /* 0x09 */
600 	{ 0x6d,0x66, 56}, /* 0x0a */
601 	{ 0x5a,0x64, 65}, /* 0x0b */  /* was 6c c3 - WRONG */
602 	{ 0x46,0x44, 67}, /* 0x0c */
603 	{ 0xb1,0x46, 68}, /* 0x0d */
604 	{ 0xd3,0x4a, 72}, /* 0x0e */
605 	{ 0x29,0x61, 75}, /* 0x0f */
606 	{ 0x6e,0x46, 76}, /* 0x10 */
607 	{ 0x2b,0x61, 78}, /* 0x11 */
608 	{ 0x31,0x42, 79}, /* 0x12 */
609 	{ 0xab,0x44, 83}, /* 0x13 */
610 	{ 0x46,0x25, 84}, /* 0x14 */
611 	{ 0x78,0x29, 86}, /* 0x15 */
612 	{ 0x62,0x44, 94}, /* 0x16 */
613 	{ 0x2b,0x41,104}, /* 0x17 */
614 	{ 0x3a,0x23,105}, /* 0x18 */
615 	{ 0x70,0x44,108}, /* 0x19 */
616 	{ 0x3c,0x23,109}, /* 0x1a */
617 	{ 0x5e,0x43,113}, /* 0x1b */
618 	{ 0xbc,0x44,116}, /* 0x1c */
619 	{ 0xe0,0x46,132}, /* 0x1d */
620 	{ 0x54,0x42,135}, /* 0x1e */
621 	{ 0xea,0x2a,139}, /* 0x1f */
622 	{ 0x41,0x22,157}, /* 0x20 */
623 	{ 0x70,0x24,162}, /* 0x21 */
624 	{ 0x30,0x21,175}, /* 0x22 */
625 	{ 0x4e,0x22,189}, /* 0x23 */
626 	{ 0xde,0x26,194}, /* 0x24 */
627 	{ 0x62,0x06,202}, /* 0x25 */
628 	{ 0x3f,0x03,229}, /* 0x26 */
629 	{ 0xb8,0x06,234}, /* 0x27 */
630 	{ 0x34,0x02,253}, /* 0x28 */
631 	{ 0x58,0x04,255}, /* 0x29 */
632 	{ 0x24,0x01,265}, /* 0x2a */
633 	{ 0x9b,0x02,267}, /* 0x2b */
634 	{ 0x70,0x05,270}, /* 0x2c */
635 	{ 0x25,0x01,272}, /* 0x2d */
636 	{ 0x9c,0x02,277}, /* 0x2e */
637 	{ 0x27,0x01,286}, /* 0x2f */
638 	{ 0x3c,0x02,291}, /* 0x30 */
639 	{ 0xef,0x0a,292}, /* 0x31 */
640 	{ 0xf6,0x0a,310}, /* 0x32 */
641 	{ 0x95,0x01,315}, /* 0x33 */
642 	{ 0xf0,0x09,324}, /* 0x34 */
643 	{ 0xfe,0x0a,331}, /* 0x35 */
644 	{ 0xf3,0x09,332}, /* 0x36 */
645 	{ 0xea,0x08,340}, /* 0x37 */
646 	{ 0xe8,0x07,376}, /* 0x38 */
647 	{ 0xde,0x06,389}, /* 0x39 */
648 	{ 0x52,0x2a, 54}, /* 0x3a 301 TV */
649 	{ 0x52,0x6a, 27}, /* 0x3b 301 TV */
650 	{ 0x62,0x24, 70}, /* 0x3c 301 TV */
651 	{ 0x62,0x64, 70}, /* 0x3d 301 TV */
652 	{ 0xa8,0x4c, 30}, /* 0x3e 301 TV */
653 	{ 0x20,0x26, 33}, /* 0x3f 301 TV */
654 	{ 0x31,0xc2, 39}, /* 0x40 */
655 	{ 0x60,0x36, 30}, /* 0x41 Chrontel */
656 	{ 0x40,0x4a, 28}, /* 0x42 Chrontel */
657 	{ 0x9f,0x46, 44}, /* 0x43 Chrontel */
658 	{ 0x97,0x2c, 26}, /* 0x44 */
659 	{ 0x44,0xe4, 25}, /* 0x45 Chrontel */
660 	{ 0x7e,0x32, 47}, /* 0x46 Chrontel */
661 	{ 0x8a,0x24, 31}, /* 0x47 Chrontel */
662 	{ 0x97,0x2c, 26}, /* 0x48 Chrontel */
663 	{ 0xce,0x3c, 39}, /* 0x49 */
664 	{ 0x52,0x4a, 36}, /* 0x4a Chrontel */
665 	{ 0x34,0x61, 95}, /* 0x4b */
666 	{ 0x78,0x27,108}, /* 0x4c - was 102 */
667 	{ 0x66,0x43,123}, /* 0x4d Modes 0x26-0x28 (1400x1050) */
668 	{ 0x41,0x4e, 21}, /* 0x4e */
669 	{ 0xa1,0x4a, 29}, /* 0x4f Chrontel */
670 	{ 0x19,0x42, 42}, /* 0x50 */
671 	{ 0x54,0x46, 58}, /* 0x51 Chrontel */
672 	{ 0x25,0x42, 61}, /* 0x52 */
673 	{ 0x44,0x44, 66}, /* 0x53 Chrontel */
674 	{ 0x3a,0x62, 70}, /* 0x54 Chrontel */
675 	{ 0x62,0xc6, 34}, /* 0x55 848x480-60 */
676 	{ 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP */
677 	{ 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60 */
678 	{ 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) */
679 	{ 0x52,0x07,149}, /* 0x59 1280x960-85 */
680 	{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
681    	{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */
682 	{ 0x45,0x25, 83}, /* 0x5c 1280x800  */
683 	{ 0x70,0x0a,147}, /* 0x5d 1680x1050 */
684 	{ 0x70,0x24,162}, /* 0x5e 1600x1200 */
685 	{ 0x5a,0x64, 65}, /* 0x5f 1280x720 - temp */
686 	{ 0x63,0x46, 68}, /* 0x60 1280x768_2 */
687 	{ 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */
688 	{    0,   0,  0}, /* 0x62 - custom (will be filled out at run-time) */
689 	{ 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */
690 	{ 0x70,0x28, 90}, /* 0x64 1152x864@60 */
691 	{ 0x41,0xc4, 32}, /* 0x65 848x480@60 */
692 	{ 0x5c,0xc6, 32}, /* 0x66 856x480@60 */
693 	{ 0x76,0xe7, 27}, /* 0x67 720x480@60 */
694 	{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
695 };
696 
697 static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
698 {
699 	{ 0x1b,0xe1, 25}, /* 0x00 */
700 	{ 0x4e,0xe4, 28}, /* 0x01 */
701 	{ 0x57,0xe4, 31}, /* 0x02 */
702 	{ 0xc3,0xc8, 36}, /* 0x03 */
703 	{ 0x42,0x47, 40}, /* 0x04 */
704 	{ 0xfe,0xcd, 43}, /* 0x05 */
705 	{ 0x5d,0xc4, 44}, /* 0x06 */
706 	{ 0x52,0x47, 49}, /* 0x07 */
707 	{ 0x53,0x47, 50}, /* 0x08 */
708 	{ 0x74,0x67, 52}, /* 0x09 */
709 	{ 0x6d,0x66, 56}, /* 0x0a */
710 	{ 0x35,0x62, 65}, /* 0x0b */  /* Was 0x5a,0x64 - 650/LVDS+301: 35,62  */
711 	{ 0x46,0x44, 67}, /* 0x0c */
712 	{ 0xb1,0x46, 68}, /* 0x0d */
713 	{ 0xd3,0x4a, 72}, /* 0x0e */
714 	{ 0x29,0x61, 75}, /* 0x0f */
715 	{ 0x6d,0x46, 75}, /* 0x10 */
716 	{ 0x41,0x43, 78}, /* 0x11 */
717 	{ 0x31,0x42, 79}, /* 0x12 */
718 	{ 0xab,0x44, 83}, /* 0x13 */
719 	{ 0x46,0x25, 84}, /* 0x14 */
720 	{ 0x78,0x29, 86}, /* 0x15 */
721 	{ 0x62,0x44, 94}, /* 0x16 */
722 	{ 0x2b,0x22,104}, /* 0x17 */
723 	{ 0x49,0x24,105}, /* 0x18 */
724 	{ 0xf8,0x2f,108}, /* 0x19 */  /* 1400x1050 LCD */
725 	{ 0x3c,0x23,109}, /* 0x1a */
726 	{ 0x5e,0x43,113}, /* 0x1b */
727 	{ 0xbc,0x44,116}, /* 0x1c */
728 	{ 0xe0,0x46,132}, /* 0x1d */
729 #if 0
730 	{ 0xd4,0x28,135}, /* 0x1e */
731 	{ 0xea,0x2a,139}, /* 0x1f */
732 	{ 0x41,0x22,157}, /* 0x20 */
733 	{ 0x70,0x24,162}, /* 0x21 */
734 #endif
735 	{ 0xe2,0x46,135}, /* 0x1e */  /* 1280x1024-75, better clock for VGA2 */
736 	{ 0xe5,0x46,139}, /* 0x1f */  /* 1024x768-120, better clock for VGA2 */
737 	{ 0x15,0x01,157}, /* 0x20 */  /* 1280x1024-85, better clock for VGA2 */
738 	{ 0x70,0x09,162}, /* 0x21 */  /* 1600x1200-60, better clock for VGA2 */
739 	{ 0x30,0x21,175}, /* 0x22 */
740 	{ 0x4e,0x22,189}, /* 0x23 */
741 	{ 0xde,0x26,194}, /* 0x24 */
742 	{ 0x70,0x07,202}, /* 0x25 */
743 	{ 0x3f,0x03,229}, /* 0x26 */
744 	{ 0xb8,0x06,234}, /* 0x27 */
745 	{ 0x34,0x02,253}, /* 0x28 */
746 	{ 0x58,0x04,255}, /* 0x29 */
747 	{ 0x24,0x01,265}, /* 0x2a */
748 	{ 0x9b,0x02,267}, /* 0x2b */
749 	{ 0x70,0x05,270}, /* 0x2c */
750 	{ 0x25,0x01,272}, /* 0x2d */
751 	{ 0x9c,0x02,277}, /* 0x2e */
752 	{ 0x27,0x01,286}, /* 0x2f */
753 	{ 0x3c,0x02,291}, /* 0x30 */
754 	{ 0xef,0x0a,292}, /* 0x31 */
755 	{ 0xf6,0x0a,310}, /* 0x32 */
756 	{ 0x95,0x01,315}, /* 0x33 */
757 	{ 0xf0,0x09,324}, /* 0x34 */
758 	{ 0xfe,0x0a,331}, /* 0x35 */
759 	{ 0xf3,0x09,332}, /* 0x36 */
760 	{ 0xea,0x08,340}, /* 0x37 */
761 	{ 0xe8,0x07,376}, /* 0x38 */
762 	{ 0xde,0x06,389}, /* 0x39 */
763 	{ 0x52,0x2a, 54}, /* 0x3a 301 TV - start */
764 	{ 0x52,0x6a, 27}, /* 0x3b 301 TV */
765 	{ 0x62,0x24, 70}, /* 0x3c 301 TV */
766 	{ 0x62,0x64, 70}, /* 0x3d 301 TV */
767 	{ 0xa8,0x4c, 30}, /* 0x3e 301 TV */
768 	{ 0x20,0x26, 33}, /* 0x3f 301 TV */
769 	{ 0x31,0xc2, 39}, /* 0x40 */
770 	{ 0x2e,0x48, 25}, /* 0x41 Replacement for LCD on 315 for index 0 */
771 	{ 0x24,0x46, 25}, /* 0x42 Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */
772 	{ 0x26,0x64, 28}, /* 0x43 Replacement for LCD on 315 for index 1 */
773 	{ 0x37,0x64, 40}, /* 0x44 Replacement for LCD on 315 for index 4 */
774 	{ 0xa1,0x42,108}, /* 0x45 1280x960 LCD */
775 	{ 0x37,0x61,100}, /* 0x46 1280x960 LCD */
776 	{ 0x78,0x27,108}, /* 0x47 */
777 	{ 0x97,0x2c, 26}, /* 0x48 UNUSED */
778 	{ 0xce,0x3c, 39}, /* 0x49 UNUSED */
779 	{ 0x52,0x4a, 36}, /* 0x4a UNUSED */
780 	{ 0x34,0x61, 95}, /* 0x4b UNUSED */
781 	{ 0x78,0x27,108}, /* 0x4c UNUSED */
782 	{ 0x66,0x43,123}, /* 0x4d 1400x1050-60 */
783 	{ 0x41,0x4e, 21}, /* 0x4e UNUSED */
784 	{ 0xa1,0x4a, 29}, /* 0x4f UNUSED */
785 	{ 0x19,0x42, 42}, /* 0x50 UNUSED */
786 	{ 0x54,0x46, 58}, /* 0x51 UNUSED */
787 	{ 0x25,0x42, 61}, /* 0x52 UNUSED */
788 	{ 0x44,0x44, 66}, /* 0x53 UNUSED */
789 	{ 0x3a,0x62, 70}, /* 0x54 UNUSED */
790 	{ 0x62,0xc6, 34}, /* 0x55 848x480-60 */
791 	{ 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP, UNUSED */
792 	{ 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60  */
793 	{ 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) TEMP, UNUSED */
794 	{ 0x52,0x07,149}, /* 0x59 1280x960-85  */
795 	{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
796    	{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */
797 	{ 0x45,0x25, 83}, /* 0x5c 1280x800 LCD - (was 0x9c,0x62, 69 - wrong?) */
798 	{ 0xbe,0x44,121}, /* 0x5d 1680x1050 LCD */
799 	{ 0x70,0x24,162}, /* 0x5e 1600x1200 LCD */
800 	{ 0x52,0x27, 75}, /* 0x5f 1280x720 LCD TMDS + HDTV (correct) */
801 	{ 0x63,0x46, 68}, /* 0x60 1280x768_2 */
802 	{ 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */
803 	{    0,   0,  0}, /* 0x62 - custom (will be filled out at run-time) */
804 	{ 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */
805 	{ 0x70,0x28, 90}, /* 0x64 1152x864@60 */
806 	{ 0x41,0xc4, 32}, /* 0x65 848x480@60 */
807 	{ 0x5c,0xc6, 32}, /* 0x66 856x480@60 */
808 	{ 0x76,0xe7, 27}, /* 0x67 720x480@60 */
809 	{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
810 };
811 
812 static const DRAM4Type SiS310_SR15[8] = {
813 	{0x00,0x04,0x60,0x60},
814 	{0x0f,0x0f,0x0f,0x0f},
815 	{0xba,0xba,0xba,0xba},
816 	{0xa9,0xa9,0xac,0xac},
817 	{0xa0,0xa0,0xa0,0xa8},
818 	{0x00,0x00,0x02,0x02},
819  	{0x30,0x30,0x40,0x40},
820 	{0x00,0xa5,0xfb,0xf6}
821 };
822 
823 #ifndef LINUX_XF86
824 
825 static UCHAR SiS310_SR07 = 0x18;
826 
827 static const DRAM4Type SiS310_CR40[5] = {
828 	{0x77,0x77,0x33,0x33},
829 	{0x77,0x77,0x33,0x33},
830 	{0x00,0x00,0x00,0x00},
831 	{0x5b,0x5b,0x03,0x03},
832 	{0x00,0x00,0xf0,0xf8}
833 };
834 
835 static UCHAR SiS310_CR49[] = {0xaa,0x88};
836 static UCHAR SiS310_SR1F = 0x00;
837 static UCHAR SiS310_SR21 = 0xa5;
838 static UCHAR SiS310_SR22 = 0xfb;
839 static UCHAR SiS310_SR23 = 0xf6;
840 static UCHAR SiS310_SR24 = 0x0d;
841 static UCHAR SiS310_SR25[] = {0x33,0x3};
842 static UCHAR SiS310_SR31 = 0x00;
843 static UCHAR SiS310_SR32 = 0x11;
844 static UCHAR SiS310_SR33 = 0x00;
845 static UCHAR SiS310_CRT2Data_1_2  = 0x00;
846 static UCHAR SiS310_CRT2Data_4_D  = 0x00;
847 static UCHAR SiS310_CRT2Data_4_E  = 0x00;
848 static UCHAR SiS310_CRT2Data_4_10 = 0x80;
849 static const USHORT SiS310_RGBSenseData    = 0xd1;
850 static const USHORT SiS310_VideoSenseData  = 0xb9;
851 static const USHORT SiS310_YCSenseData     = 0xb3;
852 static const USHORT SiS310_RGBSenseData2   = 0x0190;
853 static const USHORT SiS310_VideoSenseData2 = 0x0174;
854 static const USHORT SiS310_YCSenseData2    = 0x016b;
855 #endif
856 
857 static const SiS_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
858 {
859         {{0x10,0x40}},
860 	{{0x10,0x40}},
861 	{{0x10,0x40}},
862 	{{0x10,0x40}},
863 	{{0x10,0x40}},
864 	{{0x10,0x40}},
865 	{{0x10,0x40}},
866 	{{0x10,0x40}},
867 	{{0x10,0x40}},
868 	{{0x10,0x40}},
869 	{{0x10,0x40}},
870 	{{0x10,0x40}},
871 	{{0x10,0x40}},
872 	{{0x10,0x40}},
873 	{{0x10,0x40}},
874 	{{0x10,0x40}}
875 };
876 
877 static const SiS_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
878 {
879 	{{0x28,0xc8}},
880 	{{0x28,0xc8}},
881 	{{0x28,0xc8}},
882 	{{0x28,0xc8}},
883 	{{0x28,0xc8}},
884 	{{0x28,0xc8}},
885 	{{0x28,0xc8}},
886 	{{0x28,0xc8}},
887 	{{0x28,0xc8}},
888 	{{0x28,0xc8}},
889 	{{0x28,0xc8}},
890 	{{0x28,0xc8}},
891 	{{0x28,0xc8}},
892 	{{0x28,0xc8}},
893 	{{0x28,0xc8}},
894 	{{0x28,0xc8}}
895 };
896 
897 /**************************************************************/
898 /* SIS VIDEO BRIDGE ----------------------------------------- */
899 /**************************************************************/
900 
901 static const SiS_LCDDataStruct  SiS310_St2LCD1024x768Data[] =
902 {
903 	{   62,  25, 800, 546,1344, 806},
904 	{   32,  15, 930, 546,1344, 806},
905         {   62,  25, 800, 546,1344, 806},
906 	{  104,  45, 945, 496,1344, 806},
907 	{   62,  25, 800, 546,1344, 806},
908 	{   31,  18,1008, 624,1344, 806},
909 	{    1,   1,1344, 806,1344, 806}
910 };
911 
912 static const SiS_LCDDataStruct  SiS310_ExtLCD1024x768Data[] =
913 {
914 	{   42,  25,1536, 419,1344, 806},
915 	{   48,  25,1536, 369,1344, 806},
916 	{   42,  25,1536, 419,1344, 806},
917 	{   48,  25,1536, 369,1344, 806},
918 	{   12,   5, 896, 500,1344, 806},
919 	{   42,  25,1024, 625,1344, 806},
920 	{    1,   1,1344, 806,1344, 806}
921 };
922 
923 static const SiS_LCDDataStruct  SiS310_St2LCD1280x1024Data[] =
924 {
925 	{   22,   5, 800, 510,1650,1088},
926 	{   22,   5, 800, 510,1650,1088},
927 	{  176,  45, 900, 510,1650,1088},
928 	{  176,  45, 900, 510,1650,1088},
929 	{   22,   5, 800, 510,1650,1088},
930 	{   13,   5,1024, 675,1560,1152},
931 	{   16,   9,1266, 804,1688,1072},
932 	{    1,   1,1688,1066,1688,1066}
933 };
934 
935 static const SiS_LCDDataStruct  SiS310_ExtLCD1280x1024Data[] =
936 {
937 	{  211,  60,1024, 501,1688,1066},
938 	{  211,  60,1024, 508,1688,1066},
939 	{  211,  60,1024, 501,1688,1066},
940 	{  211,  60,1024, 508,1688,1066},
941 	{  211,  60,1024, 500,1688,1066},
942 	{  211,  75,1024, 625,1688,1066},
943 	{  211, 120,1280, 798,1688,1066},
944 	{    1,   1,1688,1066,1688,1066}
945 };
946 
947 static const SiS_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
948 {
949  {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
950  {{0x2c,0x12,0x9a,0xae,0x88,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
951  {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
952  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
953  {{0x38,0x13,0x16,0x0c,0xe6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
954  {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
955  {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
956 };
957 
958 /* *** LCDA *** */
959 
960 #if 0
961 static const SiS_LVDSDataStruct  SiS_LCDA1600x1200Data_1[]=
962 { /* Clevo, 651+301C */
963 	{1200, 450, 2048,1250},
964 	{1200, 400, 2048,1250},
965 	{1280, 450, 2048,1250},
966 	{1280, 400, 2048,1250},
967 	{1200, 530, 2048,1250},
968 	{1360, 650, 2048,1250},
969 	{1584, 818, 2048,1250},
970 	{1688,1066, 2048,1250},
971 	{1688,1066, 2048,1250},
972 #if 0
973 	{2048,1250, 2048,1250}   /* this should be correct */
974 #endif
975 #if 1
976 	{2160,1250, 2048,1250}   /* ? */
977 #endif
978 };
979 #endif
980 
981 /**************************************************************/
982 /* LVDS, CHRONTEL ------------------------------------------- */
983 /**************************************************************/
984 
985 static const SiS_LVDSDataStruct  SiS310_CHTVUPALData[]=
986 {
987 	{1008, 625,1008, 625},
988 	{1008, 625,1008, 625},
989 	{1008, 625,1008, 625},
990 	{1008, 625,1008, 625},
991 	{ 840, 625, 840, 625},
992 	{ 960, 750, 960, 750},
993 	{1400,1000,1400,1000}
994 };
995 
996 static const SiS_LVDSDataStruct  SiS310_CHTVOPALData[]=
997 {
998 	{1008, 625,1008, 625},
999 	{1008, 625,1008, 625},
1000 	{1008, 625,1008, 625},
1001 	{1008, 625,1008, 625},
1002 	{ 840, 625, 840, 625},
1003 	{ 944, 625, 944, 625},
1004         {1400, 875,1400, 875}
1005 };
1006 
1007 static const SiS_LVDSDataStruct  SiS310_CHTVUPALMData[]=
1008 {
1009 	{ 840, 600, 840, 600},
1010 	{ 840, 600, 840, 600},
1011 	{ 840, 600, 840, 600},
1012 	{ 840, 600, 840, 600},
1013 	{ 784, 600, 784, 600},
1014 	{1064, 750,1064, 750},
1015         {1160, 945,1160, 945}
1016 };
1017 
1018 static const SiS_LVDSDataStruct  SiS310_CHTVOPALMData[]=
1019 {
1020 	{ 840, 525, 840, 525},
1021 	{ 840, 525, 840, 525},
1022 	{ 840, 525, 840, 525},
1023 	{ 840, 525, 840, 525},
1024 	{ 784, 525, 784, 525},
1025 	{1040, 700,1040, 700},
1026         {1160, 840,1160, 840}
1027 };
1028 
1029 static const SiS_LVDSDataStruct  SiS310_CHTVUPALNData[]=
1030 {
1031 	{1008, 625,1008, 625},
1032 	{1008, 625,1008, 625},
1033 	{1008, 625,1008, 625},
1034 	{1008, 625,1008, 625},
1035 	{ 840, 625, 840, 625},
1036 	{ 960, 750, 960, 750},
1037 	{1400,1000,1400,1000}
1038 };
1039 
1040 static const SiS_LVDSDataStruct  SiS310_CHTVOPALNData[]=
1041 {
1042 	{1008, 625,1008, 625},
1043 	{1008, 625,1008, 625},
1044 	{1008, 625,1008, 625},
1045 	{1008, 625,1008, 625},
1046 	{ 840, 625, 840, 625},
1047 	{ 944, 625, 944, 625},
1048         {1400, 875,1400, 875}
1049 };
1050 
1051 static const SiS_LVDSDataStruct  SiS310_CHTVSOPALData[]=   /* (super overscan - no effect on 7019) */
1052 {
1053 	{1008, 625,1008, 625},
1054 	{1008, 625,1008, 625},
1055 	{1008, 625,1008, 625},
1056 	{1008, 625,1008, 625},
1057 	{ 840, 625, 840, 625},
1058 	{ 944, 625, 944, 625},
1059         {1400, 875,1400, 875}
1060 };
1061 
1062 
1063 static const SiS_LVDSDesStruct  SiS310_PanelType00_1[]=  /* 800x600 */
1064 {
1065 	{ 0, 0},
1066 	{ 0, 0},
1067 	{ 0, 0},
1068 	{ 0, 0},
1069 	{ 0, 0},
1070 	{ 0, 0},
1071 	{ 0, 0},
1072 	{ 0, 0},
1073 	{ 0, 0}
1074 };
1075 
1076 static const SiS_LVDSDesStruct  SiS310_PanelType01_1[]=  /* 1024x768 */
1077 {
1078 	{ 0, 0},
1079 	{ 0, 0},
1080 	{ 0, 0},
1081 	{ 0, 0},
1082 	{ 0, 0},
1083 	{ 0, 0},
1084 	{ 0, 805},
1085 	{ 0, 0},
1086 	{ 0, 0}
1087 };
1088 
1089 static const SiS_LVDSDesStruct  SiS310_PanelType02_1[]=  /* 1280x1024 */
1090 {
1091 	{ 0, 0},
1092 	{ 0, 0},
1093 	{ 0, 0},
1094 	{ 0, 0},
1095 	{ 0, 0},
1096 	{ 0, 0},
1097 	{ 0, 0},
1098 	{ 0, 1065},
1099 	{ 0, 0},
1100 	{ 0, 0}
1101 };
1102 
1103 
1104 static const SiS_LVDSDesStruct  SiS310_PanelType03_1[]=
1105 {
1106 	{ 0, 0},
1107 	{ 0, 0},
1108 	{ 0, 0},
1109 	{ 0, 0},
1110 	{ 0, 0},
1111 	{ 0, 0},
1112 	{ 0, 0},
1113 	{ 0, 0},
1114 	{ 0, 0}
1115 };
1116 
1117 static const SiS_LVDSDesStruct  SiS310_PanelType04_1[]=
1118 {
1119 	{1343, 798},
1120 	{1343, 794},
1121 	{1343, 798},
1122 	{1343, 794},
1123 	{1343,   0},
1124 	{1343,   0},
1125 	{ 0, 805},
1126 	{ 0, 794},
1127 	{ 0,   0}
1128 };
1129 
1130 static const SiS_LVDSDesStruct  SiS310_PanelType05_1[]=
1131 {
1132 	{1343, 798},
1133 	{1343, 794},
1134 	{1343, 798},
1135 	{1343, 794},
1136 	{1343,   0},
1137 	{1343,   0},
1138 	{ 0, 805},
1139 	{ 0, 794},
1140 	{ 0,   0}
1141 };
1142 
1143 static const SiS_LVDSDesStruct  SiS310_PanelType06_1[]=
1144 {
1145 	{1343, 798},
1146 	{1343, 794},
1147 	{1343, 798},
1148 	{1343, 794},
1149 	{1343,   0},
1150 	{1343,   0},
1151 	{ 0, 805},
1152 	{ 0, 794},
1153 	{ 0,   0}
1154 };
1155 
1156 static const SiS_LVDSDesStruct  SiS310_PanelType07_1[]=
1157 {
1158 	{1343, 798},
1159 	{1343, 794},
1160 	{1343, 798},
1161 	{1343, 794},
1162 	{1343,   0},
1163 	{1343,   0},
1164 	{ 0, 805},
1165 	{ 0, 794},
1166 	{ 0,   0}
1167 };
1168 
1169 static const SiS_LVDSDesStruct  SiS310_PanelType08_1[]=   /* 1400x1050 */
1170 {
1171 	{ 0, 0},
1172 	{ 0, 0},
1173 	{ 0, 0},
1174 	{ 0, 0},
1175 	{ 0, 0},
1176 	{ 0, 0},
1177 	{ 0, 0},
1178 	{ 0, 0},
1179 	{ 0, 0},
1180 	{ 0, 0},
1181 	{ 0, 0}
1182 };
1183 
1184 static const SiS_LVDSDesStruct  SiS310_PanelType09_1[]=   /* 1280x768 */
1185 {
1186 	{ 0, 0},
1187 	{ 0, 0},
1188 	{ 0, 0},
1189 	{ 0, 0},
1190 	{ 0, 0},
1191 	{ 0, 0},
1192 	{ 0, 0},
1193 	{ 0, 0},
1194 	{ 0, 0},
1195 	{ 0, 0},
1196 	{ 0, 0}
1197 };
1198 
1199 static const SiS_LVDSDesStruct  SiS310_PanelType0a_1[]=  /* 1600x1200 */
1200 {
1201 	{ 0, 0},
1202 	{ 0, 0},
1203 	{ 0, 0},
1204 	{ 0, 0},
1205 	{ 0, 0},
1206 	{ 0, 0},
1207 	{ 0, 0},
1208 	{ 0, 0},
1209 	{ 0, 0},
1210 	{ 0, 0},
1211 	{ 0, 0}
1212 };
1213 
1214 static const SiS_LVDSDesStruct  SiS310_PanelType0b_1[]=  /* 640x480_2 */
1215 {
1216 	{ 0, 524},
1217 	{ 0, 524},
1218 	{ 0, 524},
1219 	{ 0, 524},
1220 	{ 0, 524},
1221 	{ 0, 524},
1222 	{ 8, 524},
1223 	{ 0, 524}
1224 };
1225 
1226 static const SiS_LVDSDesStruct  SiS310_PanelType0c_1[]=  /* 640x480_3 */
1227 {
1228 	{ 0, 524},
1229 	{ 0, 524},
1230 	{ 0, 524},
1231 	{ 0, 524},
1232 	{ 0, 524},
1233 	{ 0, 524},
1234 	{ 8, 524},
1235 	{ 0, 524}
1236 };
1237 
1238 static const SiS_LVDSDesStruct  SiS310_PanelType0d_1[]=
1239 {
1240 	{1343, 798},
1241 	{1343, 794},
1242 	{1343, 798},
1243 	{1343, 794},
1244 	{1343,   0},
1245 	{1343,   0},
1246 	{ 0, 805},
1247 	{ 0, 794},
1248 	{ 0,   0}
1249 };
1250 
1251 static const SiS_LVDSDesStruct  SiS310_PanelType0e_1[]=
1252 {
1253 	{1343, 798},
1254 	{1343, 794},
1255 	{1343, 798},
1256 	{1343, 794},
1257 	{1343,   0},
1258 	{1343,   0},
1259 	{ 0, 805},
1260 	{ 0, 794},
1261 	{ 0,   0}
1262 };
1263 
1264 static const SiS_LVDSDesStruct  SiS310_PanelType0f_1[]=
1265 {
1266 	{1343, 798},
1267 	{1343, 794},
1268 	{1343, 798},
1269 	{1343, 794},
1270 	{1343,   0},
1271 	{1343,   0},
1272 	{ 0, 805},
1273 	{ 0, 794},
1274 	{ 0,   0}
1275 };
1276 
1277 static const SiS_LVDSDesStruct  SiS310_PanelType00_2[]=
1278 {
1279 	{980, 528},
1280 	{980, 503},
1281 	{980, 528},
1282 	{980, 503},
1283 	{980, 568},
1284 	{ 0, 628},
1285 	{ 0,   0},
1286 	{ 0,   0},
1287 	{ 0,   0}
1288 };
1289 
1290 static const SiS_LVDSDesStruct  SiS310_PanelType01_2[]=
1291 {
1292 	{1152, 622},
1293 	{1152, 597},
1294 	{1152, 622},
1295 	{1152, 597},
1296 	{1152, 662},
1297 	{1232, 722},
1298 	{ 0, 806},
1299 	{ 0,   0},
1300 	{ 0,   0}
1301 };
1302 
1303 static const SiS_LVDSDesStruct  SiS310_PanelType02_2[]=
1304 {
1305 	{1368, 754},
1306 	{1368, 729},
1307 	{1368, 754},
1308 	{1368, 729},
1309 	{1368, 794},
1310 	{1448, 854},
1311 	{1560, 938},
1312 	{   0,1066},
1313 	{ 0,   0},
1314 	{ 0,   0},
1315 	{ 0,   0}
1316 };
1317 
1318 static const SiS_LVDSDesStruct  SiS310_PanelType03_2[]=
1319 {
1320 	{ 0,   0},
1321 	{ 0,   0},
1322 	{ 0,   0},
1323 	{ 0,   0},
1324 	{ 0,   0},
1325 	{ 0,   0},
1326 	{ 0,   0}
1327 };
1328 
1329 static const SiS_LVDSDesStruct  SiS310_PanelType04_2[]=
1330 {
1331 	{ 0,   0},
1332 	{ 0,   0},
1333 	{ 0,   0},
1334 	{ 0,   0},
1335 	{ 0,   0},
1336 	{ 0,   0},
1337 	{ 0,   0},
1338 	{ 0,   0},
1339 	{ 0,   0}
1340 };
1341 
1342 static const SiS_LVDSDesStruct  SiS310_PanelType05_2[]=
1343 {
1344 	{1152, 622},
1345 	{1152, 597},
1346 	{1152, 622},
1347 	{1152, 597},
1348 	{1152, 662},
1349 	{1232, 722},
1350 	{ 0, 805},
1351 	{ 0, 794},
1352 	{ 0,   0}
1353 };
1354 
1355 static const SiS_LVDSDesStruct  SiS310_PanelType06_2[]=
1356 {
1357 	{1152, 622},
1358 	{1152, 597},
1359 	{1152, 622},
1360 	{1152, 597},
1361 	{1152, 662},
1362 	{1232, 722},
1363 	{ 0, 805},
1364 	{ 0, 794},
1365 	{ 0,   0}
1366 };
1367 
1368 static const SiS_LVDSDesStruct  SiS310_PanelType07_2[]=
1369 {
1370 	{1152, 622},
1371 	{1152, 597},
1372 	{1152, 622},
1373 	{1152, 597},
1374 	{1152, 662},
1375 	{1232, 722},
1376 	{ 0, 805},
1377 	{ 0, 794},
1378 	{ 0,   0}
1379 };
1380 
1381 static const SiS_LVDSDesStruct  SiS310_PanelType08_2[]=  /* 1400x1050 */
1382 {
1383 	{1308, 741},
1384 	{1308, 716},
1385 	{1308, 741},
1386 	{1308, 716},
1387 	{1308, 781},
1388 	{1388, 841},
1389 	{1500, 925},
1390 	{1628,1053},
1391 	{   0,1065},
1392 	{   0,   0},
1393 	{   0,   0}
1394 };
1395 
1396 static const SiS_LVDSDesStruct  SiS310_PanelType09_2[]= /* 1280x768 */
1397 {
1398 	{1083, 622},
1399 	{1083, 597},
1400 	{1083, 622},
1401 	{1083, 597},
1402 	{1083, 662},
1403 	{1163, 722},
1404 	{1286, 805},
1405 	{   0, 794},
1406 	{   0,   0}
1407 };
1408 
1409 static const SiS_LVDSDesStruct  SiS310_PanelType0a_2[]=  /* 1600x1200 */
1410 {
1411 	{1568, 920},
1412 	{1568, 895},
1413 	{1568, 920},
1414 	{1568, 895},
1415 	{1568, 960},
1416 	{1648,1020},
1417 	{1760,1104},
1418 	{1888,1232},
1419 	{1948,1245},
1420 	{   0,   0}
1421 #if 0
1422 	{1568, 850},
1423 	{1568, 825},
1424 	{1568, 850},
1425 	{1568, 825},
1426 	{1568, 890},
1427 	{1648, 950},
1428 	{1760,1034},
1429 	{1888,1162},
1430 	{1948,1175},
1431 	{   0,   0}
1432 #endif
1433 };
1434 
1435 static const SiS_LVDSDesStruct  SiS310_PanelType0b_2[]=  /* 640x480_2 */
1436 {
1437 	{1152, 622},
1438 	{1152, 597},
1439 	{1152, 622},
1440 	{1152, 597},
1441 	{1152, 662},
1442 	{1232, 722},
1443 	{ 0, 805},
1444 	{ 0, 794},
1445 	{ 0,   0}
1446 };
1447 
1448 static const SiS_LVDSDesStruct  SiS310_PanelType0c_2[]=  /* 640x480_3 */
1449 {
1450 	{1152, 622},
1451 	{1152, 597},
1452 	{1152, 622},
1453 	{1152, 597},
1454 	{1152, 662},
1455 	{1232, 722},
1456 	{ 0, 805},
1457 	{ 0, 794},
1458 	{ 0,   0}
1459 };
1460 
1461 static const SiS_LVDSDesStruct  SiS310_PanelType0d_2[]=
1462 {
1463 	{1152, 622},
1464 	{1152, 597},
1465 	{1152, 622},
1466 	{1152, 597},
1467 	{1152, 662},
1468 	{1232, 722},
1469 	{ 0, 805},
1470 	{ 0, 794},
1471 	{ 0,   0}
1472 };
1473 
1474 static const SiS_LVDSDesStruct  SiS310_PanelType0e_2[]=
1475 {
1476 	{1152, 622},
1477 	{1152, 597},
1478 	{1152, 622},
1479 	{1152, 597},
1480 	{1152, 662},
1481 	{1232, 722},
1482 	{ 0, 805},
1483 	{ 0, 794},
1484 	{ 0,   0}
1485 };
1486 
1487 static const SiS_LVDSDesStruct  SiS310_PanelType0f_2[] =
1488 {
1489 	{1152, 622},
1490 	{1152, 597},
1491 	{1152, 622},
1492 	{1152, 597},
1493 	{1152, 662},
1494 	{1232, 722},
1495 	{ 0, 805},
1496 	{ 0, 794},
1497 	{ 0,   0}
1498 };
1499 
1500 static const SiS_LVDSDesStruct  SiS310_PanelTypeNS_1[]=
1501 {
1502 	{ 8,   0},
1503 	{ 8,   0},
1504 	{ 8,   0},
1505 	{ 8,   0},
1506 	{ 8,   0},
1507 	{ 0,   0},
1508 	{ 0,   0},
1509 	{ 0,   0},
1510 	{ 0, 806},
1511 	{ 0,   0}
1512 };
1513 
1514 static const SiS_LVDSDesStruct  SiS310_PanelTypeNS_2[] =
1515 {
1516 	{ 0 , 0},
1517 	{ 0 , 0},
1518 	{ 0 , 0},
1519 	{ 0 , 0},
1520 	{ 0 , 0},
1521 	{ 0 , 0},
1522 	{ 0 , 0},
1523 	{ 0 , 0},
1524 	{ 0 , 0},
1525 	{ 0 , 0}
1526 };
1527 
1528 /* CRT1 CRTC for SlaveModes and LCDA */
1529 
1530 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1[] =
1531 {
1532  {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
1533    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
1534    0x00 }},
1535  {{0x6b,0x4f,0x8f,0x55,0x85,0x78,0x1f,
1536    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
1537    0x00 }},
1538  {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
1539    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
1540    0x00 }},
1541  {{0x6b,0x4f,0x8f,0x55,0x85,0x78,0x1f,
1542    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
1543    0x00 }},
1544  {{0x6b,0x4f,0x8f,0x55,0x85,0xfa,0x1f,
1545    0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
1546    0x00 }},
1547  {{0x7f,0x63,0x83,0x69,0x19,0x72,0xf0,
1548    0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
1549    0x01 }}
1550 };
1551 
1552 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1_H[] =
1553 {
1554  {{0x43,0x27,0x87,0x2d,0x1d,0xaa,0x1f,
1555    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
1556    0x00 }},
1557  {{0x43,0x27,0x87,0x2d,0x1d,0x78,0x1f,
1558    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
1559    0x00 }},
1560  {{0x43,0x27,0x87,0x2d,0x1d,0xfa,0x1f,
1561    0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
1562    0x00 }},
1563  {{0x43,0x27,0x87,0x2d,0x1d,0x78,0x1f,
1564    0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
1565    0x00 }},
1566  {{0x43,0x27,0x87,0x2d,0x1d,0xfa,0x1f,
1567    0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
1568    0x00 }},
1569  {{0x4d,0x31,0x91,0x37,0x07,0x72,0xf0,
1570    0x58,0x8d,0x57,0x73,0x20,0x00,0x01,
1571    0x01 }}
1572 };
1573 
1574 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2[]=
1575 {
1576  {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
1577    0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
1578    0x00 }},
1579  {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
1580    0xe6,0x8b,0x5d,0x73,0x00,0x00,0x06,
1581    0x00 }},
1582  {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
1583    0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
1584    0x00 }},
1585  {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
1586    0xe6,0x8b,0x5d,0x73,0x00,0x00,0x06,
1587    0x00 }},
1588  {{0x7f,0x4f,0x83,0x62,0x12,0x72,0xba,
1589    0x27,0x8c,0xdf,0x73,0x00,0x00,0x06,
1590    0x00 }},
1591  {{0x7f,0x63,0x83,0x69,0x19,0x72,0xf0,
1592    0x58,0x8d,0x57,0x73,0x20,0x00,0x06,
1593    0x01 }}
1594 };
1595 
1596 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2_H[] =
1597 {
1598  {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
1599    0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
1600    0x00 }},
1601  {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
1602    0xd6,0x8b,0x5d,0x73,0x00,0x00,0x01,
1603    0x00 }},
1604  {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
1605    0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
1606    0x00 }},
1607  {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
1608    0xd6,0x8b,0x5d,0x73,0x00,0x00,0x01,
1609    0x00 }},
1610  {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0xba,
1611    0x27,0x8c,0xdf,0x73,0x00,0x00,0x01,
1612    0x00 }},
1613  {{0x4d,0x31,0x91,0x3a,0x0a,0x72,0xf0,
1614    0x63,0x88,0x57,0x73,0x00,0x00,0x01,
1615    0x01 }}
1616 };
1617 
1618 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1[] =
1619 {
1620  {{0x73,0x4f,0x97,0x53,0x84,0xb4,0x1f,
1621    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
1622    0x00}},
1623  {{0x73,0x4f,0x97,0x53,0x84,0x82,0x1f,
1624    0x60,0x87,0x5d,0x83,0x10,0x00,0x05,
1625    0x00}},
1626  {{0x73,0x4f,0x97,0x53,0x84,0xb4,0x1f,
1627    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
1628    0x00}},
1629  {{0x73,0x4f,0x97,0x53,0x84,0x82,0x1f,
1630    0x60,0x87,0x5d,0x83,0x10,0x00,0x05,
1631    0x00}},
1632  {{0x73,0x4f,0x97,0x53,0x84,0x04,0x3e,
1633    0xE2,0x89,0xDf,0x05,0x00,0x00,0x05,
1634    0x00}},
1635  {{0x87,0x63,0x8B,0x67,0x18,0x7c,0xf0,
1636    0x5A,0x81,0x57,0x7D,0x00,0x00,0x06,
1637    0x01}},
1638  {{0xA3,0x7f,0x87,0x83,0x94,0x24,0xf5,
1639    0x02,0x89,0xFf,0x25,0x10,0x00,0x02,
1640    0x01}}
1641 };
1642 
1643 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1_H[] =
1644 {
1645  {{0x4b,0x27,0x8f,0x2b,0x1c,0xb4,0x1f,
1646    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
1647    0x00 }},
1648  {{0x4b,0x27,0x8f,0x2b,0x1c,0x82,0x1f,
1649    0x60,0x87,0x5D,0x83,0x01,0x00,0x05,
1650    0x00}},
1651  {{0x4b,0x27,0x8f,0x2b,0x1c,0xb4,0x1f,
1652    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
1653    0x00}},
1654  {{0x4b,0x27,0x8f,0x2b,0x1c,0x82,0x1f,
1655    0x60,0x87,0x5D,0x83,0x01,0x00,0x05,
1656    0x00}},
1657  {{0x4b,0x27,0x8f,0x2b,0x1c,0x04,0x3e,
1658    0xE2,0x89,0xDf,0x05,0x00,0x00,0x05,
1659    0x00}},
1660  {{0x55,0x31,0x99,0x35,0x06,0x7c,0xf0,
1661    0x5A,0x81,0x57,0x7D,0x00,0x00,0x01,
1662    0x01}},
1663  {{0x63,0x3F,0x87,0x43,0x94,0x24,0xf5,
1664    0x02,0x89,0xFf,0x25,0x10,0x00,0x01,
1665    0x01 }}
1666 };
1667 
1668 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2[] =
1669 {
1670  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
1671    0x57,0x8e,0x8f,0x25,0x30,0x00,0x06,
1672    0x00 }},
1673  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
1674    0x3e,0x85,0x5d,0x25,0x10,0x00,0x06,
1675    0x00 }},
1676  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
1677    0x57,0x8e,0x8f,0x25,0x30,0x00,0x06,
1678    0x00 }},
1679  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
1680    0x3e,0x85,0x5d,0x25,0x10,0x00,0x06,
1681    0x01 }},
1682  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
1683    0x7f,0x86,0xdf,0x25,0x10,0x00,0x06,
1684    0x00 }},
1685  {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
1686    0xbb,0x82,0x57,0x25,0x10,0x00,0x02,
1687    0x01 }},
1688  {{0xa3,0x7f,0x87,0x83,0x94,0x24,0xf5,
1689    0x02,0x89,0xff,0x25,0x10,0x00,0x02,
1690    0x01 }}
1691 };
1692 
1693 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2_H[] =
1694 {
1695  {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
1696    0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
1697    0x00 }},
1698  {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
1699    0x3e,0x85,0x5d,0x25,0x10,0x00,0x01,
1700    0x00 }},
1701  {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
1702    0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
1703    0x00 }},
1704  {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
1705    0x3e,0x85,0x5d,0x25,0x10,0x00,0x01,
1706    0x00 }},
1707  {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
1708    0x7f,0x86,0xdf,0x25,0x10,0x00,0x01,
1709    0x00 }},
1710  {{0x71,0x31,0x95,0x46,0x97,0x24,0xf1,
1711    0xbb,0x82,0x57,0x25,0x10,0x00,0x01,
1712    0x01 }},
1713  {{0x63,0x3f,0x87,0x46,0x97,0x24,0xf5,
1714    0x0f,0x86,0xff,0x25,0x30,0x00,0x01,
1715    0x01 }}
1716 };
1717 
1718 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1[] =
1719 {
1720  {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
1721    0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
1722    0x00}},
1723  {{0x7e,0x4f,0x82,0x58,0x04,0x86,0x1f,
1724    0x5e,0x82,0x5d,0x87,0x10,0x00,0x06,
1725    0x00}},
1726  {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
1727    0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
1728    0x00}},
1729  {{0x7e,0x4f,0x82,0x58,0x04,0x86,0x1f,
1730    0x5e,0x82,0x5d,0x87,0x10,0x00,0x06,
1731    0x00}},
1732  {{0x7e,0x4f,0x82,0x58,0x04,0x08,0x3e,
1733    0xe0,0x84,0xdf,0x09,0x00,0x00,0x06,
1734    0x00}},
1735  {{0x92,0x63,0x96,0x6c,0x18,0x80,0xf0,
1736    0x58,0x8c,0x57,0x81,0x20,0x00,0x06,
1737    0x01}},
1738  {{0xae,0x7f,0x92,0x88,0x94,0x28,0xf5,
1739    0x00,0x84,0xff,0x29,0x10,0x00,0x02,
1740    0x01}},
1741  {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
1742    0x00,0x84,0xff,0x29,0x09,0x00,0x07,
1743    0x01}}
1744 };
1745 
1746 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1_H[] =
1747 {
1748  {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
1749    0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
1750    0x00}},
1751  {{0x56,0x27,0x9a,0x31,0x1c,0x86,0x1f,
1752    0x5e,0x82,0x5d,0x87,0x10,0x00,0x05,
1753    0x00}},
1754  {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
1755    0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
1756    0x00}},
1757  {{0x56,0x27,0x9a,0x31,0x1c,0x86,0x1f,
1758    0x5e,0x82,0x5d,0x87,0x10,0x00,0x05,
1759    0x01}},
1760  {{0x56,0x27,0x9a,0x31,0x1c,0x08,0x3e,
1761    0xe0,0x84,0xdf,0x09,0x00,0x00,0x05,
1762    0x00}},
1763  {{0x60,0x31,0x84,0x3a,0x86,0x80,0xf0,
1764    0x58,0x8c,0x57,0x81,0x20,0x00,0x01,
1765    0x01}},
1766  {{0x6e,0x3f,0x92,0x48,0x94,0x28,0xf5,
1767    0x00,0x84,0xff,0x29,0x10,0x00,0x01,
1768    0x01}}
1769 };
1770 
1771 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2[] =
1772 {
1773  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
1774    0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x02,
1775    0x01}},
1776  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
1777    0xaf,0x83,0x44,0x43,0x21,0x00,0x02,
1778    0x01}},
1779  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
1780    0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x02,
1781    0x01}},
1782  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
1783    0xaf,0x83,0x44,0x43,0x21,0x00,0x02,
1784    0x01}},
1785  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
1786    0xf0,0x84,0x85,0x84,0x11,0x00,0x02,
1787    0x01}},
1788  {{0xce,0x63,0x92,0x8b,0x19,0x28,0xd4,
1789    0x3f,0x83,0x57,0x29,0x01,0x00,0x03,
1790    0x01}},
1791  {{0xce,0x7f,0x92,0x99,0x07,0x28,0xd4,
1792    0x93,0x87,0xff,0x29,0x21,0x00,0x07,
1793    0x01}},
1794  {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
1795    0x00,0x84,0xff,0x29,0x09,0x00,0x07,
1796    0x01}}
1797 };
1798 
1799 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2_H[] =
1800 {
1801  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
1802    0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x06,
1803    0x01}},
1804  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
1805    0xaf,0x83,0x44,0x43,0x21,0x00,0x06,
1806    0x01}},
1807  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
1808    0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x06,
1809    0x01}},
1810  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
1811    0xfa,0x83,0x44,0x43,0x31,0x00,0x06,
1812    0x01}},
1813  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
1814    0xf0,0x84,0x85,0x84,0x11,0x00,0x06,
1815    0x01}},
1816  {{0x9c,0x31,0x80,0x59,0x87,0x28,0xd4,
1817    0x3f,0x83,0x57,0x29,0x01,0x00,0x06,
1818    0x01}},
1819  {{0x8e,0x3f,0x92,0x59,0x07,0x28,0xd4,
1820    0x93,0x87,0xff,0x29,0x21,0x00,0x06,
1821    0x01}}
1822 };
1823 
1824 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1[] =
1825 {
1826   {{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
1827     0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
1828     0x00}},
1829   {{0x6f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
1830     0x5e,0x81,0x5d,0x6d,0x10,0x00,0x05,
1831     0x00}},
1832   {{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
1833     0x90,0x83,0x8f,0x9f,0x30,0x00,0x05,
1834     0x00}},
1835   {{0x6f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
1836     0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1837     0x00}},
1838   {{0x6f,0x4f,0x93,0x54,0x82,0xee,0x1f,
1839     0xdf,0x82,0xdf,0xef,0x10,0x00,0x05,
1840     0x00}},
1841   {{0x83,0x63,0x87,0x68,0x16,0x66,0xf0,
1842     0x57,0x8e,0x57,0x67,0x20,0x00,0x06,
1843     0x01}},
1844   {{0x9f,0x7f,0x83,0x84,0x92,0x0e,0xf1,
1845     0xff,0x86,0xff,0x0f,0x10,0x00,0x02,
1846     0x01,}},
1847   {{0xbf,0x9f,0x83,0xa4,0x12,0x0e,0xde,
1848     0xff,0x86,0xff,0x0f,0x01,0x00,0x07,
1849     0x01}},
1850   {{0xce,0xae,0x92,0xb3,0x01,0x28,0x10,
1851     0x19,0x80,0x19,0x29,0x0f,0x00,0x03,
1852     0x00}}
1853 #if 0
1854  {{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
1855    0x93,0x86,0x8f,0x9f,0x30,0x00,0x05,
1856    0x00}},
1857  {{0x6f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
1858    0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1859    0x00}},
1860  {{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
1861    0x93,0x86,0x8f,0x9f,0x30,0x00,0x05,
1862    0x00}},
1863  {{0x6f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
1864    0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1865    0x00}},
1866  {{0x6f,0x4f,0x93,0x54,0x82,0xee,0x1f,
1867    0xe2,0x86,0xdf,0xef,0x10,0x00,0x05,
1868    0x00}},
1869  {{0x83,0x63,0x87,0x68,0x16,0x66,0xf0,
1870    0x5a,0x8e,0x57,0x67,0x20,0x00,0x06,
1871    0x01}},
1872  {{0x9f,0x7f,0x83,0x84,0x92,0x0e,0xf5,
1873    0x02,0x86,0xff,0x0f,0x10,0x00,0x02,
1874    0x01}},
1875  {{0xbf,0x9f,0x83,0xa4,0x12,0x0e,0x5a,
1876    0x02,0x86,0xff,0x0f,0x09,0x00,0x07,
1877    0x01}},
1878  {{0xce,0xae,0x92,0xb3,0x01,0x28,0x10,
1879    0x1a,0x80,0x19,0x29,0x0f,0x00,0x03,
1880    0x00}}
1881 #endif
1882 };
1883 
1884 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1_H[] =
1885 {
1886  {{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
1887    0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
1888   0x00}},
1889  {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
1890    0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1891    0x00}},
1892  {{0x47,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
1893    0x90,0x83,0x8f,0x9f,0x30,0x00,0x05,
1894    0x00}},
1895  {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
1896    0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1897    0x00}},
1898  {{0x47,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
1899    0xdf,0x86,0xdf,0xef,0x10,0x00,0x05,
1900    0x00}},
1901  {{0x51,0x31,0x95,0x36,0x04,0x66,0xf0,
1902    0x57,0x8e,0x57,0x67,0x20,0x00,0x01,
1903    0x01}},
1904  {{0x5f,0x3f,0x83,0x44,0x92,0x0e,0xf1,
1905    0xff,0x86,0xff,0x0f,0x10,0x00,0x01,
1906    0x01}},
1907  {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
1908    0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
1909    0x01}},
1910  {{0x76,0x56,0x9a,0x5b,0x89,0x28,0x10,
1911    0x1c,0x80,0x19,0x29,0x0b,0x00,0x05,
1912    0x00}}
1913 #if 0
1914  {{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
1915    0x93,0x86,0x8f,0x9f,0x30,0x00,0x05,
1916    0x00}},
1917  {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
1918    0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1919    0x00}},
1920  {{0x47,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
1921    0x92,0x86,0x8f,0x9f,0x30,0x00,0x05,
1922    0x00}},
1923  {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
1924    0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
1925    0x00}},
1926  {{0x47,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
1927    0xe2,0x86,0xdf,0xef,0x10,0x00,0x05,
1928    0x00}},
1929  {{0x51,0x31,0x95,0x36,0x04,0x66,0xf0,
1930    0x5a,0x8e,0x57,0x67,0x20,0x00,0x01,
1931    0x01}},
1932  {{0x5f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
1933    0x02,0x86,0xff,0x0f,0x10,0x00,0x01,
1934    0x01}},
1935  {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
1936    0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
1937    0x01}},
1938  {{0x76,0x56,0x9a,0x5b,0x89,0x28,0x10,
1939    0x1c,0x80,0x19,0x29,0x0b,0x00,0x05,
1940    0x00}}
1941 #endif
1942 };
1943 
1944 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2[] =
1945 {
1946  {{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
1947    0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x02,
1948    0x01}},
1949  {{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
1950    0xbe,0x82,0x44,0x43,0x01,0x00,0x02,
1951    0x01}},
1952  {{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
1953    0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x02,
1954    0x01}},
1955  {{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
1956    0xbe,0x82,0x44,0x43,0x01,0x00,0x02,
1957    0x01}},
1958  {{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
1959    0xff,0x83,0x85,0x84,0x11,0x00,0x02,
1960    0x01}},
1961  {{0xce,0x63,0x92,0x8e,0x1c,0x28,0xd4,
1962    0x3f,0x83,0x57,0x29,0x01,0x00,0x03,
1963    0x01}},
1964  {{0xce,0x7f,0x92,0x9c,0x0a,0x28,0xd4,
1965    0x93,0x87,0xff,0x29,0x21,0x00,0x07,
1966    0x01}},
1967  {{0xce,0x9f,0x92,0xac,0x1a,0x28,0x5a,
1968    0x13,0x87,0xff,0x29,0x29,0x00,0x07,
1969    0x01}},
1970  {{0xce,0xae,0x92,0xbc,0x0a,0x28,0x10,
1971    0x20,0x84,0x19,0x29,0x0f,0x00,0x03,
1972    0x00}}
1973 #if 0
1974  {{0xce,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
1975    0xdb,0x8f,0x8f,0x29,0x21,0x00,0x03,
1976    0x00}},
1977  {{0xce,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
1978    0xc2,0x86,0x5d,0x29,0x01,0x00,0x03,
1979    0x01}},
1980  {{0xce,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
1981    0xdb,0x8f,0x8f,0x29,0x21,0x00,0x03,
1982    0x00}},
1983  {{0xce,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
1984    0xc2,0x86,0x5d,0x29,0x01,0x00,0x03,
1985    0x00}},
1986  {{0xce,0x4f,0x92,0x8c,0x1a,0x28,0x9e,
1987    0x03,0x87,0xdf,0x29,0x01,0x00,0x03,
1988    0x00}},
1989  {{0xce,0x63,0x92,0x96,0x04,0x28,0xd4,
1990    0x3f,0x83,0x57,0x29,0x01,0x00,0x07,
1991    0x01}},
1992  {{0xce,0x7f,0x92,0xa4,0x12,0x28,0xd4,
1993    0x93,0x87,0xff,0x29,0x21,0x00,0x07,
1994    0x01}},
1995  {{0xce,0x9f,0x92,0xb4,0x02,0x28,0x5a,
1996    0x13,0x87,0xff,0x29,0x29,0x00,0x03,
1997    0x01}},
1998  {{0xce,0xae,0x92,0xbc,0x0a,0x28,0x10,
1999    0x20,0x84,0x19,0x29,0x0f,0x00,0x03,
2000    0x00}}
2001 #endif
2002 };
2003 
2004 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2_H[] =
2005 {
2006  {{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
2007    0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x06,
2008    0x01}},
2009  {{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
2010    0xbe,0x82,0x44,0x43,0x01,0x00,0x06,
2011    0x01}},
2012  {{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
2013    0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x06,
2014    0x01}},
2015  {{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
2016    0xbe,0x82,0x44,0x43,0x01,0x00,0x06,
2017    0x01}},
2018  {{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
2019    0xff,0x83,0x85,0x84,0x11,0x00,0x06,
2020    0x01}},
2021  {{0x9c,0x31,0x80,0x5c,0x8a,0x28,0xd4,
2022    0x3f,0x83,0x57,0x29,0x01,0x00,0x06,
2023    0x01}},
2024  {{0x8e,0x3f,0x92,0x5c,0x0a,0x28,0xd4,
2025    0x93,0x87,0xff,0x29,0x21,0x00,0x06,
2026    0x01}},
2027  {{0x7e,0x4f,0x82,0x5c,0x0a,0x28,0x5a,
2028    0x13,0x87,0xff,0x29,0x29,0x00,0x06,
2029    0x01}},
2030  {{0x76,0x56,0x9a,0x64,0x92,0x28,0x10,
2031    0x20,0x84,0x19,0x29,0x0f,0x00,0x05,
2032    0x00}}
2033 #if 0
2034  {{0xa6,0x27,0x8a,0x64,0x92,0x28,0x9a,
2035    0xdb,0x8f,0x8f,0x29,0x21,0x00,0x06,
2036    0x00}},
2037  {{0xa6,0x27,0x8a,0x64,0x92,0x28,0x9a,
2038    0xc2,0x86,0x5d,0x29,0x01,0x00,0x06,
2039    0x00}},
2040  {{0xa6,0x27,0x8a,0x64,0x92,0x28,0x9a,
2041    0xdb,0x8f,0x8f,0x29,0x21,0x00,0x06,
2042    0x00}},
2043  {{0xa6,0x27,0x8a,0x64,0x92,0x28,0x9a,
2044    0xc2,0x86,0x5d,0x29,0x01,0x00,0x06,
2045    0x00}},
2046  {{0xa6,0x27,0x8a,0x64,0x92,0x28,0x9e,
2047    0x03,0x87,0xdf,0x29,0x01,0x00,0x06,
2048    0x00}},
2049  {{0x9c,0x31,0x80,0x64,0x92,0x28,0xd4,
2050    0x3f,0x83,0x57,0x29,0x01,0x00,0x06,
2051    0x01}},
2052  {{0x8e,0x3f,0x92,0x64,0x12,0x28,0xd4,
2053    0x93,0x87,0xff,0x29,0x21,0x00,0x06,
2054    0x01}},
2055  {{0x7e,0x4f,0x82,0x64,0x12,0x28,0x5a,
2056    0x13,0x87,0xff,0x29,0x29,0x00,0x06,
2057    0x01}},
2058  {{0x76,0x56,0x9a,0x64,0x92,0x28,0x10,
2059    0x20,0x84,0x19,0x29,0x0f,0x00,0x05,
2060    0x00}}
2061 #endif
2062 };
2063 
2064 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1[] =
2065 {
2066  {{0x83,0x4F,0x87,0x5B,0x13,0x06,0x3E,
2067    0xB3,0x86,0x8F,0x07,0x20,0x00,0x06,
2068    0x00}},
2069  {{0x83,0x4F,0x87,0x5B,0x13,0xD4,0x1F,
2070    0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
2071    0x00}},
2072  {{0x83,0x4F,0x87,0x5B,0x13,0x06,0x3E,
2073    0xB3,0x86,0x8F,0x07,0x20,0x00,0x06,
2074    0x00}},
2075  {{0x83,0x4F,0x87,0x5B,0x13,0xD4,0x1F,
2076    0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
2077    0x00}},
2078  {{0x83,0x4F,0x87,0x5B,0x13,0x56,0xBA,
2079    0x03,0x86,0xDF,0x57,0x00,0x00,0x06,
2080    0x00}},
2081  {{0x97,0x63,0x9B,0x6F,0x07,0xCE,0xF0,
2082    0x7B,0x8E,0x57,0xCF,0x20,0x00,0x02,
2083    0x01}},
2084  {{0xB3,0x7F,0x97,0x8B,0x83,0x76,0xF5,
2085    0x23,0x86,0xFF,0x77,0x10,0x00,0x06,
2086    0x01}},
2087  {{0xD3,0x9F,0x97,0xAB,0x03,0x76,0x5A,
2088    0x23,0x86,0xFF,0x77,0x09,0x00,0x03,
2089    0x01}},
2090  {{0xE2,0xAE,0x86,0xBA,0x92,0x90,0x10,
2091    0x3D,0x80,0x19,0x91,0x0F,0x00,0x03,
2092    0x00}},
2093  {{0xFB,0xC7,0x9F,0xD3,0x8B,0x26,0x11,
2094    0xD3,0x86,0xAF,0x27,0x3F,0x00,0x07,
2095    0x00}}
2096 #if 0
2097  {{0x83,0x4f,0x87,0x51,0x09,0xc0,0x1f,
2098    0x90,0x84,0x8f,0xc1,0x30,0x00,0x06,
2099    0x00}},
2100  {{0x83,0x4f,0x87,0x51,0x09,0x8e,0x1f,
2101    0x5e,0x82,0x5d,0x8f,0x10,0x00,0x06,
2102    0x00}},
2103  {{0x83,0x4f,0x87,0x51,0x09,0xc0,0x1f,
2104    0x90,0x84,0x8f,0xc1,0x30,0x00,0x06,
2105    0x00}},
2106  {{0x83,0x4f,0x87,0x51,0x09,0x8e,0x1f,
2107    0x5e,0x82,0x5d,0x8f,0x10,0x00,0x06,
2108    0x00}},
2109  {{0x83,0x4f,0x87,0x51,0x09,0x10,0x3e,
2110    0xe0,0x84,0xdf,0x11,0x00,0x00,0x06,
2111    0x00}},
2112  {{0x97,0x63,0x9b,0x65,0x1d,0x88,0xf0,
2113    0x58,0x8c,0x57,0x89,0x20,0x00,0x06,
2114    0x01}},
2115  {{0xb3,0x7f,0x97,0x81,0x99,0x30,0xf5,
2116    0x00,0x84,0xff,0x31,0x10,0x00,0x02,
2117    0x01}},
2118  {{0xd3,0x9f,0x97,0xa1,0x19,0x30,0x5a,
2119    0x00,0x84,0xff,0x31,0x09,0x00,0x07,
2120    0x01}},
2121  {{0xe2,0xae,0x86,0xb0,0x88,0x4a,0x10,
2122    0x1a,0x8e,0x19,0x4b,0x2f,0x00,0x03,
2123    0x00}},
2124  {{0xfb,0xc7,0x9f,0xc9,0x81,0xe0,0x10,
2125    0xb0,0x84,0xaf,0xe1,0x2f,0x00,0x07,
2126    0x00}}
2127 #endif
2128 };
2129 
2130 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1_H[] =
2131 {
2132  {{0x5B,0x27,0x9F,0x33,0x0B,0x06,0x2E,
2133    0xB3,0x86,0x8F,0x07,0x20,0x00,0x01,
2134    0x00}},
2135  {{0x5B,0x27,0x9F,0x29,0x01,0x8E,0x1F,
2136    0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
2137    0x00}},
2138  {{0x5B,0x27,0x9F,0x33,0x0B,0x06,0x2E,
2139    0xB3,0x86,0x8F,0x07,0x20,0x00,0x01,
2140    0x00}},
2141  {{0x83,0x4F,0x87,0x5B,0x13,0xD4,0x1F,
2142    0x81,0x84,0x5D,0xD5,0x10,0x00,0x06,
2143    0x00}},
2144  {{0x5B,0x27,0x9F,0x33,0x0B,0x56,0xBA,
2145    0x03,0x86,0xDF,0x57,0x00,0x00,0x01,
2146    0x00}},
2147  {{0x65,0x31,0x89,0x3D,0x95,0xCE,0xF0,
2148    0x7B,0x8E,0x57,0xCF,0x20,0x00,0x01,
2149    0x01}},
2150  {{0x73,0x3F,0x97,0x4B,0x83,0x76,0xF5,
2151    0x23,0x86,0xFF,0x77,0x10,0x00,0x05,
2152    0x01}},
2153  {{0xD3,0x9F,0x97,0xAB,0x03,0x76,0x5A,
2154    0x23,0x86,0xFF,0x77,0x09,0x00,0x03,
2155    0x01}},
2156  {{0xE2,0xAE,0x86,0xBA,0x92,0x90,0x10,
2157    0x3D,0x80,0x19,0x91,0x0F,0x00,0x03,
2158    0x00}},
2159  {{0x97,0x63,0x9B,0x6F,0x07,0xE0,0x10,
2160    0xB0,0x84,0xAF,0xE1,0x2F,0x00,0x06,
2161    0x00}}
2162 #if 0
2163  {{0x5b,0x27,0x9f,0x29,0x01,0xc0,0x1f,
2164    0x90,0x84,0x8f,0xc1,0x30,0x00,0x01,
2165    0x00}},
2166  {{0x5b,0x27,0x9f,0x29,0x01,0x8e,0x1f,
2167    0x5e,0x82,0x5d,0x8f,0x10,0x00,0x01,
2168    0x00}},
2169  {{0x5b,0x27,0x9f,0x29,0x01,0xc0,0x1f,
2170    0x90,0x84,0x8f,0xc1,0x30,0x00,0x01,
2171    0x00}},
2172  {{0x5b,0x27,0x9f,0x29,0x01,0x8e,0x1f,
2173    0x5e,0x82,0x5d,0x8f,0x10,0x00,0x01,
2174    0x00}},
2175  {{0x5b,0x27,0x9f,0x29,0x01,0x10,0x3e,
2176    0xe0,0x84,0xdf,0x11,0x00,0x00,0x01,
2177    0x00}},
2178  {{0x65,0x31,0x89,0x33,0x8b,0x88,0xf0,
2179    0x58,0x8c,0x57,0x89,0x20,0x00,0x01,
2180    0x01}},
2181  {{0x73,0x3f,0x97,0x41,0x99,0x30,0xf5,
2182    0x00,0x84,0xff,0x31,0x10,0x00,0x01,
2183    0x01}},
2184  {{0x83,0x4f,0x87,0x51,0x09,0x30,0x5a,
2185    0x00,0x84,0xff,0x31,0x09,0x00,0x06,
2186    0x01}},
2187  {{0x8a,0x56,0x8e,0x58,0x10,0x4a,0x10,
2188    0x1a,0x8e,0x19,0x4b,0x2f,0x00,0x06,
2189    0x00}},
2190  {{0x97,0x63,0x9b,0x65,0x1d,0xe0,0x10,
2191    0xb0,0x84,0xaf,0xe1,0x2f,0x00,0x06,
2192    0x00}}
2193 #endif
2194 };
2195 
2196 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2[] =
2197 {
2198  {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
2199    0x43,0x86,0xDB,0xDA,0x11,0x00,0x07,
2200    0x01}},
2201  {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
2202    0x2A,0x8D,0xC2,0xC1,0x11,0x00,0x07,
2203    0x01}},
2204  {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
2205    0x43,0x86,0xDB,0xDA,0x11,0x00,0x07,
2206    0x01}},
2207  {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
2208    0x2A,0x8D,0xC2,0xC1,0x11,0x00,0x07,
2209    0x01}},
2210  {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x9F,
2211    0x6B,0x8E,0x03,0x02,0x01,0x00,0x07,
2212    0x01}},
2213  {{0xFB,0x63,0x9F,0xA1,0x99,0x26,0xD5,
2214    0xA7,0x8A,0xBF,0xBE,0x01,0x00,0x07,
2215    0x01}},
2216  {{0xFB,0x7F,0x9F,0xAF,0x87,0x26,0xDD,
2217    0xFB,0x8E,0x13,0x12,0x31,0x00,0x03,
2218    0x01}},
2219  {{0xFB,0x9F,0x9F,0xBF,0x97,0x26,0x5B,
2220    0x7B,0x8E,0xFF,0x27,0x39,0x00,0x03,
2221    0x01}},
2222  {{0xFB,0xAE,0x9F,0xC6,0x9E,0x26,0x11,
2223    0x88,0x8B,0x19,0x27,0x1F,0x00,0x03,
2224    0x00}},
2225  {{0xFB,0xC7,0x9F,0xD3,0x8B,0x26,0x11,
2226    0xD3,0x86,0xAF,0x27,0x3F,0x00,0x07,
2227    0x00}}
2228 #if 0
2229  {{0xfb,0x88,0x87,0x90,0x08,0xe0,0x96,
2230    0x20,0x84,0xb9,0xb8,0x01,0x00,0x07,
2231    0x01}},
2232  {{0xfb,0x88,0x87,0x90,0x08,0xe0,0x96,
2233    0x07,0x8b,0xa0,0x9f,0x01,0x00,0x07,
2234    0x01}},
2235  {{0xfb,0x88,0x87,0x90,0x08,0xe0,0x96,
2236    0x20,0x84,0xb9,0xb8,0x01,0x00,0x07,
2237    0x01}},
2238  {{0xfb,0x88,0x87,0x90,0x08,0xe0,0x96,
2239    0x07,0x8b,0xa0,0x9f,0x01,0x00,0x07,
2240    0x01}},
2241  {{0xfb,0x88,0x87,0x90,0x08,0xe0,0x96,
2242    0x48,0x8c,0xe1,0xe0,0x11,0x00,0x07,
2243    0x01}},
2244  {{0xfb,0x63,0x9f,0x9a,0x92,0xe0,0xd4,
2245    0x9b,0x8f,0x9d,0x9c,0x21,0x00,0x07,
2246    0x01}},
2247  {{0xfb,0x7f,0x9f,0xa8,0x80,0xe0,0xd4,
2248    0xef,0x83,0xff,0xe1,0x21,0x00,0x03,
2249    0x01}},
2250  {{0xfb,0x9f,0x9f,0xb8,0x90,0xe0,0x5a,
2251    0x6f,0x83,0xff,0xe1,0x29,0x00,0x03,
2252    0x01}},
2253  {{0xfb,0xae,0x9f,0xbf,0x97,0xe0,0x10,
2254    0x7c,0x80,0x19,0xe1,0x0f,0x00,0x03,
2255    0x00}},
2256  {{0xfb,0xc7,0x9f,0xc9,0x84,0xe0,0x10,
2257    0xc7,0x8b,0xaf,0xe1,0x0f,0x00,0x07,
2258    0x00}}
2259 #endif
2260 };
2261 
2262 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2_H[] =
2263 {
2264  {{0xD3,0x5F,0x9E,0x6F,0x07,0x26,0x97,
2265    0x43,0x86,0xDB,0xDA,0x11,0x00,0x02,
2266    0x01}},
2267  {{0xD3,0x27,0x97,0x6F,0x07,0x26,0x97,
2268    0x6B,0x8E,0x83,0x82,0x01,0x00,0x03,
2269    0x01}},
2270  {{0xD3,0x5F,0x9E,0x6F,0x07,0x26,0x97,
2271    0x43,0x86,0xDB,0xDA,0x11,0x00,0x02,
2272    0x01}},
2273  {{0xD3,0x27,0x97,0x6F,0x07,0x26,0x97,
2274    0x07,0x8B,0xA0,0x9F,0x01,0x00,0x02,
2275    0x01}},
2276  {{0xD3,0x27,0x97,0x6F,0x07,0x26,0x97,
2277    0x6B,0x8E,0x83,0x82,0x01,0x00,0x03,
2278    0x01}},
2279  {{0xC9,0x31,0x8D,0x6F,0x07,0x26,0xD5,
2280    0xA7,0x8A,0xBF,0xBE,0x01,0x00,0x03,
2281    0x01}},
2282  {{0xBB,0x3F,0x9F,0x6F,0x87,0x26,0xDD,
2283    0xFB,0x8E,0x13,0x12,0x31,0x00,0x02,
2284    0x01}},
2285  {{0xAB,0x4F,0x8F,0x68,0x80,0xE0,0x5A,
2286    0x6F,0x83,0xFF,0xE1,0x29,0x00,0x02,
2287    0x01}},
2288  {{0xA3,0x56,0x87,0x67,0x9F,0xE0,0x10,
2289    0x7C,0x80,0x19,0xE1,0x0F,0x00,0x06,
2290    0x00}},
2291  {{0x97,0x63,0x9B,0x68,0x00,0xE0,0x10,
2292    0xC7,0x8B,0xAF,0xE1,0x0F,0x00,0x02,
2293    0x00}}
2294 #if 0
2295  {{0xd3,0x60,0x9f,0x68,0x00,0xe0,0x96,
2296    0x20,0x84,0xb9,0xb8,0x01,0x00,0x02,
2297    0x01}},
2298  {{0xd3,0x60,0x9f,0x68,0x00,0xe0,0x96,
2299    0x07,0x8b,0xa0,0x9f,0x01,0x00,0x02,
2300    0x01}},
2301  {{0xd3,0x60,0x9f,0x68,0x00,0xe0,0x96,
2302    0x20,0x84,0xb9,0xb8,0x01,0x00,0x02,
2303    0x01}},
2304  {{0xd3,0x60,0x9f,0x68,0x00,0xe0,0x96,
2305    0x07,0x8b,0xa0,0x9f,0x01,0x00,0x02,
2306    0x01}},
2307  {{0xd3,0x60,0x9f,0x68,0x00,0xe0,0x96,
2308    0x48,0x8c,0xe1,0xe0,0x11,0x00,0x02,
2309    0x01}},
2310  {{0xc9,0x31,0x8d,0x68,0x00,0xe0,0xd4,
2311    0x9b,0x8f,0x9d,0x9c,0x21,0x00,0x03,
2312    0x01}},
2313  {{0xbb,0x3f,0x9f,0x68,0x80,0xe0,0xd4,
2314    0xef,0x83,0xff,0xe1,0x21,0x00,0x02,
2315    0x01}},
2316  {{0xab,0x4f,0x8f,0x68,0x80,0xe0,0x5a,
2317    0x6f,0x83,0xff,0xe1,0x29,0x00,0x02,
2318    0x01}},
2319  {{0xa3,0x56,0x87,0x67,0x9f,0xe0,0x10,
2320    0x7c,0x80,0x19,0xe1,0x0f,0x00,0x06,
2321    0x00}},
2322  {{0x97,0x63,0x9b,0x68,0x00,0xe0,0x10,
2323    0xc7,0x8b,0xaf,0xe1,0x0f,0x00,0x02,
2324    0x00}}
2325 #endif
2326 };
2327 
2328 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1XXXxXXX_1[] =
2329 {
2330  {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
2331    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
2332    0x00}},
2333  {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
2334    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
2335    0x00}},
2336  {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
2337    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
2338    0x00}},
2339  {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
2340    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
2341    0x00}},
2342  {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
2343    0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
2344    0x00}},
2345  {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
2346    0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
2347    0x01}},
2348  {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2349    0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2350    0x01}},
2351  {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
2352    0x00,0x84,0xff,0x29,0x09,0x00,0x07,
2353    0x01}},
2354  {{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
2355    0x02,0x88,0xff,0x25,0x10,0x00,0x07,
2356    0x01}}
2357 };
2358 
2359 static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1XXXxXXX_1_H[] =
2360 {
2361  {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
2362    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
2363    0x00}},
2364  {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
2365    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
2366    0x00}},
2367  {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
2368    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
2369    0x00}},
2370  {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
2371    0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
2372    0x00}},
2373  {{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
2374    0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
2375    0x00}},
2376  {{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
2377    0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
2378    0x01}},
2379  {{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
2380    0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2381    0x01}}
2382 };
2383 
2384 
2385 /* CRT1 CRTC for Chrontel TV slave modes */
2386 
2387 static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1UNTSC[] =
2388 {
2389  {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2390    0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
2391    0x00 }},
2392  {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2393    0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
2394    0x00 }},
2395  {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2396    0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
2397    0x00 }},
2398  {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2399    0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
2400    0x00 }},
2401  {{0x5d,0x4f,0x81,0x56,0x99,0x56,0xba,
2402    0x0a,0x84,0xdf,0x57,0x00,0x00,0x01,
2403    0x00 }},
2404  {{0x80,0x63,0x84,0x6d,0x0f,0xec,0xf0,
2405    0x7a,0x8f,0x57,0xed,0x20,0x00,0x06,
2406    0x01 }},
2407  {{0x8c,0x7f,0x90,0x86,0x09,0xaf,0xf5,
2408    0x36,0x88,0xff,0xb0,0x10,0x00,0x02,
2409    0x01}}
2410 };
2411 
2412 static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1ONTSC[] =
2413 {
2414  {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
2415    0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
2416    0x00 }},
2417  {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
2418    0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
2419    0x00 }},
2420  {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
2421    0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
2422    0x00 }},
2423  {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
2424    0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
2425    0x00 }},
2426  {{0x5d,0x4f,0x81,0x58,0x9d,0x0b,0x3e,
2427    0xe8,0x84,0xdf,0x0c,0x00,0x00,0x01,
2428    0x00 }},
2429  {{0x7d,0x63,0x81,0x68,0x0e,0xba,0xf0,
2430    0x78,0x8a,0x57,0xbb,0x20,0x00,0x06,
2431    0x01 }},
2432  {{0x8c,0x7f,0x90,0x82,0x06,0x46,0xf5,
2433    0x15,0x88,0xff,0x47,0x70,0x00,0x02,
2434    0x01 }}
2435 };
2436 
2437 static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1UPAL[] =
2438 {
2439  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2440    0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
2441    0x00 }},
2442  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2443    0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2444    0x00 }},
2445  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2446    0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
2447    0x00 }},
2448  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2449    0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2450    0x00 }},
2451  {{0x64,0x4f,0x88,0x5a,0x9f,0x6f,0xba,
2452    0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
2453    0x00 }},
2454  {{0x73,0x63,0x97,0x69,0x8b,0xec,0xf0,
2455    0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
2456    0x01 }},
2457  {{0xaa,0x7f,0x8e,0x8e,0x96,0xe6,0xf5,
2458    0x50,0x88,0xff,0xe7,0x10,0x00,0x02,
2459    0x01}}
2460 };
2461 
2462 static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1OPAL[] =
2463 {
2464  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2465    0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
2466    0x00 }},
2467  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2468    0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2469    0x00 }},
2470  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2471    0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
2472    0x00 }},
2473  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2474    0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2475    0x00 }},
2476  {{0x64,0x4f,0x88,0x58,0x9d,0x6f,0xba,
2477    0x15,0x83,0xdf,0x70,0x00,0x00,0x01,
2478    0x00 }},
2479  {{0x71,0x63,0x95,0x69,0x8c,0x6f,0xf0,
2480    0x5a,0x8b,0x57,0x70,0x20,0x00,0x05,
2481    0x01 }},
2482  {{0xaa,0x7f,0x8e,0x8f,0x96,0x69,0xf5,
2483    0x28,0x88,0xff,0x6a,0x10,0x00,0x02,
2484    0x01 }}
2485 };
2486 
2487 
2488 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
2489 {
2490  {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2491  {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2492  {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2493  {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2494  {{0x6a,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x7e,0x80,0x98,0x00}},
2495  {{0xcf,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x88,0x30,0x7f,0x00}},
2496  {{0xee,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xd3,0xf2,0x36,0x00}}
2497 }; /* WRONG: 0x02: should be 0xfx, because if CIVEnable is clear, this should be set;
2498              0x07: Blacklevel: NTSC/PAL-M: Should be 131 (0x83), and not 0x50/0x5a
2499 	                       PAL/PAL-N:  110 (0x6e)
2500 			       NTSC-J:     102 (0x66)
2501 	     0x0c-0x0f: CIV is not default as in datasheet
2502       MISSING: 0x21: Should set D1 to ZERO (for NTSC, PAL-M) or ONE (PAL, NTSC-J)
2503       Most of this is wrong in all NTSC and PAL register arrays. But I won't correct
2504       it as long as it works. For NTSC-J, the blacklevel is corrected in init301.c;
2505       for PAL-M and PAL-N all above is corrected.
2506     */
2507 
2508 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
2509 {
2510  {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2511  {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2512  {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2513  {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2514  {{0x69,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x43,0x04,0x00}},
2515  {{0xce,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1c,0x00,0x82,0x97,0x00}},
2516  {{0xed,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x9f,0xc1,0x0c,0x00}}
2517 };
2518 
2519 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
2520 {
2521  {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2522  {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2523  {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2524  {{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2525  {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
2526  {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x1f,0x84,0x3d,0x28,0x00}},
2527  {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x20,0x3e,0xe4,0x22,0x00}}
2528 };
2529 
2530 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
2531 {
2532  {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2533  {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2534  {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2535  {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2536  {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x26,0x2a,0x55,0x5d,0x00}},
2537  {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x26,0x78,0x19,0x34,0x00}},
2538  {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}}
2539 };
2540 
2541 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
2542 {
2543  {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2544  {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2545  {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2546  {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2547  {{0x72,0x77,0xfb,0x6e,0x84,0x2e,0x02,0x83,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}},
2548  {{0xd7,0x77,0xf7,0xc8,0x84,0x3b,0x02,0x83,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}},
2549  {{0xf6,0x77,0xfb,0x66,0x87,0x32,0x01,0x83,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}}
2550 #if 0 /* Correct blacklevel and CFRB */
2551  {{0x72,0x77,0xbb,0x6e,0x84,0x2e,0x02,0x5a,0x04,0x00,0x80,0x20,0x76,0xdb,0x6e,0x00}},
2552  {{0xd7,0x77,0xb7,0xc8,0x84,0x3b,0x02,0x5a,0x04,0x00,0x80,0x19,0x84,0x0a,0xc7,0x00}},
2553  {{0xf6,0x77,0xbb,0x66,0x87,0x32,0x01,0x5a,0x04,0x00,0x80,0x1b,0xdc,0xb0,0x8d,0x00}}
2554 #endif
2555 };
2556 
2557 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
2558 {
2559  {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2560  {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2561  {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2562  {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
2563  {{0x71,0x77,0xfb,0x6e,0x84,0x1e,0x00,0x83,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}},
2564  {{0xd6,0x77,0xf7,0xb6,0x83,0x2c,0x02,0x83,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}},
2565  {{0xf5,0x77,0xfb,0x66,0x8c,0x21,0x02,0x83,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}}
2566 #if 0 /* Correct blacklevel and CFRB */
2567  {{0x71,0x77,0xbb,0x6e,0x84,0x1e,0x00,0x5a,0x04,0x00,0x80,0x25,0x1a,0x1f,0x59,0x00}},
2568  {{0xd6,0x77,0xb7,0xb6,0x83,0x2c,0x02,0x5a,0x04,0x00,0x80,0x1b,0xf8,0x1f,0x82,0x00}},
2569  {{0xf5,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x58,0x46,0x9f,0x00}}
2570 #endif
2571 };
2572 
2573 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
2574 {
2575  {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2576  {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2577  {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2578  {{0x41,0x7f,0xb7,0x12,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2579  {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2580  {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2581  {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}
2582 #if 0 /* Correct blacklevel, CIV and CFRB */
2583  {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}},
2584  {{0xc3,0x7f,0xb7,0x7a,0x84,0x40,0x02,0x5a,0x05,0x00,0x80,0x19,0x78,0xef,0x35,0x00}},
2585  {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x1a,0x33,0x3f,0x2f,0x00}}
2586 #endif
2587 };
2588 
2589 static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPALN[] =
2590 {
2591  {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2592  {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2593  {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2594  {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2595  {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2596  {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
2597  {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}}
2598 #if 0 /* Correct blacklevel, CIV and CFRB */
2599  {{0x61,0x7f,0xb7,0x99,0x84,0x35,0x04,0x5a,0x05,0x00,0x80,0x1f,0x0d,0x54,0x5e,0x00}},
2600  {{0xc1,0x7f,0xb7,0x4d,0x8c,0x1e,0x31,0x5a,0x05,0x00,0x80,0x1f,0x15,0xc0,0x1e,0x00}},
2601  {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x1d,0xf1,0x6c,0xcb,0x00}}
2602 #endif
2603 };
2604 
2605 static const UCHAR SiS310_CHTVVCLKUNTSC[] = {0x41,0x41,0x41,0x41,0x42,0x46,0x53};
2606 static const UCHAR SiS310_CHTVVCLKONTSC[] = {0x48,0x48,0x48,0x48,0x45,0x43,0x51};
2607 
2608 static const UCHAR SiS310_CHTVVCLKUPAL[]  = {0x47,0x47,0x47,0x47,0x48,0x4a,0x54};
2609 static const UCHAR SiS310_CHTVVCLKOPAL[]  = {0x47,0x47,0x47,0x47,0x48,0x4f,0x52};
2610 
2611 static const UCHAR SiS310_CHTVVCLKUPALM[] = {0x41,0x41,0x41,0x41,0x42,0x46,0x53};
2612 static const UCHAR SiS310_CHTVVCLKOPALM[] = {0x48,0x48,0x48,0x48,0x45,0x43,0x51};
2613 
2614 static const UCHAR SiS310_CHTVVCLKUPALN[] = {0x47,0x47,0x47,0x47,0x48,0x4a,0x54};
2615 static const UCHAR SiS310_CHTVVCLKOPALN[] = {0x47,0x47,0x47,0x47,0x48,0x4f,0x52};
2616 
2617 
2618