]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/staging/xgifb/vb_util.c
Staging: xgifb: fix lots of sparse warnings
[net-next-2.6.git] / drivers / staging / xgifb / vb_util.c
CommitLineData
d7636e0b 1#include "vb_def.h"
2#include "vgatypes.h"
3#include "vb_struct.h"
4
d7636e0b 5#include "XGIfb.h"
6#include <asm/io.h>
7#include <linux/types.h>
d7636e0b 8
82d6eb5b
BP
9void XGINew_SetReg1(unsigned long,unsigned short,unsigned short);
10void XGINew_SetReg2(unsigned long,unsigned short,unsigned short);
11void XGINew_SetReg3(unsigned long,unsigned short);
12void XGINew_SetReg4(unsigned long,unsigned long);
108afbf8
BP
13unsigned char XGINew_GetReg1(unsigned long, unsigned short);
14unsigned char XGINew_GetReg2(unsigned long);
82d6eb5b
BP
15unsigned long XGINew_GetReg3(unsigned long);
16void XGINew_ClearDAC(unsigned char *);
17void XGINew_SetRegANDOR(unsigned long Port,unsigned short Index,
18 unsigned short DataAND,unsigned short DataOR);
19void XGINew_SetRegOR(unsigned long Port,unsigned short Index,
20 unsigned short DataOR);
21void XGINew_SetRegAND(unsigned long Port,unsigned short Index,
22 unsigned short DataAND);
d7636e0b 23
24
25/* --------------------------------------------------------------------- */
26/* Function : XGINew_SetReg1 */
27/* Input : */
28/* Output : */
29/* Description : SR CRTC GR */
30/* --------------------------------------------------------------------- */
82d6eb5b 31void XGINew_SetReg1( unsigned long port , unsigned short index , unsigned short data )
d7636e0b 32{
1e59f711
BP
33 outb(index, port);
34 outb(data, port + 1);
d7636e0b 35}
36
37
38/* --------------------------------------------------------------------- */
39/* Function : XGINew_SetReg2 */
40/* Input : */
41/* Output : */
42/* Description : AR( 3C0 ) */
43/* --------------------------------------------------------------------- */
82d6eb5b 44/*void XGINew_SetReg2( unsigned long port , unsigned short index , unsigned short data )
d7636e0b 45{
108afbf8 46 InPortByte((P unsigned char )port + 0x3da - 0x3c0) ;
d7636e0b 47 OutPortByte( XGINew_P3c0 , index ) ;
48 OutPortByte( XGINew_P3c0 , data ) ;
49 OutPortByte( XGINew_P3c0 , 0x20 ) ;
50}*/
51
52
53/* --------------------------------------------------------------------- */
54/* Function : */
55/* Input : */
56/* Output : */
57/* Description : */
58/* --------------------------------------------------------------------- */
82d6eb5b 59void XGINew_SetReg3( unsigned long port , unsigned short data )
d7636e0b 60{
1e59f711 61 outb(data, port);
d7636e0b 62}
63
64
65/* --------------------------------------------------------------------- */
66/* Function : XGINew_SetReg4 */
67/* Input : */
68/* Output : */
69/* Description : */
70/* --------------------------------------------------------------------- */
82d6eb5b 71void XGINew_SetReg4( unsigned long port , unsigned long data )
d7636e0b 72{
1e59f711 73 outl(data, port);
d7636e0b 74}
75
76
77/* --------------------------------------------------------------------- */
78/* Function : XGINew_GetReg1 */
79/* Input : */
80/* Output : */
81/* Description : */
82/* --------------------------------------------------------------------- */
108afbf8 83unsigned char XGINew_GetReg1(unsigned long port, unsigned short index)
d7636e0b 84{
108afbf8 85 unsigned char data ;
d7636e0b 86
1e59f711
BP
87 outb(index, port);
88 data = inb(port + 1) ;
d7636e0b 89 return( data ) ;
90}
91
92
93/* --------------------------------------------------------------------- */
94/* Function : XGINew_GetReg2 */
95/* Input : */
96/* Output : */
97/* Description : */
98/* --------------------------------------------------------------------- */
108afbf8 99unsigned char XGINew_GetReg2(unsigned long port)
d7636e0b 100{
108afbf8 101 unsigned char data ;
d7636e0b 102
1e59f711 103 data = inb(port) ;
d7636e0b 104
105 return( data ) ;
106}
107
108
109/* --------------------------------------------------------------------- */
110/* Function : XGINew_GetReg3 */
111/* Input : */
112/* Output : */
113/* Description : */
114/* --------------------------------------------------------------------- */
82d6eb5b 115unsigned long XGINew_GetReg3( unsigned long port )
d7636e0b 116{
82d6eb5b 117 unsigned long data ;
d7636e0b 118
1e59f711 119 data = inl(port) ;
d7636e0b 120
121 return( data ) ;
122}
123
124
125
126/* --------------------------------------------------------------------- */
127/* Function : XGINew_SetRegANDOR */
128/* Input : */
129/* Output : */
130/* Description : */
131/* --------------------------------------------------------------------- */
82d6eb5b 132void XGINew_SetRegANDOR( unsigned long Port , unsigned short Index , unsigned short DataAND , unsigned short DataOR )
d7636e0b 133{
82d6eb5b 134 unsigned short temp ;
d7636e0b 135
136 temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */
137 temp = ( temp & ( DataAND ) ) | DataOR ;
138 XGINew_SetReg1( Port , Index , temp ) ;
139}
140
141
142/* --------------------------------------------------------------------- */
143/* Function : XGINew_SetRegAND */
144/* Input : */
145/* Output : */
146/* Description : */
147/* --------------------------------------------------------------------- */
82d6eb5b 148void XGINew_SetRegAND(unsigned long Port,unsigned short Index,unsigned short DataAND)
d7636e0b 149{
82d6eb5b 150 unsigned short temp ;
d7636e0b 151
152 temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */
153 temp &= DataAND ;
154 XGINew_SetReg1( Port , Index , temp ) ;
155}
156
157
158/* --------------------------------------------------------------------- */
159/* Function : XGINew_SetRegOR */
160/* Input : */
161/* Output : */
162/* Description : */
163/* --------------------------------------------------------------------- */
82d6eb5b 164void XGINew_SetRegOR( unsigned long Port , unsigned short Index , unsigned short DataOR )
d7636e0b 165{
82d6eb5b 166 unsigned short temp ;
d7636e0b 167
168 temp = XGINew_GetReg1( Port , Index ) ; /* XGINew_Part1Port index 02 */
169 temp |= DataOR ;
170 XGINew_SetReg1( Port , Index , temp ) ;
171}
172
8922967e 173#if 0
d7636e0b 174/* --------------------------------------------------------------------- */
175/* Function : NewDelaySecond */
176/* Input : */
177/* Output : */
178/* Description : */
179/* --------------------------------------------------------------------- */
180void NewDelaySeconds( int seconds )
181{
d7636e0b 182 int i ;
183
184
185 for( i = 0 ; i < seconds ; i++ )
186 {
d7636e0b 187
d7636e0b 188
d7636e0b 189
d7636e0b 190 }
191}
192
d7636e0b 193/* --------------------------------------------------------------------- */
194/* Function : Newdebugcode */
195/* Input : */
196/* Output : */
197/* Description : */
198/* --------------------------------------------------------------------- */
108afbf8 199void Newdebugcode(unsigned char code)
d7636e0b 200{
201// OutPortByte ( 0x80 , code ) ;
202 /* OutPortByte ( 0x300 , code ) ; */
203 /* NewDelaySeconds( 0x3 ) ; */
204}
8922967e 205#endif