Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / drivers / staging / xgifb / vb_util.c
blob1b452f8b62740f71ece6128e96091c56014a062c
1 #include "vgatypes.h"
2 #include "vb_util.h"
4 void xgifb_reg_set(unsigned long port, u8 index, u8 data)
6 outb(index, port);
7 outb(data, port + 1);
10 u8 xgifb_reg_get(unsigned long port, u8 index)
12 u8 data;
14 outb(index, port);
15 data = inb(port + 1);
16 return data;
19 void xgifb_reg_and_or(unsigned long port, u8 index,
20 unsigned data_and, unsigned data_or)
22 u8 temp;
24 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
25 temp = (temp & data_and) | data_or;
26 xgifb_reg_set(port, index, temp);
29 void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
31 u8 temp;
33 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
34 temp &= data_and;
35 xgifb_reg_set(port, index, temp);
38 void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
40 u8 temp;
42 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
43 temp |= data_or;
44 xgifb_reg_set(port, index, temp);