sisusb_init.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
  2. /* $XFree86$ */
  3. /* $XdotOrg$ */
  4. /*
  5. * Data and prototypes for init.c
  6. *
  7. * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
  8. *
  9. * If distributed as part of the Linux kernel, the following license terms
  10. * apply:
  11. *
  12. * * This program is free software; you can redistribute it and/or modify
  13. * * it under the terms of the GNU General Public License as published by
  14. * * the Free Software Foundation; either version 2 of the named License,
  15. * * or any later version.
  16. * *
  17. * * This program is distributed in the hope that it will be useful,
  18. * * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * * GNU General Public License for more details.
  21. * *
  22. * * You should have received a copy of the GNU General Public License
  23. * * along with this program; if not, write to the Free Software
  24. * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  25. *
  26. * Otherwise, the following license terms apply:
  27. *
  28. * * Redistribution and use in source and binary forms, with or without
  29. * * modification, are permitted provided that the following conditions
  30. * * are met:
  31. * * 1) Redistributions of source code must retain the above copyright
  32. * * notice, this list of conditions and the following disclaimer.
  33. * * 2) Redistributions in binary form must reproduce the above copyright
  34. * * notice, this list of conditions and the following disclaimer in the
  35. * * documentation and/or other materials provided with the distribution.
  36. * * 3) The name of the author may not be used to endorse or promote products
  37. * * derived from this software without specific prior written permission.
  38. * *
  39. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  40. * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  41. * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  42. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  43. * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  44. * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  45. * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  46. * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  47. * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  48. * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  49. *
  50. * Author: Thomas Winischhofer <[email protected]>
  51. *
  52. */
  53. #ifndef _SISUSB_INIT_H_
  54. #define _SISUSB_INIT_H_
  55. /* SiS_ModeType */
  56. #define ModeText 0x00
  57. #define ModeCGA 0x01
  58. #define ModeEGA 0x02
  59. #define ModeVGA 0x03
  60. #define Mode15Bpp 0x04
  61. #define Mode16Bpp 0x05
  62. #define Mode24Bpp 0x06
  63. #define Mode32Bpp 0x07
  64. #define ModeTypeMask 0x07
  65. #define IsTextMode 0x07
  66. #define DACInfoFlag 0x0018
  67. #define MemoryInfoFlag 0x01E0
  68. #define MemorySizeShift 5
  69. /* modeflag */
  70. #define Charx8Dot 0x0200
  71. #define LineCompareOff 0x0400
  72. #define CRT2Mode 0x0800
  73. #define HalfDCLK 0x1000
  74. #define NoSupportSimuTV 0x2000
  75. #define NoSupportLCDScale 0x4000 /* SiS bridge: No scaling possible (no matter what panel) */
  76. #define DoubleScanMode 0x8000
  77. /* Infoflag */
  78. #define SupportTV 0x0008
  79. #define SupportTV1024 0x0800
  80. #define SupportCHTV 0x0800
  81. #define Support64048060Hz 0x0800 /* Special for 640x480 LCD */
  82. #define SupportHiVision 0x0010
  83. #define SupportYPbPr750p 0x1000
  84. #define SupportLCD 0x0020
  85. #define SupportRAMDAC2 0x0040 /* All (<= 100Mhz) */
  86. #define SupportRAMDAC2_135 0x0100 /* All except DH (<= 135Mhz) */
  87. #define SupportRAMDAC2_162 0x0200 /* B, C (<= 162Mhz) */
  88. #define SupportRAMDAC2_202 0x0400 /* C (<= 202Mhz) */
  89. #define InterlaceMode 0x0080
  90. #define SyncPP 0x0000
  91. #define SyncPN 0x4000
  92. #define SyncNP 0x8000
  93. #define SyncNN 0xc000
  94. /* SetFlag */
  95. #define ProgrammingCRT2 0x0001
  96. #define LowModeTests 0x0002
  97. #define LCDVESATiming 0x0008
  98. #define EnableLVDSDDA 0x0010
  99. #define SetDispDevSwitchFlag 0x0020
  100. #define CheckWinDos 0x0040
  101. #define SetDOSMode 0x0080
  102. /* Index in ModeResInfo table */
  103. #define SIS_RI_320x200 0
  104. #define SIS_RI_320x240 1
  105. #define SIS_RI_320x400 2
  106. #define SIS_RI_400x300 3
  107. #define SIS_RI_512x384 4
  108. #define SIS_RI_640x400 5
  109. #define SIS_RI_640x480 6
  110. #define SIS_RI_800x600 7
  111. #define SIS_RI_1024x768 8
  112. #define SIS_RI_1280x1024 9
  113. #define SIS_RI_1600x1200 10
  114. #define SIS_RI_1920x1440 11
  115. #define SIS_RI_2048x1536 12
  116. #define SIS_RI_720x480 13
  117. #define SIS_RI_720x576 14
  118. #define SIS_RI_1280x960 15
  119. #define SIS_RI_800x480 16
  120. #define SIS_RI_1024x576 17
  121. #define SIS_RI_1280x720 18
  122. #define SIS_RI_856x480 19
  123. #define SIS_RI_1280x768 20
  124. #define SIS_RI_1400x1050 21
  125. #define SIS_RI_1152x864 22 /* Up to here SiS conforming */
  126. #define SIS_RI_848x480 23
  127. #define SIS_RI_1360x768 24
  128. #define SIS_RI_1024x600 25
  129. #define SIS_RI_1152x768 26
  130. #define SIS_RI_768x576 27
  131. #define SIS_RI_1360x1024 28
  132. #define SIS_RI_1680x1050 29
  133. #define SIS_RI_1280x800 30
  134. #define SIS_RI_1920x1080 31
  135. #define SIS_RI_960x540 32
  136. #define SIS_RI_960x600 33
  137. #define SIS_VIDEO_CAPTURE 0x00 - 0x30
  138. #define SIS_VIDEO_PLAYBACK 0x02 - 0x30
  139. #define SIS_CRT2_PORT_04 0x04 - 0x30
  140. int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
  141. int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo);
  142. extern int sisusb_setreg(struct sisusb_usb_data *sisusb, u32 port, u8 data);
  143. extern int sisusb_getreg(struct sisusb_usb_data *sisusb, u32 port, u8 * data);
  144. extern int sisusb_setidxreg(struct sisusb_usb_data *sisusb, u32 port,
  145. u8 index, u8 data);
  146. extern int sisusb_getidxreg(struct sisusb_usb_data *sisusb, u32 port,
  147. u8 index, u8 * data);
  148. extern int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, u32 port,
  149. u8 idx, u8 myand, u8 myor);
  150. extern int sisusb_setidxregor(struct sisusb_usb_data *sisusb, u32 port,
  151. u8 index, u8 myor);
  152. extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, u32 port,
  153. u8 idx, u8 myand);
  154. void sisusb_delete(struct kref *kref);
  155. int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data);
  156. int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 * data);
  157. int sisusb_copy_memory(struct sisusb_usb_data *sisusb, u8 *src,
  158. u32 dest, int length);
  159. int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init);
  160. int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot,
  161. u8 * arg, int cmapsz, int ch512, int dorecalc,
  162. struct vc_data *c, int fh, int uplock);
  163. void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location);
  164. int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last);
  165. void sisusb_console_exit(struct sisusb_usb_data *sisusb);
  166. void sisusb_init_concode(void);
  167. #endif