18c2ecf20Sopenharmony_ci/* $XFree86$ */ 28c2ecf20Sopenharmony_ci/* $XdotOrg$ */ 38c2ecf20Sopenharmony_ci/* 48c2ecf20Sopenharmony_ci * Data and prototypes for init301.c 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * If distributed as part of the Linux kernel, the following license terms 98c2ecf20Sopenharmony_ci * apply: 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * * This program is free software; you can redistribute it and/or modify 128c2ecf20Sopenharmony_ci * * it under the terms of the GNU General Public License as published by 138c2ecf20Sopenharmony_ci * * the Free Software Foundation; either version 2 of the named License, 148c2ecf20Sopenharmony_ci * * or any later version. 158c2ecf20Sopenharmony_ci * * 168c2ecf20Sopenharmony_ci * * This program is distributed in the hope that it will be useful, 178c2ecf20Sopenharmony_ci * * but WITHOUT ANY WARRANTY; without even the implied warranty of 188c2ecf20Sopenharmony_ci * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 198c2ecf20Sopenharmony_ci * * GNU General Public License for more details. 208c2ecf20Sopenharmony_ci * * 218c2ecf20Sopenharmony_ci * * You should have received a copy of the GNU General Public License 228c2ecf20Sopenharmony_ci * * along with this program; if not, write to the Free Software 238c2ecf20Sopenharmony_ci * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 248c2ecf20Sopenharmony_ci * 258c2ecf20Sopenharmony_ci * Otherwise, the following license terms apply: 268c2ecf20Sopenharmony_ci * 278c2ecf20Sopenharmony_ci * * Redistribution and use in source and binary forms, with or without 288c2ecf20Sopenharmony_ci * * modification, are permitted provided that the following conditions 298c2ecf20Sopenharmony_ci * * are met: 308c2ecf20Sopenharmony_ci * * 1) Redistributions of source code must retain the above copyright 318c2ecf20Sopenharmony_ci * * notice, this list of conditions and the following disclaimer. 328c2ecf20Sopenharmony_ci * * 2) Redistributions in binary form must reproduce the above copyright 338c2ecf20Sopenharmony_ci * * notice, this list of conditions and the following disclaimer in the 348c2ecf20Sopenharmony_ci * * documentation and/or other materials provided with the distribution. 358c2ecf20Sopenharmony_ci * * 3) The name of the author may not be used to endorse or promote products 368c2ecf20Sopenharmony_ci * * derived from this software without specific prior written permission. 378c2ecf20Sopenharmony_ci * * 388c2ecf20Sopenharmony_ci * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 398c2ecf20Sopenharmony_ci * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 408c2ecf20Sopenharmony_ci * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 418c2ecf20Sopenharmony_ci * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 428c2ecf20Sopenharmony_ci * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 438c2ecf20Sopenharmony_ci * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 448c2ecf20Sopenharmony_ci * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 458c2ecf20Sopenharmony_ci * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 468c2ecf20Sopenharmony_ci * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 478c2ecf20Sopenharmony_ci * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 488c2ecf20Sopenharmony_ci * 498c2ecf20Sopenharmony_ci * Author: Thomas Winischhofer <thomas@winischhofer.net> 508c2ecf20Sopenharmony_ci * 518c2ecf20Sopenharmony_ci */ 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#ifndef _INIT301_H_ 548c2ecf20Sopenharmony_ci#define _INIT301_H_ 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#include "initdef.h" 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#include "vgatypes.h" 598c2ecf20Sopenharmony_ci#include "vstruct.h" 608c2ecf20Sopenharmony_ci#ifdef SIS_CP 618c2ecf20Sopenharmony_ci#undef SIS_CP 628c2ecf20Sopenharmony_ci#endif 638c2ecf20Sopenharmony_ci#include <linux/types.h> 648c2ecf20Sopenharmony_ci#include <asm/io.h> 658c2ecf20Sopenharmony_ci#include <linux/fb.h> 668c2ecf20Sopenharmony_ci#include "sis.h" 678c2ecf20Sopenharmony_ci#include <video/sisfb.h> 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_civoid SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 708c2ecf20Sopenharmony_civoid SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 718c2ecf20Sopenharmony_ciunsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 728c2ecf20Sopenharmony_civoid SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 738c2ecf20Sopenharmony_cibool SiS_IsDualEdge(struct SiS_Private *SiS_Pr); 748c2ecf20Sopenharmony_cibool SiS_IsVAMode(struct SiS_Private *SiS_Pr); 758c2ecf20Sopenharmony_civoid SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 768c2ecf20Sopenharmony_ci unsigned short ModeIdIndex, int checkcrt2mode); 778c2ecf20Sopenharmony_civoid SiS_SetYPbPr(struct SiS_Private *SiS_Pr); 788c2ecf20Sopenharmony_civoid SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 798c2ecf20Sopenharmony_ci unsigned short ModeIdIndex); 808c2ecf20Sopenharmony_civoid SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 818c2ecf20Sopenharmony_ci unsigned short ModeIdIndex); 828c2ecf20Sopenharmony_ciunsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 838c2ecf20Sopenharmony_ci unsigned short RefreshRateTableIndex); 848c2ecf20Sopenharmony_ciunsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex); 858c2ecf20Sopenharmony_civoid SiS_DisableBridge(struct SiS_Private *SiS_Pr); 868c2ecf20Sopenharmony_cibool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 878c2ecf20Sopenharmony_civoid SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 888c2ecf20Sopenharmony_civoid SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_civoid SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 918c2ecf20Sopenharmony_ciunsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 928c2ecf20Sopenharmony_civoid SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 938c2ecf20Sopenharmony_ciunsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 948c2ecf20Sopenharmony_civoid SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 958c2ecf20Sopenharmony_ci unsigned char orval,unsigned short andval); 968c2ecf20Sopenharmony_ci#ifdef CONFIG_FB_SIS_315 978c2ecf20Sopenharmony_civoid SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr); 988c2ecf20Sopenharmony_civoid SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 998c2ecf20Sopenharmony_ci#endif /* 315 */ 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#ifdef CONFIG_FB_SIS_300 1028c2ecf20Sopenharmony_civoid SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 1038c2ecf20Sopenharmony_ci#endif 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_civoid SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime); 1068c2ecf20Sopenharmony_ciunsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr); 1078c2ecf20Sopenharmony_ciunsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 1088c2ecf20Sopenharmony_ci unsigned short adaptnum, unsigned short DDCdatatype, 1098c2ecf20Sopenharmony_ci unsigned char *buffer, unsigned int VBFlags2); 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ciextern void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 1128c2ecf20Sopenharmony_ciextern void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 1138c2ecf20Sopenharmony_ciextern bool SiS_SearchModeID(struct SiS_Private *, unsigned short *, unsigned short *); 1148c2ecf20Sopenharmony_ciextern unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1158c2ecf20Sopenharmony_ci unsigned short ModeIdIndex); 1168c2ecf20Sopenharmony_ciextern unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1178c2ecf20Sopenharmony_ciextern unsigned short SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1188c2ecf20Sopenharmony_ciextern unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 1198c2ecf20Sopenharmony_ci unsigned short RefreshRateTableIndex); 1208c2ecf20Sopenharmony_ciextern void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1218c2ecf20Sopenharmony_ci unsigned short ModeIdIndex); 1228c2ecf20Sopenharmony_ciextern void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1238c2ecf20Sopenharmony_ci unsigned short ModeIdIndex); 1248c2ecf20Sopenharmony_ciextern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1258c2ecf20Sopenharmony_ciextern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 1268c2ecf20Sopenharmony_ciextern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 1278c2ecf20Sopenharmony_ci#ifdef CONFIG_FB_SIS_300 1288c2ecf20Sopenharmony_ciextern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *tempbx, 1298c2ecf20Sopenharmony_ci unsigned short *tempcl); 1308c2ecf20Sopenharmony_ciextern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl); 1318c2ecf20Sopenharmony_ciextern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1328c2ecf20Sopenharmony_ciextern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1338c2ecf20Sopenharmony_ciextern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1348c2ecf20Sopenharmony_ci#endif 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci#endif 137