9 #include <linux/types.h>
33 #include "xf86PciInfo.h"
41 void XGINew_SetReg1( ULONG , USHORT , USHORT ) ;
42 void XGINew_SetReg2( ULONG , USHORT , USHORT ) ;
43 void XGINew_SetReg3( ULONG , USHORT ) ;
44 void XGINew_SetReg4( ULONG , ULONG ) ;
45 UCHAR XGINew_GetReg1( ULONG , USHORT) ;
46 UCHAR XGINew_GetReg2( ULONG ) ;
47 ULONG XGINew_GetReg3( ULONG ) ;
48 void XGINew_ClearDAC( PUCHAR ) ;
49 void XGINew_SetRegANDOR(ULONG Port,USHORT Index,USHORT DataAND,USHORT DataOR);
50 void XGINew_SetRegOR(ULONG Port,USHORT Index,USHORT DataOR);
51 void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND);
54 /* --------------------------------------------------------------------- */
55 /* Function : XGINew_SetReg1 */
58 /* Description : SR CRTC GR */
59 /* --------------------------------------------------------------------- */
60 void XGINew_SetReg1( ULONG port , USHORT index , USHORT data )
63 OutPortByte( ( PUCHAR )(ULONG)port , index ) ;
64 OutPortByte( ( PUCHAR )(ULONG)port + 1 , data ) ;
66 OutPortByte( port , index ) ;
67 OutPortByte( port + 1 , data ) ;
72 /* --------------------------------------------------------------------- */
73 /* Function : XGINew_SetReg2 */
76 /* Description : AR( 3C0 ) */
77 /* --------------------------------------------------------------------- */
78 /*void XGINew_SetReg2( ULONG port , USHORT index , USHORT data )
80 InPortByte( ( PUCHAR )port + 0x3da - 0x3c0 ) ;
81 OutPortByte( XGINew_P3c0 , index ) ;
82 OutPortByte( XGINew_P3c0 , data ) ;
83 OutPortByte( XGINew_P3c0 , 0x20 ) ;
87 /* --------------------------------------------------------------------- */
92 /* --------------------------------------------------------------------- */
93 void XGINew_SetReg3( ULONG port , USHORT data )
95 OutPortByte( port , data ) ;
99 /* --------------------------------------------------------------------- */
100 /* Function : XGINew_SetReg4 */
104 /* --------------------------------------------------------------------- */
105 void XGINew_SetReg4( ULONG port , ULONG data )
107 OutPortLong( port , data ) ;
111 /* --------------------------------------------------------------------- */
112 /* Function : XGINew_GetReg1 */
116 /* --------------------------------------------------------------------- */
117 UCHAR XGINew_GetReg1( ULONG port , USHORT index )
122 OutPortByte( ( PUCHAR )(ULONG)port , index ) ;
123 data = InPortByte( ( PUCHAR )(ULONG)port + 1 ) ;
125 OutPortByte( port , index ) ;
126 data = InPortByte( port + 1 ) ;
133 /* --------------------------------------------------------------------- */
134 /* Function : XGINew_GetReg2 */
138 /* --------------------------------------------------------------------- */
139 UCHAR XGINew_GetReg2( ULONG port )
143 data = InPortByte( port ) ;
149 /* --------------------------------------------------------------------- */
150 /* Function : XGINew_GetReg3 */
154 /* --------------------------------------------------------------------- */
155 ULONG XGINew_GetReg3( ULONG port )
159 data = InPortLong( port ) ;
166 /* --------------------------------------------------------------------- */
167 /* Function : XGINew_SetRegANDOR */
171 /* --------------------------------------------------------------------- */
172 void XGINew_SetRegANDOR( ULONG Port , USHORT Index , USHORT DataAND , USHORT DataOR )
176 temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */
177 temp = ( temp & ( DataAND ) ) | DataOR ;
178 XGINew_SetReg1( Port , Index , temp ) ;
182 /* --------------------------------------------------------------------- */
183 /* Function : XGINew_SetRegAND */
187 /* --------------------------------------------------------------------- */
188 void XGINew_SetRegAND(ULONG Port,USHORT Index,USHORT DataAND)
192 temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */
194 XGINew_SetReg1( Port , Index , temp ) ;
198 /* --------------------------------------------------------------------- */
199 /* Function : XGINew_SetRegOR */
203 /* --------------------------------------------------------------------- */
204 void XGINew_SetRegOR( ULONG Port , USHORT Index , USHORT DataOR )
208 temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */
210 XGINew_SetReg1( Port , Index , temp ) ;
214 /* --------------------------------------------------------------------- */
215 /* Function : NewDelaySecond */
219 /* --------------------------------------------------------------------- */
220 void NewDelaySeconds( int seconds )
228 for( i = 0 ; i < seconds ; i++ )
236 for ( j = 0 ; j < 20000 ; j++ )
237 VideoPortStallExecution( 50 ) ;
249 /* --------------------------------------------------------------------- */
250 /* Function : Newdebugcode */
254 /* --------------------------------------------------------------------- */
255 void Newdebugcode( UCHAR code )
257 // OutPortByte ( 0x80 , code ) ;
258 /* OutPortByte ( 0x300 , code ) ; */
259 /* NewDelaySeconds( 0x3 ) ; */