2010-05-19 10:44:14 +02:00
|
|
|
#include "vb_def.h"
|
|
|
|
#include "vgatypes.h"
|
|
|
|
#include "vb_struct.h"
|
|
|
|
|
|
|
|
#include "XGIfb.h"
|
2011-04-24 07:35:35 +02:00
|
|
|
#include <linux/io.h>
|
2010-05-19 10:44:14 +02:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
2011-03-13 11:26:16 +01:00
|
|
|
#include "vb_util.h"
|
2010-05-19 10:44:14 +02:00
|
|
|
|
2011-03-13 11:26:27 +01:00
|
|
|
void xgifb_reg_set(unsigned long port, u8 index, u8 data)
|
2010-05-19 10:44:14 +02:00
|
|
|
{
|
2010-06-17 19:10:41 +02:00
|
|
|
outb(index, port);
|
|
|
|
outb(data, port + 1);
|
2010-05-19 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
2011-03-13 11:26:27 +01:00
|
|
|
u8 xgifb_reg_get(unsigned long port, u8 index)
|
2010-05-19 10:44:14 +02:00
|
|
|
{
|
2011-03-13 11:26:27 +01:00
|
|
|
u8 data;
|
2010-05-19 10:44:14 +02:00
|
|
|
|
2010-09-04 08:39:32 +02:00
|
|
|
outb(index, port);
|
|
|
|
data = inb(port + 1);
|
|
|
|
return data;
|
2010-05-19 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
2011-03-13 11:26:28 +01:00
|
|
|
void xgifb_reg_and_or(unsigned long port, u8 index,
|
|
|
|
unsigned data_and, unsigned data_or)
|
2010-05-19 10:44:14 +02:00
|
|
|
{
|
2011-03-13 11:26:27 +01:00
|
|
|
u8 temp;
|
2010-05-19 10:44:14 +02:00
|
|
|
|
2011-03-13 11:26:28 +01:00
|
|
|
temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp = (temp & data_and) | data_or;
|
|
|
|
xgifb_reg_set(port, index, temp);
|
2010-05-19 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
2011-03-13 11:26:28 +01:00
|
|
|
void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
|
2010-05-19 10:44:14 +02:00
|
|
|
{
|
2011-03-13 11:26:27 +01:00
|
|
|
u8 temp;
|
2010-05-19 10:44:14 +02:00
|
|
|
|
2011-03-13 11:26:28 +01:00
|
|
|
temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp &= data_and;
|
|
|
|
xgifb_reg_set(port, index, temp);
|
2010-05-19 10:44:14 +02:00
|
|
|
}
|
|
|
|
|
2011-03-13 11:26:28 +01:00
|
|
|
void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
|
2010-05-19 10:44:14 +02:00
|
|
|
{
|
2011-03-13 11:26:27 +01:00
|
|
|
u8 temp;
|
2010-05-19 10:44:14 +02:00
|
|
|
|
2011-03-13 11:26:28 +01:00
|
|
|
temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
|
|
|
|
temp |= data_or;
|
|
|
|
xgifb_reg_set(port, index, temp);
|
2010-05-19 10:44:14 +02:00
|
|
|
}
|