Enscript Output

extractedLnx/linux-2.4.24/drivers/video/sis/init301.c_SiS_DisableBridge.c

void
SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr)
{
#ifdef SIS315H
  USHORT tempah,pushax=0,modenum;
#endif
  USHORT temp=0;
  UCHAR *ROMAddr = HwDeviceExtension->pjVirtualRomBase;

  if(SiS_Pr->SiS_IF_DEF_LVDS == 0) {

      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ===== For 30xB/LV ===== */

        if(HwDeviceExtension->jChipType < SIS_315H) {

#ifdef SIS300	   /* 300 series */

           if(HwDeviceExtension->jChipType == SIS_300) {  /* New for 300+301LV */

	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
	         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
	            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFE,0x00);
		    SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
		 }
	      }
	      if(SiS_Is301B(SiS_Pr,BaseAddr)) {
	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
	         SiS_ShortDelay(SiS_Pr,1);
	      }
	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
	      SiS_DisplayOff(SiS_Pr);
	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	      if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
	          (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
                 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
	      }

	   } else {

	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
	         SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
	      }
	      if(SiS_Is301B(SiS_Pr,BaseAddr)) {
	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
	         SiS_ShortDelay(SiS_Pr,1);
	      }
	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
	      SiS_DisplayOff(SiS_Pr);
	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	      SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
	      if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
	          (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
	         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
                 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
	      }
	   }

