]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: xgifb: replace XGINew_SetReg3() with outb()
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 13 Mar 2011 10:26:20 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Mar 2011 18:52:31 +0000 (11:52 -0700)
Replace XGINew_SetReg3() with outb().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/xgifb/vb_init.c
drivers/staging/xgifb/vb_setmode.c
drivers/staging/xgifb/vb_util.c
drivers/staging/xgifb/vb_util.h

index 0c9e2777e05a89b3222ff159793330c125470f8e..46ccdf1b3a44a2b5c3700fc05348716ffee507b4 100644 (file)
@@ -1313,7 +1313,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension)
        }
        printk("2");
 
-       XGINew_SetReg3((pVBInfo->BaseAddr + 0x12), 0x67); /* 3c2 <- 67 ,ynlai */
+       outb(0x67, (pVBInfo->BaseAddr + 0x12)); /* 3c2 <- 67 ,ynlai */
 
        pVBInfo->ISXPDOS = 0;
        printk("3");
index 32f06e8402b8aabcb852296e1f3d03b99b1a9f6d..b4f2112975644dcec245285a831eb40e45a1e849 100644 (file)
@@ -265,7 +265,7 @@ static void XGI_SetMiscRegs(unsigned short StandTableIndex,
        }
        */
 
-       XGINew_SetReg3(pVBInfo->P3c2, Miscdata); /* Set Misc(3c2) */
+       outb(Miscdata, pVBInfo->P3c2); /* Set Misc(3c2) */
 }
 
 static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension,
@@ -322,15 +322,15 @@ static void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex
                }
 
                inb(pVBInfo->P3da); /* reset 3da */
-               XGINew_SetReg3(pVBInfo->P3c0, i); /* set index */
-               XGINew_SetReg3(pVBInfo->P3c0, ARdata); /* set data */
+               outb(i, pVBInfo->P3c0); /* set index */
+               outb(ARdata, pVBInfo->P3c0); /* set data */
        }
 
        inb(pVBInfo->P3da); /* reset 3da */
-       XGINew_SetReg3(pVBInfo->P3c0, 0x14); /* set index */
-       XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data */
+       outb(0x14, pVBInfo->P3c0); /* set index */
+       outb(0x00, pVBInfo->P3c0); /* set data */
        inb(pVBInfo->P3da); /* Enable Attribute */
-       XGINew_SetReg3(pVBInfo->P3c0, 0x20);
+       outb(0x20, pVBInfo->P3c0);
 }
 
 static void XGI_SetGRCRegs(unsigned short StandTableIndex,
@@ -525,7 +525,7 @@ static void XGI_SetSync(unsigned short RefreshRateTableIndex,
        sync &= 0xC0;
        temp = 0x2F;
        temp |= sync;
-       XGINew_SetReg3(pVBInfo->P3c2, temp); /* Set Misc(3c2) */
+       outb(temp, pVBInfo->P3c2); /* Set Misc(3c2) */
 }
 
 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
                        bh = temp;
                }
        }
-       XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) dh);
-       XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) bh);
-       XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) bl);
+       outb((unsigned short) dh, pVBInfo->P3c9);
+       outb((unsigned short) bh, pVBInfo->P3c9);
+       outb((unsigned short) bl, pVBInfo->P3c9);
 }
 
 static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
@@ -1769,8 +1769,8 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
        else
                j = time;
 
-       XGINew_SetReg3(pVBInfo->P3c6, 0xFF);
-       XGINew_SetReg3(pVBInfo->P3c8, 0x00);
+       outb(0xFF, pVBInfo->P3c6);
+       outb(0x00, pVBInfo->P3c8);
 
        for (i = 0; i < j; i++) {
                data = table[i];
@@ -1784,7 +1784,7 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
                        if (data & 0x02)
                                data2 += 0x15;
 
-                       XGINew_SetReg3(pVBInfo->P3c9, data2);
+                       outb(data2, pVBInfo->P3c9);
                        data = data >> 2;
                }
        }
@@ -1794,7 +1794,7 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
                        data = table[i];
 
                        for (k = 0; k < 3; k++)
-                               XGINew_SetReg3(pVBInfo->P3c9, data);
+                               outb(data, pVBInfo->P3c9);
                }
 
                si = 32;
@@ -6471,7 +6471,7 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
        temp &= LCDPolarity;
        Miscdata = (unsigned char) inb(pVBInfo->P3cc);
 
-       XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp);
+       outb((Miscdata & 0x3F) | temp, pVBInfo->P3c2);
 
        temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability
                                        & LCDPolarity);
@@ -6629,11 +6629,11 @@ static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
 
        if (!(modeflag & Charx8Dot)) {
                inb(pVBInfo->P3da); /* reset 3da */
-               XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */
-               XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/
+               outb(0x13, pVBInfo->P3c0); /* set index */
+               outb(0x00, pVBInfo->P3c0); /* set data, panning = 0, shift left 1 dot*/
 
                inb(pVBInfo->P3da); /* Enable Attribute */
-               XGINew_SetReg3(pVBInfo->P3c0, 0x20);
+               outb(0x20, pVBInfo->P3c0);
 
                inb(pVBInfo->P3da); /* reset 3da */
        }
