1e90b8e91SNishad Kamdar /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ 21bbb4f20SThomas Winischhofer /* 31bbb4f20SThomas Winischhofer * General structure definitions for universal mode switching modules 41bbb4f20SThomas Winischhofer * 51bbb4f20SThomas Winischhofer * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria 61bbb4f20SThomas Winischhofer * 71bbb4f20SThomas Winischhofer * If distributed as part of the Linux kernel, the following license terms 81bbb4f20SThomas Winischhofer * apply: 91bbb4f20SThomas Winischhofer * 101bbb4f20SThomas Winischhofer * * This program is free software; you can redistribute it and/or modify 111bbb4f20SThomas Winischhofer * * it under the terms of the GNU General Public License as published by 121bbb4f20SThomas Winischhofer * * the Free Software Foundation; either version 2 of the named License, 131bbb4f20SThomas Winischhofer * * or any later version. 141bbb4f20SThomas Winischhofer * * 151bbb4f20SThomas Winischhofer * * This program is distributed in the hope that it will be useful, 161bbb4f20SThomas Winischhofer * * but WITHOUT ANY WARRANTY; without even the implied warranty of 171bbb4f20SThomas Winischhofer * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 181bbb4f20SThomas Winischhofer * * GNU General Public License for more details. 191bbb4f20SThomas Winischhofer * * 201bbb4f20SThomas Winischhofer * * You should have received a copy of the GNU General Public License 211bbb4f20SThomas Winischhofer * * along with this program; if not, write to the Free Software 221bbb4f20SThomas Winischhofer * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 231bbb4f20SThomas Winischhofer * 241bbb4f20SThomas Winischhofer * Otherwise, the following license terms apply: 251bbb4f20SThomas Winischhofer * 261bbb4f20SThomas Winischhofer * * Redistribution and use in source and binary forms, with or without 271bbb4f20SThomas Winischhofer * * modification, are permitted provided that the following conditions 281bbb4f20SThomas Winischhofer * * are met: 291bbb4f20SThomas Winischhofer * * 1) Redistributions of source code must retain the above copyright 301bbb4f20SThomas Winischhofer * * notice, this list of conditions and the following disclaimer. 311bbb4f20SThomas Winischhofer * * 2) Redistributions in binary form must reproduce the above copyright 321bbb4f20SThomas Winischhofer * * notice, this list of conditions and the following disclaimer in the 331bbb4f20SThomas Winischhofer * * documentation and/or other materials provided with the distribution. 341bbb4f20SThomas Winischhofer * * 3) The name of the author may not be used to endorse or promote products 351bbb4f20SThomas Winischhofer * * derived from this software without specific prior written permission. 361bbb4f20SThomas Winischhofer * * 371bbb4f20SThomas Winischhofer * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 381bbb4f20SThomas Winischhofer * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 391bbb4f20SThomas Winischhofer * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 401bbb4f20SThomas Winischhofer * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 411bbb4f20SThomas Winischhofer * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 421bbb4f20SThomas Winischhofer * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 431bbb4f20SThomas Winischhofer * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 441bbb4f20SThomas Winischhofer * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 451bbb4f20SThomas Winischhofer * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 461bbb4f20SThomas Winischhofer * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 471bbb4f20SThomas Winischhofer * 481bbb4f20SThomas Winischhofer * Author: Thomas Winischhofer <thomas@winischhofer.net> 491bbb4f20SThomas Winischhofer * 501bbb4f20SThomas Winischhofer */ 511bbb4f20SThomas Winischhofer 521bbb4f20SThomas Winischhofer #ifndef _SISUSB_STRUCT_H_ 531bbb4f20SThomas Winischhofer #define _SISUSB_STRUCT_H_ 541bbb4f20SThomas Winischhofer 551bbb4f20SThomas Winischhofer struct SiS_St { 561bbb4f20SThomas Winischhofer unsigned char St_ModeID; 571bbb4f20SThomas Winischhofer unsigned short St_ModeFlag; 581bbb4f20SThomas Winischhofer unsigned char St_StTableIndex; 591bbb4f20SThomas Winischhofer unsigned char St_CRT2CRTC; 601bbb4f20SThomas Winischhofer unsigned char St_ResInfo; 611bbb4f20SThomas Winischhofer unsigned char VB_StTVFlickerIndex; 621bbb4f20SThomas Winischhofer unsigned char VB_StTVEdgeIndex; 631bbb4f20SThomas Winischhofer unsigned char VB_StTVYFilterIndex; 641bbb4f20SThomas Winischhofer unsigned char St_PDC; 651bbb4f20SThomas Winischhofer }; 661bbb4f20SThomas Winischhofer 67ecb8b190SFelipe Balbi struct SiS_StandTable { 681bbb4f20SThomas Winischhofer unsigned char CRT_COLS; 691bbb4f20SThomas Winischhofer unsigned char ROWS; 701bbb4f20SThomas Winischhofer unsigned char CHAR_HEIGHT; 711bbb4f20SThomas Winischhofer unsigned short CRT_LEN; 721bbb4f20SThomas Winischhofer unsigned char SR[4]; 731bbb4f20SThomas Winischhofer unsigned char MISC; 741bbb4f20SThomas Winischhofer unsigned char CRTC[0x19]; 751bbb4f20SThomas Winischhofer unsigned char ATTR[0x14]; 761bbb4f20SThomas Winischhofer unsigned char GRC[9]; 771bbb4f20SThomas Winischhofer }; 781bbb4f20SThomas Winischhofer 791bbb4f20SThomas Winischhofer struct SiS_StResInfo_S { 801bbb4f20SThomas Winischhofer unsigned short HTotal; 811bbb4f20SThomas Winischhofer unsigned short VTotal; 821bbb4f20SThomas Winischhofer }; 831bbb4f20SThomas Winischhofer 84ecb8b190SFelipe Balbi struct SiS_Ext { 851bbb4f20SThomas Winischhofer unsigned char Ext_ModeID; 861bbb4f20SThomas Winischhofer unsigned short Ext_ModeFlag; 871bbb4f20SThomas Winischhofer unsigned short Ext_VESAID; 881bbb4f20SThomas Winischhofer unsigned char Ext_RESINFO; 891bbb4f20SThomas Winischhofer unsigned char VB_ExtTVFlickerIndex; 901bbb4f20SThomas Winischhofer unsigned char VB_ExtTVEdgeIndex; 911bbb4f20SThomas Winischhofer unsigned char VB_ExtTVYFilterIndex; 921bbb4f20SThomas Winischhofer unsigned char VB_ExtTVYFilterIndexROM661; 931bbb4f20SThomas Winischhofer unsigned char REFindex; 94*835bed1bSJason A. Donenfeld signed char ROMMODEIDX661; 951bbb4f20SThomas Winischhofer }; 961bbb4f20SThomas Winischhofer 97ecb8b190SFelipe Balbi struct SiS_Ext2 { 981bbb4f20SThomas Winischhofer unsigned short Ext_InfoFlag; 991bbb4f20SThomas Winischhofer unsigned char Ext_CRT1CRTC; 1001bbb4f20SThomas Winischhofer unsigned char Ext_CRTVCLK; 1011bbb4f20SThomas Winischhofer unsigned char Ext_CRT2CRTC; 1021bbb4f20SThomas Winischhofer unsigned char Ext_CRT2CRTC_NS; 1031bbb4f20SThomas Winischhofer unsigned char ModeID; 1041bbb4f20SThomas Winischhofer unsigned short XRes; 1051bbb4f20SThomas Winischhofer unsigned short YRes; 1061bbb4f20SThomas Winischhofer unsigned char Ext_PDC; 1071bbb4f20SThomas Winischhofer unsigned char Ext_FakeCRT2CRTC; 1081bbb4f20SThomas Winischhofer unsigned char Ext_FakeCRT2Clk; 1091bbb4f20SThomas Winischhofer }; 1101bbb4f20SThomas Winischhofer 111ecb8b190SFelipe Balbi struct SiS_CRT1Table { 1121bbb4f20SThomas Winischhofer unsigned char CR[17]; 1131bbb4f20SThomas Winischhofer }; 1141bbb4f20SThomas Winischhofer 115ecb8b190SFelipe Balbi struct SiS_VCLKData { 1161bbb4f20SThomas Winischhofer unsigned char SR2B, SR2C; 1171bbb4f20SThomas Winischhofer unsigned short CLOCK; 1181bbb4f20SThomas Winischhofer }; 1191bbb4f20SThomas Winischhofer 120ecb8b190SFelipe Balbi struct SiS_ModeResInfo { 1211bbb4f20SThomas Winischhofer unsigned short HTotal; 1221bbb4f20SThomas Winischhofer unsigned short VTotal; 1231bbb4f20SThomas Winischhofer unsigned char XChar; 1241bbb4f20SThomas Winischhofer unsigned char YChar; 1251bbb4f20SThomas Winischhofer }; 1261bbb4f20SThomas Winischhofer 127ecb8b190SFelipe Balbi struct SiS_Private { 1281bbb4f20SThomas Winischhofer void *sisusb; 1291bbb4f20SThomas Winischhofer 1301bbb4f20SThomas Winischhofer unsigned long IOAddress; 1311bbb4f20SThomas Winischhofer 1321bbb4f20SThomas Winischhofer unsigned long SiS_P3c4; 1331bbb4f20SThomas Winischhofer unsigned long SiS_P3d4; 1341bbb4f20SThomas Winischhofer unsigned long SiS_P3c0; 1351bbb4f20SThomas Winischhofer unsigned long SiS_P3ce; 1361bbb4f20SThomas Winischhofer unsigned long SiS_P3c2; 1371bbb4f20SThomas Winischhofer unsigned long SiS_P3ca; 1381bbb4f20SThomas Winischhofer unsigned long SiS_P3c6; 1391bbb4f20SThomas Winischhofer unsigned long SiS_P3c7; 1401bbb4f20SThomas Winischhofer unsigned long SiS_P3c8; 1411bbb4f20SThomas Winischhofer unsigned long SiS_P3c9; 1421bbb4f20SThomas Winischhofer unsigned long SiS_P3cb; 1431bbb4f20SThomas Winischhofer unsigned long SiS_P3cc; 1441bbb4f20SThomas Winischhofer unsigned long SiS_P3cd; 1451bbb4f20SThomas Winischhofer unsigned long SiS_P3da; 1461bbb4f20SThomas Winischhofer unsigned long SiS_Part1Port; 1471bbb4f20SThomas Winischhofer 1481bbb4f20SThomas Winischhofer unsigned char SiS_MyCR63; 1491bbb4f20SThomas Winischhofer unsigned short SiS_CRT1Mode; 1501bbb4f20SThomas Winischhofer unsigned short SiS_ModeType; 1511bbb4f20SThomas Winischhofer unsigned short SiS_SetFlag; 1521bbb4f20SThomas Winischhofer 1531bbb4f20SThomas Winischhofer const struct SiS_StandTable *SiS_StandTable; 1541bbb4f20SThomas Winischhofer const struct SiS_St *SiS_SModeIDTable; 1551bbb4f20SThomas Winischhofer const struct SiS_Ext *SiS_EModeIDTable; 1561bbb4f20SThomas Winischhofer const struct SiS_Ext2 *SiS_RefIndex; 1571bbb4f20SThomas Winischhofer const struct SiS_CRT1Table *SiS_CRT1Table; 158df47e533SAdrian Bunk const struct SiS_VCLKData *SiS_VCLKData; 1591bbb4f20SThomas Winischhofer const struct SiS_ModeResInfo *SiS_ModeResInfo; 1601bbb4f20SThomas Winischhofer }; 1611bbb4f20SThomas Winischhofer 1621bbb4f20SThomas Winischhofer #endif 163