#endif  /* SIS300 */

        } else {

#ifdef SIS315H	   /* 315 series */

           if(IS_SIS550650740660) {		/* 550, 650, 740, 660 */

#if 0
	      if(SiS_GetReg1(SiS_Pr->SiS_Part4Port,0x00) != 1) return;	/* From 1.10.7w */
#endif

	      modenum = SiS_GetReg1(SiS_Pr->SiS_P3d4,0x34);

              if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {			/* LV */
	      
	         SiS_SetReg1(SiS_Pr->SiS_Part4Port,0x30,0x00);
		 
		 if( (modenum <= 0x13) ||
		     (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
		     (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ) {
	     	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
		      if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
		         SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
		      }
	         }

		 if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) {
		    SiS_DDC2Delay(SiS_Pr,0xff00);
		    SiS_DDC2Delay(SiS_Pr,0x6000);
		    SiS_DDC2Delay(SiS_Pr,0x8000);

	            SiS_SetReg3(SiS_Pr->SiS_P3c6,0x00);

                    pushax = SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06);

		    if(IS_SIS740) {
		       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
		    }

	            SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);

		    if(!(IS_SIS740)) {
		       if(!(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr))) {
	                  tempah = 0xef;
	                  if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
	                     tempah = 0xf7;
                          }
	                  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
		       }
	            }
		 }

              } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {			/* B-DH */
	         /* This is actually bullshit. The B-DH bridge has cetainly no
		  * Part4 Index 26, since it has no ability to drive LCD panels
		  * at all. But as the BIOS does it, we do it, too...
		  */
	         if(HwDeviceExtension->jChipType == SIS_650) {
	            if(!(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr))) {
	               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,0xef);
	            }
		    if((!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
		       (SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ) {
	     	       SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFE,0x00);
	            }
		    SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 3);
		 }
	      }

	      if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,0xef);
	      }

              if((SiS_Pr->SiS_VBType & VB_SIS301B302B) || (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280)) {
	         tempah = 0x3f;
	         if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
	            tempah = 0x7f;
	            if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		       tempah = 0xbf;
                    }
	         }
	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
	      }

              if((SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
	         ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) {

	         if((SiS_Pr->SiS_VBType & VB_SIS301B302B) || (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280)) {
		    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
		    SiS_DisplayOff(SiS_Pr);
		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
		 } else {
	            SiS_DisplayOff(SiS_Pr);
	            SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
		    if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13)) {
		       SiS_DisplayOff(SiS_Pr);
	               SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
	               SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
	               temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
                       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	               SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
		    }
		 }

	      } else {

	         if((SiS_Pr->SiS_VBType & VB_SIS301B302B) || (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280)) {
		    if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		       SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
		       SiS_DisplayOff(SiS_Pr);
		    }
		    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
		    temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
                    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	            SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
		 } else {
                    SiS_DisplayOff(SiS_Pr);
	            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
	            SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
	            temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
                    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	            SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
		 }

	      }

	      if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (SiS_Pr->SiS_CustomT != CUT_COMPAQ1280)) {

		 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,~0x10);    		/* 1.10.8r, 8m */

	         tempah = 0x3f;
	         if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
	            tempah = 0x7f;
	            if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		       tempah = 0xbf;
                    }
	         }
	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);

		 if(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr)) {   /* 1.10.8r, 8m */
	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
		 }								/* 1.10.8r, 8m */

	         if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
	            SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
	         }

	         if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
	            if(!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) {
	               if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		          SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xFD,0x00);
                       }
                    }
	         }

	         SiS_SetReg1(SiS_Pr->SiS_P3c4,0x06,pushax);

  	      } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {

	         if(HwDeviceExtension->jChipType == SIS_650) {
		    if((SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
		       (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)))) {
		       if((!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
		          (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)))) {
			  SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 2);
	     	          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
			  SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 4);
	               }
		    }
		 }

	      } else if((SiS_Pr->SiS_VBType & VB_SIS301B302B) || (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280)) {

	         if(HwDeviceExtension->jChipType == SIS_650) {
		    if(!(SiS_IsNotM650or651(SiS_Pr,HwDeviceExtension, BaseAddr))) {
	               tempah = 0xef;
	               if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
		          if(modenum > 0x13) {
	                     tempah = 0xf7;
			  }
                       }
	               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
		    }
		    if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
		       if((SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) ||
		          (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)))) {
		          if((!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) ||
		             (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension)))) {
			     SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 2);
	     	             SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
			     SiS_SetPanelDelay(SiS_Pr, ROMAddr, HwDeviceExtension, 4);
	                  }
		       }
		    }
		 }

	      }

	  } else {			/* 315, 330 - all bridge types */

	     if(SiS_Is301B(SiS_Pr,BaseAddr)) {
	        tempah = 0x3f;
	        if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
	           tempah = 0x7f;
	           if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		      tempah = 0xbf;
                   }
	        }
	        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
	        if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
	           SiS_DisplayOff(SiS_Pr);
		   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
	        }
	     }
	     if( (!(SiS_Is301B(SiS_Pr,BaseAddr))) ||
	         (!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) ) {

 	 	if( (!(SiS_Is301B(SiS_Pr,BaseAddr))) ||
		    (!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) ) {

	           SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
	           SiS_DisplayOff(SiS_Pr);

		}

                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);

                SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);

	        temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
	        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);

	     }

	  }    /* 315/330 */

#endif /* SIS315H */

	}

      } else {     /* ============ For 301 ================ */

        if(HwDeviceExtension->jChipType < SIS_315H) {
            if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
	      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
	      SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
	   }
	}

        SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);           /* disable VB */
        SiS_DisplayOff(SiS_Pr);

        if(HwDeviceExtension->jChipType >= SIS_315H) {
            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
	}

        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);                /* disable lock mode */

	if(HwDeviceExtension->jChipType >= SIS_315H) {
            temp = SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00);
            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
	    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x00,temp);
	} else {
            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);            /* disable CRT2 */
	    if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
	        (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
		SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
		SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
	    }
	}

      }

  } else {     /* ============ For LVDS =============*/

    if(HwDeviceExtension->jChipType < SIS_315H) {

#ifdef SIS300	/* 300 series */

	if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {
	   SiS_SetCH700x(SiS_Pr,0x090E);
	}

	if(HwDeviceExtension->jChipType == SIS_730) {
	   if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x11) & 0x08)) {
	      SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);
	   }
	   if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {
	      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
	      SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
	   }
	} else {
	   if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x11) & 0x08)) {

	      if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
  
  	         if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwDeviceExtension))) {

                    SiS_WaitVBRetrace(SiS_Pr,HwDeviceExtension);

		    if(!(SiS_GetReg1(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) {
		        SiS_DisplayOff(SiS_Pr);
	            }

	            SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
	            SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
                 }
              }
	   }
	}

	SiS_DisplayOff(SiS_Pr);

	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);

	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension,BaseAddr);
	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);

	if( (!(SiS_CRT2IsLCD(SiS_Pr,BaseAddr,HwDeviceExtension))) ||
	              (!(SiS_CR36BIOSWord23d(SiS_Pr,HwDeviceExtension))) ) {
		SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
		SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
	}

