aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb/vb_setmode.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2011-03-13 06:26:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-14 14:52:33 -0400
commitec9e5d3e73d675915ac572631ef0d5dcc03d2b6c (patch)
tree7f28d2a729137a66bc7e09f1175b8f5dc1b28979 /drivers/staging/xgifb/vb_setmode.c
parentb9bf6e4e62bd40a5867e4958d21a145536582875 (diff)
staging: xgifb: rename XGINew_SetRegANDOR() to xgifb_reg_and_or()
Rename XGINew_SetRegANDOR() to xgifb_reg_and_or(). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/xgifb/vb_setmode.c')
-rw-r--r--drivers/staging/xgifb/vb_setmode.c338
1 files changed, 169 insertions, 169 deletions
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 2dc8a1fb322..49791c47d8e 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -362,11 +362,11 @@ static void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo)
362static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo) 362static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo)
363{ 363{
364 364
365 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x31, ~0x30, 0x20); 365 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x20);
366 xgifb_reg_set(pVBInfo->P3c4, 0x2B, pVBInfo->VCLKData[0].SR2B); 366 xgifb_reg_set(pVBInfo->P3c4, 0x2B, pVBInfo->VCLKData[0].SR2B);
367 xgifb_reg_set(pVBInfo->P3c4, 0x2C, pVBInfo->VCLKData[0].SR2C); 367 xgifb_reg_set(pVBInfo->P3c4, 0x2C, pVBInfo->VCLKData[0].SR2C);
368 368
369 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x31, ~0x30, 0x10); 369 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x10);
370 xgifb_reg_set(pVBInfo->P3c4, 0x2B, pVBInfo->VCLKData[1].SR2B); 370 xgifb_reg_set(pVBInfo->P3c4, 0x2B, pVBInfo->VCLKData[1].SR2B);
371 xgifb_reg_set(pVBInfo->P3c4, 0x2C, pVBInfo->VCLKData[1].SR2C); 371 xgifb_reg_set(pVBInfo->P3c4, 0x2C, pVBInfo->VCLKData[1].SR2C);
372 372
@@ -536,7 +536,7 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
536 536
537 /* xgifb_reg_set(pVBInfo->P3d4, 0x51, 0); */ 537 /* xgifb_reg_set(pVBInfo->P3d4, 0x51, 0); */
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 /* xgifb_reg_and_or(pVBInfo->P3d4, 0x11, 0x7f, 0x00); */
540 540
541 data = (unsigned char) xgifb_reg_get(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;
@@ -587,7 +587,7 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
587 if (data > 7) 587 if (data > 7)
588 data = data - 7; 588 data = data - 7;
589 data = data << 5; 589 data = data << 5;
590 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0e, ~0xE0, data); 590 xgifb_reg_and_or(pVBInfo->P3c4, 0x0e, ~0xE0, data);
591 } 591 }
592} 592}
593 593
@@ -599,7 +599,7 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeN
599 599
600 /* xgifb_reg_set(pVBInfo->P3d4, 0x51, 0); */ 600 /* xgifb_reg_set(pVBInfo->P3d4, 0x51, 0); */
601 /* xgifb_reg_set(pVBInfo->P3d4, 0x56, 0); */ 601 /* xgifb_reg_set(pVBInfo->P3d4, 0x56, 0); */
602 /* XGINew_SetRegANDOR(pVBInfo->P3d4, 0x11, 0x7f, 0x00); */ 602 /* xgifb_reg_and_or(pVBInfo->P3d4, 0x11, 0x7f, 0x00); */
603 603
604 for (i = 0x00; i <= 0x01; i++) { 604 for (i = 0x00; i <= 0x01; i++) {
605 data = pVBInfo->TimingV[0].data[i]; 605 data = pVBInfo->TimingV[0].data[i];
@@ -699,7 +699,7 @@ static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
699 Tempdx |= 0x20; /* Tempdx: HRE = HRE + 0x20 */ 699 Tempdx |= 0x20; /* Tempdx: HRE = HRE + 0x20 */
700 Tempdx <<= 2; /* Tempdx << 2 */ 700 Tempdx <<= 2; /* Tempdx << 2 */
701 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempdx); /* SR2F [7:2]->HRE */ 701 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempdx); /* SR2F [7:2]->HRE */
702 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x30, 0xE3, 00); 702 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, 0xE3, 00);
703 703
704 Tempax = pVBInfo->StandTable[StandTableIndex].CRTC[16]; /* Tempax: CR16 VRS */ 704 Tempax = pVBInfo->StandTable[StandTableIndex].CRTC[16]; /* Tempax: CR16 VRS */
705 Tempbx = Tempax; /* Tempbx=Tempax */ 705 Tempbx = Tempax; /* Tempbx=Tempax */
@@ -767,7 +767,7 @@ static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
767 Tempdx >>= 6; /* Tempdx[7:6]->[1:0] HRS[9:8] */ 767 Tempdx >>= 6; /* Tempdx[7:6]->[1:0] HRS[9:8] */
768 Tempax |= Tempdx; /* HRE[5:0]HRS[9:8] */ 768 Tempax |= Tempdx; /* HRE[5:0]HRS[9:8] */
769 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempax); /* SR2F D[7:2]->HRE, D[1:0]->HRS */ 769 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempax); /* SR2F D[7:2]->HRE, D[1:0]->HRS */
770 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x30, 0xE3, 00); 770 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, 0xE3, 00);
771 771
772 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[10]; /* CR10 VRS */ 772 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[10]; /* CR10 VRS */
773 Tempbx = Tempax; /* Tempbx: VRS */ 773 Tempbx = Tempax; /* Tempbx: VRS */
@@ -836,7 +836,7 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
836 Tempdx |= 0x20; /* Tempdx: HRE = HRE + 0x20 */ 836 Tempdx |= 0x20; /* Tempdx: HRE = HRE + 0x20 */
837 Tempdx <<= 2; /* Tempdx << 2 */ 837 Tempdx <<= 2; /* Tempdx << 2 */
838 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempdx); /* SR2F [7:2]->HRE */ 838 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempdx); /* SR2F [7:2]->HRE */
839 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x30, 0xE3, 00); 839 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, 0xE3, 00);
840 840
841 Tempax = pVBInfo->StandTable[StandTableIndex].CRTC[16]; /* Tempax: CR10 VRS */ 841 Tempax = pVBInfo->StandTable[StandTableIndex].CRTC[16]; /* Tempax: CR10 VRS */
842 xgifb_reg_set(pVBInfo->P3c4, 0x34, Tempax); /* SR34[7:0]->VRS */ 842 xgifb_reg_set(pVBInfo->P3c4, 0x34, Tempax); /* SR34[7:0]->VRS */
@@ -845,7 +845,7 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
845 Tempbx = Tempax; /* Tempbx=CR07 */ 845 Tempbx = Tempax; /* Tempbx=CR07 */
846 Tempax &= 0x04; /* Tempax[2]: CR07[2] VRS[8] */ 846 Tempax &= 0x04; /* Tempax[2]: CR07[2] VRS[8] */
847 Tempax >>= 2; 847 Tempax >>= 2;
848 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x01, Tempax); /* SR35 D[0]->VRS D[8] */ 848 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x01, Tempax); /* SR35 D[0]->VRS D[8] */
849 Tempcx |= (Tempax << 8); /* Tempcx[8] |= VRS[8] */ 849 Tempcx |= (Tempax << 8); /* Tempcx[8] |= VRS[8] */
850 Tempcx |= (Tempbx & 0x80) << 2; /* Tempcx[9] |= VRS[9] */ 850 Tempcx |= (Tempbx & 0x80) << 2; /* Tempcx[9] |= VRS[9] */
851 851
@@ -859,8 +859,8 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
859 Tempax = (unsigned char) Tempbx & 0xFF; /* Tempax[7:0]: VRE[7:0] */ 859 Tempax = (unsigned char) Tempbx & 0xFF; /* Tempax[7:0]: VRE[7:0] */
860 Tempax <<= 2; /* Tempax << 2: VRE[5:0] */ 860 Tempax <<= 2; /* Tempax << 2: VRE[5:0] */
861 Tempcx = (Tempcx & 0x600) >> 8; /* Tempcx VRS[10:9] */ 861 Tempcx = (Tempcx & 0x600) >> 8; /* Tempcx VRS[10:9] */
862 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x3F, ~0xFC, Tempax); /* SR3F D[7:2]->VRE D[5:0] */ 862 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, Tempax); /* SR3F D[7:2]->VRE D[5:0] */
863 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x06, Tempcx); /* SR35 D[2:1]->VRS[10:9] */ 863 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x06, Tempcx); /* SR35 D[2:1]->VRS[10:9] */
864 } else { 864 } else {
865 index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; 865 index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
866 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[3]; /* Tempax: CR4 HRS */ 866 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[3]; /* Tempax: CR4 HRS */
@@ -893,7 +893,7 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
893 Tempax >>= 6; /* Tempax[1:0]: HRS[9:8]*/ 893 Tempax >>= 6; /* Tempax[1:0]: HRS[9:8]*/
894 Tempax |= ((Tempbx << 2) & 0xFF); /* Tempax[7:2]: HRE[5:0] */ 894 Tempax |= ((Tempbx << 2) & 0xFF); /* Tempax[7:2]: HRE[5:0] */
895 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempax); /* SR2F [7:2][1:0]: HRE[5:0]HRS[9:8] */ 895 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempax); /* SR2F [7:2][1:0]: HRE[5:0]HRS[9:8] */
896 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x30, 0xE3, 00); 896 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, 0xE3, 00);
897 897
898 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[10]; /* CR10 VRS */ 898 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[10]; /* CR10 VRS */
899 xgifb_reg_set(pVBInfo->P3c4, 0x34, Tempax); /* SR34[7:0]->VRS[7:0] */ 899 xgifb_reg_set(pVBInfo->P3c4, 0x34, Tempax); /* SR34[7:0]->VRS[7:0] */
@@ -903,7 +903,7 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
903 Tempbx = Tempax; /* Tempbx <= CR07[7:0] */ 903 Tempbx = Tempax; /* Tempbx <= CR07[7:0] */
904 Tempax = Tempax & 0x04; /* Tempax[2]: CR7[2]: VRS[8] */ 904 Tempax = Tempax & 0x04; /* Tempax[2]: CR7[2]: VRS[8] */
905 Tempax >>= 2; /* Tempax[0]: VRS[8] */ 905 Tempax >>= 2; /* Tempax[0]: VRS[8] */
906 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x01, Tempax); /* SR35[0]: VRS[8] */ 906 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x01, Tempax); /* SR35[0]: VRS[8] */
907 Tempcx |= (Tempax << 8); /* Tempcx <= VRS[8:0] */ 907 Tempcx |= (Tempax << 8); /* Tempcx <= VRS[8:0] */
908 Tempcx |= ((Tempbx & 0x80) << 2); /* Tempcx <= VRS[9:0] */ 908 Tempcx |= ((Tempbx & 0x80) << 2); /* Tempcx <= VRS[9:0] */
909 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[14]; /* Tempax: SR0A */ 909 Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[14]; /* Tempax: SR0A */
@@ -924,9 +924,9 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
924 Tempbx |= 0x20; /* VRE + 0x20 */ 924 Tempbx |= 0x20; /* VRE + 0x20 */
925 925
926 Tempax = (Tempbx << 2) & 0xFF; /* Tempax: Tempax[7:0]; VRE[5:0]00 */ 926 Tempax = (Tempbx << 2) & 0xFF; /* Tempax: Tempax[7:0]; VRE[5:0]00 */
927 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x3F, ~0xFC, Tempax); /* SR3F[7:2]:VRE[5:0] */ 927 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, Tempax); /* SR3F[7:2]:VRE[5:0] */
928 Tempax = Tempcx >> 8; 928 Tempax = Tempcx >> 8;
929 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x07, Tempax); /* SR35[2:0]:VRS[10:8] */ 929 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x07, Tempax); /* SR35[2:0]:VRS[10:8] */
930 } 930 }
931} 931}
932 932
@@ -1127,7 +1127,7 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension,
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));
1130 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x0b, ~0x0c, 1130 xgifb_reg_and_or(pVBInfo->P3d4, 0x0b, ~0x0c,
1131 (unsigned short) ((tempcx & 0x0ff00) >> 10)); 1131 (unsigned short) ((tempcx & 0x0ff00) >> 10));
1132 xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short) (tempbx & 0xff)); 1132 xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short) (tempbx & 0xff));
1133 tempax = 0; 1133 tempax = 0;
@@ -1139,7 +1139,7 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension,
1139 if (tempbx & 0x02) 1139 if (tempbx & 0x02)
1140 tempax |= 0x40; 1140 tempax |= 0x40;
1141 1141
1142 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x42, tempax); 1142 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax);
1143 data = (unsigned char) xgifb_reg_get(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;
@@ -1147,7 +1147,7 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension,
1147 if (tempbx & 0x04) 1147 if (tempbx & 0x04)
1148 tempax |= 0x02; 1148 tempax |= 0x02;
1149 1149
1150 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x0a, ~0x02, tempax); 1150 xgifb_reg_and_or(pVBInfo->P3d4, 0x0a, ~0x02, tempax);
1151 xgifb_reg_set(pVBInfo->P3d4, 0x11, temp); 1151 xgifb_reg_set(pVBInfo->P3d4, 0x11, temp);
1152} 1152}
1153 1153
@@ -1559,9 +1559,9 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension,
1559 */ 1559 */
1560 data2 = 0x00; 1560 data2 = 0x00;
1561 1561
1562 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x07, 0xFC, data2); 1562 xgifb_reg_and_or(pVBInfo->P3c4, 0x07, 0xFC, data2);
1563 if (HwDeviceExtension->jChipType >= XG27) 1563 if (HwDeviceExtension->jChipType >= XG27)
1564 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x40, 0xFC, data2 & 0x03); 1564 xgifb_reg_and_or(pVBInfo->P3c4, 0x40, 0xFC, data2 & 0x03);
1565 1565
1566} 1566}
1567 1567
@@ -1581,7 +1581,7 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
1581 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */ 1581 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */
1582 1582
1583 if (xgifb_reg_get(pVBInfo->P3d4, 0x31) & 0x01) 1583 if (xgifb_reg_get(pVBInfo->P3d4, 0x31) & 0x01)
1584 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, 0x3F, 0x00); 1584 xgifb_reg_and_or(pVBInfo->P3c4, 0x1F, 0x3F, 0x00);
1585 1585
1586 if (ModeNo > 0x13) 1586 if (ModeNo > 0x13)
1587 data = infoflag; 1587 data = infoflag;
@@ -1604,7 +1604,7 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
1604 if (data) 1604 if (data)
1605 data2 |= 0x20; 1605 data2 |= 0x20;
1606 1606
1607 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x06, ~0x3F, data2); 1607 xgifb_reg_and_or(pVBInfo->P3c4, 0x06, ~0x3F, data2);
1608 /* xgifb_reg_set(pVBInfo->P3c4,0x06,data2); */ 1608 /* xgifb_reg_set(pVBInfo->P3c4,0x06,data2); */
1609 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo); 1609 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
1610 if (ModeNo <= 0x13) 1610 if (ModeNo <= 0x13)
@@ -1621,12 +1621,12 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
1621 } 1621 }
1622 1622
1623 data2 = data & 0x00FF; 1623 data2 = data & 0x00FF;
1624 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x19, 0xFF, data2); 1624 xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFF, data2);
1625 data2 = (data & 0xFF00) >> 8; 1625 data2 = (data & 0xFF00) >> 8;
1626 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x19, 0xFC, data2); 1626 xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFC, data2);
1627 1627
1628 if (modeflag & HalfDCLK) 1628 if (modeflag & HalfDCLK)
1629 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xF7, 0x08); 1629 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xF7, 0x08);
1630 1630
1631 data2 = 0; 1631 data2 = 0;
1632 1632
@@ -1638,14 +1638,14 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
1638 data2 |= 0x40; 1638 data2 |= 0x40;
1639 } 1639 }
1640 1640
1641 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0F, ~0x48, data2); 1641 xgifb_reg_and_or(pVBInfo->P3c4, 0x0F, ~0x48, data2);
1642 data = 0x60; 1642 data = 0x60;
1643 if (pVBInfo->ModeType != ModeText) { 1643 if (pVBInfo->ModeType != ModeText) {
1644 data = data ^ 0x60; 1644 data = data ^ 0x60;
1645 if (pVBInfo->ModeType != ModeEGA) 1645 if (pVBInfo->ModeType != ModeEGA)
1646 data = data ^ 0xA0; 1646 data = data ^ 0xA0;
1647 } 1647 }
1648 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x21, 0x1F, data); 1648 xgifb_reg_and_or(pVBInfo->P3c4, 0x21, 0x1F, data);
1649 1649
1650 XGI_SetVCLKState(HwDeviceExtension, ModeNo, RefreshRateTableIndex, 1650 XGI_SetVCLKState(HwDeviceExtension, ModeNo, RefreshRateTableIndex,
1651 pVBInfo); 1651 pVBInfo);
@@ -1696,19 +1696,19 @@ void XGI_VesaLowResolution(unsigned short ModeNo, unsigned short ModeIdIndex, st
1696 if (pVBInfo->VBType & VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) { 1696 if (pVBInfo->VBType & VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) {
1697 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) { 1697 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) {
1698 if (pVBInfo->VBInfo & SetInSlaveMode) { 1698 if (pVBInfo->VBInfo & SetInSlaveMode) {
1699 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xf7, 0x00); 1699 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xf7, 0x00);
1700 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0f, 0x7f, 0x00); 1700 xgifb_reg_and_or(pVBInfo->P3c4, 0x0f, 0x7f, 0x00);
1701 return; 1701 return;
1702 } 1702 }
1703 } 1703 }
1704 } 1704 }
1705 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0f, 0xff, 0x80); 1705 xgifb_reg_and_or(pVBInfo->P3c4, 0x0f, 0xff, 0x80);
1706 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xf7, 0x00); 1706 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xf7, 0x00);
1707 return; 1707 return;
1708 } 1708 }
1709 } 1709 }
1710 } 1710 }
1711 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0f, 0x7f, 0x00); 1711 xgifb_reg_and_or(pVBInfo->P3c4, 0x0f, 0x7f, 0x00);
1712} 1712}
1713*/ 1713*/
1714 1714
@@ -2653,7 +2653,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
2653 XGI_SetCRT1Timing_V(ModeIdIndex, ModeNo, pVBInfo); 2653 XGI_SetCRT1Timing_V(ModeIdIndex, ModeNo, pVBInfo);
2654 2654
2655 if (pVBInfo->IF_DEF_CH7007 == 1) { 2655 if (pVBInfo->IF_DEF_CH7007 == 1) {
2656 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x33, ~0x01, 2656 xgifb_reg_and_or(pVBInfo->P3c4, 0x33, ~0x01,
2657 CH7007TV_TimingVPtr[0].data[7] & 0x01); 2657 CH7007TV_TimingVPtr[0].data[7] & 0x01);
2658 xgifb_reg_set(pVBInfo->P3c4, 0x34, 2658 xgifb_reg_set(pVBInfo->P3c4, 0x34,
2659 CH7007TV_TimingVPtr[0].data[8]); 2659 CH7007TV_TimingVPtr[0].data[8]);
@@ -2914,7 +2914,7 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
2914 2914
2915 xgifb_reg_set(pVBInfo->Part1Port, 0x18, 2915 xgifb_reg_set(pVBInfo->Part1Port, 0x18,
2916 (unsigned short) (tempbx & 0xff)); 2916 (unsigned short) (tempbx & 0xff));
2917 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, ~0x0f, 2917 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f,
2918 (unsigned short) (tempcx & 0x0f)); 2918 (unsigned short) (tempcx & 0x0f));
2919 2919
2920 tempax = ((tempbx >> 8) & 0x07) << 3; 2920 tempax = ((tempbx >> 8) & 0x07) << 3;
@@ -2926,7 +2926,7 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
2926 if (pVBInfo->LCDInfo & EnableLVDSDDA) 2926 if (pVBInfo->LCDInfo & EnableLVDSDDA)
2927 tempax |= 0x40; 2927 tempax |= 0x40;
2928 2928
2929 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x1a, 0x07, 2929 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1a, 0x07,
2930 tempax); 2930 tempax);
2931 2931
2932 tempcx = pVBInfo->VGAVT; 2932 tempcx = pVBInfo->VGAVT;
@@ -2967,17 +2967,17 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
2967 (unsigned short) ((temp2 >> 8) 2967 (unsigned short) ((temp2 >> 8)
2968 & 0xff)); 2968 & 0xff));
2969 tempbx = (unsigned short) (temp2 >> 16); 2969 tempbx = (unsigned short) (temp2 >> 16);
2970 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x3a, 2970 xgifb_reg_and_or(pVBInfo->Part4Port, 0x3a,
2971 ~0xc0, 2971 ~0xc0,
2972 (unsigned short) ((tempbx 2972 (unsigned short) ((tempbx
2973 & 0xff) << 6)); 2973 & 0xff) << 6));
2974 2974
2975 tempcx = pVBInfo->VGAVDE; 2975 tempcx = pVBInfo->VGAVDE;
2976 if (tempcx == pVBInfo->VDE) 2976 if (tempcx == pVBInfo->VDE)
2977 XGINew_SetRegANDOR(pVBInfo->Part4Port, 2977 xgifb_reg_and_or(pVBInfo->Part4Port,
2978 0x30, ~0x0c, 0x00); 2978 0x30, ~0x0c, 0x00);
2979 else 2979 else
2980 XGINew_SetRegANDOR(pVBInfo->Part4Port, 2980 xgifb_reg_and_or(pVBInfo->Part4Port,
2981 0x30, ~0x0c, 0x08); 2981 0x30, ~0x0c, 0x08);
2982 } 2982 }
2983 2983
@@ -3251,7 +3251,7 @@ static void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex,
3251 XGI_GetLCDVCLKPtr(&di_0, &di_1, pVBInfo); 3251 XGI_GetLCDVCLKPtr(&di_0, &di_1, pVBInfo);
3252 3252
3253 for (i = 0; i < 4; i++) { 3253 for (i = 0; i < 4; i++) {
3254 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x31, ~0x30, 3254 xgifb_reg_and_or(pVBInfo->P3d4, 0x31, ~0x30,
3255 (unsigned short) (0x10 * i)); 3255 (unsigned short) (0x10 * i));
3256 if (pVBInfo->IF_DEF_CH7007 == 1) { 3256 if (pVBInfo->IF_DEF_CH7007 == 1) {
3257 xgifb_reg_set(pVBInfo->P3c4, 0x2b, di_0); 3257 xgifb_reg_set(pVBInfo->P3c4, 0x2b, di_0);
@@ -3344,7 +3344,7 @@ static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension,
3344 } 3344 }
3345 temp = tempcl; 3345 temp = tempcl;
3346 tempbl = ~ModeSwitchStatus; 3346 tempbl = ~ModeSwitchStatus;
3347 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x3d, tempbl, temp); 3347 xgifb_reg_and_or(pVBInfo->P3d4, 0x3d, tempbl, temp);
3348 3348
3349 if (!(pVBInfo->SetFlag & ReserveTVOption)) 3349 if (!(pVBInfo->SetFlag & ReserveTVOption))
3350 xgifb_reg_set(pVBInfo->P3d4, 0x3e, tempch); 3350 xgifb_reg_set(pVBInfo->P3d4, 0x3e, tempch);
@@ -4118,7 +4118,7 @@ void XGI_DisplayOn(struct xgi_hw_device_info *pXGIHWDE,
4118 struct vb_device_info *pVBInfo) 4118 struct vb_device_info *pVBInfo)
4119{ 4119{
4120 4120
4121 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xDF, 0x00); 4121 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xDF, 0x00);
4122 if (pXGIHWDE->jChipType == XG21) { 4122 if (pXGIHWDE->jChipType == XG21) {
4123 if (pVBInfo->IF_DEF_LVDS == 1) { 4123 if (pVBInfo->IF_DEF_LVDS == 1) {
4124 if (!(XGI_XG21GetPSCValue(pVBInfo) & 0x1)) { 4124 if (!(XGI_XG21GetPSCValue(pVBInfo) & 0x1)) {
@@ -4185,7 +4185,7 @@ void XGI_DisplayOff(struct xgi_hw_device_info *pXGIHWDE,
4185 XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* DVO/DVI signal off */ 4185 XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* DVO/DVI signal off */
4186 } 4186 }
4187 4187
4188 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xDF, 0x20); 4188 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xDF, 0x20);
4189} 4189}
4190 4190
4191static void XGI_WaitDisply(struct vb_device_info *pVBInfo) 4191static void XGI_WaitDisply(struct vb_device_info *pVBInfo)
@@ -4218,7 +4218,7 @@ static void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBIn
4218 xgifb_reg_set(pVBInfo->P3d4, 0x34, ModeNo); /* reserve CR34 for CRT1 Mode No */ 4218 xgifb_reg_set(pVBInfo->P3d4, 0x34, ModeNo); /* reserve CR34 for CRT1 Mode No */
4219 temp1 = (pVBInfo->VBInfo & SetInSlaveMode) >> 8; 4219 temp1 = (pVBInfo->VBInfo & SetInSlaveMode) >> 8;
4220 temp2 = ~(SetInSlaveMode >> 8); 4220 temp2 = ~(SetInSlaveMode >> 8);
4221 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x31, temp2, temp1); 4221 xgifb_reg_and_or(pVBInfo->P3d4, 0x31, temp2, temp1);
4222} 4222}
4223 4223
4224static void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, 4224static void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
@@ -4658,7 +4658,7 @@ static void XGI_SetCRT2Offset(unsigned short ModeNo,
4658static void XGI_SetCRT2FIFO(struct vb_device_info *pVBInfo) 4658static void XGI_SetCRT2FIFO(struct vb_device_info *pVBInfo)
4659{ 4659{
4660 xgifb_reg_set(pVBInfo->Part1Port, 0x01, 0x3B); /* threshold high ,disable auto threshold */ 4660 xgifb_reg_set(pVBInfo->Part1Port, 0x01, 0x3B); /* threshold high ,disable auto threshold */
4661 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x02, ~(0x3F), 0x04); /* threshold low default 04h */ 4661 xgifb_reg_and_or(pVBInfo->Part1Port, 0x02, ~(0x3F), 0x04); /* threshold low default 04h */
4662} 4662}
4663 4663
4664static void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, 4664static void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
@@ -4710,7 +4710,7 @@ static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
4710 temp = (pVBInfo->VGAHT / 2 - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ 4710 temp = (pVBInfo->VGAHT / 2 - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */
4711 xgifb_reg_set(pVBInfo->Part1Port, 0x08, temp); 4711 xgifb_reg_set(pVBInfo->Part1Port, 0x08, temp);
4712 temp = (((pVBInfo->VGAHT / 2 - 1) & 0xFF00) >> 8) << 4; 4712 temp = (((pVBInfo->VGAHT / 2 - 1) & 0xFF00) >> 8) << 4;
4713 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x09, ~0x0F0, temp); 4713 xgifb_reg_and_or(pVBInfo->Part1Port, 0x09, ~0x0F0, temp);
4714 temp = (pVBInfo->VGAHDE / 2 + 16) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ 4714 temp = (pVBInfo->VGAHDE / 2 + 16) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */
4715 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp); 4715 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp);
4716 tempcx = ((pVBInfo->VGAHT - pVBInfo->VGAHDE) / 2) >> 2; 4716 tempcx = ((pVBInfo->VGAHT - pVBInfo->VGAHDE) / 2) >> 2;
@@ -4744,7 +4744,7 @@ static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
4744 temp = (pVBInfo->VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ 4744 temp = (pVBInfo->VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */
4745 xgifb_reg_set(pVBInfo->Part1Port, 0x08, temp); 4745 xgifb_reg_set(pVBInfo->Part1Port, 0x08, temp);
4746 temp = (((pVBInfo->VGAHT - 1) & 0xFF00) >> 8) << 4; 4746 temp = (((pVBInfo->VGAHT - 1) & 0xFF00) >> 8) << 4;
4747 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x09, ~0x0F0, temp); 4747 xgifb_reg_and_or(pVBInfo->Part1Port, 0x09, ~0x0F0, temp);
4748 temp = (pVBInfo->VGAHDE + 16) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ 4748 temp = (pVBInfo->VGAHDE + 16) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */
4749 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp); 4749 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp);
4750 tempcx = (pVBInfo->VGAHT - pVBInfo->VGAHDE) >> 2; /* cx */ 4750 tempcx = (pVBInfo->VGAHT - pVBInfo->VGAHDE) >> 2; /* cx */
@@ -4836,7 +4836,7 @@ static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
4836 if (modeflag & HalfDCLK) 4836 if (modeflag & HalfDCLK)
4837 tempax |= 0x40; 4837 tempax |= 0x40;
4838 4838
4839 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2C, ~0x0C0, tempax); 4839 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2C, ~0x0C0, tempax);
4840} 4840}
4841 4841
4842static unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo) 4842static unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo)
@@ -5052,7 +5052,7 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
5052 } 5052 }
5053 5053
5054 xgifb_reg_set(pVBInfo->Part1Port, 0x18, 0x03); /* 0x18 SR0B */ 5054 xgifb_reg_set(pVBInfo->Part1Port, 0x18, 0x03); /* 0x18 SR0B */
5055 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0xF0, 0x00); 5055 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0xF0, 0x00);
5056 xgifb_reg_set(pVBInfo->Part1Port, 0x09, 0xFF); /* 0x09 Set Max VT */ 5056 xgifb_reg_set(pVBInfo->Part1Port, 0x09, 0xFF); /* 0x09 Set Max VT */
5057 5057
5058 tempbx = pVBInfo->VGAVT; 5058 tempbx = pVBInfo->VGAVT;
@@ -5183,7 +5183,7 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
5183 tempcx |= 0x0008; 5183 tempcx |= 0x0008;
5184 5184
5185 if (tempbx & 0x0200) 5185 if (tempbx & 0x0200)
5186 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x0B, 0x0FF, 0x20); 5186 xgifb_reg_and_or(pVBInfo->Part1Port, 0x0B, 0x0FF, 0x20);
5187 5187
5188 tempbx++; 5188 tempbx++;
5189 5189
@@ -5311,11 +5311,11 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5311 xgifb_reg_set(pVBInfo->Part2Port, i, TimingPoint[j]); /* di->temp2[j] */ 5311 xgifb_reg_set(pVBInfo->Part2Port, i, TimingPoint[j]); /* di->temp2[j] */
5312 5312
5313 if (pVBInfo->VBInfo & SetCRT2ToTV) 5313 if (pVBInfo->VBInfo & SetCRT2ToTV)
5314 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x3A, 0x1F, 0x00); 5314 xgifb_reg_and_or(pVBInfo->Part2Port, 0x3A, 0x1F, 0x00);
5315 5315
5316 temp = pVBInfo->NewFlickerMode; 5316 temp = pVBInfo->NewFlickerMode;
5317 temp &= 0x80; 5317 temp &= 0x80;
5318 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x0A, 0xFF, temp); 5318 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0A, 0xFF, temp);
5319 5319
5320 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) 5320 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
5321 tempax = 950; 5321 tempax = 950;
@@ -5379,7 +5379,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5379 xgifb_reg_set(pVBInfo->Part2Port, 0x1B, temp); 5379 xgifb_reg_set(pVBInfo->Part2Port, 0x1B, temp);
5380 5380
5381 temp = (tempcx & 0xFF00) >> 8; 5381 temp = (tempcx & 0xFF00) >> 8;
5382 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1D, ~0x0F, temp); 5382 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1D, ~0x0F, temp);
5383 5383
5384 tempcx = pVBInfo->HT >> 1; 5384 tempcx = pVBInfo->HT >> 1;
5385 push1 = tempcx; /* push cx */ 5385 push1 = tempcx; /* push cx */
@@ -5390,7 +5390,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5390 5390
5391 temp = tempcx & 0x00FF; 5391 temp = tempcx & 0x00FF;
5392 temp = temp << 4; 5392 temp = temp << 4;
5393 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x22, 0x0F, temp); 5393 xgifb_reg_and_or(pVBInfo->Part2Port, 0x22, 0x0F, temp);
5394 5394
5395 tempbx = TimingPoint[j] | ((TimingPoint[j + 1]) << 8); 5395 tempbx = TimingPoint[j] | ((TimingPoint[j + 1]) << 8);
5396 tempbx += tempcx; 5396 tempbx += tempcx;
@@ -5399,7 +5399,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5399 xgifb_reg_set(pVBInfo->Part2Port, 0x24, temp); 5399 xgifb_reg_set(pVBInfo->Part2Port, 0x24, temp);
5400 temp = (tempbx & 0xFF00) >> 8; 5400 temp = (tempbx & 0xFF00) >> 8;
5401 temp = temp << 4; 5401 temp = temp << 4;
5402 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x25, 0x0F, temp); 5402 xgifb_reg_and_or(pVBInfo->Part2Port, 0x25, 0x0F, temp);
5403 5403
5404 tempbx = push2; 5404 tempbx = push2;
5405 tempbx = tempbx + 8; 5405 tempbx = tempbx + 8;
@@ -5409,14 +5409,14 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5409 } 5409 }
5410 5410
5411 temp = (tempbx & 0x00FF) << 4; 5411 temp = (tempbx & 0x00FF) << 4;
5412 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x29, 0x0F, temp); 5412 xgifb_reg_and_or(pVBInfo->Part2Port, 0x29, 0x0F, temp);
5413 5413
5414 j += 2; 5414 j += 2;
5415 tempcx += (TimingPoint[j] | ((TimingPoint[j + 1]) << 8)); 5415 tempcx += (TimingPoint[j] | ((TimingPoint[j + 1]) << 8));
5416 temp = tempcx & 0x00FF; 5416 temp = tempcx & 0x00FF;
5417 xgifb_reg_set(pVBInfo->Part2Port, 0x27, temp); 5417 xgifb_reg_set(pVBInfo->Part2Port, 0x27, temp);
5418 temp = ((tempcx & 0xFF00) >> 8) << 4; 5418 temp = ((tempcx & 0xFF00) >> 8) << 4;
5419 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x28, 0x0F, temp); 5419 xgifb_reg_and_or(pVBInfo->Part2Port, 0x28, 0x0F, temp);
5420 5420
5421 tempcx += 8; 5421 tempcx += 8;
5422 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) 5422 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
@@ -5424,7 +5424,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5424 5424
5425 temp = tempcx & 0xFF; 5425 temp = tempcx & 0xFF;
5426 temp = temp << 4; 5426 temp = temp << 4;
5427 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x2A, 0x0F, temp); 5427 xgifb_reg_and_or(pVBInfo->Part2Port, 0x2A, 0x0F, temp);
5428 5428
5429 tempcx = push1; /* pop cx */ 5429 tempcx = push1; /* pop cx */
5430 j += 2; 5430 j += 2;
@@ -5432,7 +5432,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5432 tempcx -= temp; 5432 tempcx -= temp;
5433 temp = tempcx & 0x00FF; 5433 temp = tempcx & 0x00FF;
5434 temp = temp << 4; 5434 temp = temp << 4;
5435 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x2D, 0x0F, temp); 5435 xgifb_reg_and_or(pVBInfo->Part2Port, 0x2D, 0x0F, temp);
5436 5436
5437 tempcx -= 11; 5437 tempcx -= 11;
5438 5438
@@ -5599,7 +5599,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5599 5599
5600 xgifb_reg_set(pVBInfo->Part2Port, 0x44, temp); 5600 xgifb_reg_set(pVBInfo->Part2Port, 0x44, temp);
5601 temp = (tempbx & 0xFF00) >> 8; 5601 temp = (tempbx & 0xFF00) >> 8;
5602 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x45, ~0x03F, temp); 5602 xgifb_reg_and_or(pVBInfo->Part2Port, 0x45, ~0x03F, temp);
5603 temp = tempcx & 0x00FF; 5603 temp = tempcx & 0x00FF;
5604 5604
5605 if (tempbx & 0x2000) 5605 if (tempbx & 0x2000)
@@ -5608,7 +5608,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5608 if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) 5608 if (!(pVBInfo->VBInfo & SetCRT2ToLCD))
5609 temp |= 0x18; 5609 temp |= 0x18;
5610 5610
5611 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x46, ~0x1F, temp); 5611 xgifb_reg_and_or(pVBInfo->Part2Port, 0x46, ~0x1F, temp);
5612 if (pVBInfo->TVInfo & SetPALTV) { 5612 if (pVBInfo->TVInfo & SetPALTV) {
5613 tempbx = 0x0382; 5613 tempbx = 0x0382;
5614 tempcx = 0x007e; 5614 tempcx = 0x007e;
@@ -5654,7 +5654,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
5654 /* [ycchen] 01/14/03 Modify for 301C PALM Support */ 5654 /* [ycchen] 01/14/03 Modify for 301C PALM Support */
5655 if (pVBInfo->VBType & VB_XGI301C) { 5655 if (pVBInfo->VBType & VB_XGI301C) {
5656 if (pVBInfo->TVInfo & SetPALMTV) 5656 if (pVBInfo->TVInfo & SetPALMTV)
5657 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x4E, ~0x08, 5657 xgifb_reg_and_or(pVBInfo->Part2Port, 0x4E, ~0x08,
5658 0x08); /* PALM Mode */ 5658 0x08); /* PALM Mode */
5659 } 5659 }
5660 5660
@@ -5711,7 +5711,7 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
5711 xgifb_reg_set(pVBInfo->Part2Port, 0x2C, temp); 5711 xgifb_reg_set(pVBInfo->Part2Port, 0x2C, temp);
5712 temp = (tempbx & 0xFF00) >> 8; 5712 temp = (tempbx & 0xFF00) >> 8;
5713 temp = temp << 4; 5713 temp = temp << 4;
5714 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x2B, 0x0F, temp); 5714 xgifb_reg_and_or(pVBInfo->Part2Port, 0x2B, 0x0F, temp);
5715 temp = 0x01; 5715 temp = 0x01;
5716 5716
5717 if (pVBInfo->LCDResInfo == Panel1280x1024) { 5717 if (pVBInfo->LCDResInfo == Panel1280x1024) {
@@ -5731,7 +5731,7 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
5731 temp = tempbx & 0x00FF; 5731 temp = tempbx & 0x00FF;
5732 xgifb_reg_set(pVBInfo->Part2Port, 0x03, temp); 5732 xgifb_reg_set(pVBInfo->Part2Port, 0x03, temp);
5733 temp = ((tempbx & 0xFF00) >> 8) & 0x07; 5733 temp = ((tempbx & 0xFF00) >> 8) & 0x07;
5734 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x0C, ~0x07, temp); 5734 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0C, ~0x07, temp);
5735 5735
5736 tempcx = pVBInfo->VT - 1; 5736 tempcx = pVBInfo->VT - 1;
5737 push2 = tempcx + 1; 5737 push2 = tempcx + 1;
@@ -5740,10 +5740,10 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
5740 temp = (tempcx & 0xFF00) >> 8; 5740 temp = (tempcx & 0xFF00) >> 8;
5741 temp = temp << 5; 5741 temp = temp << 5;
5742 xgifb_reg_set(pVBInfo->Part2Port, 0x1A, temp); 5742 xgifb_reg_set(pVBInfo->Part2Port, 0x1A, temp);
5743 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x09, 0xF0, 0x00); 5743 xgifb_reg_and_or(pVBInfo->Part2Port, 0x09, 0xF0, 0x00);
5744 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x0A, 0xF0, 0x00); 5744 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0A, 0xF0, 0x00);
5745 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x17, 0xFB, 0x00); 5745 xgifb_reg_and_or(pVBInfo->Part2Port, 0x17, 0xFB, 0x00);
5746 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x18, 0xDF, 0x00); 5746 xgifb_reg_and_or(pVBInfo->Part2Port, 0x18, 0xDF, 0x00);
5747 5747
5748 /* Customized LCDB Des no add */ 5748 /* Customized LCDB Des no add */
5749 tempbx = 5; 5749 tempbx = 5;
@@ -5867,7 +5867,7 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
5867 5867
5868 temp = (tempbx & 0xFF00) >> 8; 5868 temp = (tempbx & 0xFF00) >> 8;
5869 temp = temp << 4; 5869 temp = temp << 4;
5870 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1D, ~0x0F0, temp); 5870 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1D, ~0x0F0, temp);
5871 temp = tempcx & 0x00FF; /* RHSYEXP2S=lcdhre */ 5871 temp = tempcx & 0x00FF; /* RHSYEXP2S=lcdhre */
5872 xgifb_reg_set(pVBInfo->Part2Port, 0x21, temp); 5872 xgifb_reg_set(pVBInfo->Part2Port, 0x21, temp);
5873 5873
@@ -5972,9 +5972,9 @@ static void XGI_SetTap4Regs(struct vb_device_info *pVBInfo)
5972 } 5972 }
5973 5973
5974 if ((pVBInfo->VBInfo & SetCRT2ToTV) && (!(pVBInfo->VBInfo & SetCRT2ToHiVisionTV))) 5974 if ((pVBInfo->VBInfo & SetCRT2ToTV) && (!(pVBInfo->VBInfo & SetCRT2ToHiVisionTV)))
5975 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x4E, ~0x14, 0x04); /* Enable V.Scaling */ 5975 xgifb_reg_and_or(pVBInfo->Part2Port, 0x4E, ~0x14, 0x04); /* Enable V.Scaling */
5976 else 5976 else
5977 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x4E, ~0x14, 0x10); /* Enable H.Scaling */ 5977 xgifb_reg_and_or(pVBInfo->Part2Port, 0x4E, ~0x14, 0x10); /* Enable H.Scaling */
5978#endif 5978#endif
5979} 5979}
5980 5980
@@ -6109,7 +6109,7 @@ static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex,
6109 if (pVBInfo->VGAHDE == 1024) 6109 if (pVBInfo->VGAHDE == 1024)
6110 temp = 0x20; 6110 temp = 0x20;
6111 } 6111 }
6112 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x0E, ~0xEF, temp); 6112 xgifb_reg_and_or(pVBInfo->Part4Port, 0x0E, ~0xEF, temp);
6113 6113
6114 tempebx = pVBInfo->VDE; 6114 tempebx = pVBInfo->VDE;
6115 6115
@@ -6223,13 +6223,13 @@ static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex,
6223 } 6223 }
6224 } 6224 }
6225 6225
6226 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x1F, 0x00C0, temp); 6226 xgifb_reg_and_or(pVBInfo->Part4Port, 0x1F, 0x00C0, temp);
6227 tempbx = pVBInfo->HT; 6227 tempbx = pVBInfo->HT;
6228 if (XGI_IsLCDDualLink(pVBInfo)) 6228 if (XGI_IsLCDDualLink(pVBInfo))
6229 tempbx = tempbx >> 1; 6229 tempbx = tempbx >> 1;
6230 tempbx = (tempbx >> 1) - 2; 6230 tempbx = (tempbx >> 1) - 2;
6231 temp = ((tempbx & 0x0700) >> 8) << 3; 6231 temp = ((tempbx & 0x0700) >> 8) << 3;
6232 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x21, 0x00C0, temp); 6232 xgifb_reg_and_or(pVBInfo->Part4Port, 0x21, 0x00C0, temp);
6233 temp = tempbx & 0x00FF; 6233 temp = tempbx & 0x00FF;
6234 xgifb_reg_set(pVBInfo->Part4Port, 0x22, temp); 6234 xgifb_reg_set(pVBInfo->Part4Port, 0x22, temp);
6235 } 6235 }
@@ -6242,7 +6242,7 @@ static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex,
6242 6242
6243static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo) 6243static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo)
6244{ 6244{
6245 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1E, 0xFF, 0x20); 6245 xgifb_reg_and_or(pVBInfo->P3c4, 0x1E, 0xFF, 0x20);
6246} 6246}
6247 6247
6248static void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex, 6248static void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex,
@@ -6265,14 +6265,14 @@ static void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex,
6265static void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, 6265static void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
6266 struct vb_device_info *pVBInfo) 6266 struct vb_device_info *pVBInfo)
6267{ 6267{
6268 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x63, 0xBF, 0x40); 6268 xgifb_reg_and_or(pVBInfo->P3d4, 0x63, 0xBF, 0x40);
6269} 6269}
6270 6270
6271static void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, 6271static void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
6272 struct vb_device_info *pVBInfo) 6272 struct vb_device_info *pVBInfo)
6273{ 6273{
6274 6274
6275 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x63, 0xBF, 0x00); 6275 xgifb_reg_and_or(pVBInfo->P3d4, 0x63, 0xBF, 0x00);
6276} 6276}
6277 6277
6278/*----------------------------------------------------------------------------*/ 6278/*----------------------------------------------------------------------------*/
@@ -6297,7 +6297,7 @@ void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
6297 if (tempbh & 0x20) { 6297 if (tempbh & 0x20) {
6298 temp = (tempbl >> 4) & 0x02; 6298 temp = (tempbl >> 4) & 0x02;
6299 6299
6300 XGINew_SetRegANDOR(pVBInfo->P3d4, 0xB4, ~0x02, temp); /* CR B4[1] */ 6300 xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~0x02, temp); /* CR B4[1] */
6301 6301
6302 } 6302 }
6303 6303
@@ -6325,10 +6325,10 @@ void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
6325 if (tempbh & 0x20) { 6325 if (tempbh & 0x20) {
6326 temp = (tempbl >> 4) & 0x02; 6326 temp = (tempbl >> 4) & 0x02;
6327 6327
6328 XGINew_SetRegANDOR(pVBInfo->P3d4, 0xB4, ~0x02, temp); /* CR B4[1] */ 6328 xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~0x02, temp); /* CR B4[1] */
6329 6329
6330 } 6330 }
6331 XGINew_SetRegANDOR(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0); 6331 xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0);
6332 6332
6333 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); 6333 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
6334 tempbh &= 0x03; 6334 tempbh &= 0x03;
@@ -6336,7 +6336,7 @@ void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
6336 tempbh <<= 2; 6336 tempbh <<= 2;
6337 tempbl <<= 2; /* GPIOC,GPIOD */ 6337 tempbl <<= 2; /* GPIOC,GPIOD */
6338 XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */ 6338 XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */
6339 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x48, ~tempbh, tempbl); 6339 xgifb_reg_and_or(pVBInfo->P3d4, 0x48, ~tempbh, tempbl);
6340} 6340}
6341 6341
6342/* --------------------------------------------------------------------- */ 6342/* --------------------------------------------------------------------- */
@@ -6439,8 +6439,8 @@ void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo)
6439 6439
6440 temp = xgifb_reg_get(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 xgifb_reg_and_or(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 xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: dual 12bits */
6444 6444
6445} 6445}
6446 6446
@@ -6450,8 +6450,8 @@ void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo)
6450 6450
6451 temp = xgifb_reg_get(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 xgifb_reg_and_or(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 xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: 24bits */
6455 6455
6456} 6456}
6457 6457
@@ -6475,8 +6475,8 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
6475 6475
6476 temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability 6476 temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability
6477 & LCDPolarity); 6477 & LCDPolarity);
6478 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x80, temp & 0x80); /* SR35[7] FP VSync polarity */ 6478 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x80, temp & 0x80); /* SR35[7] FP VSync polarity */
6479 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x30, ~0x20, (temp & 0x40) >> 1); /* SR30[5] FP HSync polarity */ 6479 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, ~0x20, (temp & 0x40) >> 1); /* SR30[5] FP HSync polarity */
6480 6480
6481 XGI_SetXG21FPBits(pVBInfo); 6481 XGI_SetXG21FPBits(pVBInfo);
6482 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo); 6482 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
@@ -6543,81 +6543,81 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
6543 6543
6544 /* HT SR0B[1:0] CR00 */ 6544 /* HT SR0B[1:0] CR00 */
6545 value = (LVDSHT >> 3) - 5; 6545 value = (LVDSHT >> 3) - 5;
6546 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0B, ~0x03, (value & 0x300) >> 8); 6546 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0x03, (value & 0x300) >> 8);
6547 xgifb_reg_set(pVBInfo->P3d4, 0x0, (value & 0xFF)); 6547 xgifb_reg_set(pVBInfo->P3d4, 0x0, (value & 0xFF));
6548 6548
6549 /* HBS SR0B[5:4] CR02 */ 6549 /* HBS SR0B[5:4] CR02 */
6550 value = (LVDSHBS >> 3) - 1; 6550 value = (LVDSHBS >> 3) - 1;
6551 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0B, ~0x30, (value & 0x300) >> 4); 6551 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0x30, (value & 0x300) >> 4);
6552 xgifb_reg_set(pVBInfo->P3d4, 0x2, (value & 0xFF)); 6552 xgifb_reg_set(pVBInfo->P3d4, 0x2, (value & 0xFF));
6553 6553
6554 /* HBE SR0C[1:0] CR05[7] CR03[4:0] */ 6554 /* HBE SR0C[1:0] CR05[7] CR03[4:0] */
6555 value = (LVDSHBE >> 3) - 1; 6555 value = (LVDSHBE >> 3) - 1;
6556 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0C, ~0x03, (value & 0xC0) >> 6); 6556 xgifb_reg_and_or(pVBInfo->P3c4, 0x0C, ~0x03, (value & 0xC0) >> 6);
6557 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x05, ~0x80, (value & 0x20) << 2); 6557 xgifb_reg_and_or(pVBInfo->P3d4, 0x05, ~0x80, (value & 0x20) << 2);
6558 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x03, ~0x1F, value & 0x1F); 6558 xgifb_reg_and_or(pVBInfo->P3d4, 0x03, ~0x1F, value & 0x1F);
6559 6559
6560 /* HRS SR0B[7:6] CR04 */ 6560 /* HRS SR0B[7:6] CR04 */
6561 value = (LVDSHRS >> 3) + 2; 6561 value = (LVDSHRS >> 3) + 2;
6562 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0B, ~0xC0, (value & 0x300) >> 2); 6562 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0xC0, (value & 0x300) >> 2);
6563 xgifb_reg_set(pVBInfo->P3d4, 0x4, (value & 0xFF)); 6563 xgifb_reg_set(pVBInfo->P3d4, 0x4, (value & 0xFF));
6564 6564
6565 /* Panel HRS SR2F[1:0] SR2E[7:0] */ 6565 /* Panel HRS SR2F[1:0] SR2E[7:0] */
6566 value--; 6566 value--;
6567 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x2F, ~0x03, (value & 0x300) >> 8); 6567 xgifb_reg_and_or(pVBInfo->P3c4, 0x2F, ~0x03, (value & 0x300) >> 8);
6568 xgifb_reg_set(pVBInfo->P3c4, 0x2E, (value & 0xFF)); 6568 xgifb_reg_set(pVBInfo->P3c4, 0x2E, (value & 0xFF));
6569 6569
6570 /* HRE SR0C[2] CR05[4:0] */ 6570 /* HRE SR0C[2] CR05[4:0] */
6571 value = (LVDSHRE >> 3) + 2; 6571 value = (LVDSHRE >> 3) + 2;
6572 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0C, ~0x04, (value & 0x20) >> 3); 6572 xgifb_reg_and_or(pVBInfo->P3c4, 0x0C, ~0x04, (value & 0x20) >> 3);
6573 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x05, ~0x1F, value & 0x1F); 6573 xgifb_reg_and_or(pVBInfo->P3d4, 0x05, ~0x1F, value & 0x1F);
6574 6574
6575 /* Panel HRE SR2F[7:2] */ 6575 /* Panel HRE SR2F[7:2] */
6576 value--; 6576 value--;
6577 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x2F, ~0xFC, value << 2); 6577 xgifb_reg_and_or(pVBInfo->P3c4, 0x2F, ~0xFC, value << 2);
6578 6578
6579 /* VT SR0A[0] CR07[5][0] CR06 */ 6579 /* VT SR0A[0] CR07[5][0] CR06 */
6580 value = LVDSVT - 2; 6580 value = LVDSVT - 2;
6581 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x01, (value & 0x400) >> 10); 6581 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x01, (value & 0x400) >> 10);
6582 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x20, (value & 0x200) >> 4); 6582 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x20, (value & 0x200) >> 4);
6583 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x01, (value & 0x100) >> 8); 6583 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x01, (value & 0x100) >> 8);
6584 xgifb_reg_set(pVBInfo->P3d4, 0x06, (value & 0xFF)); 6584 xgifb_reg_set(pVBInfo->P3d4, 0x06, (value & 0xFF));
6585 6585
6586 /* VBS SR0A[2] CR09[5] CR07[3] CR15 */ 6586 /* VBS SR0A[2] CR09[5] CR07[3] CR15 */
6587 value = LVDSVBS - 1; 6587 value = LVDSVBS - 1;
6588 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x04, (value & 0x400) >> 8); 6588 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x04, (value & 0x400) >> 8);
6589 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x09, ~0x20, (value & 0x200) >> 4); 6589 xgifb_reg_and_or(pVBInfo->P3d4, 0x09, ~0x20, (value & 0x200) >> 4);
6590 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x08, (value & 0x100) >> 5); 6590 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x08, (value & 0x100) >> 5);
6591 xgifb_reg_set(pVBInfo->P3d4, 0x15, (value & 0xFF)); 6591 xgifb_reg_set(pVBInfo->P3d4, 0x15, (value & 0xFF));
6592 6592
6593 /* VBE SR0A[4] CR16 */ 6593 /* VBE SR0A[4] CR16 */
6594 value = LVDSVBE - 1; 6594 value = LVDSVBE - 1;
6595 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x10, (value & 0x100) >> 4); 6595 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x10, (value & 0x100) >> 4);
6596 xgifb_reg_set(pVBInfo->P3d4, 0x16, (value & 0xFF)); 6596 xgifb_reg_set(pVBInfo->P3d4, 0x16, (value & 0xFF));
6597 6597
6598 /* VRS SR0A[3] CR7[7][2] CR10 */ 6598 /* VRS SR0A[3] CR7[7][2] CR10 */
6599 value = LVDSVRS - 1; 6599 value = LVDSVRS - 1;
6600 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x08, (value & 0x400) >> 7); 6600 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x08, (value & 0x400) >> 7);
6601 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x80, (value & 0x200) >> 2); 6601 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x80, (value & 0x200) >> 2);
6602 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x04, (value & 0x100) >> 6); 6602 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x04, (value & 0x100) >> 6);
6603 xgifb_reg_set(pVBInfo->P3d4, 0x10, (value & 0xFF)); 6603 xgifb_reg_set(pVBInfo->P3d4, 0x10, (value & 0xFF));
6604 6604
6605 /* Panel VRS SR3F[1:0] SR34[7:0] SR33[0] */ 6605 /* Panel VRS SR3F[1:0] SR34[7:0] SR33[0] */
6606 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x3F, ~0x03, (value & 0x600) >> 9); 6606 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0x03, (value & 0x600) >> 9);
6607 xgifb_reg_set(pVBInfo->P3c4, 0x34, (value >> 1) & 0xFF); 6607 xgifb_reg_set(pVBInfo->P3c4, 0x34, (value >> 1) & 0xFF);
6608 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x33, ~0x01, value & 0x01); 6608 xgifb_reg_and_or(pVBInfo->P3d4, 0x33, ~0x01, value & 0x01);
6609 6609
6610 /* VRE SR0A[5] CR11[3:0] */ 6610 /* VRE SR0A[5] CR11[3:0] */
6611 value = LVDSVRE - 1; 6611 value = LVDSVRE - 1;
6612 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x20, (value & 0x10) << 1); 6612 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x20, (value & 0x10) << 1);
6613 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x11, ~0x0F, value & 0x0F); 6613 xgifb_reg_and_or(pVBInfo->P3d4, 0x11, ~0x0F, value & 0x0F);
6614 6614
6615 /* Panel VRE SR3F[7:2] *//* SR3F[7] has to be 0, h/w bug */ 6615 /* Panel VRE SR3F[7:2] *//* SR3F[7] has to be 0, h/w bug */
6616 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x3F, ~0xFC, (value << 2) & 0x7C); 6616 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, (value << 2) & 0x7C);
6617 6617
6618 for (temp = 0, value = 0; temp < 3; temp++) { 6618 for (temp = 0, value = 0; temp < 3; temp++) {
6619 6619
6620 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x31, ~0x30, value); 6620 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, value);
6621 xgifb_reg_set(pVBInfo->P3c4, 6621 xgifb_reg_set(pVBInfo->P3c4,
6622 0x2B, 6622 0x2B,
6623 pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1); 6623 pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1);
@@ -6660,8 +6660,8 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
6660 6660
6661 temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability 6661 temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability
6662 & LCDPolarity); 6662 & LCDPolarity);
6663 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x80, temp & 0x80); /* SR35[7] FP VSync polarity */ 6663 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x80, temp & 0x80); /* SR35[7] FP VSync polarity */
6664 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x30, ~0x20, (temp & 0x40) >> 1); /* SR30[5] FP HSync polarity */ 6664 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, ~0x20, (temp & 0x40) >> 1); /* SR30[5] FP HSync polarity */
6665 6665
6666 XGI_SetXG27FPBits(pVBInfo); 6666 XGI_SetXG27FPBits(pVBInfo);
6667 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo); 6667 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
@@ -6728,80 +6728,80 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
6728 6728
6729 /* HT SR0B[1:0] CR00 */ 6729 /* HT SR0B[1:0] CR00 */
6730 value = (LVDSHT >> 3) - 5; 6730 value = (LVDSHT >> 3) - 5;
6731 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0B, ~0x03, (value & 0x300) >> 8); 6731 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0x03, (value & 0x300) >> 8);
6732 xgifb_reg_set(pVBInfo->P3d4, 0x0, (value & 0xFF)); 6732 xgifb_reg_set(pVBInfo->P3d4, 0x0, (value & 0xFF));
6733 6733
6734 /* HBS SR0B[5:4] CR02 */ 6734 /* HBS SR0B[5:4] CR02 */
6735 value = (LVDSHBS >> 3) - 1; 6735 value = (LVDSHBS >> 3) - 1;
6736 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0B, ~0x30, (value & 0x300) >> 4); 6736 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0x30, (value & 0x300) >> 4);
6737 xgifb_reg_set(pVBInfo->P3d4, 0x2, (value & 0xFF)); 6737 xgifb_reg_set(pVBInfo->P3d4, 0x2, (value & 0xFF));
6738 6738
6739 /* HBE SR0C[1:0] CR05[7] CR03[4:0] */ 6739 /* HBE SR0C[1:0] CR05[7] CR03[4:0] */
6740 value = (LVDSHBE >> 3) - 1; 6740 value = (LVDSHBE >> 3) - 1;
6741 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0C, ~0x03, (value & 0xC0) >> 6); 6741 xgifb_reg_and_or(pVBInfo->P3c4, 0x0C, ~0x03, (value & 0xC0) >> 6);
6742 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x05, ~0x80, (value & 0x20) << 2); 6742 xgifb_reg_and_or(pVBInfo->P3d4, 0x05, ~0x80, (value & 0x20) << 2);
6743 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x03, ~0x1F, value & 0x1F); 6743 xgifb_reg_and_or(pVBInfo->P3d4, 0x03, ~0x1F, value & 0x1F);
6744 6744
6745 /* HRS SR0B[7:6] CR04 */ 6745 /* HRS SR0B[7:6] CR04 */
6746 value = (LVDSHRS >> 3) + 2; 6746 value = (LVDSHRS >> 3) + 2;
6747 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0B, ~0xC0, (value & 0x300) >> 2); 6747 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0xC0, (value & 0x300) >> 2);
6748 xgifb_reg_set(pVBInfo->P3d4, 0x4, (value & 0xFF)); 6748 xgifb_reg_set(pVBInfo->P3d4, 0x4, (value & 0xFF));
6749 6749
6750 /* Panel HRS SR2F[1:0] SR2E[7:0] */ 6750 /* Panel HRS SR2F[1:0] SR2E[7:0] */
6751 value--; 6751 value--;
6752 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x2F, ~0x03, (value & 0x300) >> 8); 6752 xgifb_reg_and_or(pVBInfo->P3c4, 0x2F, ~0x03, (value & 0x300) >> 8);
6753 xgifb_reg_set(pVBInfo->P3c4, 0x2E, (value & 0xFF)); 6753 xgifb_reg_set(pVBInfo->P3c4, 0x2E, (value & 0xFF));
6754 6754
6755 /* HRE SR0C[2] CR05[4:0] */ 6755 /* HRE SR0C[2] CR05[4:0] */
6756 value = (LVDSHRE >> 3) + 2; 6756 value = (LVDSHRE >> 3) + 2;
6757 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0C, ~0x04, (value & 0x20) >> 3); 6757 xgifb_reg_and_or(pVBInfo->P3c4, 0x0C, ~0x04, (value & 0x20) >> 3);
6758 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x05, ~0x1F, value & 0x1F); 6758 xgifb_reg_and_or(pVBInfo->P3d4, 0x05, ~0x1F, value & 0x1F);
6759 6759
6760 /* Panel HRE SR2F[7:2] */ 6760 /* Panel HRE SR2F[7:2] */
6761 value--; 6761 value--;
6762 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x2F, ~0xFC, value << 2); 6762 xgifb_reg_and_or(pVBInfo->P3c4, 0x2F, ~0xFC, value << 2);
6763 6763
6764 /* VT SR0A[0] CR07[5][0] CR06 */ 6764 /* VT SR0A[0] CR07[5][0] CR06 */
6765 value = LVDSVT - 2; 6765 value = LVDSVT - 2;
6766 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x01, (value & 0x400) >> 10); 6766 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x01, (value & 0x400) >> 10);
6767 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x20, (value & 0x200) >> 4); 6767 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x20, (value & 0x200) >> 4);
6768 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x01, (value & 0x100) >> 8); 6768 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x01, (value & 0x100) >> 8);
6769 xgifb_reg_set(pVBInfo->P3d4, 0x06, (value & 0xFF)); 6769 xgifb_reg_set(pVBInfo->P3d4, 0x06, (value & 0xFF));
6770 6770
6771 /* VBS SR0A[2] CR09[5] CR07[3] CR15 */ 6771 /* VBS SR0A[2] CR09[5] CR07[3] CR15 */
6772 value = LVDSVBS - 1; 6772 value = LVDSVBS - 1;
6773 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x04, (value & 0x400) >> 8); 6773 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x04, (value & 0x400) >> 8);
6774 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x09, ~0x20, (value & 0x200) >> 4); 6774 xgifb_reg_and_or(pVBInfo->P3d4, 0x09, ~0x20, (value & 0x200) >> 4);
6775 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x08, (value & 0x100) >> 5); 6775 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x08, (value & 0x100) >> 5);
6776 xgifb_reg_set(pVBInfo->P3d4, 0x15, (value & 0xFF)); 6776 xgifb_reg_set(pVBInfo->P3d4, 0x15, (value & 0xFF));
6777 6777
6778 /* VBE SR0A[4] CR16 */ 6778 /* VBE SR0A[4] CR16 */
6779 value = LVDSVBE - 1; 6779 value = LVDSVBE - 1;
6780 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x10, (value & 0x100) >> 4); 6780 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x10, (value & 0x100) >> 4);
6781 xgifb_reg_set(pVBInfo->P3d4, 0x16, (value & 0xFF)); 6781 xgifb_reg_set(pVBInfo->P3d4, 0x16, (value & 0xFF));
6782 6782
6783 /* VRS SR0A[3] CR7[7][2] CR10 */ 6783 /* VRS SR0A[3] CR7[7][2] CR10 */
6784 value = LVDSVRS - 1; 6784 value = LVDSVRS - 1;
6785 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x08, (value & 0x400) >> 7); 6785 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x08, (value & 0x400) >> 7);
6786 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x80, (value & 0x200) >> 2); 6786 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x80, (value & 0x200) >> 2);
6787 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x07, ~0x04, (value & 0x100) >> 6); 6787 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x04, (value & 0x100) >> 6);
6788 xgifb_reg_set(pVBInfo->P3d4, 0x10, (value & 0xFF)); 6788 xgifb_reg_set(pVBInfo->P3d4, 0x10, (value & 0xFF));
6789 6789
6790 /* Panel VRS SR35[2:0] SR34[7:0] */ 6790 /* Panel VRS SR35[2:0] SR34[7:0] */
6791 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x35, ~0x07, (value & 0x700) >> 8); 6791 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x07, (value & 0x700) >> 8);
6792 xgifb_reg_set(pVBInfo->P3c4, 0x34, value & 0xFF); 6792 xgifb_reg_set(pVBInfo->P3c4, 0x34, value & 0xFF);
6793 6793
6794 /* VRE SR0A[5] CR11[3:0] */ 6794 /* VRE SR0A[5] CR11[3:0] */
6795 value = LVDSVRE - 1; 6795 value = LVDSVRE - 1;
6796 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x0A, ~0x20, (value & 0x10) << 1); 6796 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x20, (value & 0x10) << 1);
6797 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x11, ~0x0F, value & 0x0F); 6797 xgifb_reg_and_or(pVBInfo->P3d4, 0x11, ~0x0F, value & 0x0F);
6798 6798
6799 /* Panel VRE SR3F[7:2] */ 6799 /* Panel VRE SR3F[7:2] */
6800 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x3F, ~0xFC, (value << 2) & 0xFC); 6800 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, (value << 2) & 0xFC);
6801 6801
6802 for (temp = 0, value = 0; temp < 3; temp++) { 6802 for (temp = 0, value = 0; temp < 3; temp++) {
6803 6803
6804 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x31, ~0x30, value); 6804 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, value);
6805 xgifb_reg_set(pVBInfo->P3c4, 6805 xgifb_reg_set(pVBInfo->P3c4,
6806 0x2B, 6806 0x2B,
6807 pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1); 6807 pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1);
@@ -7152,7 +7152,7 @@ static void XGI_SetDelayComp(struct vb_device_info *pVBInfo)
7152 pVBInfo)].LCD_DelayCompensation; /* / Get LCD Delay */ 7152 pVBInfo)].LCD_DelayCompensation; /* / Get LCD Delay */
7153 tempah &= 0x0f; 7153 tempah &= 0x0f;
7154 tempah = tempah << 4; 7154 tempah = tempah << 4;
7155 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2D, 0x0f, 7155 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2D, 0x0f,
7156 tempah); 7156 tempah);
7157 } 7157 }
7158 } 7158 }
@@ -7165,22 +7165,22 @@ static void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInf
7165 temp = xgifb_reg_get(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 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0x0F,
7169 (unsigned short) (0x20 | (tempcx & 0x00C0))); /* Enable Dither */ 7169 (unsigned short) (0x20 | (tempcx & 0x00C0))); /* Enable Dither */
7170 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x1A, 0x7F, 0x80); 7170 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1A, 0x7F, 0x80);
7171 } else { 7171 } else {
7172 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, 7172 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0x0F,
7173 (unsigned short) (0x30 | (tempcx & 0x00C0))); 7173 (unsigned short) (0x30 | (tempcx & 0x00C0)));
7174 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x1A, 0x7F, 0x00); 7174 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1A, 0x7F, 0x00);
7175 } 7175 }
7176 7176
7177 /* 7177 /*
7178 if (tempcx & EnableLCD24bpp) { // 24bits 7178 if (tempcx & EnableLCD24bpp) { // 24bits
7179 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, (unsigned short)(0x30 | (tempcx&0x00C0))); 7179 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0x0F, (unsigned short)(0x30 | (tempcx&0x00C0)));
7180 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x1A, 0x7F, 0x00); 7180 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1A, 0x7F, 0x00);
7181 } else { 7181 } else {
7182 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x19, 0x0F, (unsigned short)(0x20 | (tempcx&0x00C0))); // Enable Dither 7182 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0x0F, (unsigned short)(0x20 | (tempcx&0x00C0))); // Enable Dither
7183 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x1A, 0x7F, 0x80); 7183 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1A, 0x7F, 0x80);
7184 } 7184 }
7185 */ 7185 */
7186} 7186}
@@ -7194,11 +7194,11 @@ static void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInf
7194static void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo) 7194static void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo)
7195{ 7195{
7196 if (tempcx & EnableLCD24bpp) /* 24bits */ 7196 if (tempcx & EnableLCD24bpp) /* 24bits */
7197 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1A, 0xE0, 7197 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1A, 0xE0,
7198 (unsigned short) (((tempcx & 0x00ff) >> 6) 7198 (unsigned short) (((tempcx & 0x00ff) >> 6)
7199 | 0x0c)); 7199 | 0x0c));
7200 else 7200 else
7201 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1A, 0xE0, 7201 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1A, 0xE0,
7202 (unsigned short) (((tempcx & 0x00ff) >> 6) 7202 (unsigned short) (((tempcx & 0x00ff) >> 6)
7203 | 0x18)); /* Enable Dither */ 7203 | 0x18)); /* Enable Dither */
7204} 7204}
@@ -7240,7 +7240,7 @@ static void XGI_SetLCDCap(struct vb_device_info *pVBInfo)
7240 (unsigned char) (tempcx & 0x1F)); 7240 (unsigned char) (tempcx & 0x1F));
7241 } 7241 }
7242 /* VB Driving */ 7242 /* VB Driving */
7243 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x0D, 7243 xgifb_reg_and_or(pVBInfo->Part4Port, 0x0D,
7244 ~((EnableVBCLKDRVLOW | EnablePLLSPLOW) >> 8), 7244 ~((EnableVBCLKDRVLOW | EnablePLLSPLOW) >> 8),
7245 (unsigned short) ((tempcx & (EnableVBCLKDRVLOW 7245 (unsigned short) ((tempcx & (EnableVBCLKDRVLOW
7246 | EnablePLLSPLOW)) >> 8)); 7246 | EnablePLLSPLOW)) >> 8));
@@ -7291,7 +7291,7 @@ static void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex
7291 tempah = TVAntiFlickList[tempbx]; 7291 tempah = TVAntiFlickList[tempbx];
7292 tempah = tempah << 4; 7292 tempah = tempah << 4;
7293 7293
7294 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x0A, 0x8F, tempah); 7294 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0A, 0x8F, tempah);
7295} 7295}
7296 7296
7297static void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex, 7297static void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex,
@@ -7313,7 +7313,7 @@ static void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex
7313 tempah = TVEdgeList[tempbx]; 7313 tempah = TVEdgeList[tempbx];
7314 tempah = tempah << 5; 7314 tempah = tempah << 5;
7315 7315
7316 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x3A, 0x1F, tempah); 7316 xgifb_reg_and_or(pVBInfo->Part2Port, 0x3A, 0x1F, tempah);
7317} 7317}
7318 7318
7319static void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo) 7319static void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo)
@@ -7518,7 +7518,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7518 tempbl = 0xf0; 7518 tempbl = 0xf0;
7519 7519
7520 if (pVBInfo->VBInfo & DisableCRT2Display) { 7520 if (pVBInfo->VBInfo & DisableCRT2Display) {
7521 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2e, tempbl, tempah); 7521 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2e, tempbl, tempah);
7522 } else { 7522 } else {
7523 tempah = 0x00; 7523 tempah = 0x00;
7524 tempbl = 0xff; 7524 tempbl = 0xff;
@@ -7529,7 +7529,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7529 && (!(pVBInfo->VBInfo & SetSimuScanMode))) { 7529 && (!(pVBInfo->VBInfo & SetSimuScanMode))) {
7530 tempbl &= 0xf7; 7530 tempbl &= 0xf7;
7531 tempah |= 0x01; 7531 tempah |= 0x01;
7532 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2e, 7532 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2e,
7533 tempbl, tempah); 7533 tempbl, tempah);
7534 } else { 7534 } else {
7535 if (pVBInfo->VBInfo & SetCRT2ToLCDA) { 7535 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
@@ -7555,15 +7555,15 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7555 if (!(pVBInfo->VBInfo 7555 if (!(pVBInfo->VBInfo
7556 & SetCRT2ToDualEdge)) 7556 & SetCRT2ToDualEdge))
7557 tempah |= 0x08; 7557 tempah |= 0x08;
7558 XGINew_SetRegANDOR(pVBInfo->Part1Port, 7558 xgifb_reg_and_or(pVBInfo->Part1Port,
7559 0x2e, tempbl, tempah); 7559 0x2e, tempbl, tempah);
7560 } else { 7560 } else {
7561 XGINew_SetRegANDOR(pVBInfo->Part1Port, 7561 xgifb_reg_and_or(pVBInfo->Part1Port,
7562 0x2e, tempbl, tempah); 7562 0x2e, tempbl, tempah);
7563 } 7563 }
7564 } 7564 }
7565 } else { 7565 } else {
7566 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2e, tempbl, 7566 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2e, tempbl,
7567 tempah); 7567 tempah);
7568 } 7568 }
7569 } 7569 }
@@ -7587,7 +7587,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7587 /* } */ 7587 /* } */
7588 } 7588 }
7589 7589
7590 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x0D, ~0x0BF, tempah); 7590 xgifb_reg_and_or(pVBInfo->Part4Port, 0x0D, ~0x0BF, tempah);
7591 tempah = 0; 7591 tempah = 0;
7592 7592
7593 if (pVBInfo->LCDInfo & SetLCDDualLink) 7593 if (pVBInfo->LCDInfo & SetLCDDualLink)
@@ -7621,7 +7621,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7621 tempah |= 0x04; /* shampoo 0129 */ 7621 tempah |= 0x04; /* shampoo 0129 */
7622 } 7622 }
7623 7623
7624 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x13, tempbl, tempah); 7624 xgifb_reg_and_or(pVBInfo->Part1Port, 0x13, tempbl, tempah);
7625 tempah = 0x00; 7625 tempah = 0x00;
7626 tempbl = 0xcf; 7626 tempbl = 0xcf;
7627 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { 7627 if (!(pVBInfo->VBInfo & DisableCRT2Display)) {
@@ -7629,7 +7629,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7629 tempah |= 0x30; 7629 tempah |= 0x30;
7630 } 7630 }
7631 7631
7632 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2c, tempbl, tempah); 7632 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2c, tempbl, tempah);
7633 tempah = 0; 7633 tempah = 0;
7634 tempbl = 0x3f; 7634 tempbl = 0x3f;
7635 7635
@@ -7637,7 +7637,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7637 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) 7637 if (pVBInfo->VBInfo & SetCRT2ToDualEdge)
7638 tempah |= 0xc0; 7638 tempah |= 0xc0;
7639 } 7639 }
7640 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x21, tempbl, tempah); 7640 xgifb_reg_and_or(pVBInfo->Part4Port, 0x21, tempbl, tempah);
7641 } 7641 }
7642 7642
7643 tempah = 0; 7643 tempah = 0;
@@ -7648,7 +7648,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
7648 tempah |= 0x80; 7648 tempah |= 0x80;
7649 } 7649 }
7650 7650
7651 XGINew_SetRegANDOR(pVBInfo->Part4Port, 0x23, tempbl, tempah); 7651 xgifb_reg_and_or(pVBInfo->Part4Port, 0x23, tempbl, tempah);
7652 7652
7653 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) { 7653 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
7654 if (pVBInfo->LCDInfo & SetLCDDualLink) { 7654 if (pVBInfo->LCDInfo & SetLCDDualLink) {
@@ -7681,7 +7681,7 @@ void XGI_UnLockCRT2(struct xgi_hw_device_info *HwDeviceExtension,
7681 struct vb_device_info *pVBInfo) 7681 struct vb_device_info *pVBInfo)
7682{ 7682{
7683 7683
7684 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2f, 0xFF, 0x01); 7684 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2f, 0xFF, 0x01);
7685 7685
7686} 7686}
7687 7687
@@ -7689,7 +7689,7 @@ void XGI_LockCRT2(struct xgi_hw_device_info *HwDeviceExtension,
7689 struct vb_device_info *pVBInfo) 7689 struct vb_device_info *pVBInfo)
7690{ 7690{
7691 7691
7692 XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2F, 0xFE, 0x00); 7692 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2F, 0xFE, 0x00);
7693 7693
7694} 7694}
7695 7695
@@ -8013,9 +8013,9 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
8013 temp = inb(pVBInfo->P3c2); 8013 temp = inb(pVBInfo->P3c2);
8014 8014
8015 if (temp & 0x10) 8015 if (temp & 0x10)
8016 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x20); 8016 xgifb_reg_and_or(pVBInfo->P3d4, 0x32, 0xDF, 0x20);
8017 else 8017 else
8018 XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x00); 8018 xgifb_reg_and_or(pVBInfo->P3d4, 0x32, 0xDF, 0x00);
8019 8019
8020 /* alan, avoid display something, set BLACK DAC if not restore DAC */ 8020 /* alan, avoid display something, set BLACK DAC if not restore DAC */
8021 outb(0x00, pVBInfo->P3c8); 8021 outb(0x00, pVBInfo->P3c8);
@@ -8091,7 +8091,7 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension,
8091 8091
8092 if ((pVBInfo->SetFlag & (EnableChA | EnableChB)) 8092 if ((pVBInfo->SetFlag & (EnableChA | EnableChB))
8093 || (!(pVBInfo->VBInfo & DisableCRT2Display))) { 8093 || (!(pVBInfo->VBInfo & DisableCRT2Display))) {
8094 XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x00, ~0xE0, 8094 xgifb_reg_and_or(pVBInfo->Part2Port, 0x00, ~0xE0,
8095 0x20); /* shampoo 0129 */ 8095 0x20); /* shampoo 0129 */
8096 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) { 8096 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
8097 if (!XGI_DisableChISLCD(pVBInfo)) { 8097 if (!XGI_DisableChISLCD(pVBInfo)) {
@@ -8442,7 +8442,7 @@ unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension,
8442 XGI_DisplayOn(HwDeviceExtension, pVBInfo); 8442 XGI_DisplayOn(HwDeviceExtension, pVBInfo);
8443 /* 8443 /*
8444 if (HwDeviceExtension->jChipType == XG21) 8444 if (HwDeviceExtension->jChipType == XG21)
8445 XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); 8445 xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0x80, 0x80);
8446 */ 8446 */
8447 } 8447 }
8448 8448