2010-05-19 02:44:14 -06:00
|
|
|
#include "vb_def.h"
|
|
|
|
#include "vgatypes.h"
|
|
|
|
#include "vb_struct.h"
|
|
|
|
|
|
|
|
#include "XGIfb.h"
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetReg1(unsigned long, unsigned short, unsigned short);
|
|
|
|
void XGINew_SetReg2(unsigned long, unsigned short, unsigned short);
|
|
|
|
void XGINew_SetReg3(unsigned long, unsigned short);
|
|
|
|
void XGINew_SetReg4(unsigned long, unsigned long);
|
2010-06-17 11:10:47 -06:00
|
|
|
unsigned char XGINew_GetReg1(unsigned long, unsigned short);
|
|
|
|
unsigned char XGINew_GetReg2(unsigned long);
|
2010-06-17 11:10:46 -06:00
|
|
|
unsigned long XGINew_GetReg3(unsigned long);
|
|
|
|
void XGINew_ClearDAC(unsigned char *);
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetRegANDOR(unsigned long Port, unsigned short Index,
|
|
|
|
unsigned short DataAND, unsigned short DataOR);
|
|
|
|
void XGINew_SetRegOR(unsigned long Port, unsigned short Index,
|
|
|
|
unsigned short DataOR);
|
|
|
|
void XGINew_SetRegAND(unsigned long Port, unsigned short Index,
|
|
|
|
unsigned short DataAND);
|
2010-05-19 02:44:14 -06:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
/* Function : XGINew_SetReg1 */
|
|
|
|
/* Input : */
|
|
|
|
/* Output : */
|
|
|
|
/* Description : SR CRTC GR */
|
|
|
|
/* --------------------------------------------------------------------- */
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetReg1(unsigned long port, unsigned short index,
|
|
|
|
unsigned short data)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-06-17 11:10:41 -06:00
|
|
|
outb(index, port);
|
|
|
|
outb(data, port + 1);
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
/* Function : XGINew_SetReg2 */
|
|
|
|
/* Input : */
|
|
|
|
/* Output : */
|
|
|
|
/* Description : AR( 3C0 ) */
|
|
|
|
/* --------------------------------------------------------------------- */
|
2010-09-04 00:39:32 -06:00
|
|
|
/*
|
|
|
|
void XGINew_SetReg2(unsigned long port, unsigned short index, unsigned short data)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
InPortByte((P unsigned char)port + 0x3da - 0x3c0) ;
|
|
|
|
OutPortByte(XGINew_P3c0, index);
|
|
|
|
OutPortByte(XGINew_P3c0, data);
|
|
|
|
OutPortByte(XGINew_P3c0, 0x20);
|
|
|
|
}
|
|
|
|
*/
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetReg3(unsigned long port, unsigned short data)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-06-17 11:10:41 -06:00
|
|
|
outb(data, port);
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetReg4(unsigned long port, unsigned long data)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-06-17 11:10:41 -06:00
|
|
|
outl(data, port);
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-06-17 11:10:47 -06:00
|
|
|
unsigned char XGINew_GetReg1(unsigned long port, unsigned short index)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned char data;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
outb(index, port);
|
|
|
|
data = inb(port + 1);
|
|
|
|
return data;
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-06-17 11:10:47 -06:00
|
|
|
unsigned char XGINew_GetReg2(unsigned long port)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned char data;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
data = inb(port);
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
return data;
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned long XGINew_GetReg3(unsigned long port)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned long data;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
data = inl(port);
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
return data;
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetRegANDOR(unsigned long Port, unsigned short Index,
|
|
|
|
unsigned short DataAND, unsigned short DataOR)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned short temp;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
temp = XGINew_GetReg1(Port, Index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp = (temp & (DataAND)) | DataOR;
|
|
|
|
XGINew_SetReg1(Port, Index, temp);
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetRegAND(unsigned long Port, unsigned short Index,
|
|
|
|
unsigned short DataAND)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned short temp;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
temp = XGINew_GetReg1(Port, Index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp &= DataAND;
|
|
|
|
XGINew_SetReg1(Port, Index, temp);
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
void XGINew_SetRegOR(unsigned long Port, unsigned short Index,
|
|
|
|
unsigned short DataOR)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
unsigned short temp;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
temp = XGINew_GetReg1(Port, Index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp |= DataOR;
|
|
|
|
XGINew_SetReg1(Port, Index, temp);
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-08-10 09:46:44 -06:00
|
|
|
#if 0
|
2010-09-04 00:39:32 -06:00
|
|
|
void NewDelaySeconds(int seconds)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
int i;
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
for (i = 0; i < seconds; i++) {
|
2010-05-19 02:44:14 -06:00
|
|
|
|
2010-09-04 00:39:32 -06:00
|
|
|
}
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
|
|
|
|
2010-06-17 11:10:47 -06:00
|
|
|
void Newdebugcode(unsigned char code)
|
2010-05-19 02:44:14 -06:00
|
|
|
{
|
2010-09-04 00:39:32 -06:00
|
|
|
/* OutPortByte(0x80, code); */
|
|
|
|
/* OutPortByte(0x300, code); */
|
|
|
|
/* NewDelaySeconds(0x3); */
|
2010-05-19 02:44:14 -06:00
|
|
|
}
|
2010-08-10 09:46:44 -06:00
|
|
|
#endif
|