linux/drivers/video/fbdev/sis/initdef.h

/* $XFree86$ */
/* $XdotOrg$ */
/*
 * Global definitions for init.c and init301.c
 *
 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
 *
 * If distributed as part of the Linux kernel, the following license terms
 * apply:
 *
 * * This program is free software; you can redistribute it and/or modify
 * * it under the terms of the GNU General Public License as published by
 * * the Free Software Foundation; either version 2 of the named License,
 * * or any later version.
 * *
 * * This program is distributed in the hope that it will be useful,
 * * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * * GNU General Public License for more details.
 * *
 * * You should have received a copy of the GNU General Public License
 * * along with this program; if not, write to the Free Software
 * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 *
 * Otherwise, the following license terms apply:
 *
 * * Redistribution and use in source and binary forms, with or without
 * * modification, are permitted provided that the following conditions
 * * are met:
 * * 1) Redistributions of source code must retain the above copyright
 * *    notice, this list of conditions and the following disclaimer.
 * * 2) Redistributions in binary form must reproduce the above copyright
 * *    notice, this list of conditions and the following disclaimer in the
 * *    documentation and/or other materials provided with the distribution.
 * * 3) The name of the author may not be used to endorse or promote products
 * *    derived from this software without specific prior written permission.
 * *
 * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Author: 	Thomas Winischhofer <[email protected]>
 *
 */

#ifndef _INITDEF_
#define _INITDEF_

#define IS_SIS330
#define IS_SIS550
#define IS_SIS650
#define IS_SIS740
#define IS_SIS651
#define IS_SISM650
#define IS_SIS65x
#define IS_SIS661
#define IS_SIS741
#define IS_SIS660
#define IS_SIS760
#define IS_SIS761
#define IS_SIS661741660760
#define IS_SIS650740
#define IS_SIS550650740
#define IS_SIS650740660
#define IS_SIS550650740660

#define SISGETROMW(x)

/* SiS_VBType */
#define VB_SIS301
#define VB_SIS301B
#define VB_SIS302B
#define VB_SIS301LV
#define VB_SIS302LV
#define VB_SIS302ELV
#define VB_SIS301C
#define VB_SIS307T
#define VB_SIS307LV
#define VB_UMC
#define VB_NoLCD
#define VB_SIS30xB
#define VB_SIS30xC
#define VB_SISTMDS
#define VB_SISLVDS
#define VB_SIS30xBLV
#define VB_SIS30xCLV
#define VB_SISVB
#define VB_SISLCDA
#define VB_SISTMDSLCDA
#define VB_SISPART4SCALER
#define VB_SISHIVISION
#define VB_SISYPBPR
#define VB_SISTAP4SCALER
#define VB_SISPART4OVERFLOW
#define VB_SISPWD
#define VB_SISEMI
#define VB_SISPOWER
#define VB_SISDUALLINK
#define VB_SISVGA2
#define VB_SISRAMDAC202

/* VBInfo */
#define SetSimuScanMode
#define SwitchCRT2
#define SetCRT2ToAVIDEO
#define SetCRT2ToSVIDEO
#define SetCRT2ToSCART
#define SetCRT2ToLCD
#define SetCRT2ToRAMDAC
#define SetCRT2ToHiVision
#define SetCRT2ToCHYPbPr
#define SetNTSCTV
#define SetPALTV
#define SetInSlaveMode
#define SetNotSimuMode
#define SetNotSimuTVMode
#define SetDispDevSwitch
#define SetCRT2ToYPbPr525750
#define LoadDACFlag
#define DisableCRT2Display
#define DriverMode
#define HotKeySwitch
#define SetCRT2ToLCDA

/* v-- Needs change in sis_vga.c if changed (GPIO) --v */
#define SetCRT2ToTV
#define SetCRT2ToTVNoYPbPrHiVision
#define SetCRT2ToTVNoHiVision

/* SiS_ModeType */
#define ModeText
#define ModeCGA
#define ModeEGA
#define ModeVGA
#define Mode15Bpp
#define Mode16Bpp
#define Mode24Bpp
#define Mode32Bpp

