1/* 2 * OEM Data for 315/330/340 series 3 * 4 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria 5 * 6 * If distributed as part of the Linux kernel, the following license terms 7 * apply: 8 * 9 * * This program is free software; you can redistribute it and/or modify 10 * * it under the terms of the GNU General Public License as published by 11 * * the Free Software Foundation; either version 2 of the named License, 12 * * or any later version. 13 * * 14 * * This program is distributed in the hope that it will be useful, 15 * * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * * GNU General Public License for more details. 18 * * 19 * * You should have received a copy of the GNU General Public License 20 * * along with this program; if not, write to the Free Software 21 * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 22 * 23 * Otherwise, the following license terms apply: 24 * 25 * * Redistribution and use in source and binary forms, with or without 26 * * modification, are permitted provided that the following conditions 27 * * are met: 28 * * 1) Redistributions of source code must retain the above copyright 29 * * notice, this list of conditions and the following disclaimer. 30 * * 2) Redistributions in binary form must reproduce the above copyright 31 * * notice, this list of conditions and the following disclaimer in the 32 * * documentation and/or other materials provided with the distribution. 33 * * 3) The name of the author may not be used to endorse or promote products 34 * * derived from this software without specific prior written permission. 35 * * 36 * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 37 * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 38 * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 39 * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 40 * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 42 * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 43 * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 44 * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 45 * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 * 47 * Author: Thomas Winischhofer <thomas@winischhofer.net> 48 * 49 */ 50 51static const unsigned char SiS310_LCDDelayCompensation_301[] = /* 301 */ 52{ 53 0x00,0x00,0x00, /* 800x600 */ 54 0x0b,0x0b,0x0b, /* 1024x768 */ 55 0x08,0x08,0x08, /* 1280x1024 */ 56 0x00,0x00,0x00, /* 640x480 (unknown) */ 57 0x00,0x00,0x00, /* 1024x600 (unknown) */ 58 0x00,0x00,0x00, /* 1152x864 (unknown) */ 59 0x08,0x08,0x08, /* 1280x960 (guessed) */ 60 0x00,0x00,0x00, /* 1152x768 (unknown) */ 61 0x08,0x08,0x08, /* 1400x1050 */ 62 0x08,0x08,0x08, /* 1280x768 (guessed) */ 63 0x00,0x00,0x00, /* 1600x1200 */ 64 0x00,0x00,0x00, /* 320x480 (unknown) */ 65 0x00,0x00,0x00, 66 0x00,0x00,0x00, 67 0x00,0x00,0x00 68}; 69 70/* This is contained in 650+301B BIOSes, but it is wrong - so we don't use it */ 71static const unsigned char SiS310_LCDDelayCompensation_650301LV[] = /* 650 + 30xLV */ 72{ 73 0x01,0x01,0x01, /* 800x600 */ 74 0x01,0x01,0x01, /* 1024x768 */ 75 0x01,0x01,0x01, /* 1280x1024 */ 76 0x01,0x01,0x01, /* 640x480 (unknown) */ 77 0x01,0x01,0x01, /* 1024x600 (unknown) */ 78 0x01,0x01,0x01, /* 1152x864 (unknown) */ 79 0x01,0x01,0x01, /* 1280x960 (guessed) */ 80 0x01,0x01,0x01, /* 1152x768 (unknown) */ 81 0x01,0x01,0x01, /* 1400x1050 */ 82 0x01,0x01,0x01, /* 1280x768 (guessed) */ 83 0x01,0x01,0x01, /* 1600x1200 */ 84 0x02,0x02,0x02, 85 0x02,0x02,0x02, 86 0x02,0x02,0x02, 87 0x02,0x02,0x02 88}; 89 90static const unsigned char SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */ 91{ 92 0x33,0x33,0x33, /* 800x600 (guessed) - new: PanelType, not PanelRes ! */ 93 0x33,0x33,0x33, /* 1024x768 */ 94 0x33,0x33,0x33, /* 1280x1024 */ 95 0x33,0x33,0x33, /* 640x480 (unknown) */ 96 0x33,0x33,0x33, /* 1024x600 (unknown) */ 97 0x33,0x33,0x33, /* 1152x864 (unknown) */ 98 0x33,0x33,0x33, /* 1280x960 (guessed) */ 99 0x33,0x33,0x33, /* 1152x768 (unknown) */ 100 0x33,0x33,0x33, /* 1400x1050 */ 101 0x33,0x33,0x33, /* 1280x768 (guessed) */ 102 0x33,0x33,0x33, /* 1600x1200 */ 103 0x33,0x33,0x33, 104 0x33,0x33,0x33, 105 0x33,0x33,0x33, 106 0x33,0x33,0x33 107}; 108 109static const unsigned char SiS310_LCDDelayCompensation_651302LV[] = /* M650/651 302LV */ 110{ 111 0x33,0x33,0x33, /* 800x600 (guessed) */ 112 0x33,0x33,0x33, /* 1024x768 */ 113 0x33,0x33,0x33, /* 1280x1024 */ 114 0x33,0x33,0x33, /* 640x480 (unknown) */ 115 0x33,0x33,0x33, /* 1024x600 (unknown) */ 116 0x33,0x33,0x33, /* 1152x864 (unknown) */ 117 0x33,0x33,0x33, /* 1280x960 (guessed) */ 118 0x33,0x33,0x33, /* 1152x768 (unknown) */ 119 0x33,0x33,0x33, /* 1400x1050 */ 120 0x33,0x33,0x33, /* 1280x768 (guessed) */ 121 0x33,0x33,0x33, /* 1600x1200 */ 122 0x33,0x33,0x33, 123 0x33,0x33,0x33, 124 0x33,0x33,0x33, 125 0x33,0x33,0x33 126}; 127 128static const unsigned char SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB */ 129{ 130 0x01,0x01,0x01, /* 800x600 */ 131 0x0C,0x0C,0x0C, /* 1024x768 */ 132 0x0C,0x0C,0x0C, /* 1280x1024 */ 133 0x08,0x08,0x08, /* 640x480 */ 134 0x0C,0x0C,0x0C, /* 1024x600 (guessed) */ 135 0x0C,0x0C,0x0C, /* 1152x864 (guessed) */ 136 0x0C,0x0C,0x0C, /* 1280x960 (guessed) */ 137 0x0C,0x0C,0x0C, /* 1152x768 (guessed) */ 138 0x0C,0x0C,0x0C, /* 1400x1050 (guessed) */ 139 0x0C,0x0C,0x0C, /* 1280x768 (guessed) */ 140 0x0C,0x0C,0x0C, /* 1600x1200 (guessed) */ 141 0x02,0x02,0x02, 142 0x02,0x02,0x02, 143 0x02,0x02,0x02, 144 0x02,0x02,0x02 145}; 146 147static const unsigned char SiS310_LCDDelayCompensation_3xx301LV[] = /* 315+30xLV */ 148{ 149 0x01,0x01,0x01, /* 800x600 */ 150 0x04,0x04,0x04, /* 1024x768 (A531/BIOS 1.14.05f: 4 - works with 6 */ 151 0x0C,0x0C,0x0C, /* 1280x1024 */ 152 0x08,0x08,0x08, /* 640x480 */ 153 0x0C,0x0C,0x0C, /* 1024x600 (guessed) */ 154 0x0C,0x0C,0x0C, /* 1152x864 (guessed) */ 155 0x0C,0x0C,0x0C, /* 1280x960 (guessed) */ 156 0x0C,0x0C,0x0C, /* 1152x768 (guessed) */ 157 0x0C,0x0C,0x0C, /* 1400x1050 (guessed) */ 158 0x0C,0x0C,0x0C, /* 1280x768 (guessed) */ 159 0x0C,0x0C,0x0C, /* 1600x1200 (guessed) */ 160 0x02,0x02,0x02, 161 0x02,0x02,0x02, 162 0x02,0x02,0x02, 163 0x02,0x02,0x02 164}; 165 166static const unsigned char SiS310_TVDelayCompensation_301[] = /* 301 */ 167{ 168 0x02,0x02, /* NTSC Enhanced, Standard */ 169 0x02,0x02, /* PAL */ 170 0x08,0x0b /* HiVision */ 171}; 172 173static const unsigned char SiS310_TVDelayCompensation_301B[] = /* 30xB, 30xLV */ 174{ 175 0x03,0x03, 176 0x03,0x03, 177 0x03,0x03 178}; 179 180static const unsigned char SiS310_TVDelayCompensation_740301B[] = /* 740 + 30xB (30xLV?) */ 181{ 182 0x05,0x05, 183 0x05,0x05, 184 0x05,0x05 185}; 186 187static const unsigned char SiS310_TVDelayCompensation_651301LV[] = /* M650, 651, 301LV */ 188{ 189 0x33,0x33, 190 0x33,0x33, 191 0x33,0x33 192}; 193 194static const unsigned char SiS310_TVDelayCompensation_651302LV[] = /* M650, 651, 302LV */ 195{ 196 0x33,0x33, 197 0x33,0x33, 198 0x33,0x33 199}; 200 201static const unsigned char SiS_TVDelay661_301[] = /* 661, 301 */ 202{ 203 0x44,0x44, 204 0x44,0x44, 205 0x00,0x00, 206 0x44,0x44, 207 0x44,0x44, 208 0x44,0x44 209}; 210 211static const unsigned char SiS_TVDelay661_301B[] = /* 661, 301B et al */ 212{ 213 0x44,0x44, 214 0x44,0x44, 215 0x00,0x00, 216 0x44,0x44, 217 0x44,0x44, 218 0x44,0x44 219}; 220 221static const unsigned char SiS310_TVDelayCompensation_LVDS[] = /* LVDS */ 222{ 223 0x0a,0x0a, 224 0x0a,0x0a, 225 0x0a,0x0a 226}; 227 228static const unsigned char SiS310_TVAntiFlick1[6][2] = 229{ 230 {0x4,0x0}, 231 {0x4,0x8}, 232 {0x0,0x0}, 233 {0x0,0x0}, 234 {0x0,0x0}, 235 {0x0,0x0} 236}; 237 238static const unsigned char SiS310_TVEdge1[6][2] = 239{ 240 {0x0,0x4}, 241 {0x0,0x4}, 242 {0x0,0x0}, 243 {0x0,0x0}, 244 {0x0,0x0}, 245 {0x0,0x0} 246}; 247 248static const unsigned char SiS310_TVYFilter1[5][8][4] = 249{ 250 { 251 {0x00,0xf4,0x10,0x38}, /* NTSC */ 252 {0x00,0xf4,0x10,0x38}, 253 {0xeb,0x04,0x25,0x18}, 254 {0xf1,0x04,0x1f,0x18}, 255 {0x00,0xf4,0x10,0x38}, 256 {0xeb,0x04,0x25,0x18}, 257 {0xee,0x0c,0x22,0x08}, 258 {0xeb,0x15,0x25,0xf6} 259 }, 260 { 261 {0x00,0xf4,0x10,0x38}, /* PAL */ 262 {0x00,0xf4,0x10,0x38}, 263 {0xf1,0xf7,0x1f,0x32}, 264 {0xf3,0x00,0x1d,0x20}, 265 {0x00,0xf4,0x10,0x38}, 266 {0xf1,0xf7,0x1f,0x32}, 267 {0xf3,0x00,0x1d,0x20}, 268 {0xfc,0xfb,0x14,0x2a} 269 }, 270 { 271 {0x00,0x00,0x00,0x00}, /* HiVision */ 272 {0x00,0xf4,0x10,0x38}, 273 {0x00,0xf4,0x10,0x38}, 274 {0xeb,0x04,0x25,0x18}, 275 {0xf7,0x06,0x19,0x14}, 276 {0x00,0xf4,0x10,0x38}, 277 {0xeb,0x04,0x25,0x18}, 278 {0xee,0x0c,0x22,0x08} 279 }, 280 { 281 {0x00,0xf4,0x10,0x38}, /* PAL-M */ 282 {0x00,0xf4,0x10,0x38}, 283 {0xeb,0x04,0x10,0x18}, 284 {0xf7,0x06,0x19,0x14}, 285 {0x00,0xf4,0x10,0x38}, 286 {0xeb,0x04,0x25,0x18}, 287 {0xeb,0x04,0x25,0x18}, 288 {0xeb,0x15,0x25,0xf6} 289 }, 290 { 291 {0x00,0xf4,0x10,0x38}, /* PAL-N */ 292 {0x00,0xf4,0x10,0x38}, 293 {0xeb,0x04,0x10,0x18}, 294 {0xf7,0x06,0x19,0x14}, 295 {0x00,0xf4,0x10,0x38}, 296 {0xeb,0x04,0x25,0x18}, 297 {0xeb,0x04,0x25,0x18}, 298 {0xeb,0x15,0x25,0xf6} 299 } 300}; 301 302static const unsigned char SiS310_TVYFilter2[5][9][7] = 303{ 304 { 305 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* NTSC */ 306 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 307 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 308 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 309 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 310 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 311 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 312 {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, 313 {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} 314 }, 315 { 316 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* PAL */ 317 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 318 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 319 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 320 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 321 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 322 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 323 {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, 324 {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} 325 }, 326 { 327 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, /* HiVision */ 328 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 329 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 330 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 331 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 332 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 333 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 334 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, 335 {0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22} 336 }, 337 { 338 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* PAL-M */ 339 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 340 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 341 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 342 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 343 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 344 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 345 {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, 346 {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} 347 }, 348 { 349 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* PAL-N */ 350 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 351 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 352 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 353 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 354 {0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, 355 {0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C}, 356 {0x01,0x01,0xFC,0xF8,0x08,0x26,0x38}, 357 {0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28} 358 } 359}; 360 361static const unsigned char SiS310_TVPhaseIncr1[3][2][4] = 362{ 363 { 364 {0x21,0xed,0xba,0x08}, 365 {0x21,0xed,0xba,0x08} 366 }, 367 { 368 {0x2a,0x05,0xe3,0x00}, 369 {0x2a,0x05,0xe3,0x00} 370 }, 371 { 372 {0x2a,0x05,0xd3,0x00}, 373 {0x2a,0x05,0xd3,0x00} 374 } 375}; 376 377static const unsigned char SiS310_TVPhaseIncr2[3][2][4] = 378{ 379 { 380 {0x21,0xf0,0x7b,0xd6}, 381 {0x21,0xf0,0x7b,0xd6} 382 }, 383 { 384 {0x2a,0x0a,0x41,0xe9}, 385 {0x2a,0x0a,0x41,0xe9} 386 }, 387 { 388 {0x2a,0x05,0xd3,0x00}, 389 {0x2a,0x05,0xd3,0x00} 390 } 391}; 392 393/**************************************************************/ 394/* CUSTOM TIMING DATA --------------------------------------- */ 395/**************************************************************/ 396 397/* Inventec / Compaq Presario 3045US, 3017 */ 398 399static const struct SiS_LCDData SiS310_ExtCompaq1280x1024Data[] = 400{ 401 { 211, 60,1024, 501,1688,1066}, 402 { 211, 60,1024, 508,1688,1066}, 403 { 211, 60,1024, 501,1688,1066}, 404 { 211, 60,1024, 508,1688,1066}, 405 { 32, 15,1696, 501,1696,1066}, 406 { 212, 75,1024, 621,1696,1066}, 407 { 4, 3,1696, 810,1696,1066}, 408 { 1, 1,1696,1066,1696,1066} 409}; 410 411/* Asus A2xxxH _2 */ 412 413static const struct SiS_Part2PortTbl SiS310_CRT2Part2_Asus1024x768_3[] = 414{ 415 {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, 416 {{0x2c,0x13,0x9a,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, 417 {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, 418 {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, 419 {{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}, 420 {{0x38,0x13,0x16,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, 421 {{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}, 422 {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, 423 {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}} 424}; 425 426 427 428 429