diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2011-03-13 06:26:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-14 14:52:30 -0400 |
commit | d8ad0a6d29ed6203b4ddc3114a9adf5bd48ba45b (patch) | |
tree | a4d6f204595567a11e372c84542d9c698d5ca1fb /drivers | |
parent | b649c827a90969f586a6595af9b9040b1f6b75b4 (diff) |
staging: xgifb: replace XGINew_GetReg2() with inb()
Replace XGINew_GetReg2() with inb().
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/xgifb/vb_setmode.c | 50 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.c | 9 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.h | 1 |
3 files changed, 25 insertions, 35 deletions
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index c9a97e631bc..32f06e8402b 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c | |||
@@ -321,15 +321,15 @@ static void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex | |||
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
324 | XGINew_GetReg2(pVBInfo->P3da); /* reset 3da */ | 324 | inb(pVBInfo->P3da); /* reset 3da */ |
325 | XGINew_SetReg3(pVBInfo->P3c0, i); /* set index */ | 325 | XGINew_SetReg3(pVBInfo->P3c0, i); /* set index */ |
326 | XGINew_SetReg3(pVBInfo->P3c0, ARdata); /* set data */ | 326 | XGINew_SetReg3(pVBInfo->P3c0, ARdata); /* set data */ |
327 | } | 327 | } |
328 | 328 | ||
329 | XGINew_GetReg2(pVBInfo->P3da); /* reset 3da */ | 329 | inb(pVBInfo->P3da); /* reset 3da */ |
330 | XGINew_SetReg3(pVBInfo->P3c0, 0x14); /* set index */ | 330 | XGINew_SetReg3(pVBInfo->P3c0, 0x14); /* set index */ |
331 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data */ | 331 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data */ |
332 | XGINew_GetReg2(pVBInfo->P3da); /* Enable Attribute */ | 332 | inb(pVBInfo->P3da); /* Enable Attribute */ |
333 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); | 333 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); |
334 | } | 334 | } |
335 | 335 | ||
@@ -968,7 +968,7 @@ static void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, | |||
968 | XGINew_SetRegAND(pVBInfo->P3c4, 0x35, ~0x80); | 968 | XGINew_SetRegAND(pVBInfo->P3c4, 0x35, ~0x80); |
969 | 969 | ||
970 | if (ModeNo <= 0x13) { | 970 | if (ModeNo <= 0x13) { |
971 | b3CC = (unsigned char) XGINew_GetReg2(XGI_P3cc); | 971 | b3CC = (unsigned char) inb(XGI_P3cc); |
972 | if (b3CC & 0x40) | 972 | if (b3CC & 0x40) |
973 | XGINew_SetRegOR(pVBInfo->P3c4, 0x30, 0x20); /* Hsync polarity */ | 973 | XGINew_SetRegOR(pVBInfo->P3c4, 0x30, 0x20); /* Hsync polarity */ |
974 | if (b3CC & 0x80) | 974 | if (b3CC & 0x80) |
@@ -1016,7 +1016,7 @@ static void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, | |||
1016 | XGINew_SetRegAND(pVBInfo->P3c4, 0x35, ~0x80); /* Vsync polarity */ | 1016 | XGINew_SetRegAND(pVBInfo->P3c4, 0x35, ~0x80); /* Vsync polarity */ |
1017 | 1017 | ||
1018 | if (ModeNo <= 0x13) { | 1018 | if (ModeNo <= 0x13) { |
1019 | b3CC = (unsigned char) XGINew_GetReg2(XGI_P3cc); | 1019 | b3CC = (unsigned char) inb(XGI_P3cc); |
1020 | if (b3CC & 0x40) | 1020 | if (b3CC & 0x40) |
1021 | XGINew_SetRegOR(pVBInfo->P3c4, 0x30, 0x20); /* Hsync polarity */ | 1021 | XGINew_SetRegOR(pVBInfo->P3c4, 0x30, 0x20); /* Hsync polarity */ |
1022 | if (b3CC & 0x80) | 1022 | if (b3CC & 0x80) |
@@ -1355,7 +1355,7 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, | |||
1355 | } | 1355 | } |
1356 | } | 1356 | } |
1357 | } else { /* for CRT2 */ | 1357 | } else { /* for CRT2 */ |
1358 | VCLKIndex = (unsigned char) XGINew_GetReg2( | 1358 | VCLKIndex = (unsigned char) inb( |
1359 | (pVBInfo->P3ca + 0x02)); /* Port 3cch */ | 1359 | (pVBInfo->P3ca + 0x02)); /* Port 3cch */ |
1360 | VCLKIndex = ((VCLKIndex >> 2) & 0x03); | 1360 | VCLKIndex = ((VCLKIndex >> 2) & 0x03); |
1361 | if (ModeNo > 0x13) { | 1361 | if (ModeNo > 0x13) { |
@@ -3204,7 +3204,7 @@ static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex, | |||
3204 | 3204 | ||
3205 | } | 3205 | } |
3206 | 3206 | ||
3207 | tempal = (unsigned char) XGINew_GetReg2((pVBInfo->P3ca + 0x02)); | 3207 | tempal = (unsigned char) inb((pVBInfo->P3ca + 0x02)); |
3208 | tempal = tempal >> 2; | 3208 | tempal = tempal >> 2; |
3209 | tempal &= 0x03; | 3209 | tempal &= 0x03; |
3210 | 3210 | ||
@@ -4190,18 +4190,18 @@ void XGI_DisplayOff(struct xgi_hw_device_info *pXGIHWDE, | |||
4190 | 4190 | ||
4191 | static void XGI_WaitDisply(struct vb_device_info *pVBInfo) | 4191 | static void XGI_WaitDisply(struct vb_device_info *pVBInfo) |
4192 | { | 4192 | { |
4193 | while ((XGINew_GetReg2(pVBInfo->P3da) & 0x01)) | 4193 | while ((inb(pVBInfo->P3da) & 0x01)) |
4194 | break; | 4194 | break; |
4195 | 4195 | ||
4196 | while (!(XGINew_GetReg2(pVBInfo->P3da) & 0x01)) | 4196 | while (!(inb(pVBInfo->P3da) & 0x01)) |
4197 | break; | 4197 | break; |
4198 | } | 4198 | } |
4199 | 4199 | ||
4200 | #if 0 | 4200 | #if 0 |
4201 | static void XGI_WaitDisplay(struct vb_device_info *pVBInfo) | 4201 | static void XGI_WaitDisplay(struct vb_device_info *pVBInfo) |
4202 | { | 4202 | { |
4203 | while (!(XGINew_GetReg2(pVBInfo->P3da) & 0x01)); | 4203 | while (!(inb(pVBInfo->P3da) & 0x01)); |
4204 | while (XGINew_GetReg2(pVBInfo->P3da) & 0x01); | 4204 | while (inb(pVBInfo->P3da) & 0x01); |
4205 | } | 4205 | } |
4206 | #endif | 4206 | #endif |
4207 | 4207 | ||
@@ -6469,7 +6469,7 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6469 | temp = (unsigned char) ((pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability | 6469 | temp = (unsigned char) ((pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability |
6470 | & (LCDPolarity << 8)) >> 8); | 6470 | & (LCDPolarity << 8)) >> 8); |
6471 | temp &= LCDPolarity; | 6471 | temp &= LCDPolarity; |
6472 | Miscdata = (unsigned char) XGINew_GetReg2(pVBInfo->P3cc); | 6472 | Miscdata = (unsigned char) inb(pVBInfo->P3cc); |
6473 | 6473 | ||
6474 | XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp); | 6474 | XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp); |
6475 | 6475 | ||
@@ -6628,14 +6628,14 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6628 | } | 6628 | } |
6629 | 6629 | ||
6630 | if (!(modeflag & Charx8Dot)) { | 6630 | if (!(modeflag & Charx8Dot)) { |
6631 | XGINew_GetReg2(pVBInfo->P3da); /* reset 3da */ | 6631 | inb(pVBInfo->P3da); /* reset 3da */ |
6632 | XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */ | 6632 | XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */ |
6633 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/ | 6633 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/ |
6634 | 6634 | ||
6635 | XGINew_GetReg2(pVBInfo->P3da); /* Enable Attribute */ | 6635 | inb(pVBInfo->P3da); /* Enable Attribute */ |
6636 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); | 6636 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); |
6637 | 6637 | ||
6638 | XGINew_GetReg2(pVBInfo->P3da); /* reset 3da */ | 6638 | inb(pVBInfo->P3da); /* reset 3da */ |
6639 | } | 6639 | } |
6640 | 6640 | ||
6641 | } | 6641 | } |
@@ -6654,7 +6654,7 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6654 | temp = (unsigned char) ((pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability | 6654 | temp = (unsigned char) ((pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability |
6655 | & (LCDPolarity << 8)) >> 8); | 6655 | & (LCDPolarity << 8)) >> 8); |
6656 | temp &= LCDPolarity; | 6656 | temp &= LCDPolarity; |
6657 | Miscdata = (unsigned char) XGINew_GetReg2(pVBInfo->P3cc); | 6657 | Miscdata = (unsigned char) inb(pVBInfo->P3cc); |
6658 | 6658 | ||
6659 | XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp); | 6659 | XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp); |
6660 | 6660 | ||
@@ -6812,14 +6812,14 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6812 | } | 6812 | } |
6813 | 6813 | ||
6814 | if (!(modeflag & Charx8Dot)) { | 6814 | if (!(modeflag & Charx8Dot)) { |
6815 | XGINew_GetReg2(pVBInfo->P3da); /* reset 3da */ | 6815 | inb(pVBInfo->P3da); /* reset 3da */ |
6816 | XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */ | 6816 | XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */ |
6817 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/ | 6817 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/ |
6818 | 6818 | ||
6819 | XGINew_GetReg2(pVBInfo->P3da); /* Enable Attribute */ | 6819 | inb(pVBInfo->P3da); /* Enable Attribute */ |
6820 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); | 6820 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); |
6821 | 6821 | ||
6822 | XGINew_GetReg2(pVBInfo->P3da); /* reset 3da */ | 6822 | inb(pVBInfo->P3da); /* reset 3da */ |
6823 | } | 6823 | } |
6824 | 6824 | ||
6825 | } | 6825 | } |
@@ -7716,12 +7716,12 @@ void XGI_LongWait(struct vb_device_info *pVBInfo) | |||
7716 | 7716 | ||
7717 | if (!(i & 0xC0)) { | 7717 | if (!(i & 0xC0)) { |
7718 | for (i = 0; i < 0xFFFF; i++) { | 7718 | for (i = 0; i < 0xFFFF; i++) { |
7719 | if (!(XGINew_GetReg2(pVBInfo->P3da) & 0x08)) | 7719 | if (!(inb(pVBInfo->P3da) & 0x08)) |
7720 | break; | 7720 | break; |
7721 | } | 7721 | } |
7722 | 7722 | ||
7723 | for (i = 0; i < 0xFFFF; i++) { | 7723 | for (i = 0; i < 0xFFFF; i++) { |
7724 | if ((XGINew_GetReg2(pVBInfo->P3da) & 0x08)) | 7724 | if ((inb(pVBInfo->P3da) & 0x08)) |
7725 | break; | 7725 | break; |
7726 | } | 7726 | } |
7727 | } | 7727 | } |
@@ -7735,7 +7735,7 @@ static void XGI_VBLongWait(struct vb_device_info *pVBInfo) | |||
7735 | temp = 0; | 7735 | temp = 0; |
7736 | for (i = 0; i < 3; i++) { | 7736 | for (i = 0; i < 3; i++) { |
7737 | for (j = 0; j < 100; j++) { | 7737 | for (j = 0; j < 100; j++) { |
7738 | tempal = XGINew_GetReg2(pVBInfo->P3da); | 7738 | tempal = inb(pVBInfo->P3da); |
7739 | if (temp & 0x01) { /* VBWaitMode2 */ | 7739 | if (temp & 0x01) { /* VBWaitMode2 */ |
7740 | if ((tempal & 0x08)) | 7740 | if ((tempal & 0x08)) |
7741 | continue; | 7741 | continue; |
@@ -8013,7 +8013,7 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo) | |||
8013 | mdelay(1); | 8013 | mdelay(1); |
8014 | 8014 | ||
8015 | XGI_WaitDisply(pVBInfo); | 8015 | XGI_WaitDisply(pVBInfo); |
8016 | temp = XGINew_GetReg2(pVBInfo->P3c2); | 8016 | temp = inb(pVBInfo->P3c2); |
8017 | 8017 | ||
8018 | if (temp & 0x10) | 8018 | if (temp & 0x10) |
8019 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x20); | 8019 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x20); |
@@ -8230,13 +8230,13 @@ static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, | |||
8230 | if ((ModeNo == 0x00) | (ModeNo == 0x01)) { | 8230 | if ((ModeNo == 0x00) | (ModeNo == 0x01)) { |
8231 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x4E); | 8231 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x4E); |
8232 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE9); | 8232 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE9); |
8233 | b3CC = (unsigned char) XGINew_GetReg2(XGINew_P3cc); | 8233 | b3CC = (unsigned char) inb(XGINew_P3cc); |
8234 | XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C)); | 8234 | XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C)); |
8235 | } else if ((ModeNo == 0x04) | (ModeNo == 0x05) | (ModeNo | 8235 | } else if ((ModeNo == 0x04) | (ModeNo == 0x05) | (ModeNo |
8236 | == 0x0D)) { | 8236 | == 0x0D)) { |
8237 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B); | 8237 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B); |
8238 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE3); | 8238 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE3); |
8239 | b3CC = (unsigned char) XGINew_GetReg2(XGINew_P3cc); | 8239 | b3CC = (unsigned char) inb(XGINew_P3cc); |
8240 | XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C)); | 8240 | XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C)); |
8241 | } | 8241 | } |
8242 | } | 8242 | } |
diff --git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c index 465bcda1e0c..299f05c422f 100644 --- a/drivers/staging/xgifb/vb_util.c +++ b/drivers/staging/xgifb/vb_util.c | |||
@@ -40,15 +40,6 @@ unsigned char XGINew_GetReg1(unsigned long port, unsigned short index) | |||
40 | return data; | 40 | return data; |
41 | } | 41 | } |
42 | 42 | ||
43 | unsigned char XGINew_GetReg2(unsigned long port) | ||
44 | { | ||
45 | unsigned char data; | ||
46 | |||
47 | data = inb(port); | ||
48 | |||
49 | return data; | ||
50 | } | ||
51 | |||
52 | unsigned long XGINew_GetReg3(unsigned long port) | 43 | unsigned long XGINew_GetReg3(unsigned long port) |
53 | { | 44 | { |
54 | unsigned long data; | 45 | unsigned long data; |
diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index bf5212755fd..e211320607c 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h | |||
@@ -3,7 +3,6 @@ | |||
3 | extern void XGINew_SetReg1(unsigned long, unsigned short, unsigned short); | 3 | extern void XGINew_SetReg1(unsigned long, unsigned short, unsigned short); |
4 | extern void XGINew_SetReg3(unsigned long, unsigned short); | 4 | extern void XGINew_SetReg3(unsigned long, unsigned short); |
5 | extern unsigned char XGINew_GetReg1(unsigned long, unsigned short); | 5 | extern unsigned char XGINew_GetReg1(unsigned long, unsigned short); |
6 | extern unsigned char XGINew_GetReg2(unsigned long); | ||
7 | extern void XGINew_SetReg4(unsigned long, unsigned long); | 6 | extern void XGINew_SetReg4(unsigned long, unsigned long); |
8 | extern unsigned long XGINew_GetReg3(unsigned long); | 7 | extern unsigned long XGINew_GetReg3(unsigned long); |
9 | extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); | 8 | extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); |