#define ModeTypeMask
#define IsTextMode

#define DACInfoFlag
#define MemoryInfoFlag
#define MemorySizeShift

/* modeflag */
#define Charx8Dot
#define LineCompareOff
#define CRT2Mode
#define HalfDCLK
#define NoSupportSimuTV
#define NoSupportLCDScale
#define DoubleScanMode

/* Infoflag */
#define SupportTV
#define SupportTV1024
#define SupportCHTV
#define Support64048060Hz
#define SupportHiVision
#define SupportYPbPr750p
#define SupportLCD
#define SupportRAMDAC2
#define SupportRAMDAC2_135
#define SupportRAMDAC2_162
#define SupportRAMDAC2_202
#define InterlaceMode
#define SyncPP
#define HaveWideTiming
#define SyncPN
#define SyncNP
#define SyncNN

/* SetFlag */
#define ProgrammingCRT2
#define LowModeTests
/* #define TVSimuMode           0x0002 - deprecated */
/* #define RPLLDIV2XO           0x0004 - deprecated */
#define LCDVESATiming
#define EnableLVDSDDA
#define SetDispDevSwitchFlag
#define CheckWinDos
#define SetDOSMode

/* TVMode flag */
#define TVSetPAL
#define TVSetNTSCJ
#define TVSetPALM
#define TVSetPALN
#define TVSetCHOverScan
#define TVSetYPbPr525i
#define TVSetYPbPr525p
#define TVSetYPbPr750p
#define TVSetHiVision
#define TVSetTVSimuMode
#define TVRPLLDIV2XO
#define TVSetNTSC1024
#define TVSet525p1024
#define TVAspect43
#define TVAspect169
#define TVAspect43LB

/* YPbPr flag (>=315, <661; converted to TVMode) */
#define YPbPr525p
#define YPbPr750p
#define YPbPr525i
#define YPbPrHiVision
#define YPbPrModeMask

/* SysFlags (to identify special versions) */
#define SF_Is651
#define SF_IsM650
#define SF_Is652
#define SF_IsM652
#define SF_IsM653
#define SF_IsM661
#define SF_IsM741
#define SF_IsM760
#define SF_760UMA
#define SF_760LFB

/* CR32 (Newer 630, and 315 series)

   [0]   VB connected with CVBS
   [1]   VB connected with SVHS
   [2]   VB connected with SCART
   [3]   VB connected with LCD
   [4]   VB connected with CRT2 (secondary VGA)
   [5]   CRT1 monitor is connected
   [6]   VB connected with Hi-Vision TV
   [7]   <= 330: VB connected with DVI combo connector
         >= 661: VB connected to YPbPr
*/

/* CR35 (300 series only) */
#define TVOverScan
#define TVOverScanShift

/* CR35 (661 series only)
   [0]    1 = PAL, 0 = NTSC
   [1]    1 = NTSC-J (if D0 = 0)
   [2]    1 = PALM (if D0 = 1)
   [3]    1 = PALN (if D0 = 1)
   [4]    1 = Overscan (Chrontel only)
   [7:5]  (only if D2 in CR38 is set)
	  000  525i
	  001  525p
	  010  750p
	  011  1080i (or HiVision on 301, 301B)
*/

/* CR37
   [0]   Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS)
   [3:1] External chip
         300 series:
	    001   SiS301 (never seen)
	    010   LVDS
	    011   LVDS + Tumpion Zurac
	    100   LVDS + Chrontel 7005
	    110   Chrontel 7005
	  315/330 series
	    001   SiS30x (never seen)
	    010   LVDS
	    011   LVDS + Chrontel 7019
	  660 series [2:1] only:
	     reserved (chip type now in CR38)
	  All other combinations reserved
   [3]    661 only: Pass 1:1 data
   [4]    LVDS: 0: Panel Link expands / 1: Panel Link does not expand
          30x:  0: Bridge scales      / 1: Bridge does not scale = Panel scales (if possible)
   [5]    LCD polarity select
          0: VESA DMT Standard
	  1: EDID 2.x defined
   [6]    LCD horizontal polarity select
          0: High active
	  1: Low active
   [7]    LCD vertical polarity select
          0: High active
	  1: Low active
*/

