staging: xgifb: delete IF_DEF_LCDA
authorAaro Koskinen <aaro.koskinen@iki.fi>
Mon, 10 Sep 2012 21:15:15 +0000 (00:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2012 22:48:16 +0000 (15:48 -0700)
IF_DEF_LCDA is always true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/vb_setmode.c
drivers/staging/xgifb/vb_struct.h

index dc1e371ca382015464df9cdfce680540b9d7619e..3cba143f3ca12c636c8f1e7fc18caa14ca8b05aa 100644 (file)
@@ -258,23 +258,13 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
                }
 
                if (pVBInfo->VBInfo & SetCRT2ToHiVision) { /* for HiTV */
-                       if ((pVBInfo->VBType & VB_SIS301LV) &&
-                           (pVBInfo->VBExtInfo == VB_YPbPr1080i)) {
-                               tempax |= SupportYPbPr750p;
-                               if ((pVBInfo->VBInfo & SetInSlaveMode) &&
-                                   ((resinfo == 3) ||
-                                    (resinfo == 4) ||
-                                    (resinfo > 7)))
+                       tempax |= SupportHiVision;
+                       if ((pVBInfo->VBInfo & SetInSlaveMode) &&
+                           ((resinfo == 4) ||
+                            (resinfo == 3 &&
+                             (pVBInfo->SetFlag & TVSimuMode)) ||
+                            (resinfo > 7)))
                                        return 0;
-                       } else {
-                               tempax |= SupportHiVision;
-                               if ((pVBInfo->VBInfo & SetInSlaveMode) &&
-                                   ((resinfo == 4) ||
-                                    (resinfo == 3 &&
-                                     (pVBInfo->SetFlag & TVSimuMode)) ||
-                                    (resinfo > 7)))
-                                               return 0;
-                       }
                } else {
                        if (pVBInfo->VBInfo & (SetCRT2ToAVIDEO |
                                               SetCRT2ToSVIDEO |
@@ -969,13 +959,8 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
                        }
 
                        /* 301lv */
-                       if ((pVBInfo->VBType & VB_SIS301LV) &&
-                           !(pVBInfo->VBExtInfo == VB_YPbPr1080i)) {
-                               if (pVBInfo->VBExtInfo == YPbPr750p)
-                                       VCLKIndex = XGI_YPbPr750pVCLK;
-                               else if (pVBInfo->VBExtInfo == YPbPr525p)
-                                       VCLKIndex = YPbPr525pVCLK;
-                               else if (pVBInfo->SetFlag & RPLLDIV2XO)
+                       if (pVBInfo->VBType & VB_SIS301LV) {
+                               if (pVBInfo->SetFlag & RPLLDIV2XO)
                                        VCLKIndex = YPbPr525iVCLK_2;
                                else
                                        VCLKIndex = YPbPr525iVCLK;
@@ -2634,21 +2619,18 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
 
        temp = xgifb_reg_get(pVBInfo->P3d4, 0x38);
 
-       if (pVBInfo->IF_DEF_LCDA == 1) {
-
-               if (((HwDeviceExtension->jChipType >= XG20) ||
-                    (HwDeviceExtension->jChipType >= XG40)) &&
-                   (pVBInfo->IF_DEF_LVDS == 0)) {
-                       if (pVBInfo->VBType &
-                           (VB_SIS302B |
-                            VB_SIS301LV |
-                            VB_SIS302LV |
-                            VB_XGI301C)) {
-                               if (temp & EnableDualEdge) {
-                                       tempbx |= SetCRT2ToDualEdge;
-                                       if (temp & SetToLCDA)
-                                               tempbx |= XGI_SetCRT2ToLCDA;
-                               }
+       if (((HwDeviceExtension->jChipType >= XG20) ||
+            (HwDeviceExtension->jChipType >= XG40)) &&
+           (pVBInfo->IF_DEF_LVDS == 0)) {
+               if (pVBInfo->VBType &
+                   (VB_SIS302B |
+                    VB_SIS301LV |
+                    VB_SIS302LV |
+                    VB_XGI301C)) {
+                       if (temp & EnableDualEdge) {
+                               tempbx |= SetCRT2ToDualEdge;
+                               if (temp & SetToLCDA)
+                                       tempbx |= XGI_SetCRT2ToLCDA;
                        }
                }
        }
@@ -2702,19 +2684,17 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
                tempbx = 0;
        }
 
-       if (pVBInfo->IF_DEF_LCDA == 1) { /* Select Display Device */
-               if (!(pVBInfo->VBType & VB_NoLCD)) {
-                       if (tempbx & XGI_SetCRT2ToLCDA) {
-                               if (tempbx & SetSimuScanMode)
-                                       tempbx &= (~(SetCRT2ToLCD |
-                                                    SetCRT2ToRAMDAC |
-                                                    SwitchCRT2));
-                               else
-                                       tempbx &= (~(SetCRT2ToLCD |
-                                                    SetCRT2ToRAMDAC |
-                                                    SetCRT2ToTV |
-                                                    SwitchCRT2));
-                       }
+       if (!(pVBInfo->VBType & VB_NoLCD)) {
+               if (tempbx & XGI_SetCRT2ToLCDA) {
+                       if (tempbx & SetSimuScanMode)
+                               tempbx &= (~(SetCRT2ToLCD |
+                                            SetCRT2ToRAMDAC |
+                                            SwitchCRT2));
+                       else
+                               tempbx &= (~(SetCRT2ToLCD |
+                                            SetCRT2ToRAMDAC |
+                                            SetCRT2ToTV |
+                                            SwitchCRT2));
                }
        }
 
@@ -2777,11 +2757,9 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
        if (!(tempbx & DisableCRT2Display)) {
                if ((!(tempbx & DriverMode)) ||
                    (!(modeflag & CRT2Mode))) {
-                       if (pVBInfo->IF_DEF_LCDA == 1) {
-                               if (!(tempbx & XGI_SetCRT2ToLCDA))
-                                       tempbx |= (SetInSlaveMode |
-                                                  SetSimuScanMode);
-                       }
+                       if (!(tempbx & XGI_SetCRT2ToLCDA))
+                               tempbx |= (SetInSlaveMode |
+                                          SetSimuScanMode);
                }
 
                /* LCD+TV can't support in slave mode
@@ -3841,16 +3819,9 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
                                | VB_SIS302LV | VB_XGI301C)))
                        temp += 2;
 
-               if (pVBInfo->VBInfo & SetCRT2ToHiVision) {
-                       if (pVBInfo->VBType & VB_SIS301LV) {
-                               if (pVBInfo->VBExtInfo == VB_YPbPr1080i) {
-                                       if (resinfo == 7)
-                                               temp -= 2;
-                               }
-                       } else if (resinfo == 7) {
+               if ((pVBInfo->VBInfo & SetCRT2ToHiVision) &&
+                   !(pVBInfo->VBType & VB_SIS301LV) && (resinfo == 7))
                                temp -= 2;
-                       }
-               }
        }
 
        /* 0x05 Horizontal Display Start */
@@ -6566,7 +6537,6 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info,
        struct vb_device_info *pVBInfo = &VBINF;
        pVBInfo->BaseAddr = xgifb_info->vga_base;
        pVBInfo->IF_DEF_LVDS = 0;
-       pVBInfo->IF_DEF_LCDA = 1;
 
        if (HwDeviceExtension->jChipType >= XG20) {
                pVBInfo->IF_DEF_YPbPr = 0;
index 043d0fbc472a26465e651afbaa8c1473a8b0a4e4..ccb57ce6058184a4d329dc133f423787186bfa4b 100644 (file)
@@ -168,11 +168,10 @@ struct vb_device_info {
        unsigned short   ModeType;
        unsigned short   IF_DEF_LVDS, IF_DEF_TRUMPION, IF_DEF_DSTN;
        unsigned short   IF_DEF_CRT2Monitor;
-       unsigned short   IF_DEF_LCDA, IF_DEF_YPbPr;
+       unsigned short   IF_DEF_YPbPr;
        unsigned short   IF_DEF_HiVision;
        unsigned short   LCDResInfo, LCDTypeInfo, VBType;/*301b*/
        unsigned short   VBInfo, TVInfo, LCDInfo;
-       unsigned short   VBExtInfo;/*301lv*/
        unsigned short   SetFlag;
        unsigned short   NewFlickerMode;
        unsigned short   SelectCRT2Rate;