i2c-eg20t: change timeout value 50msec to 1000msec
[zen-stable.git] / drivers / staging / xgifb / vb_util.c
blobb5c99891ead4f0cb53d736be1868bd647e102c1a
1 #include <linux/io.h>
2 #include <linux/types.h>
4 #include "vb_def.h"
5 #include "vgatypes.h"
6 #include "vb_struct.h"
8 #include "XGIfb.h"
10 #include "vb_util.h"
12 void xgifb_reg_set(unsigned long port, u8 index, u8 data)
14 outb(index, port);
15 outb(data, port + 1);
18 u8 xgifb_reg_get(unsigned long port, u8 index)
20 u8 data;
22 outb(index, port);
23 data = inb(port + 1);
24 return data;
27 void xgifb_reg_and_or(unsigned long port, u8 index,
28 unsigned data_and, unsigned data_or)
30 u8 temp;
32 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
33 temp = (temp & data_and) | data_or;
34 xgifb_reg_set(port, index, temp);
37 void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and)
39 u8 temp;
41 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
42 temp &= data_and;
43 xgifb_reg_set(port, index, temp);
46 void xgifb_reg_or(unsigned long port, u8 index, unsigned data_or)
48 u8 temp;
50 temp = xgifb_reg_get(port, index); /* XGINew_Part1Port index 02 */
51 temp |= data_or;
52 xgifb_reg_set(port, index, temp);