/* CR37: LCDInfo */
#define LCDRGB18Bit
#define LCDNonExpanding
#define LCDSync
#define LCDPass11
#define LCDDualLink

#define DontExpandLCD
#define LCDNonExpandingShift
#define DontExpandLCDShift
#define LCDSyncBit
#define LCDSyncShift

/* CR38 (315 series) */
#define EnableDualEdge
#define SetToLCDA
#define EnableCHScart
#define EnableCHYPbPr
#define EnableSiSYPbPr
#define EnableYPbPr525i
#define EnableYPbPr525p
#define EnableYPbPr750p
#define EnableYPbPr1080i
#define EnablePALM
#define EnablePALN
#define EnableNTSCJ

/* CR38 (661 and later)
  D[7:5]  000 No VB
          001 301 series VB
	  010 LVDS
	  011 Chrontel 7019
	  100 Conexant
  D2      Enable YPbPr output (see CR35)
  D[1:0]  LCDA (like before)
*/

#define EnablePALMN

/* CR39 (650 only) */
#define LCDPass1_1
#define Enable302LV_DualLink

/* CR39 (661 and later)
   D[7]   LVDS (SiS or third party)
   D[1:0] YPbPr Aspect Ratio
          00 4:3 letterbox
	  01 4:3
	  10 16:9
	  11 4:3
*/

/* CR3B (651+301C)
   D[1:0] YPbPr Aspect Ratio
          ?
*/

/* CR79 (315/330 series only; not 661 and later)
   [3-0] Notify driver
         0001 Mode Switch event (set by BIOS)
	 0010 Epansion On/Off event
	 0011 TV UnderScan/OverScan event
	 0100 Set Brightness event
	 0101 Set Contrast event
	 0110 Set Mute event
	 0111 Set Volume Up/Down event
   [4]   Enable Backlight Control by BIOS/driver
         (set by driver; set means that the BIOS should
	 not touch the backlight registers because eg.
	 the driver already switched off the backlight)
   [5]   PAL/NTSC (set by BIOS)
   [6]   Expansion On/Off (set by BIOS; copied to CR32[4])
   [7]   TV UnderScan/OverScan (set by BIOS)
*/

/* CR7C - 661 and later
   [7]   DualEdge enabled (or: to be enabled)
   [6]   CRT2 = TV/LCD/VGA enabled (or: to be enabled)
   [5]   Init done (set at end of SiS_Init)
   {4]   LVDS LCD capabilities
   [3]   LVDS LCD capabilities
   [2]   LVDS LCD capabilities (PWD)
   [1]   LVDS LCD capabilities (PWD)
   [0]   LVDS=1, TMDS=0 (SiS or third party)
*/

/* CR7E - 661 and later
   VBType:
   [7] LVDS (third party)
   [3] 301C
   [2] 302LV
   [1] 301LV
   [0] 301B
*/

/* LCDResInfo */
#define Panel300_800x600
#define Panel300_1024x768
#define Panel300_1280x1024
#define Panel300_1280x960
#define Panel300_640x480
#define Panel300_1024x600
#define Panel300_1152x768
#define Panel300_1280x768
#define Panel300_Custom
#define Panel300_Barco1366

#define Panel310_800x600
#define Panel310_1024x768
#define Panel310_1280x1024
#define Panel310_640x480
#define Panel310_1024x600
#define Panel310_1152x864
#define Panel310_1280x960
#define Panel310_1152x768
#define Panel310_1400x1050
#define Panel310_1280x768
#define Panel310_1600x1200
#define Panel310_320x240_2
#define Panel310_320x240_3
#define Panel310_320x240_1
#define Panel310_Custom

#define Panel661_800x600
#define Panel661_1024x768
#define Panel661_1280x1024
#define Panel661_640x480
#define Panel661_1024x600
#define Panel661_1152x864
#define Panel661_1280x960
#define Panel661_1280x854
#define Panel661_1400x1050
#define Panel661_1280x768
#define Panel661_1600x1200
#define Panel661_1280x800
#define Panel661_1680x1050
#define Panel661_1280x720
#define Panel661_Custom