@@ -6656,7 +6656,7 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
        temp &= LCDPolarity;
        Miscdata = (unsigned char) inb(pVBInfo->P3cc);
 
-       XGINew_SetReg3(pVBInfo->P3c2, (Miscdata & 0x3F) | temp);
+       outb((Miscdata & 0x3F) | temp, pVBInfo->P3c2);
 
        temp = (unsigned char) (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability
                                        & LCDPolarity);
@@ -6813,11 +6813,11 @@ static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdInde
 
        if (!(modeflag & Charx8Dot)) {
                inb(pVBInfo->P3da); /* reset 3da */
-               XGINew_SetReg3(pVBInfo->P3c0, 0x13); /* set index */
-               XGINew_SetReg3(pVBInfo->P3c0, 0x00); /* set data, panning = 0, shift left 1 dot*/
+               outb(0x13, pVBInfo->P3c0); /* set index */
+               outb(0x00, pVBInfo->P3c0); /* set data, panning = 0, shift left 1 dot*/
 
                inb(pVBInfo->P3da); /* Enable Attribute */
-               XGINew_SetReg3(pVBInfo->P3c0, 0x20);
+               outb(0x20, pVBInfo->P3c0);
 
                inb(pVBInfo->P3da); /* reset 3da */
        }
@@ -7995,15 +7995,12 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
        XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B);
        XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE1);
 
-       XGINew_SetReg3(pVBInfo->P3c8, 0x00);
+       outb(0x00, pVBInfo->P3c8);
 
        for (i = 0; i < 256; i++) {
-               XGINew_SetReg3((pVBInfo->P3c8 + 1),
-                               (unsigned char) DAC_TEST_PARMS[0]);
-               XGINew_SetReg3((pVBInfo->P3c8 + 1),
-                               (unsigned char) DAC_TEST_PARMS[1]);
-               XGINew_SetReg3((pVBInfo->P3c8 + 1),
-                               (unsigned char) DAC_TEST_PARMS[2]);
+               outb((unsigned char) DAC_TEST_PARMS[0], (pVBInfo->P3c8 + 1));
+               outb((unsigned char) DAC_TEST_PARMS[1], (pVBInfo->P3c8 + 1));
+               outb((unsigned char) DAC_TEST_PARMS[2], (pVBInfo->P3c8 + 1));
        }
 
        XGI_VBLongWait(pVBInfo);
@@ -8021,12 +8018,12 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
                XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xDF, 0x00);
 
        /* alan, avoid display something, set BLACK DAC if not restore DAC */
-       XGINew_SetReg3(pVBInfo->P3c8, 0x00);
+       outb(0x00, pVBInfo->P3c8);
 
        for (i = 0; i < 256; i++) {
-               XGINew_SetReg3((pVBInfo->P3c8 + 1), 0);
-               XGINew_SetReg3((pVBInfo->P3c8 + 1), 0);
-               XGINew_SetReg3((pVBInfo->P3c8 + 1), 0);
+               outb(0, (pVBInfo->P3c8 + 1));
+               outb(0, (pVBInfo->P3c8 + 1));
+               outb(0, (pVBInfo->P3c8 + 1));
        }
 
        XGINew_SetReg1(pVBInfo->P3c4, 0x01, SR01);
@@ -8231,13 +8228,13 @@ static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension,
                        XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x4E);
                        XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE9);
                        b3CC = (unsigned char) inb(XGINew_P3cc);
-                       XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C));
+                       outb((b3CC |= 0x0C), XGINew_P3cc);
                } else if ((ModeNo == 0x04) | (ModeNo == 0x05) | (ModeNo
                                == 0x0D)) {
                        XGINew_SetReg1(pVBInfo->P3c4, 0x2B, 0x1B);
                        XGINew_SetReg1(pVBInfo->P3c4, 0x2C, 0xE3);
                        b3CC = (unsigned char) inb(XGINew_P3cc);
-                       XGINew_SetReg3(XGINew_P3cc, (b3CC |= 0x0C));
+                       outb((b3CC |= 0x0C), XGINew_P3cc);
                }
        }
 
index be6224e373e81811dcd2e7eb6b3a8786500f20d5..064580eb895b398811ccbc82485e4347b22b0b76 100644 (file)
@@ -21,11 +21,6 @@ void XGINew_SetReg1(unsigned long port, unsigned short index,
        outb(data, port + 1);
 }
 
-void XGINew_SetReg3(unsigned long port, unsigned short data)
-{
-       outb(data, port);
-}
-
 void XGINew_SetReg4(unsigned long port, unsigned long data)
 {
        outl(data, port);
index b35c63d11264fd6633fcaa23f5a6b1756b12ea8f..a67f72009056beabcbcd30da766107711e760475 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _VBUTIL_
 #define _VBUTIL_
 extern   void     XGINew_SetReg1(unsigned long, unsigned short, unsigned short);
-extern   void     XGINew_SetReg3(unsigned long, unsigned short);
 extern    unsigned char     XGINew_GetReg1(unsigned long, unsigned short);
 extern   void     XGINew_SetReg4(unsigned long, unsigned long);
 extern   void     XGINew_SetRegOR(unsigned long Port,unsigned short Index,unsigned short DataOR);