diff options
-rw-r--r-- | drivers/staging/xgifb/vb_ext.c | 28 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_init.c | 98 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_setmode.c | 200 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.c | 8 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.h | 2 |
5 files changed, 168 insertions, 168 deletions
diff --git a/drivers/staging/xgifb/vb_ext.c b/drivers/staging/xgifb/vb_ext.c index a2998645fa1..3a371053920 100644 --- a/drivers/staging/xgifb/vb_ext.c +++ b/drivers/staging/xgifb/vb_ext.c | |||
@@ -18,7 +18,7 @@ static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo) | |||
18 | { | 18 | { |
19 | unsigned short flag; | 19 | unsigned short flag; |
20 | 20 | ||
21 | flag = XGINew_GetReg1(pVBInfo->Part4Port, 0x01); | 21 | flag = xgifb_reg_get(pVBInfo->Part4Port, 0x01); |
22 | 22 | ||
23 | if (flag > 0x0B0) | 23 | if (flag > 0x0B0) |
24 | return 0; /* 301b */ | 24 | return 0; /* 301b */ |
@@ -40,7 +40,7 @@ static unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, | |||
40 | XGI_LongWait(pVBInfo); | 40 | XGI_LongWait(pVBInfo); |
41 | 41 | ||
42 | tempch = (tempcx & 0x7F00) >> 8; | 42 | tempch = (tempcx & 0x7F00) >> 8; |
43 | temp = XGINew_GetReg1(pVBInfo->Part4Port, 0x03); | 43 | temp = xgifb_reg_get(pVBInfo->Part4Port, 0x03); |
44 | temp = temp ^ (0x0E); | 44 | temp = temp ^ (0x0E); |
45 | temp &= tempch; | 45 | temp &= tempch; |
46 | 46 | ||
@@ -114,7 +114,7 @@ static unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo) | |||
114 | unsigned short tempax, tempbx, temp; | 114 | unsigned short tempax, tempbx, temp; |
115 | /* unsigned short return_flag; */ | 115 | /* unsigned short return_flag; */ |
116 | 116 | ||
117 | tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x1A); | 117 | tempax = xgifb_reg_get(pVBInfo->P3c4, 0x1A); |
118 | tempbx = tempax & 0x1E; | 118 | tempbx = tempax & 0x1E; |
119 | 119 | ||
120 | if (tempax == 0) | 120 | if (tempax == 0) |
@@ -124,7 +124,7 @@ static unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo) | |||
124 | if (!(tempax & 0x10)) { | 124 | if (!(tempax & 0x10)) { |
125 | if (pVBInfo->IF_DEF_LVDS == 1) { | 125 | if (pVBInfo->IF_DEF_LVDS == 1) { |
126 | tempbx = 0; | 126 | tempbx = 0; |
127 | temp = XGINew_GetReg1(pVBInfo->P3c4, 0x38); | 127 | temp = xgifb_reg_get(pVBInfo->P3c4, 0x38); |
128 | if (temp & 0x40) | 128 | if (temp & 0x40) |
129 | tempbx |= 0x08; | 129 | tempbx |= 0x08; |
130 | if (temp & 0x20) | 130 | if (temp & 0x20) |
@@ -132,7 +132,7 @@ static unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo) | |||
132 | if (temp & 0x01) | 132 | if (temp & 0x01) |
133 | tempbx |= 0x01; | 133 | tempbx |= 0x01; |
134 | 134 | ||
135 | temp = XGINew_GetReg1(pVBInfo->P3c4, 0x39); | 135 | temp = xgifb_reg_get(pVBInfo->P3c4, 0x39); |
136 | if (temp & 0x80) | 136 | if (temp & 0x80) |
137 | tempbx |= 0x04; | 137 | tempbx |= 0x04; |
138 | } else { | 138 | } else { |
@@ -159,7 +159,7 @@ static unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceEx | |||
159 | unsigned short flag; | 159 | unsigned short flag; |
160 | 160 | ||
161 | if (XGI_BridgeIsOn(pVBInfo) == 0) { | 161 | if (XGI_BridgeIsOn(pVBInfo) == 0) { |
162 | flag = XGINew_GetReg1(pVBInfo->Part1Port, 0x0); | 162 | flag = xgifb_reg_get(pVBInfo->Part1Port, 0x0); |
163 | 163 | ||
164 | if (flag & 0x050) | 164 | if (flag & 0x050) |
165 | return 1; | 165 | return 1; |
@@ -188,7 +188,7 @@ static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtensi | |||
188 | XGI_LongWait(pVBInfo); | 188 | XGI_LongWait(pVBInfo); |
189 | 189 | ||
190 | tempch = (tempcx & 0xFF00) >> 8; | 190 | tempch = (tempcx & 0xFF00) >> 8; |
191 | temp = XGINew_GetReg1(pVBInfo->Part4Port, 0x03); | 191 | temp = xgifb_reg_get(pVBInfo->Part4Port, 0x03); |
192 | temp = temp ^ (0x0E); | 192 | temp = temp ^ (0x0E); |
193 | temp &= tempch; | 193 | temp &= tempch; |
194 | 194 | ||
@@ -208,7 +208,7 @@ static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtensi | |||
208 | XGI_LongWait(pVBInfo); | 208 | XGI_LongWait(pVBInfo); |
209 | 209 | ||
210 | tempch = (tempcx & 0xFF00) >> 8; | 210 | tempch = (tempcx & 0xFF00) >> 8; |
211 | temp = XGINew_GetReg1(pVBInfo->Part4Port, 0x03); | 211 | temp = xgifb_reg_get(pVBInfo->Part4Port, 0x03); |
212 | temp = temp ^ (0x0E); | 212 | temp = temp ^ (0x0E); |
213 | temp &= tempch; | 213 | temp &= tempch; |
214 | 214 | ||
@@ -227,7 +227,7 @@ static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtensi | |||
227 | XGI_LongWait(pVBInfo); | 227 | XGI_LongWait(pVBInfo); |
228 | 228 | ||
229 | tempch = (tempcx & 0xFF00) >> 8; | 229 | tempch = (tempcx & 0xFF00) >> 8; |
230 | temp = XGINew_GetReg1(pVBInfo->Part4Port, 0x03); | 230 | temp = xgifb_reg_get(pVBInfo->Part4Port, 0x03); |
231 | temp = temp ^ (0x0E); | 231 | temp = temp ^ (0x0E); |
232 | temp &= tempch; | 232 | temp &= tempch; |
233 | 233 | ||
@@ -245,8 +245,8 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_ | |||
245 | pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress; | 245 | pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress; |
246 | 246 | ||
247 | if (pVBInfo->IF_DEF_LVDS == 1) { | 247 | if (pVBInfo->IF_DEF_LVDS == 1) { |
248 | tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x1A); /* ynlai 02/27/2002 */ | 248 | tempax = xgifb_reg_get(pVBInfo->P3c4, 0x1A); /* ynlai 02/27/2002 */ |
249 | tempbx = XGINew_GetReg1(pVBInfo->P3c4, 0x1B); | 249 | tempbx = xgifb_reg_get(pVBInfo->P3c4, 0x1B); |
250 | tempax = ((tempax & 0xFE) >> 1) | (tempbx << 8); | 250 | tempax = ((tempax & 0xFE) >> 1) | (tempbx << 8); |
251 | if (tempax == 0x00) { /* Get Panel id from DDC */ | 251 | if (tempax == 0x00) { /* Get Panel id from DDC */ |
252 | temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo); | 252 | temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo); |
@@ -266,14 +266,14 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_ | |||
266 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, tempbx, temp); | 266 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, tempbx, temp); |
267 | } else { /* for 301 */ | 267 | } else { /* for 301 */ |
268 | if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) { /* for HiVision */ | 268 | if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) { /* for HiVision */ |
269 | tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x38); | 269 | tempax = xgifb_reg_get(pVBInfo->P3c4, 0x38); |
270 | temp = tempax & 0x01; | 270 | temp = tempax & 0x01; |
271 | tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x3A); | 271 | tempax = xgifb_reg_get(pVBInfo->P3c4, 0x3A); |
272 | temp = temp | (tempax & 0x02); | 272 | temp = temp | (tempax & 0x02); |
273 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xA0, temp); | 273 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xA0, temp); |
274 | } else { | 274 | } else { |
275 | if (XGI_BridgeIsOn(pVBInfo)) { | 275 | if (XGI_BridgeIsOn(pVBInfo)) { |
276 | P2reg0 = XGINew_GetReg1(pVBInfo->Part2Port, 0x00); | 276 | P2reg0 = xgifb_reg_get(pVBInfo->Part2Port, 0x00); |
277 | if (!XGINew_BridgeIsEnable(HwDeviceExtension, pVBInfo)) { | 277 | if (!XGINew_BridgeIsEnable(HwDeviceExtension, pVBInfo)) { |
278 | SenseModeNo = 0x2e; | 278 | SenseModeNo = 0x2e; |
279 | /* xgifb_reg_set(pVBInfo->P3d4, 0x30, 0x41); */ | 279 | /* xgifb_reg_set(pVBInfo->P3d4, 0x30, 0x41); */ |
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index 07fa73dec79..7138a24f83a 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c | |||
@@ -49,10 +49,10 @@ static unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceE | |||
49 | data = *pVBInfo->pSoftSetting & 0x07; | 49 | data = *pVBInfo->pSoftSetting & 0x07; |
50 | return data; | 50 | return data; |
51 | } else { | 51 | } else { |
52 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x39) & 0x02; | 52 | data = xgifb_reg_get(pVBInfo->P3c4, 0x39) & 0x02; |
53 | 53 | ||
54 | if (data == 0) | 54 | if (data == 0) |
55 | data = (XGINew_GetReg1(pVBInfo->P3c4, 0x3A) & 0x02) >> 1; | 55 | data = (xgifb_reg_get(pVBInfo->P3c4, 0x3A) & 0x02) >> 1; |
56 | 56 | ||
57 | return data; | 57 | return data; |
58 | } | 58 | } |
@@ -61,7 +61,7 @@ static unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceE | |||
61 | data = *pVBInfo->pSoftSetting & 0x07; | 61 | data = *pVBInfo->pSoftSetting & 0x07; |
62 | return data; | 62 | return data; |
63 | } | 63 | } |
64 | temp = XGINew_GetReg1(pVBInfo->P3c4, 0x3B); | 64 | temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B); |
65 | 65 | ||
66 | if ((temp & 0x88) == 0x80) /* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */ | 66 | if ((temp & 0x88) == 0x80) /* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */ |
67 | data = 0; /* DDR */ | 67 | data = 0; /* DDR */ |
@@ -72,7 +72,7 @@ static unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceE | |||
72 | XGINew_SetRegAND(pVBInfo->P3d4, 0xB4, ~0x02); /* Independent GPIO control */ | 72 | XGINew_SetRegAND(pVBInfo->P3d4, 0xB4, ~0x02); /* Independent GPIO control */ |
73 | udelay(800); | 73 | udelay(800); |
74 | XGINew_SetRegOR(pVBInfo->P3d4, 0x4A, 0x80); /* Enable GPIOH read */ | 74 | XGINew_SetRegOR(pVBInfo->P3d4, 0x4A, 0x80); /* Enable GPIOH read */ |
75 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48); /* GPIOF 0:DVI 1:DVO */ | 75 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); /* GPIOF 0:DVI 1:DVO */ |
76 | /* HOTPLUG_SUPPORT */ | 76 | /* HOTPLUG_SUPPORT */ |
77 | /* for current XG20 & XG21, GPIOH is floating, driver will fix DDR temporarily */ | 77 | /* for current XG20 & XG21, GPIOH is floating, driver will fix DDR temporarily */ |
78 | if (temp & 0x01) /* DVI read GPIOH */ | 78 | if (temp & 0x01) /* DVI read GPIOH */ |
@@ -83,7 +83,7 @@ static unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceE | |||
83 | XGINew_SetRegOR(pVBInfo->P3d4, 0xB4, 0x02); | 83 | XGINew_SetRegOR(pVBInfo->P3d4, 0xB4, 0x02); |
84 | return data; | 84 | return data; |
85 | } else { | 85 | } else { |
86 | data = XGINew_GetReg1(pVBInfo->P3d4, 0x97) & 0x01; | 86 | data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01; |
87 | 87 | ||
88 | if (data == 1) | 88 | if (data == 1) |
89 | data++; | 89 | data++; |
@@ -143,7 +143,7 @@ static void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, | |||
143 | && (pVBInfo->ECLKData[XGINew_RAMType].SR2F == 0x01)) | 143 | && (pVBInfo->ECLKData[XGINew_RAMType].SR2F == 0x01)) |
144 | || ((pVBInfo->ECLKData[XGINew_RAMType].SR2E == 0x22) | 144 | || ((pVBInfo->ECLKData[XGINew_RAMType].SR2E == 0x22) |
145 | && (pVBInfo->ECLKData[XGINew_RAMType].SR2F == 0x01)))) | 145 | && (pVBInfo->ECLKData[XGINew_RAMType].SR2F == 0x01)))) |
146 | xgifb_reg_set(pVBInfo->P3c4, 0x32, ((unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x32) & 0xFC) | 0x02); | 146 | xgifb_reg_set(pVBInfo->P3c4, 0x32, ((unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x32) & 0xFC) | 0x02); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
@@ -327,15 +327,15 @@ static void XGINew_DDR1x_DefaultRegister( | |||
327 | default: | 327 | default: |
328 | xgifb_reg_set(P3d4, 0x82, 0x88); | 328 | xgifb_reg_set(P3d4, 0x82, 0x88); |
329 | xgifb_reg_set(P3d4, 0x86, 0x00); | 329 | xgifb_reg_set(P3d4, 0x86, 0x00); |
330 | XGINew_GetReg1(P3d4, 0x86); /* Insert read command for delay */ | 330 | xgifb_reg_get(P3d4, 0x86); /* Insert read command for delay */ |
331 | xgifb_reg_set(P3d4, 0x86, 0x88); | 331 | xgifb_reg_set(P3d4, 0x86, 0x88); |
332 | XGINew_GetReg1(P3d4, 0x86); | 332 | xgifb_reg_get(P3d4, 0x86); |
333 | xgifb_reg_set(P3d4, 0x86, pVBInfo->CR40[13][XGINew_RAMType]); | 333 | xgifb_reg_set(P3d4, 0x86, pVBInfo->CR40[13][XGINew_RAMType]); |
334 | xgifb_reg_set(P3d4, 0x82, 0x77); | 334 | xgifb_reg_set(P3d4, 0x82, 0x77); |
335 | xgifb_reg_set(P3d4, 0x85, 0x00); | 335 | xgifb_reg_set(P3d4, 0x85, 0x00); |
336 | XGINew_GetReg1(P3d4, 0x85); /* Insert read command for delay */ | 336 | xgifb_reg_get(P3d4, 0x85); /* Insert read command for delay */ |
337 | xgifb_reg_set(P3d4, 0x85, 0x88); | 337 | xgifb_reg_set(P3d4, 0x85, 0x88); |
338 | XGINew_GetReg1(P3d4, 0x85); /* Insert read command for delay */ | 338 | xgifb_reg_get(P3d4, 0x85); /* Insert read command for delay */ |
339 | xgifb_reg_set(P3d4, 0x85, pVBInfo->CR40[12][XGINew_RAMType]); /* CR85 */ | 339 | xgifb_reg_set(P3d4, 0x85, pVBInfo->CR40[12][XGINew_RAMType]); /* CR85 */ |
340 | xgifb_reg_set(P3d4, 0x82, pVBInfo->CR40[11][XGINew_RAMType]); /* CR82 */ | 340 | xgifb_reg_set(P3d4, 0x82, pVBInfo->CR40[11][XGINew_RAMType]); /* CR82 */ |
341 | break; | 341 | break; |
@@ -357,15 +357,15 @@ static void XGINew_DDR2_DefaultRegister( | |||
357 | /* keep following setting sequence, each setting in the same reg insert idle */ | 357 | /* keep following setting sequence, each setting in the same reg insert idle */ |
358 | xgifb_reg_set(P3d4, 0x82, 0x77); | 358 | xgifb_reg_set(P3d4, 0x82, 0x77); |
359 | xgifb_reg_set(P3d4, 0x86, 0x00); | 359 | xgifb_reg_set(P3d4, 0x86, 0x00); |
360 | XGINew_GetReg1(P3d4, 0x86); /* Insert read command for delay */ | 360 | xgifb_reg_get(P3d4, 0x86); /* Insert read command for delay */ |
361 | xgifb_reg_set(P3d4, 0x86, 0x88); | 361 | xgifb_reg_set(P3d4, 0x86, 0x88); |
362 | XGINew_GetReg1(P3d4, 0x86); /* Insert read command for delay */ | 362 | xgifb_reg_get(P3d4, 0x86); /* Insert read command for delay */ |
363 | xgifb_reg_set(P3d4, 0x86, pVBInfo->CR40[13][XGINew_RAMType]); /* CR86 */ | 363 | xgifb_reg_set(P3d4, 0x86, pVBInfo->CR40[13][XGINew_RAMType]); /* CR86 */ |
364 | xgifb_reg_set(P3d4, 0x82, 0x77); | 364 | xgifb_reg_set(P3d4, 0x82, 0x77); |
365 | xgifb_reg_set(P3d4, 0x85, 0x00); | 365 | xgifb_reg_set(P3d4, 0x85, 0x00); |
366 | XGINew_GetReg1(P3d4, 0x85); /* Insert read command for delay */ | 366 | xgifb_reg_get(P3d4, 0x85); /* Insert read command for delay */ |
367 | xgifb_reg_set(P3d4, 0x85, 0x88); | 367 | xgifb_reg_set(P3d4, 0x85, 0x88); |
368 | XGINew_GetReg1(P3d4, 0x85); /* Insert read command for delay */ | 368 | xgifb_reg_get(P3d4, 0x85); /* Insert read command for delay */ |
369 | xgifb_reg_set(P3d4, 0x85, pVBInfo->CR40[12][XGINew_RAMType]); /* CR85 */ | 369 | xgifb_reg_set(P3d4, 0x85, pVBInfo->CR40[12][XGINew_RAMType]); /* CR85 */ |
370 | if (HwDeviceExtension->jChipType == XG27) | 370 | if (HwDeviceExtension->jChipType == XG27) |
371 | xgifb_reg_set(P3d4, 0x82, pVBInfo->CR40[11][XGINew_RAMType]); /* CR82 */ | 371 | xgifb_reg_set(P3d4, 0x82, pVBInfo->CR40[11][XGINew_RAMType]); /* CR82 */ |
@@ -400,7 +400,7 @@ static void XGINew_SetDRAMDefaultRegister340( | |||
400 | temp1 = ((temp >> (2 * j)) & 0x03) << 2; | 400 | temp1 = ((temp >> (2 * j)) & 0x03) << 2; |
401 | temp2 |= temp1; | 401 | temp2 |= temp1; |
402 | xgifb_reg_set(P3d4, 0x6B, temp2); | 402 | xgifb_reg_set(P3d4, 0x6B, temp2); |
403 | XGINew_GetReg1(P3d4, 0x6B); /* Insert read command for delay */ | 403 | xgifb_reg_get(P3d4, 0x6B); /* Insert read command for delay */ |
404 | temp2 &= 0xF0; | 404 | temp2 &= 0xF0; |
405 | temp2 += 0x10; | 405 | temp2 += 0x10; |
406 | } | 406 | } |
@@ -413,7 +413,7 @@ static void XGINew_SetDRAMDefaultRegister340( | |||
413 | temp1 = ((temp >> (2 * j)) & 0x03) << 2; | 413 | temp1 = ((temp >> (2 * j)) & 0x03) << 2; |
414 | temp2 |= temp1; | 414 | temp2 |= temp1; |
415 | xgifb_reg_set(P3d4, 0x6E, temp2); | 415 | xgifb_reg_set(P3d4, 0x6E, temp2); |
416 | XGINew_GetReg1(P3d4, 0x6E); /* Insert read command for delay */ | 416 | xgifb_reg_get(P3d4, 0x6E); /* Insert read command for delay */ |
417 | temp2 &= 0xF0; | 417 | temp2 &= 0xF0; |
418 | temp2 += 0x10; | 418 | temp2 += 0x10; |
419 | } | 419 | } |
@@ -429,7 +429,7 @@ static void XGINew_SetDRAMDefaultRegister340( | |||
429 | temp1 = (temp >> (2 * j)) & 0x03; | 429 | temp1 = (temp >> (2 * j)) & 0x03; |
430 | temp2 |= temp1; | 430 | temp2 |= temp1; |
431 | xgifb_reg_set(P3d4, 0x6F, temp2); | 431 | xgifb_reg_set(P3d4, 0x6F, temp2); |
432 | XGINew_GetReg1(P3d4, 0x6F); /* Insert read command for delay */ | 432 | xgifb_reg_get(P3d4, 0x6F); /* Insert read command for delay */ |
433 | temp2 &= 0xF8; | 433 | temp2 &= 0xF8; |
434 | temp2 += 0x08; | 434 | temp2 += 0x08; |
435 | } | 435 | } |
@@ -446,7 +446,7 @@ static void XGINew_SetDRAMDefaultRegister340( | |||
446 | temp1 = (temp >> (2 * j)) & 0x03; | 446 | temp1 = (temp >> (2 * j)) & 0x03; |
447 | temp2 |= temp1; | 447 | temp2 |= temp1; |
448 | xgifb_reg_set(P3d4, 0x89, temp2); | 448 | xgifb_reg_set(P3d4, 0x89, temp2); |
449 | XGINew_GetReg1(P3d4, 0x89); /* Insert read command for delay */ | 449 | xgifb_reg_get(P3d4, 0x89); /* Insert read command for delay */ |
450 | temp2 &= 0xF0; | 450 | temp2 &= 0xF0; |
451 | temp2 += 0x10; | 451 | temp2 += 0x10; |
452 | } | 452 | } |
@@ -530,7 +530,7 @@ static unsigned short XGINew_SetDRAMSizeReg(int index, | |||
530 | unsigned char ChannelNo; | 530 | unsigned char ChannelNo; |
531 | 531 | ||
532 | RankSize = DRAMTYPE_TABLE[index][3] * XGINew_DataBusWidth / 32; | 532 | RankSize = DRAMTYPE_TABLE[index][3] * XGINew_DataBusWidth / 32; |
533 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x13); | 533 | data = xgifb_reg_get(pVBInfo->P3c4, 0x13); |
534 | data &= 0x80; | 534 | data &= 0x80; |
535 | 535 | ||
536 | if (data == 0x80) | 536 | if (data == 0x80) |
@@ -550,7 +550,7 @@ static unsigned short XGINew_SetDRAMSizeReg(int index, | |||
550 | memsize = data >> 4; | 550 | memsize = data >> 4; |
551 | 551 | ||
552 | /* [2004/03/25] Vicent, Fix DRAM Sizing Error */ | 552 | /* [2004/03/25] Vicent, Fix DRAM Sizing Error */ |
553 | xgifb_reg_set(pVBInfo->P3c4, 0x14, (XGINew_GetReg1(pVBInfo->P3c4, 0x14) & 0x0F) | (data & 0xF0)); | 553 | xgifb_reg_set(pVBInfo->P3c4, 0x14, (xgifb_reg_get(pVBInfo->P3c4, 0x14) & 0x0F) | (data & 0xF0)); |
554 | 554 | ||
555 | /* data |= XGINew_ChannelAB << 2; */ | 555 | /* data |= XGINew_ChannelAB << 2; */ |
556 | /* data |= (XGINew_DataBusWidth / 64) << 1; */ | 556 | /* data |= (XGINew_DataBusWidth / 64) << 1; */ |
@@ -571,7 +571,7 @@ static unsigned short XGINew_SetDRAMSize20Reg(int index, | |||
571 | unsigned char ChannelNo; | 571 | unsigned char ChannelNo; |
572 | 572 | ||
573 | RankSize = DRAMTYPE_TABLE[index][3] * XGINew_DataBusWidth / 8; | 573 | RankSize = DRAMTYPE_TABLE[index][3] * XGINew_DataBusWidth / 8; |
574 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x13); | 574 | data = xgifb_reg_get(pVBInfo->P3c4, 0x13); |
575 | data &= 0x80; | 575 | data &= 0x80; |
576 | 576 | ||
577 | if (data == 0x80) | 577 | if (data == 0x80) |
@@ -591,7 +591,7 @@ static unsigned short XGINew_SetDRAMSize20Reg(int index, | |||
591 | memsize = data >> 4; | 591 | memsize = data >> 4; |
592 | 592 | ||
593 | /* [2004/03/25] Vicent, Fix DRAM Sizing Error */ | 593 | /* [2004/03/25] Vicent, Fix DRAM Sizing Error */ |
594 | xgifb_reg_set(pVBInfo->P3c4, 0x14, (XGINew_GetReg1(pVBInfo->P3c4, 0x14) & 0x0F) | (data & 0xF0)); | 594 | xgifb_reg_set(pVBInfo->P3c4, 0x14, (xgifb_reg_get(pVBInfo->P3c4, 0x14) & 0x0F) | (data & 0xF0)); |
595 | udelay(15); | 595 | udelay(15); |
596 | 596 | ||
597 | /* data |= XGINew_ChannelAB << 2; */ | 597 | /* data |= XGINew_ChannelAB << 2; */ |
@@ -636,10 +636,10 @@ static unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo) | |||
636 | { | 636 | { |
637 | unsigned char data; | 637 | unsigned char data; |
638 | 638 | ||
639 | data = XGINew_GetReg1(pVBInfo->P3d4, 0x97); | 639 | data = xgifb_reg_get(pVBInfo->P3d4, 0x97); |
640 | 640 | ||
641 | if ((data & 0x10) == 0) { | 641 | if ((data & 0x10) == 0) { |
642 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x39); | 642 | data = xgifb_reg_get(pVBInfo->P3c4, 0x39); |
643 | data = (data & 0x02) >> 1; | 643 | data = (data & 0x02) >> 1; |
644 | return data; | 644 | return data; |
645 | } else { | 645 | } else { |
@@ -655,7 +655,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension, | |||
655 | switch (HwDeviceExtension->jChipType) { | 655 | switch (HwDeviceExtension->jChipType) { |
656 | case XG20: | 656 | case XG20: |
657 | case XG21: | 657 | case XG21: |
658 | data = XGINew_GetReg1(pVBInfo->P3d4, 0x97); | 658 | data = xgifb_reg_get(pVBInfo->P3d4, 0x97); |
659 | data = data & 0x01; | 659 | data = data & 0x01; |
660 | XGINew_ChannelAB = 1; /* XG20 "JUST" one channel */ | 660 | XGINew_ChannelAB = 1; /* XG20 "JUST" one channel */ |
661 | 661 | ||
@@ -952,15 +952,15 @@ static void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *HwDeviceExtension, | |||
952 | 952 | ||
953 | XGISetModeNew(HwDeviceExtension, 0x2e); | 953 | XGISetModeNew(HwDeviceExtension, 0x2e); |
954 | 954 | ||
955 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x21); | 955 | data = xgifb_reg_get(pVBInfo->P3c4, 0x21); |
956 | xgifb_reg_set(pVBInfo->P3c4, 0x21, (unsigned short) (data & 0xDF)); /* disable read cache */ | 956 | xgifb_reg_set(pVBInfo->P3c4, 0x21, (unsigned short) (data & 0xDF)); /* disable read cache */ |
957 | XGI_DisplayOff(HwDeviceExtension, pVBInfo); | 957 | XGI_DisplayOff(HwDeviceExtension, pVBInfo); |
958 | 958 | ||
959 | /* data = XGINew_GetReg1(pVBInfo->P3c4, 0x1); */ | 959 | /* data = xgifb_reg_get(pVBInfo->P3c4, 0x1); */ |
960 | /* data |= 0x20 ; */ | 960 | /* data |= 0x20 ; */ |
961 | /* xgifb_reg_set(pVBInfo->P3c4, 0x01, data); *//* Turn OFF Display */ | 961 | /* xgifb_reg_set(pVBInfo->P3c4, 0x01, data); *//* Turn OFF Display */ |
962 | XGINew_DDRSizing340(HwDeviceExtension, pVBInfo); | 962 | XGINew_DDRSizing340(HwDeviceExtension, pVBInfo); |
963 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x21); | 963 | data = xgifb_reg_get(pVBInfo->P3c4, 0x21); |
964 | xgifb_reg_set(pVBInfo->P3c4, 0x21, (unsigned short) (data | 0x20)); /* enable read cache */ | 964 | xgifb_reg_set(pVBInfo->P3c4, 0x21, (unsigned short) (data | 0x20)); /* enable read cache */ |
965 | } | 965 | } |
966 | 966 | ||
@@ -1059,7 +1059,7 @@ static void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, | |||
1059 | { | 1059 | { |
1060 | unsigned short tempbx = 0, temp, tempcx, CR3CData; | 1060 | unsigned short tempbx = 0, temp, tempcx, CR3CData; |
1061 | 1061 | ||
1062 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x32); | 1062 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x32); |
1063 | 1063 | ||
1064 | if (temp & Monitor1Sense) | 1064 | if (temp & Monitor1Sense) |
1065 | tempbx |= ActiveCRT1; | 1065 | tempbx |= ActiveCRT1; |
@@ -1081,11 +1081,11 @@ static void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, | |||
1081 | tempbx |= (ActiveYPbPr << 8); | 1081 | tempbx |= (ActiveYPbPr << 8); |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | tempcx = XGINew_GetReg1(pVBInfo->P3d4, 0x3d); | 1084 | tempcx = xgifb_reg_get(pVBInfo->P3d4, 0x3d); |
1085 | tempcx |= (XGINew_GetReg1(pVBInfo->P3d4, 0x3e) << 8); | 1085 | tempcx |= (xgifb_reg_get(pVBInfo->P3d4, 0x3e) << 8); |
1086 | 1086 | ||
1087 | if (tempbx & tempcx) { | 1087 | if (tempbx & tempcx) { |
1088 | CR3CData = XGINew_GetReg1(pVBInfo->P3d4, 0x3c); | 1088 | CR3CData = xgifb_reg_get(pVBInfo->P3d4, 0x3c); |
1089 | if (!(CR3CData & DisplayDeviceFromCMOS)) { | 1089 | if (!(CR3CData & DisplayDeviceFromCMOS)) { |
1090 | tempcx = 0x1FF0; | 1090 | tempcx = 0x1FF0; |
1091 | if (*pVBInfo->pSoftSetting & ModeSoftSetting) | 1091 | if (*pVBInfo->pSoftSetting & ModeSoftSetting) |
@@ -1107,9 +1107,9 @@ static void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, | |||
1107 | { | 1107 | { |
1108 | unsigned short temp, tempcl = 0, tempch = 0, CR31Data, CR38Data; | 1108 | unsigned short temp, tempcl = 0, tempch = 0, CR31Data, CR38Data; |
1109 | 1109 | ||
1110 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x3d); | 1110 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x3d); |
1111 | temp |= XGINew_GetReg1(pVBInfo->P3d4, 0x3e) << 8; | 1111 | temp |= xgifb_reg_get(pVBInfo->P3d4, 0x3e) << 8; |
1112 | temp |= (XGINew_GetReg1(pVBInfo->P3d4, 0x31) & (DriverMode >> 8)) << 8; | 1112 | temp |= (xgifb_reg_get(pVBInfo->P3d4, 0x31) & (DriverMode >> 8)) << 8; |
1113 | 1113 | ||
1114 | if (pVBInfo->IF_DEF_CRT2Monitor == 1) { | 1114 | if (pVBInfo->IF_DEF_CRT2Monitor == 1) { |
1115 | if (temp & ActiveCRT2) | 1115 | if (temp & ActiveCRT2) |
@@ -1168,7 +1168,7 @@ static void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, | |||
1168 | tempcl ^= (SetSimuScanMode | SwitchToCRT2); | 1168 | tempcl ^= (SetSimuScanMode | SwitchToCRT2); |
1169 | xgifb_reg_set(pVBInfo->P3d4, 0x30, tempcl); | 1169 | xgifb_reg_set(pVBInfo->P3d4, 0x30, tempcl); |
1170 | 1170 | ||
1171 | CR31Data = XGINew_GetReg1(pVBInfo->P3d4, 0x31); | 1171 | CR31Data = xgifb_reg_get(pVBInfo->P3d4, 0x31); |
1172 | CR31Data &= ~(SetNotSimuMode >> 8); | 1172 | CR31Data &= ~(SetNotSimuMode >> 8); |
1173 | if (!(temp & ActiveCRT1)) | 1173 | if (!(temp & ActiveCRT1)) |
1174 | CR31Data |= (SetNotSimuMode >> 8); | 1174 | CR31Data |= (SetNotSimuMode >> 8); |
@@ -1177,7 +1177,7 @@ static void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, | |||
1177 | CR31Data |= (DisableCRT2Display >> 8); | 1177 | CR31Data |= (DisableCRT2Display >> 8); |
1178 | xgifb_reg_set(pVBInfo->P3d4, 0x31, CR31Data); | 1178 | xgifb_reg_set(pVBInfo->P3d4, 0x31, CR31Data); |
1179 | 1179 | ||
1180 | CR38Data = XGINew_GetReg1(pVBInfo->P3d4, 0x38); | 1180 | CR38Data = xgifb_reg_get(pVBInfo->P3d4, 0x38); |
1181 | CR38Data &= ~SetYPbPr; | 1181 | CR38Data &= ~SetYPbPr; |
1182 | CR38Data |= tempch; | 1182 | CR38Data |= tempch; |
1183 | xgifb_reg_set(pVBInfo->P3d4, 0x38, CR38Data); | 1183 | xgifb_reg_set(pVBInfo->P3d4, 0x38, CR38Data); |
@@ -1201,12 +1201,12 @@ static void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension, | |||
1201 | } else { | 1201 | } else { |
1202 | #endif | 1202 | #endif |
1203 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* Enable GPIOA/B read */ | 1203 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* Enable GPIOA/B read */ |
1204 | Temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48) & 0xC0; | 1204 | Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0xC0; |
1205 | if (Temp == 0xC0) { /* DVI & DVO GPIOA/B pull high */ | 1205 | if (Temp == 0xC0) { /* DVI & DVO GPIOA/B pull high */ |
1206 | XGINew_SenseLCD(HwDeviceExtension, pVBInfo); | 1206 | XGINew_SenseLCD(HwDeviceExtension, pVBInfo); |
1207 | XGINew_SetRegOR(pVBInfo->P3d4, 0x32, LCDSense); | 1207 | XGINew_SetRegOR(pVBInfo->P3d4, 0x32, LCDSense); |
1208 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x20, 0x20); /* Enable read GPIOF */ | 1208 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x20, 0x20); /* Enable read GPIOF */ |
1209 | Temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48) & 0x04; | 1209 | Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x04; |
1210 | if (!Temp) | 1210 | if (!Temp) |
1211 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0x80); /* TMDS on chip */ | 1211 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x38, ~0xE0, 0x80); /* TMDS on chip */ |
1212 | else | 1212 | else |
@@ -1224,9 +1224,9 @@ static void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension, | |||
1224 | unsigned char Temp, bCR4A; | 1224 | unsigned char Temp, bCR4A; |
1225 | 1225 | ||
1226 | pVBInfo->IF_DEF_LVDS = 0; | 1226 | pVBInfo->IF_DEF_LVDS = 0; |
1227 | bCR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 1227 | bCR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
1228 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x07, 0x07); /* Enable GPIOA/B/C read */ | 1228 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x07, 0x07); /* Enable GPIOA/B/C read */ |
1229 | Temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48) & 0x07; | 1229 | Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x07; |
1230 | xgifb_reg_set(pVBInfo->P3d4, 0x4A, bCR4A); | 1230 | xgifb_reg_set(pVBInfo->P3d4, 0x4A, bCR4A); |
1231 | 1231 | ||
1232 | if (Temp <= 0x02) { | 1232 | if (Temp <= 0x02) { |
@@ -1244,12 +1244,12 @@ static unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo) | |||
1244 | { | 1244 | { |
1245 | unsigned char CR38, CR4A, temp; | 1245 | unsigned char CR38, CR4A, temp; |
1246 | 1246 | ||
1247 | CR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 1247 | CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
1248 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x10, 0x10); /* enable GPIOE read */ | 1248 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x10, 0x10); /* enable GPIOE read */ |
1249 | CR38 = XGINew_GetReg1(pVBInfo->P3d4, 0x38); | 1249 | CR38 = xgifb_reg_get(pVBInfo->P3d4, 0x38); |
1250 | temp = 0; | 1250 | temp = 0; |
1251 | if ((CR38 & 0xE0) > 0x80) { | 1251 | if ((CR38 & 0xE0) > 0x80) { |
1252 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48); | 1252 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); |
1253 | temp &= 0x08; | 1253 | temp &= 0x08; |
1254 | temp >>= 3; | 1254 | temp >>= 3; |
1255 | } | 1255 | } |
@@ -1263,9 +1263,9 @@ static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo) | |||
1263 | { | 1263 | { |
1264 | unsigned char CR4A, temp; | 1264 | unsigned char CR4A, temp; |
1265 | 1265 | ||
1266 | CR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 1266 | CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
1267 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* enable GPIOA/B/C read */ | 1267 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); /* enable GPIOA/B/C read */ |
1268 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48); | 1268 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); |
1269 | if (temp <= 2) | 1269 | if (temp <= 2) |
1270 | temp &= 0x03; | 1270 | temp &= 0x03; |
1271 | else | 1271 | else |
@@ -1424,7 +1424,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension) | |||
1424 | if (HwDeviceExtension->jChipType < XG20) { /* kuku 2004/06/25 */ | 1424 | if (HwDeviceExtension->jChipType < XG20) { /* kuku 2004/06/25 */ |
1425 | /* Set AGP Rate */ | 1425 | /* Set AGP Rate */ |
1426 | /* | 1426 | /* |
1427 | temp1 = XGINew_GetReg1(pVBInfo->P3c4, 0x3B); | 1427 | temp1 = xgifb_reg_get(pVBInfo->P3c4, 0x3B); |
1428 | temp1 &= 0x02; | 1428 | temp1 &= 0x02; |
1429 | if (temp1 == 0x02) { | 1429 | if (temp1 == 0x02) { |
1430 | outl(0x80000000, 0xcf8); | 1430 | outl(0x80000000, 0xcf8); |
@@ -1492,7 +1492,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension) | |||
1492 | XGI_UnLockCRT2(HwDeviceExtension, pVBInfo); | 1492 | XGI_UnLockCRT2(HwDeviceExtension, pVBInfo); |
1493 | XGINew_SetRegANDOR(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00); /* alan, disable VideoCapture */ | 1493 | XGINew_SetRegANDOR(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00); /* alan, disable VideoCapture */ |
1494 | xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00); | 1494 | xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00); |
1495 | temp1 = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x7B); /* chk if BCLK>=100MHz */ | 1495 | temp1 = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x7B); /* chk if BCLK>=100MHz */ |
1496 | temp = (unsigned char) ((temp1 >> 4) & 0x0F); | 1496 | temp = (unsigned char) ((temp1 >> 4) & 0x0F); |
1497 | 1497 | ||
1498 | xgifb_reg_set(pVBInfo->Part1Port, 0x02, (*pVBInfo->pCRT2Data_1_2)); | 1498 | xgifb_reg_set(pVBInfo->Part1Port, 0x02, (*pVBInfo->pCRT2Data_1_2)); |
@@ -1577,7 +1577,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension) | |||
1577 | /* SetDefExt2Regs begin */ | 1577 | /* SetDefExt2Regs begin */ |
1578 | /* | 1578 | /* |
1579 | AGP = 1; | 1579 | AGP = 1; |
1580 | temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x3A); | 1580 | temp = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x3A); |
1581 | temp &= 0x30; | 1581 | temp &= 0x30; |
1582 | if (temp == 0x30) | 1582 | if (temp == 0x30) |
1583 | AGP = 0; | 1583 | AGP = 0; |
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 4cca02dc5ad..cef0cf7f759 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c | |||
@@ -274,7 +274,7 @@ static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, | |||
274 | unsigned char CRTCdata; | 274 | unsigned char CRTCdata; |
275 | unsigned short i; | 275 | unsigned short i; |
276 | 276 | ||
277 | CRTCdata = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); | 277 | CRTCdata = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); |
278 | CRTCdata &= 0x7f; | 278 | CRTCdata &= 0x7f; |
279 | xgifb_reg_set(pVBInfo->P3d4, 0x11, CRTCdata); /* Unlock CRTC */ | 279 | xgifb_reg_set(pVBInfo->P3d4, 0x11, CRTCdata); /* Unlock CRTC */ |
280 | 280 | ||
@@ -345,7 +345,7 @@ static void XGI_SetGRCRegs(unsigned short StandTableIndex, | |||
345 | } | 345 | } |
346 | 346 | ||
347 | if (pVBInfo->ModeType > ModeVGA) { | 347 | if (pVBInfo->ModeType > ModeVGA) { |
348 | GRdata = (unsigned char) XGINew_GetReg1(pVBInfo->P3ce, 0x05); | 348 | GRdata = (unsigned char) xgifb_reg_get(pVBInfo->P3ce, 0x05); |
349 | GRdata &= 0xBF; /* 256 color disable */ | 349 | GRdata &= 0xBF; /* 256 color disable */ |
350 | xgifb_reg_set(pVBInfo->P3ce, 0x05, GRdata); | 350 | xgifb_reg_set(pVBInfo->P3ce, 0x05, GRdata); |
351 | } | 351 | } |
@@ -538,7 +538,7 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, | |||
538 | /* xgifb_reg_set(pVBInfo->P3d4, 0x56, 0); */ | 538 | /* xgifb_reg_set(pVBInfo->P3d4, 0x56, 0); */ |
539 | /* XGINew_SetRegANDOR(pVBInfo->P3d4, 0x11, 0x7f, 0x00); */ | 539 | /* XGINew_SetRegANDOR(pVBInfo->P3d4, 0x11, 0x7f, 0x00); */ |
540 | 540 | ||
541 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); /* unlock cr0-7 */ | 541 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); /* unlock cr0-7 */ |
542 | data &= 0x7F; | 542 | data &= 0x7F; |
543 | xgifb_reg_set(pVBInfo->P3d4, 0x11, data); | 543 | xgifb_reg_set(pVBInfo->P3d4, 0x11, data); |
544 | 544 | ||
@@ -555,7 +555,7 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, | |||
555 | xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i + 6), data); | 555 | xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i + 6), data); |
556 | } | 556 | } |
557 | 557 | ||
558 | j = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x0e); | 558 | j = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0e); |
559 | j &= 0x1F; | 559 | j &= 0x1F; |
560 | data = pVBInfo->TimingH[0].data[7]; | 560 | data = pVBInfo->TimingH[0].data[7]; |
561 | data &= 0xE0; | 561 | data &= 0xE0; |
@@ -563,16 +563,16 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, | |||
563 | xgifb_reg_set(pVBInfo->P3c4, 0x0e, data); | 563 | xgifb_reg_set(pVBInfo->P3c4, 0x0e, data); |
564 | 564 | ||
565 | if (HwDeviceExtension->jChipType >= XG20) { | 565 | if (HwDeviceExtension->jChipType >= XG20) { |
566 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x04); | 566 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x04); |
567 | data = data - 1; | 567 | data = data - 1; |
568 | xgifb_reg_set(pVBInfo->P3d4, 0x04, data); | 568 | xgifb_reg_set(pVBInfo->P3d4, 0x04, data); |
569 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x05); | 569 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x05); |
570 | data1 = data; | 570 | data1 = data; |
571 | data1 &= 0xE0; | 571 | data1 &= 0xE0; |
572 | data &= 0x1F; | 572 | data &= 0x1F; |
573 | if (data == 0) { | 573 | if (data == 0) { |
574 | pushax = data; | 574 | pushax = data; |
575 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, | 575 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, |
576 | 0x0c); | 576 | 0x0c); |
577 | data &= 0xFB; | 577 | data &= 0xFB; |
578 | xgifb_reg_set(pVBInfo->P3c4, 0x0c, data); | 578 | xgifb_reg_set(pVBInfo->P3c4, 0x0c, data); |
@@ -581,7 +581,7 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, | |||
581 | data = data - 1; | 581 | data = data - 1; |
582 | data |= data1; | 582 | data |= data1; |
583 | xgifb_reg_set(pVBInfo->P3d4, 0x05, data); | 583 | xgifb_reg_set(pVBInfo->P3d4, 0x05, data); |
584 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x0e); | 584 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0e); |
585 | data = data >> 5; | 585 | data = data >> 5; |
586 | data = data + 3; | 586 | data = data + 3; |
587 | if (data > 7) | 587 | if (data > 7) |
@@ -616,7 +616,7 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeN | |||
616 | xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x11), data); | 616 | xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x11), data); |
617 | } | 617 | } |
618 | 618 | ||
619 | j = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x0a); | 619 | j = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0a); |
620 | j &= 0xC0; | 620 | j &= 0xC0; |
621 | data = pVBInfo->TimingV[0].data[6]; | 621 | data = pVBInfo->TimingV[0].data[6]; |
622 | data &= 0x3F; | 622 | data &= 0x3F; |
@@ -636,7 +636,7 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeN | |||
636 | if (i) | 636 | if (i) |
637 | data |= 0x80; | 637 | data |= 0x80; |
638 | 638 | ||
639 | j = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x09); | 639 | j = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x09); |
640 | j &= 0x5F; | 640 | j &= 0x5F; |
641 | data |= j; | 641 | data |= j; |
642 | xgifb_reg_set(pVBInfo->P3d4, 0x09, data); | 642 | xgifb_reg_set(pVBInfo->P3d4, 0x09, data); |
@@ -653,7 +653,7 @@ static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
653 | index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; /* Get index */ | 653 | index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; /* Get index */ |
654 | index = index & IndexMask; | 654 | index = index & IndexMask; |
655 | 655 | ||
656 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); | 656 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); |
657 | data &= 0x7F; | 657 | data &= 0x7F; |
658 | xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ | 658 | xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ |
659 | 659 | ||
@@ -955,7 +955,7 @@ static void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, | |||
955 | xgifb_reg_set(pVBInfo->P3d4, 0x47, *pVBInfo->pCR47); | 955 | xgifb_reg_set(pVBInfo->P3d4, 0x47, *pVBInfo->pCR47); |
956 | } | 956 | } |
957 | 957 | ||
958 | Temp = XGINew_GetReg1(pVBInfo->P3d4, 0x37); | 958 | Temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); |
959 | 959 | ||
960 | if (Temp & 0x01) { | 960 | if (Temp & 0x01) { |
961 | XGINew_SetRegOR(pVBInfo->P3c4, 0x06, 0x40); /* 18 bits FP */ | 961 | XGINew_SetRegOR(pVBInfo->P3c4, 0x06, 0x40); /* 18 bits FP */ |
@@ -995,7 +995,7 @@ static void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, | |||
995 | xgifb_reg_set(pVBInfo->P3d4, 0x46, 0x00); | 995 | xgifb_reg_set(pVBInfo->P3d4, 0x46, 0x00); |
996 | xgifb_reg_set(pVBInfo->P3d4, 0x47, 0x00); | 996 | xgifb_reg_set(pVBInfo->P3d4, 0x47, 0x00); |
997 | 997 | ||
998 | Temp = XGINew_GetReg1(pVBInfo->P3d4, 0x37); | 998 | Temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); |
999 | if ((Temp & 0x03) == 0) { /* dual 12 */ | 999 | if ((Temp & 0x03) == 0) { /* dual 12 */ |
1000 | xgifb_reg_set(pVBInfo->P3d4, 0x46, 0x13); | 1000 | xgifb_reg_set(pVBInfo->P3d4, 0x46, 0x13); |
1001 | xgifb_reg_set(pVBInfo->P3d4, 0x47, 0x13); | 1001 | xgifb_reg_set(pVBInfo->P3d4, 0x47, 0x13); |
@@ -1122,8 +1122,8 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, | |||
1122 | tempax -= 1; | 1122 | tempax -= 1; |
1123 | tempbx -= 1; | 1123 | tempbx -= 1; |
1124 | tempcx = tempax; | 1124 | tempcx = tempax; |
1125 | temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); | 1125 | temp = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); |
1126 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); | 1126 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); |
1127 | data &= 0x7F; | 1127 | data &= 0x7F; |
1128 | xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ | 1128 | xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ |
1129 | xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short) (tempcx & 0xff)); | 1129 | xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short) (tempcx & 0xff)); |
@@ -1140,7 +1140,7 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, | |||
1140 | tempax |= 0x40; | 1140 | tempax |= 0x40; |
1141 | 1141 | ||
1142 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x42, tempax); | 1142 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x42, tempax); |
1143 | data = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x07); | 1143 | data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x07); |
1144 | data &= 0xFF; | 1144 | data &= 0xFF; |
1145 | tempax = 0; | 1145 | tempax = 0; |
1146 | 1146 | ||
@@ -1216,7 +1216,7 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1216 | temp2 = temp; | 1216 | temp2 = temp; |
1217 | temp = temp >> 8; /* ah */ | 1217 | temp = temp >> 8; /* ah */ |
1218 | temp &= 0x0F; | 1218 | temp &= 0x0F; |
1219 | i = XGINew_GetReg1(pVBInfo->P3c4, 0x0E); | 1219 | i = xgifb_reg_get(pVBInfo->P3c4, 0x0E); |
1220 | i &= 0xF0; | 1220 | i &= 0xF0; |
1221 | i |= temp; | 1221 | i |= temp; |
1222 | xgifb_reg_set(pVBInfo->P3c4, 0x0E, i); | 1222 | xgifb_reg_set(pVBInfo->P3c4, 0x0E, i); |
@@ -1429,7 +1429,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1429 | 1429 | ||
1430 | if (pVBInfo->IF_DEF_LVDS == 1) { | 1430 | if (pVBInfo->IF_DEF_LVDS == 1) { |
1431 | index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; | 1431 | index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; |
1432 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x31) & 0xCF; | 1432 | data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; |
1433 | xgifb_reg_set(pVBInfo->P3c4, 0x31, data); | 1433 | xgifb_reg_set(pVBInfo->P3c4, 0x31, data); |
1434 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, | 1434 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, |
1435 | pVBInfo->VCLKData[index].SR2B); | 1435 | pVBInfo->VCLKData[index].SR2B); |
@@ -1442,7 +1442,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1442 | vclkindex = XGI_GetVCLK2Ptr(ModeNo, ModeIdIndex, | 1442 | vclkindex = XGI_GetVCLK2Ptr(ModeNo, ModeIdIndex, |
1443 | RefreshRateTableIndex, HwDeviceExtension, | 1443 | RefreshRateTableIndex, HwDeviceExtension, |
1444 | pVBInfo); | 1444 | pVBInfo); |
1445 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x31) & 0xCF; | 1445 | data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; |
1446 | xgifb_reg_set(pVBInfo->P3c4, 0x31, data); | 1446 | xgifb_reg_set(pVBInfo->P3c4, 0x31, data); |
1447 | data = pVBInfo->VBVCLKData[vclkindex].Part4_A; | 1447 | data = pVBInfo->VBVCLKData[vclkindex].Part4_A; |
1448 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, data); | 1448 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, data); |
@@ -1451,7 +1451,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1451 | xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01); | 1451 | xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01); |
1452 | } else { | 1452 | } else { |
1453 | index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; | 1453 | index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; |
1454 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x31) & 0xCF; | 1454 | data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; |
1455 | xgifb_reg_set(pVBInfo->P3c4, 0x31, data); | 1455 | xgifb_reg_set(pVBInfo->P3c4, 0x31, data); |
1456 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, | 1456 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, |
1457 | pVBInfo->VCLKData[index].SR2B); | 1457 | pVBInfo->VCLKData[index].SR2B); |
@@ -1462,9 +1462,9 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1462 | 1462 | ||
1463 | if (HwDeviceExtension->jChipType >= XG20) { | 1463 | if (HwDeviceExtension->jChipType >= XG20) { |
1464 | if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag & HalfDCLK) { | 1464 | if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag & HalfDCLK) { |
1465 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x2B); | 1465 | data = xgifb_reg_get(pVBInfo->P3c4, 0x2B); |
1466 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, data); | 1466 | xgifb_reg_set(pVBInfo->P3c4, 0x2B, data); |
1467 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x2C); | 1467 | data = xgifb_reg_get(pVBInfo->P3c4, 0x2C); |
1468 | index = data; | 1468 | index = data; |
1469 | index &= 0xE0; | 1469 | index &= 0xE0; |
1470 | data &= 0x1F; | 1470 | data &= 0x1F; |
@@ -1482,27 +1482,27 @@ static void XGI_SetCRT1FIFO(unsigned short ModeNo, | |||
1482 | { | 1482 | { |
1483 | unsigned short data; | 1483 | unsigned short data; |
1484 | 1484 | ||
1485 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x3D); | 1485 | data = xgifb_reg_get(pVBInfo->P3c4, 0x3D); |
1486 | data &= 0xfe; | 1486 | data &= 0xfe; |
1487 | xgifb_reg_set(pVBInfo->P3c4, 0x3D, data); /* diable auto-threshold */ | 1487 | xgifb_reg_set(pVBInfo->P3c4, 0x3D, data); /* diable auto-threshold */ |
1488 | 1488 | ||
1489 | if (ModeNo > 0x13) { | 1489 | if (ModeNo > 0x13) { |
1490 | xgifb_reg_set(pVBInfo->P3c4, 0x08, 0x34); | 1490 | xgifb_reg_set(pVBInfo->P3c4, 0x08, 0x34); |
1491 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x09); | 1491 | data = xgifb_reg_get(pVBInfo->P3c4, 0x09); |
1492 | data &= 0xC0; | 1492 | data &= 0xC0; |
1493 | xgifb_reg_set(pVBInfo->P3c4, 0x09, data | 0x30); | 1493 | xgifb_reg_set(pVBInfo->P3c4, 0x09, data | 0x30); |
1494 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x3D); | 1494 | data = xgifb_reg_get(pVBInfo->P3c4, 0x3D); |
1495 | data |= 0x01; | 1495 | data |= 0x01; |
1496 | xgifb_reg_set(pVBInfo->P3c4, 0x3D, data); | 1496 | xgifb_reg_set(pVBInfo->P3c4, 0x3D, data); |
1497 | } else { | 1497 | } else { |
1498 | if (HwDeviceExtension->jChipType == XG27) { | 1498 | if (HwDeviceExtension->jChipType == XG27) { |
1499 | xgifb_reg_set(pVBInfo->P3c4, 0x08, 0x0E); | 1499 | xgifb_reg_set(pVBInfo->P3c4, 0x08, 0x0E); |
1500 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x09); | 1500 | data = xgifb_reg_get(pVBInfo->P3c4, 0x09); |
1501 | data &= 0xC0; | 1501 | data &= 0xC0; |
1502 | xgifb_reg_set(pVBInfo->P3c4, 0x09, data | 0x20); | 1502 | xgifb_reg_set(pVBInfo->P3c4, 0x09, data | 0x20); |
1503 | } else { | 1503 | } else { |
1504 | xgifb_reg_set(pVBInfo->P3c4, 0x08, 0xAE); | 1504 | xgifb_reg_set(pVBInfo->P3c4, 0x08, 0xAE); |
1505 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x09); | 1505 | data = xgifb_reg_get(pVBInfo->P3c4, 0x09); |
1506 | data &= 0xF0; | 1506 | data &= 0xF0; |
1507 | xgifb_reg_set(pVBInfo->P3c4, 0x09, data); | 1507 | xgifb_reg_set(pVBInfo->P3c4, 0x09, data); |
1508 | } | 1508 | } |
@@ -1529,7 +1529,7 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, | |||
1529 | VCLK = pVBInfo->VCLKData[index].CLOCK; | 1529 | VCLK = pVBInfo->VCLKData[index].CLOCK; |
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x32); | 1532 | data = xgifb_reg_get(pVBInfo->P3c4, 0x32); |
1533 | data &= 0xf3; | 1533 | data &= 0xf3; |
1534 | if (VCLK >= 200) | 1534 | if (VCLK >= 200) |
1535 | data |= 0x0c; /* VCLK > 200 */ | 1535 | data |= 0x0c; /* VCLK > 200 */ |
@@ -1540,7 +1540,7 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, | |||
1540 | xgifb_reg_set(pVBInfo->P3c4, 0x32, data); | 1540 | xgifb_reg_set(pVBInfo->P3c4, 0x32, data); |
1541 | 1541 | ||
1542 | if (HwDeviceExtension->jChipType < XG20) { | 1542 | if (HwDeviceExtension->jChipType < XG20) { |
1543 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x1F); | 1543 | data = xgifb_reg_get(pVBInfo->P3c4, 0x1F); |
1544 | data &= 0xE7; | 1544 | data &= 0xE7; |
1545 | if (VCLK < 200) | 1545 | if (VCLK < 200) |
1546 | data |= 0x10; | 1546 | data |= 0x10; |
@@ -1580,7 +1580,7 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, | |||
1580 | } else | 1580 | } else |
1581 | modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */ | 1581 | modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */ |
1582 | 1582 | ||
1583 | if (XGINew_GetReg1(pVBInfo->P3d4, 0x31) & 0x01) | 1583 | if (xgifb_reg_get(pVBInfo->P3d4, 0x31) & 0x01) |
1584 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, 0x3F, 0x00); | 1584 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, 0x3F, 0x00); |
1585 | 1585 | ||
1586 | if (ModeNo > 0x13) | 1586 | if (ModeNo > 0x13) |
@@ -1654,7 +1654,7 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, | |||
1654 | /* if (XGINew_IF_DEF_NEW_LOWRES) */ | 1654 | /* if (XGINew_IF_DEF_NEW_LOWRES) */ |
1655 | /* XGI_VesaLowResolution(ModeNo, ModeIdIndex); //030305 fix lowresolution bug */ | 1655 | /* XGI_VesaLowResolution(ModeNo, ModeIdIndex); //030305 fix lowresolution bug */ |
1656 | 1656 | ||
1657 | data = XGINew_GetReg1(pVBInfo->P3d4, 0x31); | 1657 | data = xgifb_reg_get(pVBInfo->P3d4, 0x31); |
1658 | 1658 | ||
1659 | if (HwDeviceExtension->jChipType == XG27) { | 1659 | if (HwDeviceExtension->jChipType == XG27) { |
1660 | if (data & 0x40) | 1660 | if (data & 0x40) |
@@ -2668,7 +2668,7 @@ static unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo) | |||
2668 | { | 2668 | { |
2669 | unsigned char tempal, tempah, tempbl, i; | 2669 | unsigned char tempal, tempah, tempbl, i; |
2670 | 2670 | ||
2671 | tempah = XGINew_GetReg1(pVBInfo->P3d4, 0x36); | 2671 | tempah = xgifb_reg_get(pVBInfo->P3d4, 0x36); |
2672 | tempal = tempah & 0x0F; | 2672 | tempal = tempah & 0x0F; |
2673 | tempah = tempah & 0xF0; | 2673 | tempah = tempah & 0xF0; |
2674 | i = 0; | 2674 | i = 0; |
@@ -3276,22 +3276,22 @@ static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, | |||
3276 | | VB_XGI302LV | VB_XGI301C)) { | 3276 | | VB_XGI302LV | VB_XGI301C)) { |
3277 | tempcl = 0; | 3277 | tempcl = 0; |
3278 | tempch = 0; | 3278 | tempch = 0; |
3279 | temp = XGINew_GetReg1(pVBInfo->P3c4, 0x01); | 3279 | temp = xgifb_reg_get(pVBInfo->P3c4, 0x01); |
3280 | 3280 | ||
3281 | if (!(temp & 0x20)) { | 3281 | if (!(temp & 0x20)) { |
3282 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x17); | 3282 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x17); |
3283 | if (temp & 0x80) { | 3283 | if (temp & 0x80) { |
3284 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x53); | 3284 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x53); |
3285 | if (!(temp & 0x40)) | 3285 | if (!(temp & 0x40)) |
3286 | tempcl |= ActiveCRT1; | 3286 | tempcl |= ActiveCRT1; |
3287 | } | 3287 | } |
3288 | } | 3288 | } |
3289 | 3289 | ||
3290 | temp = XGINew_GetReg1(pVBInfo->Part1Port, 0x2e); | 3290 | temp = xgifb_reg_get(pVBInfo->Part1Port, 0x2e); |
3291 | temp &= 0x0f; | 3291 | temp &= 0x0f; |
3292 | 3292 | ||
3293 | if (!(temp == 0x08)) { | 3293 | if (!(temp == 0x08)) { |
3294 | tempax = XGINew_GetReg1(pVBInfo->Part1Port, 0x13); /* Check ChannelA by Part1_13 [2003/10/03] */ | 3294 | tempax = xgifb_reg_get(pVBInfo->Part1Port, 0x13); /* Check ChannelA by Part1_13 [2003/10/03] */ |
3295 | if (tempax & 0x04) | 3295 | if (tempax & 0x04) |
3296 | tempcl = tempcl | ActiveLCD; | 3296 | tempcl = tempcl | ActiveLCD; |
3297 | 3297 | ||
@@ -3305,7 +3305,7 @@ static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, | |||
3305 | tempcl |= ActiveLCD; | 3305 | tempcl |= ActiveLCD; |
3306 | 3306 | ||
3307 | if (temp == 0x05) { | 3307 | if (temp == 0x05) { |
3308 | temp = XGINew_GetReg1(pVBInfo->Part2Port, 0x00); | 3308 | temp = xgifb_reg_get(pVBInfo->Part2Port, 0x00); |
3309 | 3309 | ||
3310 | if (!(temp & 0x08)) | 3310 | if (!(temp & 0x08)) |
3311 | tempch |= ActiveAVideo; | 3311 | tempch |= ActiveAVideo; |
@@ -3322,7 +3322,7 @@ static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, | |||
3322 | } | 3322 | } |
3323 | 3323 | ||
3324 | if (pVBInfo->VBInfo & SetCRT2ToYPbPr) { | 3324 | if (pVBInfo->VBInfo & SetCRT2ToYPbPr) { |
3325 | temp = XGINew_GetReg1( | 3325 | temp = xgifb_reg_get( |
3326 | pVBInfo->Part2Port, | 3326 | pVBInfo->Part2Port, |
3327 | 0x4d); | 3327 | 0x4d); |
3328 | 3328 | ||
@@ -3335,7 +3335,7 @@ static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, | |||
3335 | } | 3335 | } |
3336 | } | 3336 | } |
3337 | 3337 | ||
3338 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x3d); | 3338 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x3d); |
3339 | if (tempcl & ActiveLCD) { | 3339 | if (tempcl & ActiveLCD) { |
3340 | if ((pVBInfo->SetFlag & ReserveTVOption)) { | 3340 | if ((pVBInfo->SetFlag & ReserveTVOption)) { |
3341 | if (temp & ActiveTV) | 3341 | if (temp & ActiveTV) |
@@ -3376,10 +3376,10 @@ void XGI_GetVBType(struct vb_device_info *pVBInfo) | |||
3376 | } | 3376 | } |
3377 | if (pVBInfo->IF_DEF_LVDS == 0) { | 3377 | if (pVBInfo->IF_DEF_LVDS == 0) { |
3378 | tempbx = VB_XGI302B; | 3378 | tempbx = VB_XGI302B; |
3379 | flag = XGINew_GetReg1(pVBInfo->Part4Port, 0x00); | 3379 | flag = xgifb_reg_get(pVBInfo->Part4Port, 0x00); |
3380 | if (flag != 0x02) { | 3380 | if (flag != 0x02) { |
3381 | tempbx = VB_XGI301; | 3381 | tempbx = VB_XGI301; |
3382 | flag = XGINew_GetReg1(pVBInfo->Part4Port, 0x01); | 3382 | flag = xgifb_reg_get(pVBInfo->Part4Port, 0x01); |
3383 | if (flag >= 0xB0) { | 3383 | if (flag >= 0xB0) { |
3384 | tempbx = VB_XGI301B; | 3384 | tempbx = VB_XGI301B; |
3385 | if (flag >= 0xC0) { | 3385 | if (flag >= 0xC0) { |
@@ -3389,7 +3389,7 @@ void XGI_GetVBType(struct vb_device_info *pVBInfo) | |||
3389 | if (flag >= 0xE0) { | 3389 | if (flag >= 0xE0) { |
3390 | tempbx = VB_XGI302LV; | 3390 | tempbx = VB_XGI302LV; |
3391 | tempah | 3391 | tempah |
3392 | = XGINew_GetReg1( | 3392 | = xgifb_reg_get( |
3393 | pVBInfo->Part4Port, | 3393 | pVBInfo->Part4Port, |
3394 | 0x39); | 3394 | 0x39); |
3395 | if (tempah != 0xFF) | 3395 | if (tempah != 0xFF) |
@@ -3400,7 +3400,7 @@ void XGI_GetVBType(struct vb_device_info *pVBInfo) | |||
3400 | } | 3400 | } |
3401 | 3401 | ||
3402 | if (tempbx & (VB_XGI301B | VB_XGI302B)) { | 3402 | if (tempbx & (VB_XGI301B | VB_XGI302B)) { |
3403 | flag = XGINew_GetReg1( | 3403 | flag = xgifb_reg_get( |
3404 | pVBInfo->Part4Port, | 3404 | pVBInfo->Part4Port, |
3405 | 0x23); | 3405 | 0x23); |
3406 | 3406 | ||
@@ -3436,9 +3436,9 @@ void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3436 | tempbx = 0; | 3436 | tempbx = 0; |
3437 | 3437 | ||
3438 | if (pVBInfo->VBType & 0xFFFF) { | 3438 | if (pVBInfo->VBType & 0xFFFF) { |
3439 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x30); /* Check Display Device */ | 3439 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x30); /* Check Display Device */ |
3440 | tempbx = tempbx | temp; | 3440 | tempbx = tempbx | temp; |
3441 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x31); | 3441 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x31); |
3442 | push = temp; | 3442 | push = temp; |
3443 | push = push << 8; | 3443 | push = push << 8; |
3444 | tempax = temp << 8; | 3444 | tempax = temp << 8; |
@@ -3448,7 +3448,7 @@ void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3448 | temp = 0xFFFF ^ temp; | 3448 | temp = 0xFFFF ^ temp; |
3449 | tempbx &= temp; | 3449 | tempbx &= temp; |
3450 | 3450 | ||
3451 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38); | 3451 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); |
3452 | 3452 | ||
3453 | if (pVBInfo->IF_DEF_LCDA == 1) { | 3453 | if (pVBInfo->IF_DEF_LCDA == 1) { |
3454 | 3454 | ||
@@ -3497,7 +3497,7 @@ void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3497 | & VB_CH7007))) { /* [Billy] 07/05/04 */ | 3497 | & VB_CH7007))) { /* [Billy] 07/05/04 */ |
3498 | if (temp & SetYPbPr) { /* temp = CR38 */ | 3498 | if (temp & SetYPbPr) { /* temp = CR38 */ |
3499 | if (pVBInfo->IF_DEF_HiVision == 1) { | 3499 | if (pVBInfo->IF_DEF_HiVision == 1) { |
3500 | temp = XGINew_GetReg1( | 3500 | temp = xgifb_reg_get( |
3501 | pVBInfo->P3d4, | 3501 | pVBInfo->P3d4, |
3502 | 0x35); /* shampoo add for new scratch */ | 3502 | 0x35); /* shampoo add for new scratch */ |
3503 | temp &= YPbPrMode; | 3503 | temp &= YPbPrMode; |
@@ -3685,7 +3685,7 @@ void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3685 | } | 3685 | } |
3686 | 3686 | ||
3687 | if (pVBInfo->VBInfo & SetCRT2ToTV) { | 3687 | if (pVBInfo->VBInfo & SetCRT2ToTV) { |
3688 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x35); | 3688 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x35); |
3689 | tempbx = temp; | 3689 | tempbx = temp; |
3690 | if (tempbx & SetPALTV) { | 3690 | if (tempbx & SetPALTV) { |
3691 | tempbx &= (SetCHTVOverScan | SetPALMTV | 3691 | tempbx &= (SetCHTVOverScan | SetPALMTV |
@@ -3697,7 +3697,7 @@ void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3697 | | SetPALTV); | 3697 | | SetPALTV); |
3698 | /* | 3698 | /* |
3699 | if (pVBInfo->IF_DEF_LVDS == 0) { | 3699 | if (pVBInfo->IF_DEF_LVDS == 0) { |
3700 | index1 = XGINew_GetReg1(pVBInfo->P3d4, 0x38); //PAL-M/PAL-N Info | 3700 | index1 = xgifb_reg_get(pVBInfo->P3d4, 0x38); //PAL-M/PAL-N Info |
3701 | temp2 = (index1 & 0xC0) >> 5; //00:PAL, 01:PAL-M, 10:PAL-N | 3701 | temp2 = (index1 & 0xC0) >> 5; //00:PAL, 01:PAL-M, 10:PAL-N |
3702 | tempbx |= temp2; | 3702 | tempbx |= temp2; |
3703 | if (temp2 & 0x02) //PAL-M | 3703 | if (temp2 & 0x02) //PAL-M |
@@ -3707,14 +3707,14 @@ void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3707 | } | 3707 | } |
3708 | 3708 | ||
3709 | if (pVBInfo->IF_DEF_CH7017 == 1) { | 3709 | if (pVBInfo->IF_DEF_CH7017 == 1) { |
3710 | tempbx = XGINew_GetReg1(pVBInfo->P3d4, 0x35); | 3710 | tempbx = xgifb_reg_get(pVBInfo->P3d4, 0x35); |
3711 | 3711 | ||
3712 | if (tempbx & TVOverScan) | 3712 | if (tempbx & TVOverScan) |
3713 | tempbx |= SetCHTVOverScan; | 3713 | tempbx |= SetCHTVOverScan; |
3714 | } | 3714 | } |
3715 | 3715 | ||
3716 | if (pVBInfo->IF_DEF_CH7007 == 1) { /* [Billy] 07/05/04 */ | 3716 | if (pVBInfo->IF_DEF_CH7007 == 1) { /* [Billy] 07/05/04 */ |
3717 | tempbx = XGINew_GetReg1(pVBInfo->P3d4, 0x35); | 3717 | tempbx = xgifb_reg_get(pVBInfo->P3d4, 0x35); |
3718 | 3718 | ||
3719 | if (tempbx & TVOverScan) | 3719 | if (tempbx & TVOverScan) |
3720 | tempbx |= SetCHTVOverScan; | 3720 | tempbx |= SetCHTVOverScan; |
@@ -3727,7 +3727,7 @@ void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3727 | 3727 | ||
3728 | if (pVBInfo->IF_DEF_YPbPr == 1) { | 3728 | if (pVBInfo->IF_DEF_YPbPr == 1) { |
3729 | if (pVBInfo->VBInfo & SetCRT2ToYPbPr) { | 3729 | if (pVBInfo->VBInfo & SetCRT2ToYPbPr) { |
3730 | index1 = XGINew_GetReg1(pVBInfo->P3d4, 0x35); | 3730 | index1 = xgifb_reg_get(pVBInfo->P3d4, 0x35); |
3731 | index1 &= YPbPrMode; | 3731 | index1 &= YPbPrMode; |
3732 | 3732 | ||
3733 | if (index1 == YPbPrMode525i) | 3733 | if (index1 == YPbPrMode525i) |
@@ -3791,7 +3791,7 @@ unsigned char XGI_GetLCDInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3791 | resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO; /* si+Ext_ResInfo // */ | 3791 | resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO; /* si+Ext_ResInfo // */ |
3792 | } | 3792 | } |
3793 | 3793 | ||
3794 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x36); /* Get LCD Res.Info */ | 3794 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x36); /* Get LCD Res.Info */ |
3795 | tempbx = temp & 0x0F; | 3795 | tempbx = temp & 0x0F; |
3796 | 3796 | ||
3797 | if (tempbx == 0) | 3797 | if (tempbx == 0) |
@@ -3800,7 +3800,7 @@ unsigned char XGI_GetLCDInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3800 | /* LCD75 [2003/8/22] Vicent */ | 3800 | /* LCD75 [2003/8/22] Vicent */ |
3801 | if ((tempbx == Panel1024x768) || (tempbx == Panel1280x1024)) { | 3801 | if ((tempbx == Panel1024x768) || (tempbx == Panel1280x1024)) { |
3802 | if (pVBInfo->VBInfo & DriverMode) { | 3802 | if (pVBInfo->VBInfo & DriverMode) { |
3803 | tempax = XGINew_GetReg1(pVBInfo->P3d4, 0x33); | 3803 | tempax = xgifb_reg_get(pVBInfo->P3d4, 0x33); |
3804 | if (pVBInfo->VBInfo & SetCRT2ToLCDA) | 3804 | if (pVBInfo->VBInfo & SetCRT2ToLCDA) |
3805 | tempax &= 0x0F; | 3805 | tempax &= 0x0F; |
3806 | else | 3806 | else |
@@ -3828,7 +3828,7 @@ unsigned char XGI_GetLCDInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3828 | 3828 | ||
3829 | tempbx = 0; | 3829 | tempbx = 0; |
3830 | 3830 | ||
3831 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x37); | 3831 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); |
3832 | 3832 | ||
3833 | temp &= (ScalingLCD | LCDNonExpanding | LCDSyncBit | SetPWDEnable); | 3833 | temp &= (ScalingLCD | LCDNonExpanding | LCDSyncBit | SetPWDEnable); |
3834 | 3834 | ||
@@ -3998,7 +3998,7 @@ static unsigned char XGINew_CheckMemorySize( | |||
3998 | memorysize = memorysize > MemorySizeShift; | 3998 | memorysize = memorysize > MemorySizeShift; |
3999 | memorysize++; /* Get memory size */ | 3999 | memorysize++; /* Get memory size */ |
4000 | 4000 | ||
4001 | temp = XGINew_GetReg1(pVBInfo->P3c4, 0x14); /* Get DRAM Size */ | 4001 | temp = xgifb_reg_get(pVBInfo->P3c4, 0x14); /* Get DRAM Size */ |
4002 | tmp = temp; | 4002 | tmp = temp; |
4003 | 4003 | ||
4004 | if (HwDeviceExtension->jChipType == XG40) { | 4004 | if (HwDeviceExtension->jChipType == XG40) { |
@@ -4038,17 +4038,17 @@ void XGINew_IsLowResolution(unsigned short ModeNo, unsigned short ModeIdIndex, u | |||
4038 | unsigned short data ; | 4038 | unsigned short data ; |
4039 | unsigned short ModeFlag ; | 4039 | unsigned short ModeFlag ; |
4040 | 4040 | ||
4041 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x0F); | 4041 | data = xgifb_reg_get(pVBInfo->P3c4, 0x0F); |
4042 | data &= 0x7F; | 4042 | data &= 0x7F; |
4043 | xgifb_reg_set(pVBInfo->P3c4, 0x0F, data); | 4043 | xgifb_reg_set(pVBInfo->P3c4, 0x0F, data); |
4044 | 4044 | ||
4045 | if (ModeNo > 0x13) { | 4045 | if (ModeNo > 0x13) { |
4046 | ModeFlag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; | 4046 | ModeFlag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; |
4047 | if ((ModeFlag & HalfDCLK) && (ModeFlag & DoubleScanMode)) { | 4047 | if ((ModeFlag & HalfDCLK) && (ModeFlag & DoubleScanMode)) { |
4048 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x0F); | 4048 | data = xgifb_reg_get(pVBInfo->P3c4, 0x0F); |
4049 | data |= 0x80; | 4049 | data |= 0x80; |
4050 | xgifb_reg_set(pVBInfo->P3c4, 0x0F, data); | 4050 | xgifb_reg_set(pVBInfo->P3c4, 0x0F, data); |
4051 | data = XGINew_GetReg1(pVBInfo->P3c4, 0x01); | 4051 | data = xgifb_reg_get(pVBInfo->P3c4, 0x01); |
4052 | data &= 0xF7; | 4052 | data &= 0xF7; |
4053 | xgifb_reg_set(pVBInfo->P3c4, 0x01, data); | 4053 | xgifb_reg_set(pVBInfo->P3c4, 0x01, data); |
4054 | } | 4054 | } |
@@ -4080,10 +4080,10 @@ static unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo) | |||
4080 | { | 4080 | { |
4081 | unsigned char CR4A, temp; | 4081 | unsigned char CR4A, temp; |
4082 | 4082 | ||
4083 | CR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 4083 | CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
4084 | XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x23); /* enable GPIO write */ | 4084 | XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x23); /* enable GPIO write */ |
4085 | 4085 | ||
4086 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48); | 4086 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); |
4087 | 4087 | ||
4088 | temp = XG21GPIODataTransfer(temp); | 4088 | temp = XG21GPIODataTransfer(temp); |
4089 | temp &= 0x23; | 4089 | temp &= 0x23; |
@@ -4101,15 +4101,15 @@ static unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo) | |||
4101 | { | 4101 | { |
4102 | unsigned char CR4A, CRB4, temp; | 4102 | unsigned char CR4A, CRB4, temp; |
4103 | 4103 | ||
4104 | CR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 4104 | CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
4105 | XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x0C); /* enable GPIO write */ | 4105 | XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x0C); /* enable GPIO write */ |
4106 | 4106 | ||
4107 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48); | 4107 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); |
4108 | 4108 | ||
4109 | temp &= 0x0C; | 4109 | temp &= 0x0C; |
4110 | temp >>= 2; | 4110 | temp >>= 2; |
4111 | xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); | 4111 | xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); |
4112 | CRB4 = XGINew_GetReg1(pVBInfo->P3d4, 0xB4); | 4112 | CRB4 = xgifb_reg_get(pVBInfo->P3d4, 0xB4); |
4113 | temp |= ((CRB4 & 0x04) << 3); | 4113 | temp |= ((CRB4 & 0x04) << 3); |
4114 | return temp; | 4114 | return temp; |
4115 | } | 4115 | } |
@@ -5637,7 +5637,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
5637 | } | 5637 | } |
5638 | 5638 | ||
5639 | xgifb_reg_set(pVBInfo->Part2Port, 0x4d, temp); | 5639 | xgifb_reg_set(pVBInfo->Part2Port, 0x4d, temp); |
5640 | temp = XGINew_GetReg1(pVBInfo->Part2Port, 0x43); /* 301b change */ | 5640 | temp = xgifb_reg_get(pVBInfo->Part2Port, 0x43); /* 301b change */ |
5641 | xgifb_reg_set(pVBInfo->Part2Port, 0x43, (unsigned short) (temp - 3)); | 5641 | xgifb_reg_set(pVBInfo->Part2Port, 0x43, (unsigned short) (temp - 3)); |
5642 | 5642 | ||
5643 | if (!(pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p))) { | 5643 | if (!(pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p))) { |
@@ -5659,7 +5659,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
5659 | } | 5659 | } |
5660 | 5660 | ||
5661 | if (pVBInfo->TVInfo & SetPALMTV) { | 5661 | if (pVBInfo->TVInfo & SetPALMTV) { |
5662 | tempax = (unsigned char) XGINew_GetReg1(pVBInfo->Part2Port, | 5662 | tempax = (unsigned char) xgifb_reg_get(pVBInfo->Part2Port, |
5663 | 0x01); | 5663 | 0x01); |
5664 | tempax--; | 5664 | tempax--; |
5665 | XGINew_SetRegAND(pVBInfo->Part2Port, 0x01, tempax); | 5665 | XGINew_SetRegAND(pVBInfo->Part2Port, 0x01, tempax); |
@@ -6289,7 +6289,7 @@ void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, | |||
6289 | { | 6289 | { |
6290 | unsigned char CR4A, temp; | 6290 | unsigned char CR4A, temp; |
6291 | 6291 | ||
6292 | CR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 6292 | CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
6293 | tempbh &= 0x23; | 6293 | tempbh &= 0x23; |
6294 | tempbl &= 0x23; | 6294 | tempbl &= 0x23; |
6295 | XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */ | 6295 | XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */ |
@@ -6301,7 +6301,7 @@ void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, | |||
6301 | 6301 | ||
6302 | } | 6302 | } |
6303 | 6303 | ||
6304 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x48); | 6304 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); |
6305 | 6305 | ||
6306 | temp = XG21GPIODataTransfer(temp); | 6306 | temp = XG21GPIODataTransfer(temp); |
6307 | temp &= ~tempbh; | 6307 | temp &= ~tempbh; |
@@ -6330,7 +6330,7 @@ void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, | |||
6330 | } | 6330 | } |
6331 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0); | 6331 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0); |
6332 | 6332 | ||
6333 | CR4A = XGINew_GetReg1(pVBInfo->P3d4, 0x4A); | 6333 | CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); |
6334 | tempbh &= 0x03; | 6334 | tempbh &= 0x03; |
6335 | tempbl &= 0x03; | 6335 | tempbl &= 0x03; |
6336 | tempbh <<= 2; | 6336 | tempbh <<= 2; |
@@ -6344,7 +6344,7 @@ unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo) | |||
6344 | { | 6344 | { |
6345 | unsigned short index; | 6345 | unsigned short index; |
6346 | 6346 | ||
6347 | index = XGINew_GetReg1(pVBInfo->P3d4, 0x36); | 6347 | index = xgifb_reg_get(pVBInfo->P3d4, 0x36); |
6348 | if (index < sizeof(XGI21_LCDCapList) | 6348 | if (index < sizeof(XGI21_LCDCapList) |
6349 | / sizeof(struct XGI21_LVDSCapStruct)) | 6349 | / sizeof(struct XGI21_LVDSCapStruct)) |
6350 | return index; | 6350 | return index; |
@@ -6437,7 +6437,7 @@ void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo) | |||
6437 | { | 6437 | { |
6438 | unsigned char temp; | 6438 | unsigned char temp; |
6439 | 6439 | ||
6440 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x37); /* D[0] 1: 18bit */ | 6440 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); /* D[0] 1: 18bit */ |
6441 | temp = (temp & 1) << 6; | 6441 | temp = (temp & 1) << 6; |
6442 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x06, ~0x40, temp); /* SR06[6] 18bit Dither */ | 6442 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x06, ~0x40, temp); /* SR06[6] 18bit Dither */ |
6443 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: dual 12bits */ | 6443 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: dual 12bits */ |
@@ -6448,7 +6448,7 @@ void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo) | |||
6448 | { | 6448 | { |
6449 | unsigned char temp; | 6449 | unsigned char temp; |
6450 | 6450 | ||
6451 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x37); /* D[1:0] 01: 18bit, 00: dual 12, 10: single 24 */ | 6451 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); /* D[1:0] 01: 18bit, 00: dual 12, 10: single 24 */ |
6452 | temp = (temp & 3) << 6; | 6452 | temp = (temp & 3) << 6; |
6453 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x06, ~0xc0, temp & 0x80); /* SR06[7]0: dual 12/1: single 24 [6] 18bit Dither <= 0 h/w recommend */ | 6453 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x06, ~0xc0, temp & 0x80); /* SR06[7]0: dual 12/1: single 24 [6] 18bit Dither <= 0 h/w recommend */ |
6454 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: 24bits */ | 6454 | XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: 24bits */ |
@@ -6535,7 +6535,7 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6535 | LVDSVBE = LVDSVBS + LVDSVT | 6535 | LVDSVBE = LVDSVBS + LVDSVT |
6536 | - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE; | 6536 | - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE; |
6537 | 6537 | ||
6538 | temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); | 6538 | temp = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); |
6539 | xgifb_reg_set(pVBInfo->P3d4, 0x11, temp & 0x7f); /* Unlock CRTC */ | 6539 | xgifb_reg_set(pVBInfo->P3d4, 0x11, temp & 0x7f); /* Unlock CRTC */ |
6540 | 6540 | ||
6541 | if (!(modeflag & Charx8Dot)) | 6541 | if (!(modeflag & Charx8Dot)) |
@@ -6720,7 +6720,7 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6720 | LVDSVBE = LVDSVBS + LVDSVT | 6720 | LVDSVBE = LVDSVBS + LVDSVT |
6721 | - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE; | 6721 | - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE; |
6722 | 6722 | ||
6723 | temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x11); | 6723 | temp = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); |
6724 | xgifb_reg_set(pVBInfo->P3d4, 0x11, temp & 0x7f); /* Unlock CRTC */ | 6724 | xgifb_reg_set(pVBInfo->P3d4, 0x11, temp & 0x7f); /* Unlock CRTC */ |
6725 | 6725 | ||
6726 | if (!(modeflag & Charx8Dot)) | 6726 | if (!(modeflag & Charx8Dot)) |
@@ -6855,7 +6855,7 @@ static unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo) | |||
6855 | unsigned short tempbx, tempah; | 6855 | unsigned short tempbx, tempah; |
6856 | 6856 | ||
6857 | tempbx = pVBInfo->SetFlag & (DisableChA | DisableChB); | 6857 | tempbx = pVBInfo->SetFlag & (DisableChA | DisableChB); |
6858 | tempah = ~((unsigned short) XGINew_GetReg1(pVBInfo->Part1Port, 0x2E)); | 6858 | tempah = ~((unsigned short) xgifb_reg_get(pVBInfo->Part1Port, 0x2E)); |
6859 | 6859 | ||
6860 | if (tempbx & (EnableChA | DisableChA)) { | 6860 | if (tempbx & (EnableChA | DisableChA)) { |
6861 | if (!(tempah & 0x08)) /* Chk LCDA Mode */ | 6861 | if (!(tempah & 0x08)) /* Chk LCDA Mode */ |
@@ -6882,7 +6882,7 @@ static unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo) | |||
6882 | unsigned short tempbx, tempah; | 6882 | unsigned short tempbx, tempah; |
6883 | 6883 | ||
6884 | tempbx = pVBInfo->SetFlag & (EnableChA | EnableChB); | 6884 | tempbx = pVBInfo->SetFlag & (EnableChA | EnableChB); |
6885 | tempah = ~((unsigned short) XGINew_GetReg1(pVBInfo->Part1Port, 0x2E)); | 6885 | tempah = ~((unsigned short) xgifb_reg_get(pVBInfo->Part1Port, 0x2E)); |
6886 | 6886 | ||
6887 | if (tempbx & (EnableChA | DisableChA)) { | 6887 | if (tempbx & (EnableChA | DisableChA)) { |
6888 | if (!(tempah & 0x08)) /* Chk LCDA Mode */ | 6888 | if (!(tempah & 0x08)) /* Chk LCDA Mode */ |
@@ -6983,7 +6983,7 @@ void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, | |||
6983 | || (!(pVBInfo->VBInfo & SetCRT2ToLCDA)) | 6983 | || (!(pVBInfo->VBInfo & SetCRT2ToLCDA)) |
6984 | || (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | 6984 | || (pVBInfo->VBInfo & (SetCRT2ToRAMDAC |
6985 | | SetCRT2ToLCD | SetCRT2ToTV))) { | 6985 | | SetCRT2ToLCD | SetCRT2ToTV))) { |
6986 | tempah = XGINew_GetReg1(pVBInfo->Part1Port, 0x00); /* save Part1 index 0 */ | 6986 | tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x00); /* save Part1 index 0 */ |
6987 | XGINew_SetRegOR(pVBInfo->Part1Port, 0x00, 0x10); /* BTDAC = 1, avoid VB reset */ | 6987 | XGINew_SetRegOR(pVBInfo->Part1Port, 0x00, 0x10); /* BTDAC = 1, avoid VB reset */ |
6988 | XGINew_SetRegAND(pVBInfo->Part1Port, 0x1E, 0xDF); /* disable CRT2 */ | 6988 | XGINew_SetRegAND(pVBInfo->Part1Port, 0x1E, 0xDF); /* disable CRT2 */ |
6989 | xgifb_reg_set(pVBInfo->Part1Port, 0x00, tempah); /* restore Part1 index 0 */ | 6989 | xgifb_reg_set(pVBInfo->Part1Port, 0x00, tempah); /* restore Part1 index 0 */ |
@@ -7129,7 +7129,7 @@ static void XGI_SetDelayComp(struct vb_device_info *pVBInfo) | |||
7129 | 7129 | ||
7130 | tempbl &= 0x0F; | 7130 | tempbl &= 0x0F; |
7131 | tempbh &= 0xF0; | 7131 | tempbh &= 0xF0; |
7132 | tempah = XGINew_GetReg1(pVBInfo->Part1Port, 0x2D); | 7132 | tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x2D); |
7133 | 7133 | ||
7134 | if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD | 7134 | if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD |
7135 | | SetCRT2ToTV)) { /* Channel B */ | 7135 | | SetCRT2ToTV)) { /* Channel B */ |
@@ -7162,7 +7162,7 @@ static void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInf | |||
7162 | { | 7162 | { |
7163 | unsigned short temp; | 7163 | unsigned short temp; |
7164 | 7164 | ||
7165 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x37); | 7165 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); |
7166 | 7166 | ||
7167 | if (temp & LCDRGB18Bit) { | 7167 | if (temp & LCDRGB18Bit) { |
7168 | XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, | 7168 | XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, |
@@ -7465,7 +7465,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo, | |||
7465 | /* xgifb_reg_set(pVBInfo->Part1Port, 0x03, 0x00); // fix write part1 index 0 BTDRAM bit Bug */ | 7465 | /* xgifb_reg_set(pVBInfo->Part1Port, 0x03, 0x00); // fix write part1 index 0 BTDRAM bit Bug */ |
7466 | tempah = 0; | 7466 | tempah = 0; |
7467 | if (!(pVBInfo->VBInfo & DisableCRT2Display)) { | 7467 | if (!(pVBInfo->VBInfo & DisableCRT2Display)) { |
7468 | tempah = XGINew_GetReg1(pVBInfo->Part1Port, 0x00); | 7468 | tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x00); |
7469 | tempah &= ~0x10; /* BTRAMDAC */ | 7469 | tempah &= ~0x10; /* BTRAMDAC */ |
7470 | tempah |= 0x40; /* BTRAM */ | 7470 | tempah |= 0x40; /* BTRAM */ |
7471 | 7471 | ||
@@ -7700,7 +7700,7 @@ unsigned char XGI_BridgeIsOn(struct vb_device_info *pVBInfo) | |||
7700 | if (pVBInfo->IF_DEF_LVDS == 1) { | 7700 | if (pVBInfo->IF_DEF_LVDS == 1) { |
7701 | return 1; | 7701 | return 1; |
7702 | } else { | 7702 | } else { |
7703 | flag = XGINew_GetReg1(pVBInfo->Part4Port, 0x00); | 7703 | flag = xgifb_reg_get(pVBInfo->Part4Port, 0x00); |
7704 | if ((flag == 1) || (flag == 2)) | 7704 | if ((flag == 1) || (flag == 2)) |
7705 | return 1; /* 301b */ | 7705 | return 1; /* 301b */ |
7706 | else | 7706 | else |
@@ -7712,7 +7712,7 @@ void XGI_LongWait(struct vb_device_info *pVBInfo) | |||
7712 | { | 7712 | { |
7713 | unsigned short i; | 7713 | unsigned short i; |
7714 | 7714 | ||
7715 | i = XGINew_GetReg1(pVBInfo->P3c4, 0x1F); | 7715 | i = xgifb_reg_get(pVBInfo->P3c4, 0x1F); |
7716 | 7716 | ||
7717 | if (!(i & 0xC0)) { | 7717 | if (!(i & 0xC0)) { |
7718 | for (i = 0; i < 0xFFFF; i++) { | 7718 | for (i = 0; i < 0xFFFF; i++) { |
@@ -7784,7 +7784,7 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, | |||
7784 | if (ModeNo < 0x14) | 7784 | if (ModeNo < 0x14) |
7785 | return 0xFFFF; | 7785 | return 0xFFFF; |
7786 | 7786 | ||
7787 | index = XGINew_GetReg1(pVBInfo->P3d4, 0x33); | 7787 | index = xgifb_reg_get(pVBInfo->P3d4, 0x33); |
7788 | index = index >> pVBInfo->SelectCRT2Rate; | 7788 | index = index >> pVBInfo->SelectCRT2Rate; |
7789 | index &= 0x0F; | 7789 | index &= 0x0F; |
7790 | 7790 | ||
@@ -7950,25 +7950,25 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo) | |||
7950 | 7950 | ||
7951 | /* [2004/05/06] Vicent to fix XG42 single LCD sense to CRT+LCD */ | 7951 | /* [2004/05/06] Vicent to fix XG42 single LCD sense to CRT+LCD */ |
7952 | xgifb_reg_set(pVBInfo->P3d4, 0x57, 0x4A); | 7952 | xgifb_reg_set(pVBInfo->P3d4, 0x57, 0x4A); |
7953 | xgifb_reg_set(pVBInfo->P3d4, 0x53, (unsigned char) (XGINew_GetReg1( | 7953 | xgifb_reg_set(pVBInfo->P3d4, 0x53, (unsigned char) (xgifb_reg_get( |
7954 | pVBInfo->P3d4, 0x53) | 0x02)); | 7954 | pVBInfo->P3d4, 0x53) | 0x02)); |
7955 | 7955 | ||
7956 | SR31 = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x31); | 7956 | SR31 = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x31); |
7957 | CR63 = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x63); | 7957 | CR63 = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x63); |
7958 | SR01 = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x01); | 7958 | SR01 = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x01); |
7959 | 7959 | ||
7960 | xgifb_reg_set(pVBInfo->P3c4, 0x01, (unsigned char) (SR01 & 0xDF)); | 7960 | xgifb_reg_set(pVBInfo->P3c4, 0x01, (unsigned char) (SR01 & 0xDF)); |
7961 | xgifb_reg_set(pVBInfo->P3d4, 0x63, (unsigned char) (CR63 & 0xBF)); | 7961 | xgifb_reg_set(pVBInfo->P3d4, 0x63, (unsigned char) (CR63 & 0xBF)); |
7962 | 7962 | ||
7963 | CR17 = (unsigned char) XGINew_GetReg1(pVBInfo->P3d4, 0x17); | 7963 | CR17 = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x17); |
7964 | xgifb_reg_set(pVBInfo->P3d4, 0x17, (unsigned char) (CR17 | 0x80)); | 7964 | xgifb_reg_set(pVBInfo->P3d4, 0x17, (unsigned char) (CR17 | 0x80)); |
7965 | 7965 | ||
7966 | SR1F = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x1F); | 7966 | SR1F = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x1F); |
7967 | xgifb_reg_set(pVBInfo->P3c4, 0x1F, (unsigned char) (SR1F | 0x04)); | 7967 | xgifb_reg_set(pVBInfo->P3c4, 0x1F, (unsigned char) (SR1F | 0x04)); |
7968 | 7968 | ||
7969 | SR07 = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x07); | 7969 | SR07 = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x07); |
7970 | xgifb_reg_set(pVBInfo->P3c4, 0x07, (unsigned char) (SR07 & 0xFB)); | 7970 | xgifb_reg_set(pVBInfo->P3c4, 0x07, (unsigned char) (SR07 & 0xFB)); |
7971 | SR06 = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x06); | 7971 | SR06 = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x06); |
7972 | xgifb_reg_set(pVBInfo->P3c4, 0x06, (unsigned char) (SR06 & 0xC3)); | 7972 | xgifb_reg_set(pVBInfo->P3c4, 0x06, (unsigned char) (SR06 & 0xC3)); |
7973 | 7973 | ||
7974 | xgifb_reg_set(pVBInfo->P3d4, 0x11, 0x00); | 7974 | xgifb_reg_set(pVBInfo->P3d4, 0x11, 0x00); |
@@ -8031,7 +8031,7 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo) | |||
8031 | xgifb_reg_set(pVBInfo->P3c4, 0x31, SR31); | 8031 | xgifb_reg_set(pVBInfo->P3c4, 0x31, SR31); |
8032 | 8032 | ||
8033 | /* [2004/05/11] Vicent */ | 8033 | /* [2004/05/11] Vicent */ |
8034 | xgifb_reg_set(pVBInfo->P3d4, 0x53, (unsigned char) (XGINew_GetReg1( | 8034 | xgifb_reg_set(pVBInfo->P3d4, 0x53, (unsigned char) (xgifb_reg_get( |
8035 | pVBInfo->P3d4, 0x53) & 0xFD)); | 8035 | pVBInfo->P3d4, 0x53) & 0xFD)); |
8036 | xgifb_reg_set(pVBInfo->P3c4, 0x1F, (unsigned char) SR1F); | 8036 | xgifb_reg_set(pVBInfo->P3c4, 0x1F, (unsigned char) SR1F); |
8037 | } | 8037 | } |
@@ -8068,7 +8068,7 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, | |||
8068 | if ((pVBInfo->SetFlag & EnableChB) || (pVBInfo->VBInfo | 8068 | if ((pVBInfo->SetFlag & EnableChB) || (pVBInfo->VBInfo |
8069 | & (SetCRT2ToLCD | SetCRT2ToTV | 8069 | & (SetCRT2ToLCD | SetCRT2ToTV |
8070 | | SetCRT2ToRAMDAC))) { | 8070 | | SetCRT2ToRAMDAC))) { |
8071 | tempah = (unsigned char) XGINew_GetReg1( | 8071 | tempah = (unsigned char) xgifb_reg_get( |
8072 | pVBInfo->P3c4, 0x32); | 8072 | pVBInfo->P3c4, 0x32); |
8073 | tempah &= 0xDF; | 8073 | tempah &= 0xDF; |
8074 | if (pVBInfo->VBInfo & SetInSlaveMode) { | 8074 | if (pVBInfo->VBInfo & SetInSlaveMode) { |
@@ -8078,7 +8078,7 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, | |||
8078 | xgifb_reg_set(pVBInfo->P3c4, 0x32, tempah); | 8078 | xgifb_reg_set(pVBInfo->P3c4, 0x32, tempah); |
8079 | XGINew_SetRegOR(pVBInfo->P3c4, 0x1E, 0x20); | 8079 | XGINew_SetRegOR(pVBInfo->P3c4, 0x1E, 0x20); |
8080 | 8080 | ||
8081 | tempah = (unsigned char) XGINew_GetReg1( | 8081 | tempah = (unsigned char) xgifb_reg_get( |
8082 | pVBInfo->Part1Port, 0x2E); | 8082 | pVBInfo->Part1Port, 0x2E); |
8083 | 8083 | ||
8084 | if (!(tempah & 0x80)) | 8084 | if (!(tempah & 0x80)) |
@@ -8161,7 +8161,7 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, | |||
8161 | | SetCRT2ToLCDA)) | 8161 | | SetCRT2ToLCDA)) |
8162 | XGINew_SetRegOR(pVBInfo->Part1Port, 0x1E, 0x20); /* enable CRT2 */ | 8162 | XGINew_SetRegOR(pVBInfo->Part1Port, 0x1E, 0x20); /* enable CRT2 */ |
8163 | 8163 | ||
8164 | tempah = (unsigned char) XGINew_GetReg1(pVBInfo->Part1Port, | 8164 | tempah = (unsigned char) xgifb_reg_get(pVBInfo->Part1Port, |
8165 | 0x2E); | 8165 | 0x2E); |
8166 | if (!(tempah & 0x80)) | 8166 | if (!(tempah & 0x80)) |
8167 | XGINew_SetRegOR(pVBInfo->Part1Port, 0x2E, 0x80); /* BVBDOENABLE = 1 */ | 8167 | XGINew_SetRegOR(pVBInfo->Part1Port, 0x2E, 0x80); /* BVBDOENABLE = 1 */ |
@@ -8239,7 +8239,7 @@ static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, | |||
8239 | } | 8239 | } |
8240 | 8240 | ||
8241 | if (HwDeviceExtension->jChipType >= XG21) { | 8241 | if (HwDeviceExtension->jChipType >= XG21) { |
8242 | temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38); | 8242 | temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); |
8243 | if (temp & 0xA0) { | 8243 | if (temp & 0xA0) { |
8244 | 8244 | ||
8245 | /* XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); *//* Enable write GPIOF */ | 8245 | /* XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); *//* Enable write GPIOF */ |
@@ -8335,12 +8335,12 @@ unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension, | |||
8335 | pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2; | 8335 | pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2; |
8336 | 8336 | ||
8337 | if (HwDeviceExtension->jChipType == XG21) { /* for x86 Linux, XG21 LVDS */ | 8337 | if (HwDeviceExtension->jChipType == XG21) { /* for x86 Linux, XG21 LVDS */ |
8338 | if ((XGINew_GetReg1(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) | 8338 | if ((xgifb_reg_get(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) |
8339 | pVBInfo->IF_DEF_LVDS = 1; | 8339 | pVBInfo->IF_DEF_LVDS = 1; |
8340 | } | 8340 | } |
8341 | if (HwDeviceExtension->jChipType == XG27) { | 8341 | if (HwDeviceExtension->jChipType == XG27) { |
8342 | if ((XGINew_GetReg1(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) { | 8342 | if ((xgifb_reg_get(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) { |
8343 | if (XGINew_GetReg1(pVBInfo->P3d4, 0x30) & 0x20) | 8343 | if (xgifb_reg_get(pVBInfo->P3d4, 0x30) & 0x20) |
8344 | pVBInfo->IF_DEF_LVDS = 1; | 8344 | pVBInfo->IF_DEF_LVDS = 1; |
8345 | } | 8345 | } |
8346 | } | 8346 | } |
diff --git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c index f7cad57a134..65f13495538 100644 --- a/drivers/staging/xgifb/vb_util.c +++ b/drivers/staging/xgifb/vb_util.c | |||
@@ -15,7 +15,7 @@ void xgifb_reg_set(unsigned long port, unsigned short index, | |||
15 | outb(data, port + 1); | 15 | outb(data, port + 1); |
16 | } | 16 | } |
17 | 17 | ||
18 | unsigned char XGINew_GetReg1(unsigned long port, unsigned short index) | 18 | unsigned char xgifb_reg_get(unsigned long port, unsigned short index) |
19 | { | 19 | { |
20 | unsigned char data; | 20 | unsigned char data; |
21 | 21 | ||
@@ -29,7 +29,7 @@ void XGINew_SetRegANDOR(unsigned long Port, unsigned short Index, | |||
29 | { | 29 | { |
30 | unsigned short temp; | 30 | unsigned short temp; |
31 | 31 | ||
32 | temp = XGINew_GetReg1(Port, Index); /* XGINew_Part1Port index 02 */ | 32 | temp = xgifb_reg_get(Port, Index); /* XGINew_Part1Port index 02 */ |
33 | temp = (temp & (DataAND)) | DataOR; | 33 | temp = (temp & (DataAND)) | DataOR; |
34 | xgifb_reg_set(Port, Index, temp); | 34 | xgifb_reg_set(Port, Index, temp); |
35 | } | 35 | } |
@@ -39,7 +39,7 @@ void XGINew_SetRegAND(unsigned long Port, unsigned short Index, | |||
39 | { | 39 | { |
40 | unsigned short temp; | 40 | unsigned short temp; |
41 | 41 | ||
42 | temp = XGINew_GetReg1(Port, Index); /* XGINew_Part1Port index 02 */ | 42 | temp = xgifb_reg_get(Port, Index); /* XGINew_Part1Port index 02 */ |
43 | temp &= DataAND; | 43 | temp &= DataAND; |
44 | xgifb_reg_set(Port, Index, temp); | 44 | xgifb_reg_set(Port, Index, temp); |
45 | } | 45 | } |
@@ -49,7 +49,7 @@ void XGINew_SetRegOR(unsigned long Port, unsigned short Index, | |||
49 | { | 49 | { |
50 | unsigned short temp; | 50 | unsigned short temp; |
51 | 51 | ||
52 | temp = XGINew_GetReg1(Port, Index); /* XGINew_Part1Port index 02 */ | 52 | temp = xgifb_reg_get(Port, Index); /* XGINew_Part1Port index 02 */ |
53 | temp |= DataOR; | 53 | temp |= DataOR; |
54 | xgifb_reg_set(Port, Index, temp); | 54 | xgifb_reg_set(Port, Index, temp); |
55 | } | 55 | } |
diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index c99592a51d7..6332d4c6681 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _VBUTIL_ | 1 | #ifndef _VBUTIL_ |
2 | #define _VBUTIL_ | 2 | #define _VBUTIL_ |
3 | extern void xgifb_reg_set(unsigned long, unsigned short, unsigned short); | 3 | extern void xgifb_reg_set(unsigned long, unsigned short, unsigned short); |
4 | extern unsigned char XGINew_GetReg1(unsigned long, unsigned short); | 4 | extern unsigned char xgifb_reg_get(unsigned long, unsigned short); |
5 | extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); | 5 | extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); |
6 | extern void XGINew_SetRegAND(unsigned long Port,unsigned short Index,unsigned short DataAND); | 6 | extern void XGINew_SetRegAND(unsigned long Port,unsigned short Index,unsigned short DataAND); |
7 | extern void XGINew_SetRegANDOR(unsigned long Port,unsigned short Index,unsigned short DataAND,unsigned short DataOR); | 7 | extern void XGINew_SetRegANDOR(unsigned long Port,unsigned short Index,unsigned short DataAND,unsigned short DataOR); |