SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); 
SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); 
SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo){#ifdef SIS300   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;#endif   USHORT ModeIdIndex, RefreshRateTableIndex;#if 0   USHORT temp;#endif   SiS_Pr->SiS_SetFlag |= ProgrammingCRT2;   if(!SiS_Pr->UseCustomMode) {      SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex);   } else {      ModeIdIndex = 0;   }   /* Used for shifting CR33 */   SiS_Pr->SiS_SelectCRT2Rate = 4;   SiS_UnLockCRT2(SiS_Pr, HwInfo);   RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);   SiS_SaveCRT2Info(SiS_Pr,ModeNo);   if(SiS_Pr->SiS_SetFlag & LowModeTests) {      SiS_DisableBridge(SiS_Pr,HwInfo);      if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (HwInfo->jChipType == SIS_730)) {         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80);      }      SiS_SetCRT2ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);   }   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {      SiS_LockCRT2(SiS_Pr, HwInfo);      SiS_DisplayOn(SiS_Pr);      return TRUE;   }   SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);   /* Set up Panel Link for LVDS and LCDA */   SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0;   if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||       ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ||       ((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) {      SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);   }#ifdef LINUX_XF86#ifdef TWDEBUG  xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES);  xf86DrvMsg(0, X_INFO, "(init301: HDE     0x%03x VDE     0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE);  xf86DrvMsg(0, X_INFO, "(init301: VGAHDE  0x%03x VGAVDE  0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE);  xf86DrvMsg(0, X_INFO, "(init301: HT      0x%03x VT      0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT);  xf86DrvMsg(0, X_INFO, "(init301: VGAHT   0x%03x VGAVT   0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT);#endif#endif   if(SiS_Pr->SiS_SetFlag & LowModeTests) {      SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);   }   if(SiS_Pr->SiS_VBType & VB_SISVB) {        if(SiS_Pr->SiS_SetFlag & LowModeTests) {	   SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);#ifdef SIS315H	   SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);#endif      	   SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);      	   SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);#ifdef SIS315H	   SiS_SetGroup4_C_ELV(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);#endif      	   SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);	   SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);	   /* For 301BDH (Panel link initialization): */	   if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {	      if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) {		 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) {		    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {		       SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,		                       RefreshRateTableIndex,HwInfo);		    }                 }	      }	      SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,		              RefreshRateTableIndex,HwInfo);	   }        }   } else {        SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);        if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {    	   SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwInfo);	}        SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwInfo);	if(SiS_Pr->SiS_SetFlag & LowModeTests) {     	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {	         if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {#ifdef SIS315H		    SiS_SetCH701xForLCD(SiS_Pr,HwInfo);#endif		 }	      }	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {       		 SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex);	      }     	   }	}   }#ifdef SIS300   if(HwInfo->jChipType < SIS_315H) {      if(SiS_Pr->SiS_SetFlag & LowModeTests) {	 if(SiS_Pr->SiS_UseOEM) {	    if((SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_UseOEM == -1)) {	       if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {	          SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,	       			    RefreshRateTableIndex);	       }	    } else {       	       SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,	       			 RefreshRateTableIndex);	    }	 }	 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {            if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||	       (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {	       SetOEMLCDData2(SiS_Pr, HwInfo, ModeNo, ModeIdIndex,RefreshRateTableIndex);	    }	    SiS_DisplayOn(SiS_Pr);         }      }   }#endif#ifdef SIS315H   if(HwInfo->jChipType >= SIS_315H) {      if(SiS_Pr->SiS_SetFlag & LowModeTests) {	 if(HwInfo->jChipType < SIS_661) {	    SiS_FinalizeLCD(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);            SiS_OEM310Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex);	 } else {	    SiS_OEM661Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex);	 }         SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40);      }   }#endif   if(SiS_Pr->SiS_SetFlag & LowModeTests) {      SiS_EnableBridge(SiS_Pr, HwInfo);   }   SiS_DisplayOn(SiS_Pr);   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) {      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {	 /* Disable LCD panel when using TV */	 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFF,0x0C);      } else {	 /* Disable TV when using LCD */	 SiS_SetCH70xxANDOR(SiS_Pr,0x010E,0xF8);      }   }   if(SiS_Pr->SiS_SetFlag & LowModeTests) {      SiS_LockCRT2(SiS_Pr,HwInfo);   }   return TRUE;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/544393fe584d333480659a4bed30f5295355df11/init301.c/clean/drivers/video/sis/init301.c