162306a36Sopenharmony_ci/* $XFree86$ */ 262306a36Sopenharmony_ci/* $XdotOrg$ */ 362306a36Sopenharmony_ci/* 462306a36Sopenharmony_ci * Data and prototypes for init301.c 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * If distributed as part of the Linux kernel, the following license terms 962306a36Sopenharmony_ci * apply: 1062306a36Sopenharmony_ci * 1162306a36Sopenharmony_ci * * This program is free software; you can redistribute it and/or modify 1262306a36Sopenharmony_ci * * it under the terms of the GNU General Public License as published by 1362306a36Sopenharmony_ci * * the Free Software Foundation; either version 2 of the named License, 1462306a36Sopenharmony_ci * * or any later version. 1562306a36Sopenharmony_ci * * 1662306a36Sopenharmony_ci * * This program is distributed in the hope that it will be useful, 1762306a36Sopenharmony_ci * * but WITHOUT ANY WARRANTY; without even the implied warranty of 1862306a36Sopenharmony_ci * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1962306a36Sopenharmony_ci * * GNU General Public License for more details. 2062306a36Sopenharmony_ci * * 2162306a36Sopenharmony_ci * * You should have received a copy of the GNU General Public License 2262306a36Sopenharmony_ci * * along with this program; if not, write to the Free Software 2362306a36Sopenharmony_ci * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 2462306a36Sopenharmony_ci * 2562306a36Sopenharmony_ci * Otherwise, the following license terms apply: 2662306a36Sopenharmony_ci * 2762306a36Sopenharmony_ci * * Redistribution and use in source and binary forms, with or without 2862306a36Sopenharmony_ci * * modification, are permitted provided that the following conditions 2962306a36Sopenharmony_ci * * are met: 3062306a36Sopenharmony_ci * * 1) Redistributions of source code must retain the above copyright 3162306a36Sopenharmony_ci * * notice, this list of conditions and the following disclaimer. 3262306a36Sopenharmony_ci * * 2) Redistributions in binary form must reproduce the above copyright 3362306a36Sopenharmony_ci * * notice, this list of conditions and the following disclaimer in the 3462306a36Sopenharmony_ci * * documentation and/or other materials provided with the distribution. 3562306a36Sopenharmony_ci * * 3) The name of the author may not be used to endorse or promote products 3662306a36Sopenharmony_ci * * derived from this software without specific prior written permission. 3762306a36Sopenharmony_ci * * 3862306a36Sopenharmony_ci * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 3962306a36Sopenharmony_ci * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 4062306a36Sopenharmony_ci * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 4162306a36Sopenharmony_ci * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 4262306a36Sopenharmony_ci * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 4362306a36Sopenharmony_ci * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 4462306a36Sopenharmony_ci * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 4562306a36Sopenharmony_ci * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 4662306a36Sopenharmony_ci * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 4762306a36Sopenharmony_ci * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4862306a36Sopenharmony_ci * 4962306a36Sopenharmony_ci * Author: Thomas Winischhofer <thomas@winischhofer.net> 5062306a36Sopenharmony_ci * 5162306a36Sopenharmony_ci */ 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci#ifndef _INIT301_H_ 5462306a36Sopenharmony_ci#define _INIT301_H_ 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci#include "initdef.h" 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci#include "vgatypes.h" 5962306a36Sopenharmony_ci#include "vstruct.h" 6062306a36Sopenharmony_ci#ifdef SIS_CP 6162306a36Sopenharmony_ci#undef SIS_CP 6262306a36Sopenharmony_ci#endif 6362306a36Sopenharmony_ci#include <linux/types.h> 6462306a36Sopenharmony_ci#include <asm/io.h> 6562306a36Sopenharmony_ci#include <linux/fb.h> 6662306a36Sopenharmony_ci#include "sis.h" 6762306a36Sopenharmony_ci#include <video/sisfb.h> 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_civoid SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 7062306a36Sopenharmony_civoid SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 7162306a36Sopenharmony_ciunsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 7262306a36Sopenharmony_civoid SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 7362306a36Sopenharmony_cibool SiS_IsDualEdge(struct SiS_Private *SiS_Pr); 7462306a36Sopenharmony_cibool SiS_IsVAMode(struct SiS_Private *SiS_Pr); 7562306a36Sopenharmony_civoid SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 7662306a36Sopenharmony_ci unsigned short ModeIdIndex, int checkcrt2mode); 7762306a36Sopenharmony_civoid SiS_SetYPbPr(struct SiS_Private *SiS_Pr); 7862306a36Sopenharmony_civoid SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 7962306a36Sopenharmony_ci unsigned short ModeIdIndex); 8062306a36Sopenharmony_civoid SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 8162306a36Sopenharmony_ci unsigned short ModeIdIndex); 8262306a36Sopenharmony_ciunsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 8362306a36Sopenharmony_ci unsigned short RefreshRateTableIndex); 8462306a36Sopenharmony_ciunsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex); 8562306a36Sopenharmony_civoid SiS_DisableBridge(struct SiS_Private *SiS_Pr); 8662306a36Sopenharmony_cibool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 8762306a36Sopenharmony_civoid SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 8862306a36Sopenharmony_civoid SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_civoid SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 9162306a36Sopenharmony_ciunsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 9262306a36Sopenharmony_civoid SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 9362306a36Sopenharmony_ciunsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 9462306a36Sopenharmony_civoid SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 9562306a36Sopenharmony_ci unsigned char orval,unsigned short andval); 9662306a36Sopenharmony_ci#ifdef CONFIG_FB_SIS_315 9762306a36Sopenharmony_civoid SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr); 9862306a36Sopenharmony_civoid SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 9962306a36Sopenharmony_ci#endif /* 315 */ 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci#ifdef CONFIG_FB_SIS_300 10262306a36Sopenharmony_civoid SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 10362306a36Sopenharmony_ci#endif 10462306a36Sopenharmony_ci 10562306a36Sopenharmony_civoid SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime); 10662306a36Sopenharmony_ciunsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr); 10762306a36Sopenharmony_ciunsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 10862306a36Sopenharmony_ci unsigned short adaptnum, unsigned short DDCdatatype, 10962306a36Sopenharmony_ci unsigned char *buffer, unsigned int VBFlags2); 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ciextern void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 11262306a36Sopenharmony_ciextern void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 11362306a36Sopenharmony_ciextern bool SiS_SearchModeID(struct SiS_Private *, unsigned short *, unsigned short *); 11462306a36Sopenharmony_ciextern unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 11562306a36Sopenharmony_ci unsigned short ModeIdIndex); 11662306a36Sopenharmony_ciextern unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 11762306a36Sopenharmony_ciextern unsigned short SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 11862306a36Sopenharmony_ciextern unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 11962306a36Sopenharmony_ci unsigned short RefreshRateTableIndex); 12062306a36Sopenharmony_ciextern void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 12162306a36Sopenharmony_ci unsigned short ModeIdIndex); 12262306a36Sopenharmony_ciextern void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 12362306a36Sopenharmony_ci unsigned short ModeIdIndex); 12462306a36Sopenharmony_ciextern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 12562306a36Sopenharmony_ciextern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 12662306a36Sopenharmony_ciextern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 12762306a36Sopenharmony_ci#ifdef CONFIG_FB_SIS_300 12862306a36Sopenharmony_ciextern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *tempbx, 12962306a36Sopenharmony_ci unsigned short *tempcl); 13062306a36Sopenharmony_ciextern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl); 13162306a36Sopenharmony_ciextern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 13262306a36Sopenharmony_ciextern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 13362306a36Sopenharmony_ciextern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 13462306a36Sopenharmony_ci#endif 13562306a36Sopenharmony_ci 13662306a36Sopenharmony_ci#endif 137