Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus
[linux-btrfs-devel.git] / drivers / staging / xgifb / vb_util.c
blobea2b795bfa5091404a38075d0c93fb65ef671a93
1 #include "vb_def.h"
2 #include "vgatypes.h"
3 #include "vb_struct.h"
5 #include "XGIfb.h"
6 #include <linux/io.h>
7 #include <linux/types.h>
9 #include "vb_util.h"
11 void xgifb_reg_set(unsigned long port, u8 index, u8 data)
13 outb(index, port);
14 outb(data, port + 1);
17 u8 xgifb_reg_get(unsigned long port, u8 index)
19 u8 data;
21 outb(index, port);
22 data = inb(port + 1);
23 return data;
26 void xgifb_reg_and_or(unsigned long port, u8 index,
27 unsigned data_and, unsigned data_or)
29 u8 temp;
31 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
32 temp = (temp & data_and) | data_or;
33 xgifb_reg_set(port, index, temp);
36 void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
38 u8 temp;
40 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
41 temp &= data_and;
42 xgifb_reg_set(port, index, temp);
45 void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
47 u8 temp;
49 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
50 temp |= data_or;
51 xgifb_reg_set(port, index, temp);