#endif  /* SIS300 */

    } else {

#ifdef SIS315H	/* 315 series */

	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {

		if(HwDeviceExtension->jChipType == SIS_740) {
		   temp = SiS_GetCH701x(SiS_Pr,0x61);
		   if(temp < 1) {
		      SiS_SetCH701x(SiS_Pr,0xac76);
		      SiS_SetCH701x(SiS_Pr,0x0066);
		   }

		   if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
			SiS_SetCH701x(SiS_Pr,0x3e49);
		   } else if(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwDeviceExtension, BaseAddr))  {
			SiS_SetCH701x(SiS_Pr,0x3e49);
		   }
		}

		if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
			SiS_Chrontel701xBLOff(SiS_Pr);
			SiS_Chrontel701xOff(SiS_Pr,HwDeviceExtension);
		} else if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
			SiS_Chrontel701xBLOff(SiS_Pr);
			SiS_Chrontel701xOff(SiS_Pr,HwDeviceExtension);
		}

		if(HwDeviceExtension->jChipType != SIS_740) {
		   if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
			SiS_SetCH701x(SiS_Pr,0x0149);
		   } else if(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwDeviceExtension, BaseAddr))  {
			SiS_SetCH701x(SiS_Pr,0x0149);
		   }
		}

	}

	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
		SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xF7,0x08);
		SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 3);
	}

	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
		SiS_DisplayOff(SiS_Pr);
	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_DisplayOff(SiS_Pr);
	} else if(!(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_DisplayOff(SiS_Pr);
	}

	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
	} else if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
	}

	if(HwDeviceExtension->jChipType == SIS_740) {
	   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
	}

	SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);

	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	} else if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
	}

	if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
	        if(SiS_CRT2IsLCD(SiS_Pr, BaseAddr,HwDeviceExtension)) {
		   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
		   if(HwDeviceExtension->jChipType == SIS_550) {
		      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf);
		      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef);
		   }
		}
	} else {
	   if(HwDeviceExtension->jChipType == SIS_740) {
	        if(SiS_IsLCDOrLCDA(SiS_Pr,HwDeviceExtension, BaseAddr)) {
		   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
		}
	   } else {
	        if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
		   SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf);
	        }
	   }
	}

	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
	    	if(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr)) {
			/* SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff); */
		} else {
			SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb);
		}
	}

	SiS_UnLockCRT2(SiS_Pr,HwDeviceExtension, BaseAddr);

	if(HwDeviceExtension->jChipType == SIS_550) {
	        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
		SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
	} else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
	} else if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
	} else if(!(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr))) {
		SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
	}

#if 0  /* BIOS code makes no sense */
       if(SiS_IsVAMode(SiS_Pr,HwDeviceExtension, BaseAddr)) {
           if(!(SiS_IsDualEdge(SiS_Pr,HwDeviceExtension, BaseAddr))) {
	        if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr)) {
		  /* Nothing there! */
		}
           }
       }
#endif
       if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
		if(SiS_CRT2IsLCD(SiS_Pr, BaseAddr,HwDeviceExtension)) {
			if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwDeviceExtension, BaseAddr))) {
				SiS_SetPanelDelay(SiS_Pr,ROMAddr, HwDeviceExtension, 2);
				SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,0xFB,0x04);
			}
		}
       }

#endif  /* SIS315H */

    }  /* 310 series */

  }  /* LVDS */

}

Generated by GNU enscript 1.6.4.