init301.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* $XFree86$ */
  2. /* $XdotOrg$ */
  3. /*
  4. * Data and prototypes for init301.c
  5. *
  6. * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
  7. *
  8. * If distributed as part of the Linux kernel, the following license terms
  9. * apply:
  10. *
  11. * * This program is free software; you can redistribute it and/or modify
  12. * * it under the terms of the GNU General Public License as published by
  13. * * the Free Software Foundation; either version 2 of the named License,
  14. * * or any later version.
  15. * *
  16. * * This program is distributed in the hope that it will be useful,
  17. * * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * * GNU General Public License for more details.
  20. * *
  21. * * You should have received a copy of the GNU General Public License
  22. * * along with this program; if not, write to the Free Software
  23. * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  24. *
  25. * Otherwise, the following license terms apply:
  26. *
  27. * * Redistribution and use in source and binary forms, with or without
  28. * * modification, are permitted provided that the following conditions
  29. * * are met:
  30. * * 1) Redistributions of source code must retain the above copyright
  31. * * notice, this list of conditions and the following disclaimer.
  32. * * 2) Redistributions in binary form must reproduce the above copyright
  33. * * notice, this list of conditions and the following disclaimer in the
  34. * * documentation and/or other materials provided with the distribution.
  35. * * 3) The name of the author may not be used to endorse or promote products
  36. * * derived from this software without specific prior written permission.
  37. * *
  38. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  39. * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  40. * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  41. * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  42. * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  43. * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  44. * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  45. * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  46. * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  47. * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  48. *
  49. * Author: Thomas Winischhofer <thomas@winischhofer.net>
  50. *
  51. */
  52. #ifndef _INIT301_H_
  53. #define _INIT301_H_
  54. #include "initdef.h"
  55. #include "vgatypes.h"
  56. #include "vstruct.h"
  57. #ifdef SIS_CP
  58. #undef SIS_CP
  59. #endif
  60. #include <linux/types.h>
  61. #include <asm/io.h>
  62. #include <linux/fb.h>
  63. #include "sis.h"
  64. #include <video/sisfb.h>
  65. void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr);
  66. void SiS_EnableCRT2(struct SiS_Private *SiS_Pr);
  67. unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
  68. void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr);
  69. bool SiS_IsDualEdge(struct SiS_Private *SiS_Pr);
  70. bool SiS_IsVAMode(struct SiS_Private *SiS_Pr);
  71. void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  72. unsigned short ModeIdIndex, int checkcrt2mode);
  73. void SiS_SetYPbPr(struct SiS_Private *SiS_Pr);
  74. void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  75. unsigned short ModeIdIndex);
  76. void SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  77. unsigned short ModeIdIndex);
  78. unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex,
  79. unsigned short RefreshRateTableIndex);
  80. unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex);
  81. void SiS_DisableBridge(struct SiS_Private *SiS_Pr);
  82. bool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
  83. void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr);
  84. void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr);
  85. void SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
  86. unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax);
  87. void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
  88. unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax);
  89. void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg,
  90. unsigned char orval,unsigned short andval);
  91. #ifdef CONFIG_FB_SIS_315
  92. void SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr);
  93. void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr);
  94. #endif /* 315 */
  95. #ifdef CONFIG_FB_SIS_300
  96. void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo);
  97. #endif
  98. void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime);
  99. unsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr);
  100. unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
  101. unsigned short adaptnum, unsigned short DDCdatatype,
  102. unsigned char *buffer, unsigned int VBFlags2);
  103. extern void SiS_DisplayOff(struct SiS_Private *SiS_Pr);
  104. extern void SiS_DisplayOn(struct SiS_Private *SiS_Pr);
  105. extern bool SiS_SearchModeID(struct SiS_Private *, unsigned short *, unsigned short *);
  106. extern unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  107. unsigned short ModeIdIndex);
  108. extern unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
  109. extern unsigned short SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
  110. extern unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex,
  111. unsigned short RefreshRateTableIndex);
  112. extern void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  113. unsigned short ModeIdIndex);
  114. extern void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
  115. unsigned short ModeIdIndex);
  116. extern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth);
  117. extern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide);
  118. extern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide);
  119. #ifdef CONFIG_FB_SIS_300
  120. extern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *tempbx,
  121. unsigned short *tempcl);
  122. extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl);
  123. extern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index);
  124. extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg);
  125. extern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg);
  126. #endif
  127. #endif