#define Panel_800x600
#define Panel_1024x768
#define Panel_1280x1024
#define Panel_640x480
#define Panel_1024x600
#define Panel_1152x864
#define Panel_1280x960
#define Panel_1152x768
#define Panel_1400x1050
#define Panel_1280x768
#define Panel_1600x1200
#define Panel_1280x800
#define Panel_1680x1050
#define Panel_1280x720
#define Panel_Custom
#define Panel_320x240_1
#define Panel_Barco1366
#define Panel_848x480
#define Panel_320x240_2
#define Panel_320x240_3
#define Panel_1280x768_2
#define Panel_1280x768_3
#define Panel_1280x800_2
#define Panel_856x480
#define Panel_1280x854

/* Index in ModeResInfo table */
#define SIS_RI_320x200
#define SIS_RI_320x240
#define SIS_RI_320x400
#define SIS_RI_400x300
#define SIS_RI_512x384
#define SIS_RI_640x400
#define SIS_RI_640x480
#define SIS_RI_800x600
#define SIS_RI_1024x768
#define SIS_RI_1280x1024
#define SIS_RI_1600x1200
#define SIS_RI_1920x1440
#define SIS_RI_2048x1536
#define SIS_RI_720x480
#define SIS_RI_720x576
#define SIS_RI_1280x960
#define SIS_RI_800x480
#define SIS_RI_1024x576
#define SIS_RI_1280x720
#define SIS_RI_856x480
#define SIS_RI_1280x768
#define SIS_RI_1400x1050
#define SIS_RI_1152x864
#define SIS_RI_848x480
#define SIS_RI_1360x768
#define SIS_RI_1024x600
#define SIS_RI_1152x768
#define SIS_RI_768x576
#define SIS_RI_1360x1024
#define SIS_RI_1680x1050
#define SIS_RI_1280x800
#define SIS_RI_1920x1080
#define SIS_RI_960x540
#define SIS_RI_960x600
#define SIS_RI_1280x854

/* CR5F */
#define IsM650

/* Timing data */
#define NTSCHT
#define NTSC2HT
#define NTSCVT
#define PALHT
#define PALVT
#define StHiTVHT
#define StHiTVVT
#define StHiTextTVHT
#define StHiTextTVVT
#define ExtHiTVHT
#define ExtHiTVVT

/* Indices in (VB)VCLKData tables */

#define VCLK28
#define VCLK40
#define VCLK65_300
#define VCLK108_2_300
#define VCLK81_300
#define VCLK108_3_300
#define VCLK100_300
#define VCLK34_300
#define VCLK_CUSTOM_300

#define VCLK65_315
#define VCLK108_2_315
#define VCLK81_315
#define VCLK162_315
#define VCLK108_3_315
#define VCLK100_315
#define VCLK34_315
#define VCLK68_315
#define VCLK_1280x800_315_2
#define VCLK121_315
#define VCLK130_315
#define VCLK_1280x720
#define VCLK_1280x768_2
#define VCLK_1280x768_3
#define VCLK_CUSTOM_315
#define VCLK_1280x720_2
#define VCLK_720x480
#define VCLK_720x576
#define VCLK_768x576
#define VCLK_848x480
#define VCLK_856x480
#define VCLK_800x480
#define VCLK_1024x576
#define VCLK_1152x864
#define VCLK_1360x768
#define VCLK_1280x800_315
#define VCLK_1280x854

#define TVCLKBASE_300
#define TVCLKBASE_315
#define TVVCLKDIV2
#define TVVCLK
#define HiTVVCLKDIV2
#define HiTVVCLK
#define HiTVSimuVCLK
#define HiTVTextVCLK
#define YPbPr750pVCLK

/* ------------------------------ */

#define SetSCARTOutput

#define HotPlugFunction

#define StStructSize

