Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
0002 /* $XFree86$ */
0003 /* $XdotOrg$ */
0004 /*
0005  * Data and prototypes for init.c
0006  *
0007  * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
0008  *
0009  * If distributed as part of the Linux kernel, the following license terms
0010  * apply:
0011  *
0012  * * This program is free software; you can redistribute it and/or modify
0013  * * it under the terms of the GNU General Public License as published by
0014  * * the Free Software Foundation; either version 2 of the named License,
0015  * * or any later version.
0016  * *
0017  * * This program is distributed in the hope that it will be useful,
0018  * * but WITHOUT ANY WARRANTY; without even the implied warranty of
0019  * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020  * * GNU General Public License for more details.
0021  * *
0022  * * You should have received a copy of the GNU General Public License
0023  * * along with this program; if not, write to the Free Software
0024  * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
0025  *
0026  * Otherwise, the following license terms apply:
0027  *
0028  * * Redistribution and use in source and binary forms, with or without
0029  * * modification, are permitted provided that the following conditions
0030  * * are met:
0031  * * 1) Redistributions of source code must retain the above copyright
0032  * *    notice, this list of conditions and the following disclaimer.
0033  * * 2) Redistributions in binary form must reproduce the above copyright
0034  * *    notice, this list of conditions and the following disclaimer in the
0035  * *    documentation and/or other materials provided with the distribution.
0036  * * 3) The name of the author may not be used to endorse or promote products
0037  * *    derived from this software without specific prior written permission.
0038  * *
0039  * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
0040  * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0041  * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
0042  * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
0043  * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
0044  * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0045  * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0046  * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0047  * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
0048  * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0049  *
0050  * Author:  Thomas Winischhofer <thomas@winischhofer.net>
0051  *
0052  */
0053 
0054 #ifndef _SISUSB_INIT_H_
0055 #define _SISUSB_INIT_H_
0056 
0057 /* SiS_ModeType */
0058 #define ModeText        0x00
0059 #define ModeCGA         0x01
0060 #define ModeEGA         0x02
0061 #define ModeVGA         0x03
0062 #define Mode15Bpp       0x04
0063 #define Mode16Bpp       0x05
0064 #define Mode24Bpp       0x06
0065 #define Mode32Bpp       0x07
0066 
0067 #define ModeTypeMask        0x07
0068 #define IsTextMode      0x07
0069 
0070 #define DACInfoFlag     0x0018
0071 #define MemoryInfoFlag      0x01E0
0072 #define MemorySizeShift     5
0073 
0074 /* modeflag */
0075 #define Charx8Dot       0x0200
0076 #define LineCompareOff      0x0400
0077 #define CRT2Mode        0x0800
0078 #define HalfDCLK        0x1000
0079 #define NoSupportSimuTV     0x2000
0080 #define NoSupportLCDScale   0x4000  /* SiS bridge: No scaling possible (no matter what panel) */
0081 #define DoubleScanMode      0x8000
0082 
0083 /* Infoflag */
0084 #define SupportTV       0x0008
0085 #define SupportTV1024       0x0800
0086 #define SupportCHTV     0x0800
0087 #define Support64048060Hz   0x0800  /* Special for 640x480 LCD */
0088 #define SupportHiVision     0x0010
0089 #define SupportYPbPr750p    0x1000
0090 #define SupportLCD      0x0020
0091 #define SupportRAMDAC2      0x0040  /* All           (<= 100Mhz) */
0092 #define SupportRAMDAC2_135  0x0100  /* All except DH (<= 135Mhz) */
0093 #define SupportRAMDAC2_162  0x0200  /* B, C          (<= 162Mhz) */
0094 #define SupportRAMDAC2_202  0x0400  /* C             (<= 202Mhz) */
0095 #define InterlaceMode       0x0080
0096 #define SyncPP          0x0000
0097 #define SyncPN          0x4000
0098 #define SyncNP          0x8000
0099 #define SyncNN          0xc000
0100 
0101 /* SetFlag */
0102 #define ProgrammingCRT2     0x0001
0103 #define LowModeTests        0x0002
0104 #define LCDVESATiming       0x0008
0105 #define EnableLVDSDDA       0x0010
0106 #define SetDispDevSwitchFlag    0x0020
0107 #define CheckWinDos     0x0040
0108 #define SetDOSMode      0x0080
0109 
0110 /* Index in ModeResInfo table */
0111 #define SIS_RI_320x200      0
0112 #define SIS_RI_320x240      1
0113 #define SIS_RI_320x400      2
0114 #define SIS_RI_400x300      3
0115 #define SIS_RI_512x384      4
0116 #define SIS_RI_640x400      5
0117 #define SIS_RI_640x480      6
0118 #define SIS_RI_800x600      7
0119 #define SIS_RI_1024x768     8
0120 #define SIS_RI_1280x1024    9
0121 #define SIS_RI_1600x1200    10
0122 #define SIS_RI_1920x1440    11
0123 #define SIS_RI_2048x1536    12
0124 #define SIS_RI_720x480      13
0125 #define SIS_RI_720x576      14
0126 #define SIS_RI_1280x960     15
0127 #define SIS_RI_800x480      16
0128 #define SIS_RI_1024x576     17
0129 #define SIS_RI_1280x720     18
0130 #define SIS_RI_856x480      19
0131 #define SIS_RI_1280x768     20
0132 #define SIS_RI_1400x1050    21
0133 #define SIS_RI_1152x864     22  /* Up to here SiS conforming */
0134 #define SIS_RI_848x480      23
0135 #define SIS_RI_1360x768     24
0136 #define SIS_RI_1024x600     25
0137 #define SIS_RI_1152x768     26
0138 #define SIS_RI_768x576      27
0139 #define SIS_RI_1360x1024    28
0140 #define SIS_RI_1680x1050    29
0141 #define SIS_RI_1280x800     30
0142 #define SIS_RI_1920x1080    31
0143 #define SIS_RI_960x540      32
0144 #define SIS_RI_960x600      33
0145 
0146 #define SIS_VIDEO_CAPTURE   0x00 - 0x30
0147 #define SIS_VIDEO_PLAYBACK  0x02 - 0x30
0148 #define SIS_CRT2_PORT_04    0x04 - 0x30
0149 
0150 int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
0151 int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo);
0152 
0153 extern int sisusb_setreg(struct sisusb_usb_data *sisusb, u32 port, u8 data);
0154 extern int sisusb_getreg(struct sisusb_usb_data *sisusb, u32 port, u8 * data);
0155 extern int sisusb_setidxreg(struct sisusb_usb_data *sisusb, u32 port,
0156                 u8 index, u8 data);
0157 extern int sisusb_getidxreg(struct sisusb_usb_data *sisusb, u32 port,
0158                 u8 index, u8 * data);
0159 extern int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, u32 port,
0160                  u8 idx, u8 myand, u8 myor);
0161 extern int sisusb_setidxregor(struct sisusb_usb_data *sisusb, u32 port,
0162                   u8 index, u8 myor);
0163 extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, u32 port,
0164                    u8 idx, u8 myand);
0165 
0166 void sisusb_delete(struct kref *kref);
0167 int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data);
0168 int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 * data);
0169 int sisusb_copy_memory(struct sisusb_usb_data *sisusb, u8 *src,
0170                u32 dest, int length);
0171 int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init);
0172 int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot,
0173              u8 * arg, int cmapsz, int ch512, int dorecalc,
0174              struct vc_data *c, int fh, int uplock);
0175 void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location);
0176 int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last);
0177 void sisusb_console_exit(struct sisusb_usb_data *sisusb);
0178 void sisusb_init_concode(void);
0179 
0180 #endif