diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2011-03-13 06:26:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-14 14:52:31 -0400 |
commit | efdf4ee78cd5eb1172955a63fff1e6f6748a41d9 (patch) | |
tree | e470280dbaf30bc877d2aec8bfaa811e6d33a621 /drivers | |
parent | f5b571fa24f523265b6bf9a282e0aa7eeff8098a (diff) |
staging: xgifb: replace XGINew_SetReg3() with outb()
Replace XGINew_SetReg3() with outb().
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_init.c | 2 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_setmode.c | 67 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.c | 5 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_util.h | 1 |
4 files changed, 33 insertions, 42 deletions
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index 0c9e2777e05..46ccdf1b3a4 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c | |||
@@ -1313,7 +1313,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension) | |||
1313 | } | 1313 | } |
1314 | printk("2"); | 1314 | printk("2"); |
1315 | 1315 | ||
1316 | XGINew_SetReg3((pVBInfo->BaseAddr + 0x12), 0x67); /* 3c2 <- 67 ,ynlai */ | 1316 | outb(0x67, (pVBInfo->BaseAddr + 0x12)); /* 3c2 <- 67 ,ynlai */ |
1317 | 1317 | ||
1318 | pVBInfo->ISXPDOS = 0; | 1318 | pVBInfo->ISXPDOS = 0; |
1319 | printk("3"); | 1319 | printk("3"); |
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 32f06e8402b..b4f21129756 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c | |||
@@ -265,7 +265,7 @@ static void XGI_SetMiscRegs(unsigned short StandTableIndex, | |||
265 | } | 265 | } |
266 | */ | 266 | */ |
267 | 267 | ||
268 | XGINew_SetReg3(pVBInfo->P3c2, Miscdata); /* Set Misc(3c2) */ | 268 | outb(Miscdata, pVBInfo->P3c2); /* Set Misc(3c2) */ |
269 | } | 269 | } |
270 | 270 | ||
271 | static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, | 271 | static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, |
@@ -322,15 +322,15 @@ static void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex | |||
322 | } | 322 | } |
323 | 323 | ||
324 | inb(pVBInfo->P3da); /* reset 3da */ | 324 | inb(pVBInfo->P3da); /* reset 3da */ |
325 | XGINew_SetReg3(pVBInfo->P3c0, i); /* set index */ | 325 | outb(i, pVBInfo->P3c0); /* set index */ |
326 | XGINew_SetReg3(pVBInfo->P3c0, ARdata); /* set data */ | 326 | outb(ARdata, pVBInfo->P3c0); /* set data */ |
327 | } | 327 | } |
328 | 328 | ||
329 | inb(pVBInfo->P3da); /* reset 3da */ | 329 | inb(pVBInfo->P3da); /* reset 3da */ |
330 | XGINew_SetReg3(pVBInfo->P3c0, 0x14); /* set index */ | 330 | outb(0x14, pVBInfo->P3c0); /* set index */ |
331 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data */ | 331 | outb(0x00, pVBInfo->P3c0); /* set data */ |
332 | inb(pVBInfo->P3da); /* Enable Attribute */ | 332 | inb(pVBInfo->P3da); /* Enable Attribute */ |
333 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); | 333 | outb(0x20, pVBInfo->P3c0); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void XGI_SetGRCRegs(unsigned short StandTableIndex, | 336 | static void XGI_SetGRCRegs(unsigned short StandTableIndex, |
@@ -525,7 +525,7 @@ static void XGI_SetSync(unsigned short RefreshRateTableIndex, | |||
525 | sync &= 0xC0; | 525 | sync &= 0xC0; |
526 | temp = 0x2F; | 526 | temp = 0x2F; |
527 | temp |= sync; | 527 | temp |= sync; |
528 | XGINew_SetReg3(pVBInfo->P3c2, temp); /* Set Misc(3c2) */ | 528 | outb(temp, pVBInfo->P3c2); /* Set Misc(3c2) */ |
529 | } | 529 | } |
530 | 530 | ||
531 | static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, | 531 | static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, |
@@ -1734,9 +1734,9 @@ static void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al | |||
1734 | bh = temp; | 1734 | bh = temp; |
1735 | } | 1735 | } |
1736 | } | 1736 | } |
1737 | XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) dh); | 1737 | outb((unsigned short) dh, pVBInfo->P3c9); |
1738 | XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) bh); | 1738 | outb((unsigned short) bh, pVBInfo->P3c9); |
1739 | XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) bl); | 1739 | outb((unsigned short) bl, pVBInfo->P3c9); |
1740 | } | 1740 | } |
1741 | 1741 | ||
1742 | static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, | 1742 | static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, |
@@ -1769,8 +1769,8 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1769 | else | 1769 | else |
1770 | j = time; | 1770 | j = time; |
1771 | 1771 | ||
1772 | XGINew_SetReg3(pVBInfo->P3c6, 0xFF); | 1772 | outb(0xFF, pVBInfo->P3c6); |
1773 | XGINew_SetReg3(pVBInfo->P3c8, 0x00); | 1773 | outb(0x00, pVBInfo->P3c8); |
1774 | 1774 | ||
1775 | for (i = 0; i < j; i++) { | 1775 | for (i = 0; i < j; i++) { |
1776 | data = table[i]; | 1776 | data = table[i]; |
@@ -1784,7 +1784,7 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1784 | if (data & 0x02) | 1784 | if (data & 0x02) |
1785 | data2 += 0x15; | 1785 | data2 += 0x15; |
1786 | 1786 | ||
1787 | XGINew_SetReg3(pVBInfo->P3c9, data2); | 1787 | outb(data2, pVBInfo->P3c9); |
1788 | data = data >> 2; | 1788 | data = data >> 2; |
1789 | } | 1789 | } |
1790 | } | 1790 | } |
@@ -1794,7 +1794,7 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
1794 | data = table[i]; | 1794 | data = table[i]; |
1795 | 1795 | ||
1796 | for (k = 0; k < 3; k++) | 1796 | for (k = 0; k < 3; k++) |
1797 | XGINew_SetReg3(pVBInfo->P3c9, data); | 1797 | outb(data, pVBInfo->P3c9); |
1798 | } | 1798 | } |
1799 | 1799 | ||
1800 | si = 32; | 1800 | si = 32; |
@@ -6471,7 +6471,7 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6471 | temp &= LCDPolarity; | 6471 | temp &= LCDPolarity; |
6472 | Miscdata = (unsigned char) inb(pVBInfo->P3cc); | 6472 | Miscdata = (unsigned char) inb(pVBInfo->P3cc); |
6473 | 6473 | ||
6474 | XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp); | 6474 | outb((Miscdata & 0x3F) | temp, pVBInfo->P3c2); |
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); |
@@ -6629,11 +6629,11 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6629 | 6629 | ||
6630 | if (!(modeflag & Charx8Dot)) { | 6630 | if (!(modeflag & Charx8Dot)) { |
6631 | inb(pVBInfo->P3da); /* reset 3da */ | 6631 | inb(pVBInfo->P3da); /* reset 3da */ |
6632 | XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */ | 6632 | outb(0x13, pVBInfo->P3c0); /* set index */ |
6633 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/ | 6633 | outb(0x00, pVBInfo->P3c0); /* set data, panning = 0, shift left 1 dot*/ |
6634 | 6634 | ||
6635 | inb(pVBInfo->P3da); /* Enable Attribute */ | 6635 | inb(pVBInfo->P3da); /* Enable Attribute */ |
6636 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); | 6636 | outb(0x20, pVBInfo->P3c0); |
6637 | 6637 | ||
6638 | inb(pVBInfo->P3da); /* reset 3da */ | 6638 | inb(pVBInfo->P3da); /* reset 3da */ |
6639 | } | 6639 | } |
@@ -6656,7 +6656,7 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6656 | temp &= LCDPolarity; | 6656 | temp &= LCDPolarity; |
6657 | Miscdata = (unsigned char) inb(pVBInfo->P3cc); | 6657 | Miscdata = (unsigned char) inb(pVBInfo->P3cc); |
6658 | 6658 | ||
6659 | XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp); | 6659 | outb((Miscdata & 0x3F) | temp, pVBInfo->P3c2); |
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); |
@@ -6813,11 +6813,11 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde | |||
6813 | 6813 | ||
6814 | if (!(modeflag & Charx8Dot)) { | 6814 | if (!(modeflag & Charx8Dot)) { |
6815 | inb(pVBInfo->P3da); /* reset 3da */ | 6815 | inb(pVBInfo->P3da); /* reset 3da */ |
6816 | XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */ | 6816 | outb(0x13, pVBInfo->P3c0); /* set index */ |
6817 | XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/ | 6817 | outb(0x00, pVBInfo->P3c0); /* set data, panning = 0, shift left 1 dot*/ |
6818 | 6818 | ||
6819 | inb(pVBInfo->P3da); /* Enable Attribute */ | 6819 | inb(pVBInfo->P3da); /* Enable Attribute */ |
6820 | XGINew_SetReg3(pVBInfo->P3c0, 0x20); | 6820 | outb(0x20, pVBInfo->P3c0); |
6821 | 6821 | ||
6822 | inb(pVBInfo->P3da); /* reset 3da */ | 6822 | inb(pVBInfo->P3da); /* reset 3da */ |
6823 | } | 6823 | } |
@@ -7995,15 +7995,12 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo) | |||
7995 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B); | 7995 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B); |
7996 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE1); | 7996 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE1); |
7997 | 7997 | ||
7998 | XGINew_SetReg3(pVBInfo->P3c8, 0x00); | 7998 | outb(0x00, pVBInfo->P3c8); |
7999 | 7999 | ||
8000 | for (i = 0; i < 256; i++) { | 8000 | for (i = 0; i < 256; i++) { |
8001 | XGINew_SetReg3((pVBInfo->P3c8 + 1), | 8001 | outb((unsigned char) DAC_TEST_PARMS[0], (pVBInfo->P3c8 + 1)); |
8002 | (unsigned char) DAC_TEST_PARMS[0]); | 8002 | outb((unsigned char) DAC_TEST_PARMS[1], (pVBInfo->P3c8 + 1)); |
8003 | XGINew_SetReg3((pVBInfo->P3c8 + 1), | 8003 | outb((unsigned char) DAC_TEST_PARMS[2], (pVBInfo->P3c8 + 1)); |
8004 | (unsigned char) DAC_TEST_PARMS[1]); | ||
8005 | XGINew_SetReg3((pVBInfo->P3c8 + 1), | ||
8006 | (unsigned char) DAC_TEST_PARMS[2]); | ||
8007 | } | 8004 | } |
8008 | 8005 | ||
8009 | XGI_VBLongWait(pVBInfo); | 8006 | XGI_VBLongWait(pVBInfo); |
@@ -8021,12 +8018,12 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo) | |||
8021 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x00); | 8018 | XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x00); |
8022 | 8019 | ||
8023 | /* alan, avoid display something, set BLACK DAC if not restore DAC */ | 8020 | /* alan, avoid display something, set BLACK DAC if not restore DAC */ |
8024 | XGINew_SetReg3(pVBInfo->P3c8, 0x00); | 8021 | outb(0x00, pVBInfo->P3c8); |
8025 | 8022 | ||
8026 | for (i = 0; i < 256; i++) { | 8023 | for (i = 0; i < 256; i++) { |
8027 | XGINew_SetReg3((pVBInfo->P3c8 + 1), 0); | 8024 | outb(0, (pVBInfo->P3c8 + 1)); |
8028 | XGINew_SetReg3((pVBInfo->P3c8 + 1), 0); | 8025 | outb(0, (pVBInfo->P3c8 + 1)); |
8029 | XGINew_SetReg3((pVBInfo->P3c8 + 1), 0); | 8026 | outb(0, (pVBInfo->P3c8 + 1)); |
8030 | } | 8027 | } |
8031 | 8028 | ||
8032 | XGINew_SetReg1(pVBInfo->P3c4, 0x01, SR01); | 8029 | XGINew_SetReg1(pVBInfo->P3c4, 0x01, SR01); |
@@ -8231,13 +8228,13 @@ static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, | |||
8231 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x4E); | 8228 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x4E); |
8232 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE9); | 8229 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE9); |
8233 | b3CC = (unsigned char) inb(XGINew_P3cc); | 8230 | b3CC = (unsigned char) inb(XGINew_P3cc); |
8234 | XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C)); | 8231 | outb((b3CC |= 0x0C), XGINew_P3cc); |
8235 | } else if ((ModeNo == 0x04) | (ModeNo == 0x05) | (ModeNo | 8232 | } else if ((ModeNo == 0x04) | (ModeNo == 0x05) | (ModeNo |
8236 | == 0x0D)) { | 8233 | == 0x0D)) { |
8237 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B); | 8234 | XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B); |
8238 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE3); | 8235 | XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE3); |
8239 | b3CC = (unsigned char) inb(XGINew_P3cc); | 8236 | b3CC = (unsigned char) inb(XGINew_P3cc); |
8240 | XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C)); | 8237 | outb((b3CC |= 0x0C), XGINew_P3cc); |
8241 | } | 8238 | } |
8242 | } | 8239 | } |
8243 | 8240 | ||
diff --git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c index be6224e373e..064580eb895 100644 --- a/drivers/staging/xgifb/vb_util.c +++ b/drivers/staging/xgifb/vb_util.c | |||
@@ -21,11 +21,6 @@ void XGINew_SetReg1(unsigned long port, unsigned short index, | |||
21 | outb(data, port + 1); | 21 | outb(data, port + 1); |
22 | } | 22 | } |
23 | 23 | ||
24 | void XGINew_SetReg3(unsigned long port, unsigned short data) | ||
25 | { | ||
26 | outb(data, port); | ||
27 | } | ||
28 | |||
29 | void XGINew_SetReg4(unsigned long port, unsigned long data) | 24 | void XGINew_SetReg4(unsigned long port, unsigned long data) |
30 | { | 25 | { |
31 | outl(data, port); | 26 | outl(data, port); |
diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h index b35c63d1126..a67f7200905 100644 --- a/drivers/staging/xgifb/vb_util.h +++ b/drivers/staging/xgifb/vb_util.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _VBUTIL_ | 1 | #ifndef _VBUTIL_ |
2 | #define _VBUTIL_ | 2 | #define _VBUTIL_ |
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); | ||
5 | extern unsigned char XGINew_GetReg1(unsigned long, unsigned short); | 4 | extern unsigned char XGINew_GetReg1(unsigned long, unsigned short); |
6 | extern void XGINew_SetReg4(unsigned long, unsigned long); | 5 | extern void XGINew_SetReg4(unsigned long, unsigned long); |
7 | extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); | 6 | extern void XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR); |