#define SIS_VIDEO_CAPTURE
#define SIS_VIDEO_PLAYBACK
#define SIS_CRT2_PORT_04
#define SIS_CRT2_PORT_10
#define SIS_CRT2_PORT_12
#define SIS_CRT2_PORT_14

#define ADR_CRT2PtrData
#define offset_Zurac
#define ADR_LVDSDesPtrData
#define ADR_LVDSCRT1DataPtr
#define ADR_CHTVVCLKPtr
#define ADR_CHTVRegDataPtr

#define LCDDataLen
#define HiTVDataLen
#define TVDataLen

#define LVDSDataLen
#define LVDSDesDataLen
#define ActiveNonExpanding
#define ActiveNonExpandingShift
#define ActivePAL
#define ActivePALShift
#define ModeSwitchStatus
#define SoftTVType
#define SoftSettingAddr
#define ModeSettingAddr

#define _PanelType00
#define _PanelType01
#define _PanelType02
#define _PanelType03
#define _PanelType04
#define _PanelType05
#define _PanelType06
#define _PanelType07
#define _PanelType08
#define _PanelType09
#define _PanelType0A
#define _PanelType0B
#define _PanelType0C
#define _PanelType0D
#define _PanelType0E
#define _PanelType0F

#define PRIMARY_VGA

#define BIOSIDCodeAddr
#define OEMUtilIDCodeAddr
#define VBModeIDTableAddr
#define OEMTVPtrAddr
#define PhaseTableAddr
#define NTSCFilterTableAddr
#define PALFilterTableAddr
#define OEMLCDPtr_1Addr
#define OEMLCDPtr_2Addr
#define LCDHPosTable_1Addr
#define LCDHPosTable_2Addr
#define LCDVPosTable_1Addr
#define LCDVPosTable_2Addr
#define OEMLCDPIDTableAddr

#define VBModeStructSize
#define PhaseTableSize
#define FilterTableSize
#define LCDHPosTableSize
#define LCDVPosTableSize
#define OEMLVDSPIDTableSize
#define LVDSHPosTableSize
#define LVDSVPosTableSize

#define VB_ModeID
#define VB_TVTableIndex
#define VB_LCDTableIndex
#define VB_LCDHIndex
#define VB_LCDVIndex

#define OEMLCDEnable
#define OEMLCDDelayEnable
#define OEMLCDPOSEnable
#define OEMTVEnable
#define OEMTVDelayEnable
#define OEMTVFlickerEnable
#define OEMTVPhaseEnable
#define OEMTVFilterEnable

#define OEMLCDPanelIDSupport

/*
  =============================================================
   		  for 315 series (old data layout)
  =============================================================
*/
#define SoftDRAMType
#define SoftSetting_OFFSET
#define SR07_OFFSET
#define SR15_OFFSET
#define SR16_OFFSET
#define SR17_OFFSET
#define SR19_OFFSET
#define SR1F_OFFSET
#define SR21_OFFSET
#define SR22_OFFSET
#define SR23_OFFSET
#define SR24_OFFSET
#define SR25_OFFSET
#define SR31_OFFSET
#define SR32_OFFSET
#define SR33_OFFSET

#define CR40_OFFSET
#define SR25_1_OFFSET
#define CR49_OFFSET

#define VB310Data_1_2_Offset
#define VB310Data_4_D_Offset
#define VB310Data_4_E_Offset
#define VB310Data_4_10_Offset

#define RGBSenseDataOffset
#define YCSenseDataOffset
#define VideoSenseDataOffset
#define OutputSelectOffset

#define ECLK_MCLK_DISTANCE
#define VBIOSTablePointerStart
#define StandTablePtrOffset
#define EModeIDTablePtrOffset
#define CRT1TablePtrOffset
#define ScreenOffsetPtrOffset
#define VCLKDataPtrOffset
#define MCLKDataPtrOffset
#define CRT2PtrDataPtrOffset
#define TVAntiFlickPtrOffset
#define TVDelayPtr1Offset
#define TVPhaseIncrPtr1Offset
#define TVYFilterPtr1Offset
#define LCDDelayPtr1Offset
#define TVEdgePtr1Offset
#define CRT2Delay1Offset

#endif