sisfb: use CONFIG_FB_SIS_301/315 instead of SIS301/315H

There is no need to alias CONFIG #defines.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by Aaro Koskinen and committed by Paul Mundt f7854e5d b6c30ca6

+193 -201
+37 -37
drivers/video/sis/init.c
··· 62 63 #include "init.h" 64 65 - #ifdef SIS300 66 #include "300vtbl.h" 67 #endif 68 69 - #ifdef SIS315H 70 #include "310vtbl.h" 71 #endif 72 ··· 78 /* POINTER INITIALIZATION */ 79 /*********************************************/ 80 81 - #if defined(SIS300) || defined(SIS315H) 82 static void 83 InitCommonPointer(struct SiS_Private *SiS_Pr) 84 { ··· 160 } 161 #endif 162 163 - #ifdef SIS300 164 static void 165 InitTo300Pointer(struct SiS_Private *SiS_Pr) 166 { ··· 237 } 238 #endif 239 240 - #ifdef SIS315H 241 static void 242 InitTo310Pointer(struct SiS_Private *SiS_Pr) 243 { ··· 321 SiSInitPtr(struct SiS_Private *SiS_Pr) 322 { 323 if(SiS_Pr->ChipType < SIS_315H) { 324 - #ifdef SIS300 325 InitTo300Pointer(SiS_Pr); 326 #else 327 return false; 328 #endif 329 } else { 330 - #ifdef SIS315H 331 InitTo310Pointer(SiS_Pr); 332 #else 333 return false; ··· 1087 SiSInitPCIetc(struct SiS_Private *SiS_Pr) 1088 { 1089 switch(SiS_Pr->ChipType) { 1090 - #ifdef SIS300 1091 case SIS_300: 1092 case SIS_540: 1093 case SIS_630: ··· 1106 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x5A); 1107 break; 1108 #endif 1109 - #ifdef SIS315H 1110 case SIS_315H: 1111 case SIS_315: 1112 case SIS_315PRO: ··· 1170 if((temp == 1) || (temp == 2)) return; 1171 1172 switch(SiS_Pr->ChipType) { 1173 - #ifdef SIS300 1174 case SIS_540: 1175 case SIS_630: 1176 case SIS_730: ··· 1184 } 1185 break; 1186 #endif 1187 - #ifdef SIS315H 1188 case SIS_550: 1189 case SIS_650: 1190 case SIS_740: ··· 1499 /* HELPER: Get DRAM type */ 1500 /*********************************************/ 1501 1502 - #ifdef SIS315H 1503 static unsigned char 1504 SiS_Get310DRAMType(struct SiS_Private *SiS_Pr) 1505 { ··· 2122 SiS_SetReg(SiS_Pr->SiS_P3d4,0x14,0x4F); 2123 } 2124 2125 - #ifdef SIS315H 2126 if(SiS_Pr->ChipType == XGI_20) { 2127 SiS_SetReg(SiS_Pr->SiS_P3d4,0x04,crt1data[4] - 1); 2128 if(!(temp = crt1data[5] & 0x1f)) { ··· 2205 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2c,clkb); 2206 2207 if(SiS_Pr->ChipType >= SIS_315H) { 2208 - #ifdef SIS315H 2209 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x01); 2210 if(SiS_Pr->ChipType == XGI_20) { 2211 unsigned short mf = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); ··· 2226 /* FIFO */ 2227 /*********************************************/ 2228 2229 - #ifdef SIS300 2230 void 2231 SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 2232 unsigned short *idx2) ··· 2535 2536 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ); 2537 } 2538 - #endif /* SIS300 */ 2539 2540 - #ifdef SIS315H 2541 static void 2542 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) 2543 { ··· 2589 } 2590 2591 if(SiS_Pr->ChipType < SIS_315H) { 2592 - #ifdef SIS300 2593 if(VCLK > 150) data |= 0x80; 2594 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data); 2595 ··· 2598 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data); 2599 #endif 2600 } else if(SiS_Pr->ChipType < XGI_20) { 2601 - #ifdef SIS315H 2602 if(VCLK >= 166) data |= 0x0c; 2603 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); 2604 ··· 2607 } 2608 #endif 2609 } else { 2610 - #ifdef SIS315H 2611 if(VCLK >= 200) data |= 0x0c; 2612 if(SiS_Pr->ChipType == XGI_20) data &= ~0x04; 2613 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); ··· 2652 unsigned short ModeIdIndex, unsigned short RRTI) 2653 { 2654 unsigned short data, infoflag = 0, modeflag, resindex; 2655 - #ifdef SIS315H 2656 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2657 unsigned short data2, data3; 2658 #endif ··· 2713 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,data); 2714 } 2715 2716 - #ifdef SIS315H 2717 if(SiS_Pr->ChipType >= SIS_315H) { 2718 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xfb); 2719 } ··· 2803 2804 SiS_SetVCLKState(SiS_Pr, ModeNo, RRTI, ModeIdIndex); 2805 2806 - #ifdef SIS315H 2807 if(((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) || 2808 (SiS_Pr->ChipType == XGI_40)) { 2809 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) { ··· 2822 #endif 2823 } 2824 2825 - #ifdef SIS315H 2826 static void 2827 SiS_SetupDualChip(struct SiS_Private *SiS_Pr) 2828 { ··· 3000 } 3001 3002 switch(SiS_Pr->ChipType) { 3003 - #ifdef SIS300 3004 case SIS_300: 3005 SiS_SetCRT1FIFO_300(SiS_Pr, ModeNo, RefreshRateTableIndex); 3006 break; ··· 3011 break; 3012 #endif 3013 default: 3014 - #ifdef SIS315H 3015 if(SiS_Pr->ChipType == XGI_20) { 3016 unsigned char sr2b = 0, sr2c = 0; 3017 switch(ModeNo) { ··· 3034 3035 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 3036 3037 - #ifdef SIS315H 3038 if(SiS_Pr->ChipType == XGI_40) { 3039 SiS_SetupDualChip(SiS_Pr); 3040 } ··· 3074 static void 3075 SiS_ResetVB(struct SiS_Private *SiS_Pr) 3076 { 3077 - #ifdef SIS315H 3078 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 3079 unsigned short temp; 3080 ··· 3109 * which locks CRT2 in some way to CRT1 timing. Disable 3110 * this here. 3111 */ 3112 - #ifdef SIS315H 3113 if((IS_SIS651) || (IS_SISM650) || 3114 SiS_Pr->ChipType == SIS_340 || 3115 SiS_Pr->ChipType == XGI_40) { ··· 3130 static void 3131 SiS_Handle760(struct SiS_Private *SiS_Pr) 3132 { 3133 - #ifdef SIS315H 3134 unsigned int somebase; 3135 unsigned char temp1, temp2, temp3; 3136 ··· 3272 SiS_DisplayOn(SiS_Pr); 3273 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3274 3275 - #ifdef SIS315H 3276 if(SiS_Pr->ChipType >= SIS_315H) { 3277 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 3278 if(!(SiS_IsDualEdge(SiS_Pr))) { ··· 3284 3285 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3286 if(SiS_Pr->ChipType >= SIS_315H) { 3287 - #ifdef SIS315H 3288 if(!SiS_Pr->SiS_ROMNew) { 3289 if(SiS_IsVAMode(SiS_Pr)) { 3290 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); ··· 3407 SiS_Pr->CVBlankStart = SiS_Pr->SiS_VGAVDE; 3408 3409 if(SiS_Pr->ChipType < SIS_315H) { 3410 - #ifdef SIS300 3411 tempbx = SiS_Pr->SiS_VGAHT; 3412 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3413 tempbx = SiS_Pr->PanelHT; ··· 3416 remaining = tempbx % 8; 3417 #endif 3418 } else { 3419 - #ifdef SIS315H 3420 /* OK for LCDA, LVDS */ 3421 tempbx = SiS_Pr->PanelHT - SiS_Pr->PanelXRes; 3422 tempax = SiS_Pr->SiS_VGAHDE; /* not /2 ! */ ··· 3430 SiS_Pr->CHTotal = SiS_Pr->CHBlankEnd = tempbx; 3431 3432 if(SiS_Pr->ChipType < SIS_315H) { 3433 - #ifdef SIS300 3434 if(SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) { 3435 SiS_Pr->CHSyncStart = SiS_Pr->SiS_VGAHDE + ((SiS_Pr->PanelHRS + 1) & ~1); 3436 SiS_Pr->CHSyncEnd = SiS_Pr->CHSyncStart + SiS_Pr->PanelHRE; ··· 3462 } 3463 #endif 3464 } else { 3465 - #ifdef SIS315H 3466 tempax = VGAHDE; 3467 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3468 tempbx = SiS_Pr->PanelXRes; ··· 3481 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3482 tempax = SiS_Pr->PanelYRes; 3483 } else if(SiS_Pr->ChipType < SIS_315H) { 3484 - #ifdef SIS300 3485 /* Stupid hack for 640x400/320x200 */ 3486 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { 3487 if((tempax + tempbx) == 438) tempbx += 16;
··· 62 63 #include "init.h" 64 65 + #ifdef CONFIG_FB_SIS_300 66 #include "300vtbl.h" 67 #endif 68 69 + #ifdef CONFIG_FB_SIS_315 70 #include "310vtbl.h" 71 #endif 72 ··· 78 /* POINTER INITIALIZATION */ 79 /*********************************************/ 80 81 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 82 static void 83 InitCommonPointer(struct SiS_Private *SiS_Pr) 84 { ··· 160 } 161 #endif 162 163 + #ifdef CONFIG_FB_SIS_300 164 static void 165 InitTo300Pointer(struct SiS_Private *SiS_Pr) 166 { ··· 237 } 238 #endif 239 240 + #ifdef CONFIG_FB_SIS_315 241 static void 242 InitTo310Pointer(struct SiS_Private *SiS_Pr) 243 { ··· 321 SiSInitPtr(struct SiS_Private *SiS_Pr) 322 { 323 if(SiS_Pr->ChipType < SIS_315H) { 324 + #ifdef CONFIG_FB_SIS_300 325 InitTo300Pointer(SiS_Pr); 326 #else 327 return false; 328 #endif 329 } else { 330 + #ifdef CONFIG_FB_SIS_315 331 InitTo310Pointer(SiS_Pr); 332 #else 333 return false; ··· 1087 SiSInitPCIetc(struct SiS_Private *SiS_Pr) 1088 { 1089 switch(SiS_Pr->ChipType) { 1090 + #ifdef CONFIG_FB_SIS_300 1091 case SIS_300: 1092 case SIS_540: 1093 case SIS_630: ··· 1106 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x5A); 1107 break; 1108 #endif 1109 + #ifdef CONFIG_FB_SIS_315 1110 case SIS_315H: 1111 case SIS_315: 1112 case SIS_315PRO: ··· 1170 if((temp == 1) || (temp == 2)) return; 1171 1172 switch(SiS_Pr->ChipType) { 1173 + #ifdef CONFIG_FB_SIS_300 1174 case SIS_540: 1175 case SIS_630: 1176 case SIS_730: ··· 1184 } 1185 break; 1186 #endif 1187 + #ifdef CONFIG_FB_SIS_315 1188 case SIS_550: 1189 case SIS_650: 1190 case SIS_740: ··· 1499 /* HELPER: Get DRAM type */ 1500 /*********************************************/ 1501 1502 + #ifdef CONFIG_FB_SIS_315 1503 static unsigned char 1504 SiS_Get310DRAMType(struct SiS_Private *SiS_Pr) 1505 { ··· 2122 SiS_SetReg(SiS_Pr->SiS_P3d4,0x14,0x4F); 2123 } 2124 2125 + #ifdef CONFIG_FB_SIS_315 2126 if(SiS_Pr->ChipType == XGI_20) { 2127 SiS_SetReg(SiS_Pr->SiS_P3d4,0x04,crt1data[4] - 1); 2128 if(!(temp = crt1data[5] & 0x1f)) { ··· 2205 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2c,clkb); 2206 2207 if(SiS_Pr->ChipType >= SIS_315H) { 2208 + #ifdef CONFIG_FB_SIS_315 2209 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x01); 2210 if(SiS_Pr->ChipType == XGI_20) { 2211 unsigned short mf = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); ··· 2226 /* FIFO */ 2227 /*********************************************/ 2228 2229 + #ifdef CONFIG_FB_SIS_300 2230 void 2231 SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 2232 unsigned short *idx2) ··· 2535 2536 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ); 2537 } 2538 + #endif /* CONFIG_FB_SIS_300 */ 2539 2540 + #ifdef CONFIG_FB_SIS_315 2541 static void 2542 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) 2543 { ··· 2589 } 2590 2591 if(SiS_Pr->ChipType < SIS_315H) { 2592 + #ifdef CONFIG_FB_SIS_300 2593 if(VCLK > 150) data |= 0x80; 2594 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data); 2595 ··· 2598 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data); 2599 #endif 2600 } else if(SiS_Pr->ChipType < XGI_20) { 2601 + #ifdef CONFIG_FB_SIS_315 2602 if(VCLK >= 166) data |= 0x0c; 2603 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); 2604 ··· 2607 } 2608 #endif 2609 } else { 2610 + #ifdef CONFIG_FB_SIS_315 2611 if(VCLK >= 200) data |= 0x0c; 2612 if(SiS_Pr->ChipType == XGI_20) data &= ~0x04; 2613 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); ··· 2652 unsigned short ModeIdIndex, unsigned short RRTI) 2653 { 2654 unsigned short data, infoflag = 0, modeflag, resindex; 2655 + #ifdef CONFIG_FB_SIS_315 2656 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2657 unsigned short data2, data3; 2658 #endif ··· 2713 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,data); 2714 } 2715 2716 + #ifdef CONFIG_FB_SIS_315 2717 if(SiS_Pr->ChipType >= SIS_315H) { 2718 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xfb); 2719 } ··· 2803 2804 SiS_SetVCLKState(SiS_Pr, ModeNo, RRTI, ModeIdIndex); 2805 2806 + #ifdef CONFIG_FB_SIS_315 2807 if(((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) || 2808 (SiS_Pr->ChipType == XGI_40)) { 2809 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) { ··· 2822 #endif 2823 } 2824 2825 + #ifdef CONFIG_FB_SIS_315 2826 static void 2827 SiS_SetupDualChip(struct SiS_Private *SiS_Pr) 2828 { ··· 3000 } 3001 3002 switch(SiS_Pr->ChipType) { 3003 + #ifdef CONFIG_FB_SIS_300 3004 case SIS_300: 3005 SiS_SetCRT1FIFO_300(SiS_Pr, ModeNo, RefreshRateTableIndex); 3006 break; ··· 3011 break; 3012 #endif 3013 default: 3014 + #ifdef CONFIG_FB_SIS_315 3015 if(SiS_Pr->ChipType == XGI_20) { 3016 unsigned char sr2b = 0, sr2c = 0; 3017 switch(ModeNo) { ··· 3034 3035 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 3036 3037 + #ifdef CONFIG_FB_SIS_315 3038 if(SiS_Pr->ChipType == XGI_40) { 3039 SiS_SetupDualChip(SiS_Pr); 3040 } ··· 3074 static void 3075 SiS_ResetVB(struct SiS_Private *SiS_Pr) 3076 { 3077 + #ifdef CONFIG_FB_SIS_315 3078 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 3079 unsigned short temp; 3080 ··· 3109 * which locks CRT2 in some way to CRT1 timing. Disable 3110 * this here. 3111 */ 3112 + #ifdef CONFIG_FB_SIS_315 3113 if((IS_SIS651) || (IS_SISM650) || 3114 SiS_Pr->ChipType == SIS_340 || 3115 SiS_Pr->ChipType == XGI_40) { ··· 3130 static void 3131 SiS_Handle760(struct SiS_Private *SiS_Pr) 3132 { 3133 + #ifdef CONFIG_FB_SIS_315 3134 unsigned int somebase; 3135 unsigned char temp1, temp2, temp3; 3136 ··· 3272 SiS_DisplayOn(SiS_Pr); 3273 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3274 3275 + #ifdef CONFIG_FB_SIS_315 3276 if(SiS_Pr->ChipType >= SIS_315H) { 3277 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 3278 if(!(SiS_IsDualEdge(SiS_Pr))) { ··· 3284 3285 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3286 if(SiS_Pr->ChipType >= SIS_315H) { 3287 + #ifdef CONFIG_FB_SIS_315 3288 if(!SiS_Pr->SiS_ROMNew) { 3289 if(SiS_IsVAMode(SiS_Pr)) { 3290 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); ··· 3407 SiS_Pr->CVBlankStart = SiS_Pr->SiS_VGAVDE; 3408 3409 if(SiS_Pr->ChipType < SIS_315H) { 3410 + #ifdef CONFIG_FB_SIS_300 3411 tempbx = SiS_Pr->SiS_VGAHT; 3412 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3413 tempbx = SiS_Pr->PanelHT; ··· 3416 remaining = tempbx % 8; 3417 #endif 3418 } else { 3419 + #ifdef CONFIG_FB_SIS_315 3420 /* OK for LCDA, LVDS */ 3421 tempbx = SiS_Pr->PanelHT - SiS_Pr->PanelXRes; 3422 tempax = SiS_Pr->SiS_VGAHDE; /* not /2 ! */ ··· 3430 SiS_Pr->CHTotal = SiS_Pr->CHBlankEnd = tempbx; 3431 3432 if(SiS_Pr->ChipType < SIS_315H) { 3433 + #ifdef CONFIG_FB_SIS_300 3434 if(SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) { 3435 SiS_Pr->CHSyncStart = SiS_Pr->SiS_VGAHDE + ((SiS_Pr->PanelHRS + 1) & ~1); 3436 SiS_Pr->CHSyncEnd = SiS_Pr->CHSyncStart + SiS_Pr->PanelHRE; ··· 3462 } 3463 #endif 3464 } else { 3465 + #ifdef CONFIG_FB_SIS_315 3466 tempax = VGAHDE; 3467 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3468 tempbx = SiS_Pr->PanelXRes; ··· 3481 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3482 tempax = SiS_Pr->PanelYRes; 3483 } else if(SiS_Pr->ChipType < SIS_315H) { 3484 + #ifdef CONFIG_FB_SIS_300 3485 /* Stupid hack for 640x400/320x200 */ 3486 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { 3487 if((tempax + tempbx) == 438) tempbx += 16;
+4 -4
drivers/video/sis/init.h
··· 273 { 1280, 854, 8,16} /* 0x22 */ 274 }; 275 276 - #if defined(SIS300) || defined(SIS315H) 277 static const struct SiS_StandTable_S SiS_StandTable[]= 278 { 279 /* 0x00: MD_0_200 */ ··· 1549 unsigned short ModeIdIndex); 1550 unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr,unsigned short ModeNo, 1551 unsigned short ModeIdIndex, unsigned short RRTI); 1552 - #ifdef SIS300 1553 void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 1554 unsigned short *idx2); 1555 unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2); ··· 1585 extern bool SiS_IsVAMode(struct SiS_Private *); 1586 extern bool SiS_IsDualEdge(struct SiS_Private *); 1587 1588 - #ifdef SIS300 1589 extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1590 extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, 1591 unsigned int val); 1592 #endif 1593 - #ifdef SIS315H 1594 extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, 1595 unsigned char val); 1596 extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg);
··· 273 { 1280, 854, 8,16} /* 0x22 */ 274 }; 275 276 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 277 static const struct SiS_StandTable_S SiS_StandTable[]= 278 { 279 /* 0x00: MD_0_200 */ ··· 1549 unsigned short ModeIdIndex); 1550 unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr,unsigned short ModeNo, 1551 unsigned short ModeIdIndex, unsigned short RRTI); 1552 + #ifdef CONFIG_FB_SIS_300 1553 void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 1554 unsigned short *idx2); 1555 unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2); ··· 1585 extern bool SiS_IsVAMode(struct SiS_Private *); 1586 extern bool SiS_IsDualEdge(struct SiS_Private *); 1587 1588 + #ifdef CONFIG_FB_SIS_300 1589 extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1590 extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, 1591 unsigned int val); 1592 #endif 1593 + #ifdef CONFIG_FB_SIS_315 1594 extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, 1595 unsigned char val); 1596 extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg);
+141 -141
drivers/video/sis/init301.c
··· 75 76 #include "init301.h" 77 78 - #ifdef SIS300 79 #include "oem300.h" 80 #endif 81 82 - #ifdef SIS315H 83 #include "oem310.h" 84 #endif 85 ··· 134 /* HELPER: Get Pointer to LCD structure */ 135 /*********************************************/ 136 137 - #ifdef SIS315H 138 static unsigned char * 139 GetLCDStructPtr661(struct SiS_Private *SiS_Pr) 140 { ··· 400 /* HELPER: GET SOME DATA FROM BIOS ROM */ 401 /*********************************************/ 402 403 - #ifdef SIS300 404 static bool 405 SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) 406 { ··· 445 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); 446 } 447 448 - #if defined(SIS300) || defined(SIS315H) 449 static void 450 SiS_GenericDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 451 { ··· 453 } 454 #endif 455 456 - #ifdef SIS315H 457 static void 458 SiS_LongDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 459 { ··· 463 } 464 #endif 465 466 - #if defined(SIS300) || defined(SIS315H) 467 static void 468 SiS_ShortDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 469 { ··· 476 static void 477 SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) 478 { 479 - #if defined(SIS300) || defined(SIS315H) 480 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 481 unsigned short PanelID, DelayIndex, Delay=0; 482 #endif 483 484 if(SiS_Pr->ChipType < SIS_315H) { 485 486 - #ifdef SIS300 487 488 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); 489 if(SiS_Pr->SiS_VBType & VB_SISVB) { ··· 509 } 510 SiS_ShortDelay(SiS_Pr, Delay); 511 512 - #endif /* SIS300 */ 513 514 } else { 515 516 - #ifdef SIS315H 517 518 if((SiS_Pr->ChipType >= SIS_661) || 519 (SiS_Pr->ChipType <= SIS_315PRO) || ··· 575 576 } 577 578 - #endif /* SIS315H */ 579 580 } 581 } 582 583 - #ifdef SIS315H 584 static void 585 SiS_PanelDelayLoop(struct SiS_Private *SiS_Pr, unsigned short DelayTime, unsigned short DelayLoop) 586 { ··· 609 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); 610 } 611 612 - #if defined(SIS300) || defined(SIS315H) 613 static void 614 SiS_WaitRetrace2(struct SiS_Private *SiS_Pr, unsigned short reg) 615 { ··· 626 SiS_WaitVBRetrace(struct SiS_Private *SiS_Pr) 627 { 628 if(SiS_Pr->ChipType < SIS_315H) { 629 - #ifdef SIS300 630 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 631 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; 632 } ··· 637 } 638 #endif 639 } else { 640 - #ifdef SIS315H 641 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { 642 SiS_WaitRetrace1(SiS_Pr); 643 } else { ··· 682 /* HELPER: MISC */ 683 /*********************************************/ 684 685 - #ifdef SIS300 686 static bool 687 SiS_Is301B(struct SiS_Private *SiS_Pr) 688 { ··· 704 bool 705 SiS_IsDualEdge(struct SiS_Private *SiS_Pr) 706 { 707 - #ifdef SIS315H 708 if(SiS_Pr->ChipType >= SIS_315H) { 709 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { 710 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; ··· 717 bool 718 SiS_IsVAMode(struct SiS_Private *SiS_Pr) 719 { 720 - #ifdef SIS315H 721 unsigned short flag; 722 723 if(SiS_Pr->ChipType >= SIS_315H) { ··· 728 return false; 729 } 730 731 - #ifdef SIS315H 732 static bool 733 SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) 734 { ··· 741 static bool 742 SiS_IsDualLink(struct SiS_Private *SiS_Pr) 743 { 744 - #ifdef SIS315H 745 if(SiS_Pr->ChipType >= SIS_315H) { 746 if((SiS_CRT2IsLCD(SiS_Pr)) || 747 (SiS_IsVAMode(SiS_Pr))) { ··· 752 return false; 753 } 754 755 - #ifdef SIS315H 756 static bool 757 SiS_TVEnabled(struct SiS_Private *SiS_Pr) 758 { ··· 764 } 765 #endif 766 767 - #ifdef SIS315H 768 static bool 769 SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) 770 { ··· 773 } 774 #endif 775 776 - #ifdef SIS315H 777 static bool 778 SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) 779 { ··· 784 } 785 #endif 786 787 - #ifdef SIS315H 788 static bool 789 SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) 790 { ··· 800 } 801 #endif 802 803 - #ifdef SIS315H 804 static bool 805 SiS_IsYPbPr(struct SiS_Private *SiS_Pr) 806 { ··· 812 } 813 #endif 814 815 - #ifdef SIS315H 816 static bool 817 SiS_IsChScart(struct SiS_Private *SiS_Pr) 818 { ··· 824 } 825 #endif 826 827 - #ifdef SIS315H 828 static bool 829 SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) 830 { ··· 844 } 845 #endif 846 847 - #ifdef SIS315H 848 static bool 849 SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) 850 { ··· 910 /*********************************************/ 911 912 /* Setup general purpose IO for Chrontel communication */ 913 - #ifdef SIS300 914 void 915 SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo) 916 { ··· 961 tempax &= (DriverMode | LoadDACFlag | SetNotSimuMode | SetPALTV); 962 tempbx |= tempax; 963 964 - #ifdef SIS315H 965 if(SiS_Pr->ChipType >= SIS_315H) { 966 if(SiS_Pr->SiS_VBType & VB_SISLCDA) { 967 if(ModeNo == 0x03) { ··· 1011 } 1012 } 1013 1014 - #endif /* SIS315H */ 1015 1016 if(!(SiS_Pr->SiS_VBType & VB_SISVGA2)) { 1017 tempbx &= ~(SetCRT2ToRAMDAC); ··· 1146 1147 SiS_Pr->SiS_VBInfo = tempbx; 1148 1149 - #ifdef SIS300 1150 if(SiS_Pr->ChipType == SIS_630) { 1151 SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); 1152 } ··· 1421 static void 1422 SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr) 1423 { 1424 - #ifdef SIS315H 1425 unsigned char *ROMAddr; 1426 unsigned short temp; 1427 ··· 1471 { 1472 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; 1473 bool panelcanscale = false; 1474 - #ifdef SIS300 1475 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 1476 static const unsigned char SiS300SeriesLCDRes[] = 1477 { 0, 1, 2, 3, 7, 4, 5, 8, 1478 0, 0, 10, 0, 0, 0, 0, 15 }; 1479 #endif 1480 - #ifdef SIS315H 1481 unsigned char *myptr = NULL; 1482 #endif 1483 ··· 1516 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; 1517 } 1518 temp &= 0x0f; 1519 - #ifdef SIS300 1520 if(SiS_Pr->ChipType < SIS_315H) { 1521 /* Very old BIOSes only know 7 sizes (NetVista 2179, 1.01g) */ 1522 if(SiS_Pr->SiS_VBType & VB_SIS301) { ··· 1528 #endif 1529 1530 /* Translate to our internal types */ 1531 - #ifdef SIS315H 1532 if(SiS_Pr->ChipType == SIS_550) { 1533 if (temp == Panel310_1152x768) temp = Panel_320x240_2; /* Verified working */ 1534 else if(temp == Panel310_320x240_2) temp = Panel_320x240_2; ··· 1551 1552 SiS_Pr->SiS_LCDResInfo = temp; 1553 1554 - #ifdef SIS300 1555 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 1556 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { 1557 SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; ··· 1593 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; 1594 1595 /* Dual link, Pass 1:1 BIOS default, etc. */ 1596 - #ifdef SIS315H 1597 if(SiS_Pr->ChipType >= SIS_661) { 1598 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 1599 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; ··· 2030 } 2031 } 2032 2033 - #ifdef SIS300 2034 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 2035 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { 2036 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ ··· 2306 VCLKIndex = SiS_Pr->PanelVCLKIdx315; 2307 } 2308 2309 - #ifdef SIS300 2310 /* Special Timing: Barco iQ Pro R series */ 2311 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; 2312 ··· 2369 { 2370 unsigned short i, j, modeflag, tempah=0; 2371 short tempcl; 2372 - #if defined(SIS300) || defined(SIS315H) 2373 unsigned short tempbl; 2374 #endif 2375 - #ifdef SIS315H 2376 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2377 unsigned short tempah2, tempbl2; 2378 #endif ··· 2395 2396 if(SiS_Pr->ChipType < SIS_315H) { 2397 2398 - #ifdef SIS300 /* ---- 300 series ---- */ 2399 2400 /* For 301BDH: (with LCD via LVDS) */ 2401 if(SiS_Pr->SiS_VBType & VB_NoLCD) { ··· 2418 2419 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; 2420 2421 - #endif /* SIS300 */ 2422 2423 } else { 2424 2425 - #ifdef SIS315H /* ------- 315/330 series ------ */ 2426 2427 if(ModeNo > 0x13) { 2428 tempcl -= ModeVGA; ··· 2435 2436 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; 2437 2438 - #endif /* SIS315H */ 2439 2440 } 2441 ··· 2444 if(SiS_Pr->ChipType < SIS_315H) { 2445 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); 2446 } else { 2447 - #ifdef SIS315H 2448 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 2449 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); 2450 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { ··· 2525 2526 if(SiS_Pr->ChipType >= SIS_315H) { 2527 2528 - #ifdef SIS315H 2529 /* LVDS can only be slave in 8bpp modes */ 2530 tempah = 0x80; 2531 if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { ··· 2545 2546 } else { 2547 2548 - #ifdef SIS300 2549 tempah = 0; 2550 if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { 2551 tempah |= 0x02; ··· 2567 2568 if(SiS_Pr->ChipType >= SIS_315H) { 2569 2570 - #ifdef SIS315H 2571 /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ 2572 2573 /* The following is nearly unpreditable and varies from machine ··· 2659 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); 2660 } 2661 2662 - #endif /* SIS315H */ 2663 2664 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 2665 2666 - #ifdef SIS300 2667 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); 2668 2669 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || ··· 2686 2687 } else { /* LVDS */ 2688 2689 - #ifdef SIS315H 2690 if(SiS_Pr->ChipType >= SIS_315H) { 2691 2692 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { ··· 2872 } 2873 } 2874 2875 - #ifdef SIS315H 2876 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { 2877 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { 2878 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { ··· 2977 case Panel_1280x1024: tempbx = 24; break; 2978 case Panel_1400x1050: tempbx = 26; break; 2979 case Panel_1600x1200: tempbx = 28; break; 2980 - #ifdef SIS300 2981 case Panel_Barco1366: tempbx = 80; break; 2982 #endif 2983 } ··· 2994 2995 if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 30; 2996 2997 - #ifdef SIS300 2998 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { 2999 tempbx = 82; 3000 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; ··· 3130 3131 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 3132 3133 - #ifdef SIS315H 3134 SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 3135 SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); 3136 #endif ··· 3155 case 16: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; 3156 case 18: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; 3157 case 20: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; 3158 - #ifdef SIS300 3159 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; 3160 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; 3161 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; ··· 3189 (SiS_Pr->SiS_SetFlag & SetDOSMode) ) { 3190 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; 3191 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; 3192 - #ifdef SIS300 3193 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { 3194 if(ResIndex < 0x08) { 3195 SiS_Pr->SiS_HDE = 1280; ··· 3211 unsigned short resinfo, CRT2Index, ResIndex; 3212 const struct SiS_LCDData *LCDPtr = NULL; 3213 const struct SiS_TVData *TVPtr = NULL; 3214 - #ifdef SIS315H 3215 short resinfo661; 3216 #endif 3217 ··· 3224 } else { 3225 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; 3226 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; 3227 - #ifdef SIS315H 3228 resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; 3229 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && 3230 (SiS_Pr->SiS_SetFlag & LCDVESATiming) && ··· 3401 3402 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { 3403 3404 - #ifdef SIS315H 3405 SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; 3406 SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; 3407 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); ··· 3461 case Panel_1680x1050 : 3462 case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; 3463 case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; 3464 - #ifdef SIS315H 3465 case 200 : LCDPtr = SiS310_ExtCompaq1280x1024Data; break; 3466 case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; 3467 #endif ··· 3559 { 3560 const struct SiS_LVDSDes *PanelDesPtr = NULL; 3561 3562 - #ifdef SIS300 3563 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { 3564 3565 if(SiS_Pr->ChipType < SIS_315H) { ··· 3631 3632 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 3633 3634 - #ifdef SIS315H 3635 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3636 /* non-pass 1:1 only, see above */ 3637 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { ··· 3706 } else { 3707 3708 if(SiS_Pr->ChipType < SIS_315H) { 3709 - #ifdef SIS300 3710 switch(SiS_Pr->SiS_LCDResInfo) { 3711 case Panel_800x600: 3712 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { ··· 3751 } 3752 #endif 3753 } else { 3754 - #ifdef SIS315H 3755 switch(SiS_Pr->SiS_LCDResInfo) { 3756 case Panel_1024x768: 3757 case Panel_1280x1024: ··· 3779 if(SiS_Pr->ChipType < SIS_315H) { 3780 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; 3781 } else { 3782 - #ifdef SIS315H 3783 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; 3784 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; 3785 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; ··· 3801 /* DISABLE VIDEO BRIDGE */ 3802 /*********************************************/ 3803 3804 - #ifdef SIS315H 3805 static int 3806 SiS_HandlePWD(struct SiS_Private *SiS_Pr) 3807 { ··· 3839 void 3840 SiS_DisableBridge(struct SiS_Private *SiS_Pr) 3841 { 3842 - #ifdef SIS315H 3843 unsigned short tempah, pushax=0, modenum; 3844 #endif 3845 unsigned short temp=0; ··· 3850 3851 if(SiS_Pr->ChipType < SIS_315H) { 3852 3853 - #ifdef SIS300 /* 300 series */ 3854 3855 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { 3856 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { ··· 3883 } 3884 } 3885 3886 - #endif /* SIS300 */ 3887 3888 } else { 3889 3890 - #ifdef SIS315H /* 315 series */ 3891 3892 int didpwd = 0; 3893 bool custom1 = (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || ··· 4011 4012 } 4013 4014 - #endif /* SIS315H */ 4015 4016 } 4017 4018 } else { /* ============ For 301 ================ */ 4019 4020 if(SiS_Pr->ChipType < SIS_315H) { 4021 - #ifdef SIS300 4022 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { 4023 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); 4024 SiS_PanelDelay(SiS_Pr, 3); ··· 4041 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); 4042 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); 4043 } else { 4044 - #ifdef SIS300 4045 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ 4046 if( (!(SiS_CRT2IsLCD(SiS_Pr))) || 4047 (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { ··· 4057 4058 if(SiS_Pr->ChipType < SIS_315H) { 4059 4060 - #ifdef SIS300 /* 300 series */ 4061 4062 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { 4063 SiS_SetCH700x(SiS_Pr,0x0E,0x09); ··· 4101 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); 4102 } 4103 4104 - #endif /* SIS300 */ 4105 4106 } else { 4107 4108 - #ifdef SIS315H /* 315 series */ 4109 4110 if(!(SiS_IsNotM650orLater(SiS_Pr))) { 4111 /*if(SiS_Pr->ChipType < SIS_340) { */ /* XGI needs this */ ··· 4218 } 4219 } 4220 4221 - #endif /* SIS315H */ 4222 4223 } /* 315 series */ 4224 ··· 4239 SiS_EnableBridge(struct SiS_Private *SiS_Pr) 4240 { 4241 unsigned short temp=0, tempah; 4242 - #ifdef SIS315H 4243 unsigned short temp1, pushax=0; 4244 bool delaylong = false; 4245 #endif ··· 4250 4251 if(SiS_Pr->ChipType < SIS_315H) { 4252 4253 - #ifdef SIS300 /* 300 series */ 4254 4255 if(SiS_CRT2IsLCD(SiS_Pr)) { 4256 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { ··· 4313 } 4314 4315 4316 - #endif /* SIS300 */ 4317 4318 } else { 4319 4320 - #ifdef SIS315H /* 315 series */ 4321 4322 #ifdef SET_EMI 4323 unsigned char r30=0, r31=0, r32=0, r33=0, cr36=0; ··· 4616 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); 4617 } 4618 4619 - #endif /* SIS315H */ 4620 4621 } 4622 ··· 4667 4668 if(SiS_Pr->ChipType < SIS_315H) { 4669 4670 - #ifdef SIS300 /* 300 series */ 4671 4672 if(SiS_CRT2IsLCD(SiS_Pr)) { 4673 if(SiS_Pr->ChipType == SIS_730) { ··· 4711 } 4712 } 4713 4714 - #endif /* SIS300 */ 4715 4716 } else { 4717 4718 - #ifdef SIS315H /* 315 series */ 4719 4720 if(!(SiS_IsNotM650orLater(SiS_Pr))) { 4721 /*if(SiS_Pr->ChipType < SIS_340) {*/ /* XGI needs this */ ··· 4809 } 4810 } 4811 4812 - #endif /* SIS315H */ 4813 4814 } /* 310 series */ 4815 ··· 4899 4900 if(SiS_Pr->ChipType < SIS_315H) { 4901 4902 - #ifdef SIS300 /* ---- 300 series --- */ 4903 4904 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* 630 - 301B(-DH) */ 4905 ··· 4928 4929 } 4930 4931 - #endif /* SIS300 */ 4932 4933 } else { 4934 4935 - #ifdef SIS315H /* ------- 315 series ------ */ 4936 4937 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* 315 - LVDS */ 4938 ··· 5004 } 5005 5006 } 5007 - #endif /* SIS315H */ 5008 } 5009 } 5010 } 5011 5012 /* Set CRT2 FIFO on 300/540/630/730 */ 5013 - #ifdef SIS300 5014 static void 5015 SiS_SetCRT2FIFO_300(struct SiS_Private *SiS_Pr,unsigned short ModeNo) 5016 { ··· 5185 #endif 5186 5187 /* Set CRT2 FIFO on 315/330 series */ 5188 - #ifdef SIS315H 5189 static void 5190 SiS_SetCRT2FIFO_310(struct SiS_Private *SiS_Pr) 5191 { ··· 5357 unsigned short push2, tempax, tempbx, tempcx, temp; 5358 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; 5359 bool islvds = false, issis = false, chkdclkfirst = false; 5360 - #ifdef SIS300 5361 unsigned short crt2crtc = 0; 5362 #endif 5363 - #ifdef SIS315H 5364 unsigned short pushcx; 5365 #endif 5366 5367 if(ModeNo <= 0x13) { 5368 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; 5369 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; 5370 - #ifdef SIS300 5371 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; 5372 #endif 5373 } else if(SiS_Pr->UseCustomMode) { ··· 5375 } else { 5376 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; 5377 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; 5378 - #ifdef SIS300 5379 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; 5380 #endif 5381 } ··· 5396 } 5397 } 5398 5399 - #ifdef SIS315H 5400 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 5401 if(IS_SIS330) { 5402 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); ··· 5646 5647 if(SiS_Pr->ChipType < SIS_315H) { 5648 5649 - #ifdef SIS300 /* 300 series */ 5650 tempeax = SiS_Pr->SiS_VGAVDE << 6; 5651 temp = (tempeax % (unsigned int)SiS_Pr->SiS_VDE); 5652 tempeax = tempeax / (unsigned int)SiS_Pr->SiS_VDE; ··· 5657 temp = (unsigned short)(tempeax & 0x00FF); 5658 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ 5659 tempvcfact = temp; 5660 - #endif /* SIS300 */ 5661 5662 } else { 5663 5664 - #ifdef SIS315H /* 315 series */ 5665 tempeax = SiS_Pr->SiS_VGAVDE << 18; 5666 tempebx = SiS_Pr->SiS_VDE; 5667 temp = (tempeax % tempebx); ··· 5747 temp = (unsigned short)(tempecx & 0x00FF); 5748 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); 5749 5750 - #ifdef SIS315H 5751 if(SiS_Pr->ChipType >= SIS_315H) { 5752 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 5753 if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SISLVDS)) { ··· 5765 } 5766 #endif 5767 5768 - #ifdef SIS300 5769 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { 5770 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 5771 unsigned char *trumpdata; ··· 5801 } 5802 #endif 5803 5804 - #ifdef SIS315H 5805 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { 5806 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); 5807 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); ··· 5901 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); 5902 } 5903 } 5904 - #endif /* SIS315H */ 5905 } 5906 5907 /* Set Part 1 */ ··· 5909 SiS_SetGroup1(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 5910 unsigned short RefreshRateTableIndex) 5911 { 5912 - #if defined(SIS300) || defined(SIS315H) 5913 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 5914 #endif 5915 unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; 5916 unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0; 5917 - #ifdef SIS315H 5918 unsigned short tempbl=0; 5919 #endif 5920 ··· 5940 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { 5941 5942 if(SiS_Pr->ChipType < SIS_315H ) { 5943 - #ifdef SIS300 5944 SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo); 5945 #endif 5946 } else { 5947 - #ifdef SIS315H 5948 SiS_SetCRT2FIFO_310(SiS_Pr); 5949 #endif 5950 } ··· 5953 5954 if(SiS_Pr->ChipType < SIS_315H ) { 5955 5956 - #ifdef SIS300 /* ------------- 300 series --------------*/ 5957 5958 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ 5959 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ ··· 5972 5973 bridgeadd = 12; 5974 5975 - #endif /* SIS300 */ 5976 5977 } else { 5978 5979 - #ifdef SIS315H /* ------------------- 315/330 series --------------- */ 5980 5981 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ 5982 if(modeflag & HalfDCLK) { ··· 6027 } 6028 } 6029 6030 - #endif /* SIS315H */ 6031 6032 } /* 315/330 series */ 6033 ··· 6158 6159 if(SiS_Pr->ChipType < SIS_315H) { 6160 6161 - #ifdef SIS300 /* ---------- 300 series -------------- */ 6162 6163 if(SiS_Pr->SiS_VBType & VB_SISVB) { 6164 temp = 0x20; ··· 6212 6213 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */ 6214 6215 - #endif /* SIS300 */ 6216 6217 } else { 6218 6219 - #ifdef SIS315H /* --------------- 315/330 series ---------------*/ 6220 6221 if(SiS_Pr->ChipType < SIS_661) { 6222 ··· 6251 if(modeflag & HalfDCLK) tempax |= 0x40; 6252 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); 6253 6254 - #endif /* SIS315H */ 6255 6256 } 6257 ··· 6283 /* SET PART 2 REGISTER GROUP */ 6284 /*********************************************/ 6285 6286 - #ifdef SIS315H 6287 static unsigned char * 6288 SiS_GetGroup2CLVXPtr(struct SiS_Private *SiS_Pr, int tabletype) 6289 { ··· 6380 } 6381 #endif 6382 6383 - #ifdef SIS300 6384 static void 6385 SiS_Group2LCDSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short crt2crtc) 6386 { ··· 6592 unsigned int longtemp, PhaseIndex; 6593 bool newtvphase; 6594 const unsigned char *TimingPoint; 6595 - #ifdef SIS315H 6596 unsigned short resindex, CRT2Index; 6597 const struct SiS_Part2PortTbl *CRT2Part2Ptr = NULL; 6598 ··· 6971 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); 6972 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); 6973 6974 - #ifdef SIS315H 6975 if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, 6976 &CRT2Index, &resindex)) { 6977 switch(CRT2Index) { ··· 7093 7094 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); 7095 7096 - #ifdef SIS300 7097 SiS_Group2LCDSpecial(SiS_Pr, ModeNo, crt2crtc); 7098 #endif 7099 ··· 7176 7177 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); 7178 7179 - #ifdef SIS300 7180 SiS_Set300Part2Regs(SiS_Pr, ModeIdIndex, RefreshRateTableIndex, ModeNo); 7181 #endif 7182 - #ifdef SIS315H 7183 } /* CRT2-LCD from table */ 7184 #endif 7185 } ··· 7248 /* SET PART 4 REGISTER GROUP */ 7249 /*********************************************/ 7250 7251 - #ifdef SIS315H 7252 #if 0 7253 static void 7254 SiS_ShiftXPos(struct SiS_Private *SiS_Pr, int shift) ··· 7877 7878 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { 7879 7880 - #ifdef SIS300 7881 7882 /* Chrontel 7005 - I assume that it does not come with a 315 series chip */ 7883 ··· 7990 7991 /* Chrontel 7019 - assumed that it does not come with a 300 series chip */ 7992 7993 - #ifdef SIS315H 7994 7995 unsigned short temp; 7996 ··· 8041 8042 } 8043 8044 - #ifdef SIS315H /* ----------- 315 series only ---------- */ 8045 8046 void 8047 SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr) ··· 8523 bool 8524 SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 8525 { 8526 - #ifdef SIS300 8527 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 8528 #endif 8529 unsigned short ModeIdIndex, RefreshRateTableIndex; ··· 8578 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8579 8580 SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8581 - #ifdef SIS315H 8582 SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8583 #endif 8584 SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex); 8585 SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8586 - #ifdef SIS315H 8587 SiS_SetGroup4_C_ELV(SiS_Pr, ModeNo, ModeIdIndex); 8588 #endif 8589 SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex); ··· 8614 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { 8615 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { 8616 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { 8617 - #ifdef SIS315H 8618 SiS_SetCH701xForLCD(SiS_Pr); 8619 #endif 8620 } ··· 8627 8628 } 8629 8630 - #ifdef SIS300 8631 if(SiS_Pr->ChipType < SIS_315H) { 8632 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8633 if(SiS_Pr->SiS_UseOEM) { ··· 8650 } 8651 #endif 8652 8653 - #ifdef SIS315H 8654 if(SiS_Pr->ChipType >= SIS_315H) { 8655 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8656 if(SiS_Pr->ChipType < SIS_661) { ··· 8729 } 8730 } 8731 8732 - #ifdef SIS300 8733 static unsigned char * 8734 SiS_SetTrumpBlockLoop(struct SiS_Private *SiS_Pr, unsigned char *dataptr) 8735 { ··· 9456 9457 /* =============== SiS 315/330 O.E.M. ================= */ 9458 9459 - #ifdef SIS315H 9460 9461 static unsigned short 9462 GetRAMDACromptr(struct SiS_Private *SiS_Pr) ··· 10644 10645 /* ================= SiS 300 O.E.M. ================== */ 10646 10647 - #ifdef SIS300 10648 10649 static void 10650 SetOEMLCDData2(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex,
··· 75 76 #include "init301.h" 77 78 + #ifdef CONFIG_FB_SIS_300 79 #include "oem300.h" 80 #endif 81 82 + #ifdef CONFIG_FB_SIS_315 83 #include "oem310.h" 84 #endif 85 ··· 134 /* HELPER: Get Pointer to LCD structure */ 135 /*********************************************/ 136 137 + #ifdef CONFIG_FB_SIS_315 138 static unsigned char * 139 GetLCDStructPtr661(struct SiS_Private *SiS_Pr) 140 { ··· 400 /* HELPER: GET SOME DATA FROM BIOS ROM */ 401 /*********************************************/ 402 403 + #ifdef CONFIG_FB_SIS_300 404 static bool 405 SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) 406 { ··· 445 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); 446 } 447 448 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 449 static void 450 SiS_GenericDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 451 { ··· 453 } 454 #endif 455 456 + #ifdef CONFIG_FB_SIS_315 457 static void 458 SiS_LongDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 459 { ··· 463 } 464 #endif 465 466 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 467 static void 468 SiS_ShortDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 469 { ··· 476 static void 477 SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) 478 { 479 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 480 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 481 unsigned short PanelID, DelayIndex, Delay=0; 482 #endif 483 484 if(SiS_Pr->ChipType < SIS_315H) { 485 486 + #ifdef CONFIG_FB_SIS_300 487 488 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); 489 if(SiS_Pr->SiS_VBType & VB_SISVB) { ··· 509 } 510 SiS_ShortDelay(SiS_Pr, Delay); 511 512 + #endif /* CONFIG_FB_SIS_300 */ 513 514 } else { 515 516 + #ifdef CONFIG_FB_SIS_315 517 518 if((SiS_Pr->ChipType >= SIS_661) || 519 (SiS_Pr->ChipType <= SIS_315PRO) || ··· 575 576 } 577 578 + #endif /* CONFIG_FB_SIS_315 */ 579 580 } 581 } 582 583 + #ifdef CONFIG_FB_SIS_315 584 static void 585 SiS_PanelDelayLoop(struct SiS_Private *SiS_Pr, unsigned short DelayTime, unsigned short DelayLoop) 586 { ··· 609 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); 610 } 611 612 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 613 static void 614 SiS_WaitRetrace2(struct SiS_Private *SiS_Pr, unsigned short reg) 615 { ··· 626 SiS_WaitVBRetrace(struct SiS_Private *SiS_Pr) 627 { 628 if(SiS_Pr->ChipType < SIS_315H) { 629 + #ifdef CONFIG_FB_SIS_300 630 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 631 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; 632 } ··· 637 } 638 #endif 639 } else { 640 + #ifdef CONFIG_FB_SIS_315 641 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { 642 SiS_WaitRetrace1(SiS_Pr); 643 } else { ··· 682 /* HELPER: MISC */ 683 /*********************************************/ 684 685 + #ifdef CONFIG_FB_SIS_300 686 static bool 687 SiS_Is301B(struct SiS_Private *SiS_Pr) 688 { ··· 704 bool 705 SiS_IsDualEdge(struct SiS_Private *SiS_Pr) 706 { 707 + #ifdef CONFIG_FB_SIS_315 708 if(SiS_Pr->ChipType >= SIS_315H) { 709 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { 710 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; ··· 717 bool 718 SiS_IsVAMode(struct SiS_Private *SiS_Pr) 719 { 720 + #ifdef CONFIG_FB_SIS_315 721 unsigned short flag; 722 723 if(SiS_Pr->ChipType >= SIS_315H) { ··· 728 return false; 729 } 730 731 + #ifdef CONFIG_FB_SIS_315 732 static bool 733 SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) 734 { ··· 741 static bool 742 SiS_IsDualLink(struct SiS_Private *SiS_Pr) 743 { 744 + #ifdef CONFIG_FB_SIS_315 745 if(SiS_Pr->ChipType >= SIS_315H) { 746 if((SiS_CRT2IsLCD(SiS_Pr)) || 747 (SiS_IsVAMode(SiS_Pr))) { ··· 752 return false; 753 } 754 755 + #ifdef CONFIG_FB_SIS_315 756 static bool 757 SiS_TVEnabled(struct SiS_Private *SiS_Pr) 758 { ··· 764 } 765 #endif 766 767 + #ifdef CONFIG_FB_SIS_315 768 static bool 769 SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) 770 { ··· 773 } 774 #endif 775 776 + #ifdef CONFIG_FB_SIS_315 777 static bool 778 SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) 779 { ··· 784 } 785 #endif 786 787 + #ifdef CONFIG_FB_SIS_315 788 static bool 789 SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) 790 { ··· 800 } 801 #endif 802 803 + #ifdef CONFIG_FB_SIS_315 804 static bool 805 SiS_IsYPbPr(struct SiS_Private *SiS_Pr) 806 { ··· 812 } 813 #endif 814 815 + #ifdef CONFIG_FB_SIS_315 816 static bool 817 SiS_IsChScart(struct SiS_Private *SiS_Pr) 818 { ··· 824 } 825 #endif 826 827 + #ifdef CONFIG_FB_SIS_315 828 static bool 829 SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) 830 { ··· 844 } 845 #endif 846 847 + #ifdef CONFIG_FB_SIS_315 848 static bool 849 SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) 850 { ··· 910 /*********************************************/ 911 912 /* Setup general purpose IO for Chrontel communication */ 913 + #ifdef CONFIG_FB_SIS_300 914 void 915 SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo) 916 { ··· 961 tempax &= (DriverMode | LoadDACFlag | SetNotSimuMode | SetPALTV); 962 tempbx |= tempax; 963 964 + #ifdef CONFIG_FB_SIS_315 965 if(SiS_Pr->ChipType >= SIS_315H) { 966 if(SiS_Pr->SiS_VBType & VB_SISLCDA) { 967 if(ModeNo == 0x03) { ··· 1011 } 1012 } 1013 1014 + #endif /* CONFIG_FB_SIS_315 */ 1015 1016 if(!(SiS_Pr->SiS_VBType & VB_SISVGA2)) { 1017 tempbx &= ~(SetCRT2ToRAMDAC); ··· 1146 1147 SiS_Pr->SiS_VBInfo = tempbx; 1148 1149 + #ifdef CONFIG_FB_SIS_300 1150 if(SiS_Pr->ChipType == SIS_630) { 1151 SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); 1152 } ··· 1421 static void 1422 SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr) 1423 { 1424 + #ifdef CONFIG_FB_SIS_315 1425 unsigned char *ROMAddr; 1426 unsigned short temp; 1427 ··· 1471 { 1472 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; 1473 bool panelcanscale = false; 1474 + #ifdef CONFIG_FB_SIS_300 1475 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 1476 static const unsigned char SiS300SeriesLCDRes[] = 1477 { 0, 1, 2, 3, 7, 4, 5, 8, 1478 0, 0, 10, 0, 0, 0, 0, 15 }; 1479 #endif 1480 + #ifdef CONFIG_FB_SIS_315 1481 unsigned char *myptr = NULL; 1482 #endif 1483 ··· 1516 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; 1517 } 1518 temp &= 0x0f; 1519 + #ifdef CONFIG_FB_SIS_300 1520 if(SiS_Pr->ChipType < SIS_315H) { 1521 /* Very old BIOSes only know 7 sizes (NetVista 2179, 1.01g) */ 1522 if(SiS_Pr->SiS_VBType & VB_SIS301) { ··· 1528 #endif 1529 1530 /* Translate to our internal types */ 1531 + #ifdef CONFIG_FB_SIS_315 1532 if(SiS_Pr->ChipType == SIS_550) { 1533 if (temp == Panel310_1152x768) temp = Panel_320x240_2; /* Verified working */ 1534 else if(temp == Panel310_320x240_2) temp = Panel_320x240_2; ··· 1551 1552 SiS_Pr->SiS_LCDResInfo = temp; 1553 1554 + #ifdef CONFIG_FB_SIS_300 1555 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 1556 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { 1557 SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; ··· 1593 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; 1594 1595 /* Dual link, Pass 1:1 BIOS default, etc. */ 1596 + #ifdef CONFIG_FB_SIS_315 1597 if(SiS_Pr->ChipType >= SIS_661) { 1598 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 1599 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; ··· 2030 } 2031 } 2032 2033 + #ifdef CONFIG_FB_SIS_300 2034 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 2035 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { 2036 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ ··· 2306 VCLKIndex = SiS_Pr->PanelVCLKIdx315; 2307 } 2308 2309 + #ifdef CONFIG_FB_SIS_300 2310 /* Special Timing: Barco iQ Pro R series */ 2311 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; 2312 ··· 2369 { 2370 unsigned short i, j, modeflag, tempah=0; 2371 short tempcl; 2372 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 2373 unsigned short tempbl; 2374 #endif 2375 + #ifdef CONFIG_FB_SIS_315 2376 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2377 unsigned short tempah2, tempbl2; 2378 #endif ··· 2395 2396 if(SiS_Pr->ChipType < SIS_315H) { 2397 2398 + #ifdef CONFIG_FB_SIS_300 /* ---- 300 series ---- */ 2399 2400 /* For 301BDH: (with LCD via LVDS) */ 2401 if(SiS_Pr->SiS_VBType & VB_NoLCD) { ··· 2418 2419 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; 2420 2421 + #endif /* CONFIG_FB_SIS_300 */ 2422 2423 } else { 2424 2425 + #ifdef CONFIG_FB_SIS_315 /* ------- 315/330 series ------ */ 2426 2427 if(ModeNo > 0x13) { 2428 tempcl -= ModeVGA; ··· 2435 2436 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; 2437 2438 + #endif /* CONFIG_FB_SIS_315 */ 2439 2440 } 2441 ··· 2444 if(SiS_Pr->ChipType < SIS_315H) { 2445 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); 2446 } else { 2447 + #ifdef CONFIG_FB_SIS_315 2448 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 2449 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); 2450 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { ··· 2525 2526 if(SiS_Pr->ChipType >= SIS_315H) { 2527 2528 + #ifdef CONFIG_FB_SIS_315 2529 /* LVDS can only be slave in 8bpp modes */ 2530 tempah = 0x80; 2531 if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { ··· 2545 2546 } else { 2547 2548 + #ifdef CONFIG_FB_SIS_300 2549 tempah = 0; 2550 if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { 2551 tempah |= 0x02; ··· 2567 2568 if(SiS_Pr->ChipType >= SIS_315H) { 2569 2570 + #ifdef CONFIG_FB_SIS_315 2571 /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ 2572 2573 /* The following is nearly unpreditable and varies from machine ··· 2659 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); 2660 } 2661 2662 + #endif /* CONFIG_FB_SIS_315 */ 2663 2664 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 2665 2666 + #ifdef CONFIG_FB_SIS_300 2667 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); 2668 2669 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || ··· 2686 2687 } else { /* LVDS */ 2688 2689 + #ifdef CONFIG_FB_SIS_315 2690 if(SiS_Pr->ChipType >= SIS_315H) { 2691 2692 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { ··· 2872 } 2873 } 2874 2875 + #ifdef CONFIG_FB_SIS_315 2876 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { 2877 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { 2878 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { ··· 2977 case Panel_1280x1024: tempbx = 24; break; 2978 case Panel_1400x1050: tempbx = 26; break; 2979 case Panel_1600x1200: tempbx = 28; break; 2980 + #ifdef CONFIG_FB_SIS_300 2981 case Panel_Barco1366: tempbx = 80; break; 2982 #endif 2983 } ··· 2994 2995 if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 30; 2996 2997 + #ifdef CONFIG_FB_SIS_300 2998 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { 2999 tempbx = 82; 3000 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; ··· 3130 3131 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 3132 3133 + #ifdef CONFIG_FB_SIS_315 3134 SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 3135 SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); 3136 #endif ··· 3155 case 16: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; 3156 case 18: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; 3157 case 20: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; 3158 + #ifdef CONFIG_FB_SIS_300 3159 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; 3160 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; 3161 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; ··· 3189 (SiS_Pr->SiS_SetFlag & SetDOSMode) ) { 3190 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; 3191 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; 3192 + #ifdef CONFIG_FB_SIS_300 3193 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { 3194 if(ResIndex < 0x08) { 3195 SiS_Pr->SiS_HDE = 1280; ··· 3211 unsigned short resinfo, CRT2Index, ResIndex; 3212 const struct SiS_LCDData *LCDPtr = NULL; 3213 const struct SiS_TVData *TVPtr = NULL; 3214 + #ifdef CONFIG_FB_SIS_315 3215 short resinfo661; 3216 #endif 3217 ··· 3224 } else { 3225 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; 3226 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; 3227 + #ifdef CONFIG_FB_SIS_315 3228 resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; 3229 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && 3230 (SiS_Pr->SiS_SetFlag & LCDVESATiming) && ··· 3401 3402 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { 3403 3404 + #ifdef CONFIG_FB_SIS_315 3405 SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; 3406 SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; 3407 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); ··· 3461 case Panel_1680x1050 : 3462 case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; 3463 case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; 3464 + #ifdef CONFIG_FB_SIS_315 3465 case 200 : LCDPtr = SiS310_ExtCompaq1280x1024Data; break; 3466 case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; 3467 #endif ··· 3559 { 3560 const struct SiS_LVDSDes *PanelDesPtr = NULL; 3561 3562 + #ifdef CONFIG_FB_SIS_300 3563 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { 3564 3565 if(SiS_Pr->ChipType < SIS_315H) { ··· 3631 3632 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 3633 3634 + #ifdef CONFIG_FB_SIS_315 3635 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3636 /* non-pass 1:1 only, see above */ 3637 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { ··· 3706 } else { 3707 3708 if(SiS_Pr->ChipType < SIS_315H) { 3709 + #ifdef CONFIG_FB_SIS_300 3710 switch(SiS_Pr->SiS_LCDResInfo) { 3711 case Panel_800x600: 3712 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { ··· 3751 } 3752 #endif 3753 } else { 3754 + #ifdef CONFIG_FB_SIS_315 3755 switch(SiS_Pr->SiS_LCDResInfo) { 3756 case Panel_1024x768: 3757 case Panel_1280x1024: ··· 3779 if(SiS_Pr->ChipType < SIS_315H) { 3780 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; 3781 } else { 3782 + #ifdef CONFIG_FB_SIS_315 3783 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; 3784 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; 3785 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; ··· 3801 /* DISABLE VIDEO BRIDGE */ 3802 /*********************************************/ 3803 3804 + #ifdef CONFIG_FB_SIS_315 3805 static int 3806 SiS_HandlePWD(struct SiS_Private *SiS_Pr) 3807 { ··· 3839 void 3840 SiS_DisableBridge(struct SiS_Private *SiS_Pr) 3841 { 3842 + #ifdef CONFIG_FB_SIS_315 3843 unsigned short tempah, pushax=0, modenum; 3844 #endif 3845 unsigned short temp=0; ··· 3850 3851 if(SiS_Pr->ChipType < SIS_315H) { 3852 3853 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 3854 3855 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { 3856 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { ··· 3883 } 3884 } 3885 3886 + #endif /* CONFIG_FB_SIS_300 */ 3887 3888 } else { 3889 3890 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 3891 3892 int didpwd = 0; 3893 bool custom1 = (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || ··· 4011 4012 } 4013 4014 + #endif /* CONFIG_FB_SIS_315 */ 4015 4016 } 4017 4018 } else { /* ============ For 301 ================ */ 4019 4020 if(SiS_Pr->ChipType < SIS_315H) { 4021 + #ifdef CONFIG_FB_SIS_300 4022 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { 4023 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); 4024 SiS_PanelDelay(SiS_Pr, 3); ··· 4041 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); 4042 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); 4043 } else { 4044 + #ifdef CONFIG_FB_SIS_300 4045 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ 4046 if( (!(SiS_CRT2IsLCD(SiS_Pr))) || 4047 (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { ··· 4057 4058 if(SiS_Pr->ChipType < SIS_315H) { 4059 4060 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 4061 4062 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { 4063 SiS_SetCH700x(SiS_Pr,0x0E,0x09); ··· 4101 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); 4102 } 4103 4104 + #endif /* CONFIG_FB_SIS_300 */ 4105 4106 } else { 4107 4108 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 4109 4110 if(!(SiS_IsNotM650orLater(SiS_Pr))) { 4111 /*if(SiS_Pr->ChipType < SIS_340) { */ /* XGI needs this */ ··· 4218 } 4219 } 4220 4221 + #endif /* CONFIG_FB_SIS_315 */ 4222 4223 } /* 315 series */ 4224 ··· 4239 SiS_EnableBridge(struct SiS_Private *SiS_Pr) 4240 { 4241 unsigned short temp=0, tempah; 4242 + #ifdef CONFIG_FB_SIS_315 4243 unsigned short temp1, pushax=0; 4244 bool delaylong = false; 4245 #endif ··· 4250 4251 if(SiS_Pr->ChipType < SIS_315H) { 4252 4253 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 4254 4255 if(SiS_CRT2IsLCD(SiS_Pr)) { 4256 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { ··· 4313 } 4314 4315 4316 + #endif /* CONFIG_FB_SIS_300 */ 4317 4318 } else { 4319 4320 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 4321 4322 #ifdef SET_EMI 4323 unsigned char r30=0, r31=0, r32=0, r33=0, cr36=0; ··· 4616 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); 4617 } 4618 4619 + #endif /* CONFIG_FB_SIS_315 */ 4620 4621 } 4622 ··· 4667 4668 if(SiS_Pr->ChipType < SIS_315H) { 4669 4670 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 4671 4672 if(SiS_CRT2IsLCD(SiS_Pr)) { 4673 if(SiS_Pr->ChipType == SIS_730) { ··· 4711 } 4712 } 4713 4714 + #endif /* CONFIG_FB_SIS_300 */ 4715 4716 } else { 4717 4718 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 4719 4720 if(!(SiS_IsNotM650orLater(SiS_Pr))) { 4721 /*if(SiS_Pr->ChipType < SIS_340) {*/ /* XGI needs this */ ··· 4809 } 4810 } 4811 4812 + #endif /* CONFIG_FB_SIS_315 */ 4813 4814 } /* 310 series */ 4815 ··· 4899 4900 if(SiS_Pr->ChipType < SIS_315H) { 4901 4902 + #ifdef CONFIG_FB_SIS_300 /* ---- 300 series --- */ 4903 4904 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* 630 - 301B(-DH) */ 4905 ··· 4928 4929 } 4930 4931 + #endif /* CONFIG_FB_SIS_300 */ 4932 4933 } else { 4934 4935 + #ifdef CONFIG_FB_SIS_315 /* ------- 315 series ------ */ 4936 4937 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* 315 - LVDS */ 4938 ··· 5004 } 5005 5006 } 5007 + #endif /* CONFIG_FB_SIS_315 */ 5008 } 5009 } 5010 } 5011 5012 /* Set CRT2 FIFO on 300/540/630/730 */ 5013 + #ifdef CONFIG_FB_SIS_300 5014 static void 5015 SiS_SetCRT2FIFO_300(struct SiS_Private *SiS_Pr,unsigned short ModeNo) 5016 { ··· 5185 #endif 5186 5187 /* Set CRT2 FIFO on 315/330 series */ 5188 + #ifdef CONFIG_FB_SIS_315 5189 static void 5190 SiS_SetCRT2FIFO_310(struct SiS_Private *SiS_Pr) 5191 { ··· 5357 unsigned short push2, tempax, tempbx, tempcx, temp; 5358 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; 5359 bool islvds = false, issis = false, chkdclkfirst = false; 5360 + #ifdef CONFIG_FB_SIS_300 5361 unsigned short crt2crtc = 0; 5362 #endif 5363 + #ifdef CONFIG_FB_SIS_315 5364 unsigned short pushcx; 5365 #endif 5366 5367 if(ModeNo <= 0x13) { 5368 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; 5369 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; 5370 + #ifdef CONFIG_FB_SIS_300 5371 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; 5372 #endif 5373 } else if(SiS_Pr->UseCustomMode) { ··· 5375 } else { 5376 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; 5377 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; 5378 + #ifdef CONFIG_FB_SIS_300 5379 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; 5380 #endif 5381 } ··· 5396 } 5397 } 5398 5399 + #ifdef CONFIG_FB_SIS_315 5400 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 5401 if(IS_SIS330) { 5402 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); ··· 5646 5647 if(SiS_Pr->ChipType < SIS_315H) { 5648 5649 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 5650 tempeax = SiS_Pr->SiS_VGAVDE << 6; 5651 temp = (tempeax % (unsigned int)SiS_Pr->SiS_VDE); 5652 tempeax = tempeax / (unsigned int)SiS_Pr->SiS_VDE; ··· 5657 temp = (unsigned short)(tempeax & 0x00FF); 5658 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ 5659 tempvcfact = temp; 5660 + #endif /* CONFIG_FB_SIS_300 */ 5661 5662 } else { 5663 5664 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 5665 tempeax = SiS_Pr->SiS_VGAVDE << 18; 5666 tempebx = SiS_Pr->SiS_VDE; 5667 temp = (tempeax % tempebx); ··· 5747 temp = (unsigned short)(tempecx & 0x00FF); 5748 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); 5749 5750 + #ifdef CONFIG_FB_SIS_315 5751 if(SiS_Pr->ChipType >= SIS_315H) { 5752 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 5753 if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SISLVDS)) { ··· 5765 } 5766 #endif 5767 5768 + #ifdef CONFIG_FB_SIS_300 5769 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { 5770 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 5771 unsigned char *trumpdata; ··· 5801 } 5802 #endif 5803 5804 + #ifdef CONFIG_FB_SIS_315 5805 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { 5806 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); 5807 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); ··· 5901 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); 5902 } 5903 } 5904 + #endif /* CONFIG_FB_SIS_315 */ 5905 } 5906 5907 /* Set Part 1 */ ··· 5909 SiS_SetGroup1(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 5910 unsigned short RefreshRateTableIndex) 5911 { 5912 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 5913 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 5914 #endif 5915 unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; 5916 unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0; 5917 + #ifdef CONFIG_FB_SIS_315 5918 unsigned short tempbl=0; 5919 #endif 5920 ··· 5940 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { 5941 5942 if(SiS_Pr->ChipType < SIS_315H ) { 5943 + #ifdef CONFIG_FB_SIS_300 5944 SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo); 5945 #endif 5946 } else { 5947 + #ifdef CONFIG_FB_SIS_315 5948 SiS_SetCRT2FIFO_310(SiS_Pr); 5949 #endif 5950 } ··· 5953 5954 if(SiS_Pr->ChipType < SIS_315H ) { 5955 5956 + #ifdef CONFIG_FB_SIS_300 /* ------------- 300 series --------------*/ 5957 5958 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ 5959 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ ··· 5972 5973 bridgeadd = 12; 5974 5975 + #endif /* CONFIG_FB_SIS_300 */ 5976 5977 } else { 5978 5979 + #ifdef CONFIG_FB_SIS_315 /* ------------------- 315/330 series --------------- */ 5980 5981 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ 5982 if(modeflag & HalfDCLK) { ··· 6027 } 6028 } 6029 6030 + #endif /* CONFIG_FB_SIS_315 */ 6031 6032 } /* 315/330 series */ 6033 ··· 6158 6159 if(SiS_Pr->ChipType < SIS_315H) { 6160 6161 + #ifdef CONFIG_FB_SIS_300 /* ---------- 300 series -------------- */ 6162 6163 if(SiS_Pr->SiS_VBType & VB_SISVB) { 6164 temp = 0x20; ··· 6212 6213 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */ 6214 6215 + #endif /* CONFIG_FB_SIS_300 */ 6216 6217 } else { 6218 6219 + #ifdef CONFIG_FB_SIS_315 /* --------------- 315/330 series ---------------*/ 6220 6221 if(SiS_Pr->ChipType < SIS_661) { 6222 ··· 6251 if(modeflag & HalfDCLK) tempax |= 0x40; 6252 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); 6253 6254 + #endif /* CONFIG_FB_SIS_315 */ 6255 6256 } 6257 ··· 6283 /* SET PART 2 REGISTER GROUP */ 6284 /*********************************************/ 6285 6286 + #ifdef CONFIG_FB_SIS_315 6287 static unsigned char * 6288 SiS_GetGroup2CLVXPtr(struct SiS_Private *SiS_Pr, int tabletype) 6289 { ··· 6380 } 6381 #endif 6382 6383 + #ifdef CONFIG_FB_SIS_300 6384 static void 6385 SiS_Group2LCDSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short crt2crtc) 6386 { ··· 6592 unsigned int longtemp, PhaseIndex; 6593 bool newtvphase; 6594 const unsigned char *TimingPoint; 6595 + #ifdef CONFIG_FB_SIS_315 6596 unsigned short resindex, CRT2Index; 6597 const struct SiS_Part2PortTbl *CRT2Part2Ptr = NULL; 6598 ··· 6971 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); 6972 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); 6973 6974 + #ifdef CONFIG_FB_SIS_315 6975 if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, 6976 &CRT2Index, &resindex)) { 6977 switch(CRT2Index) { ··· 7093 7094 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); 7095 7096 + #ifdef CONFIG_FB_SIS_300 7097 SiS_Group2LCDSpecial(SiS_Pr, ModeNo, crt2crtc); 7098 #endif 7099 ··· 7176 7177 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); 7178 7179 + #ifdef CONFIG_FB_SIS_300 7180 SiS_Set300Part2Regs(SiS_Pr, ModeIdIndex, RefreshRateTableIndex, ModeNo); 7181 #endif 7182 + #ifdef CONFIG_FB_SIS_315 7183 } /* CRT2-LCD from table */ 7184 #endif 7185 } ··· 7248 /* SET PART 4 REGISTER GROUP */ 7249 /*********************************************/ 7250 7251 + #ifdef CONFIG_FB_SIS_315 7252 #if 0 7253 static void 7254 SiS_ShiftXPos(struct SiS_Private *SiS_Pr, int shift) ··· 7877 7878 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { 7879 7880 + #ifdef CONFIG_FB_SIS_300 7881 7882 /* Chrontel 7005 - I assume that it does not come with a 315 series chip */ 7883 ··· 7990 7991 /* Chrontel 7019 - assumed that it does not come with a 300 series chip */ 7992 7993 + #ifdef CONFIG_FB_SIS_315 7994 7995 unsigned short temp; 7996 ··· 8041 8042 } 8043 8044 + #ifdef CONFIG_FB_SIS_315 /* ----------- 315 series only ---------- */ 8045 8046 void 8047 SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr) ··· 8523 bool 8524 SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 8525 { 8526 + #ifdef CONFIG_FB_SIS_300 8527 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 8528 #endif 8529 unsigned short ModeIdIndex, RefreshRateTableIndex; ··· 8578 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8579 8580 SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8581 + #ifdef CONFIG_FB_SIS_315 8582 SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8583 #endif 8584 SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex); 8585 SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8586 + #ifdef CONFIG_FB_SIS_315 8587 SiS_SetGroup4_C_ELV(SiS_Pr, ModeNo, ModeIdIndex); 8588 #endif 8589 SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex); ··· 8614 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { 8615 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { 8616 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { 8617 + #ifdef CONFIG_FB_SIS_315 8618 SiS_SetCH701xForLCD(SiS_Pr); 8619 #endif 8620 } ··· 8627 8628 } 8629 8630 + #ifdef CONFIG_FB_SIS_300 8631 if(SiS_Pr->ChipType < SIS_315H) { 8632 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8633 if(SiS_Pr->SiS_UseOEM) { ··· 8650 } 8651 #endif 8652 8653 + #ifdef CONFIG_FB_SIS_315 8654 if(SiS_Pr->ChipType >= SIS_315H) { 8655 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8656 if(SiS_Pr->ChipType < SIS_661) { ··· 8729 } 8730 } 8731 8732 + #ifdef CONFIG_FB_SIS_300 8733 static unsigned char * 8734 SiS_SetTrumpBlockLoop(struct SiS_Private *SiS_Pr, unsigned char *dataptr) 8735 { ··· 9456 9457 /* =============== SiS 315/330 O.E.M. ================= */ 9458 9459 + #ifdef CONFIG_FB_SIS_315 9460 9461 static unsigned short 9462 GetRAMDACromptr(struct SiS_Private *SiS_Pr) ··· 10644 10645 /* ================= SiS 300 O.E.M. ================== */ 10646 10647 + #ifdef CONFIG_FB_SIS_300 10648 10649 static void 10650 SetOEMLCDData2(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex,
+7 -7
drivers/video/sis/init301.h
··· 230 0xFF,0xFF, 231 }; 232 233 - #ifdef SIS315H 234 /* 661 et al LCD data structure (2.03.00) */ 235 static const unsigned char SiS_LCDStruct661[] = { 236 /* 1024x768 */ ··· 272 }; 273 #endif 274 275 - #ifdef SIS300 276 static unsigned char SiS300_TrumpionData[14][80] = { 277 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 278 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23, ··· 375 unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 376 void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 377 unsigned char orval,unsigned short andval); 378 - #ifdef SIS315H 379 static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr); 380 static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr); 381 static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr); ··· 384 void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 385 #endif /* 315 */ 386 387 - #ifdef SIS300 388 static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr); 389 void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 390 #endif ··· 415 static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno); 416 static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr); 417 418 - #ifdef SIS300 419 static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr, 420 unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefTabindex); 421 static void SetOEMLCDData2(struct SiS_Private *SiS_Pr, 422 unsigned short ModeNo, unsigned short ModeIdIndex,unsigned short RefTableIndex); 423 #endif 424 - #ifdef SIS315H 425 static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr, 426 unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 427 static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr, ··· 456 extern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 457 extern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 458 extern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 459 - #ifdef SIS300 460 extern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *tempbx, 461 unsigned short *tempcl); 462 extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl);
··· 230 0xFF,0xFF, 231 }; 232 233 + #ifdef CONFIG_FB_SIS_315 234 /* 661 et al LCD data structure (2.03.00) */ 235 static const unsigned char SiS_LCDStruct661[] = { 236 /* 1024x768 */ ··· 272 }; 273 #endif 274 275 + #ifdef CONFIG_FB_SIS_300 276 static unsigned char SiS300_TrumpionData[14][80] = { 277 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 278 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23, ··· 375 unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 376 void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 377 unsigned char orval,unsigned short andval); 378 + #ifdef CONFIG_FB_SIS_315 379 static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr); 380 static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr); 381 static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr); ··· 384 void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 385 #endif /* 315 */ 386 387 + #ifdef CONFIG_FB_SIS_300 388 static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr); 389 void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 390 #endif ··· 415 static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno); 416 static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr); 417 418 + #ifdef CONFIG_FB_SIS_300 419 static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr, 420 unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefTabindex); 421 static void SetOEMLCDData2(struct SiS_Private *SiS_Pr, 422 unsigned short ModeNo, unsigned short ModeIdIndex,unsigned short RefTableIndex); 423 #endif 424 + #ifdef CONFIG_FB_SIS_315 425 static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr, 426 unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 427 static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr, ··· 456 extern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 457 extern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 458 extern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 459 + #ifdef CONFIG_FB_SIS_300 460 extern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *tempbx, 461 unsigned short *tempcl); 462 extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl);
+3 -3
drivers/video/sis/initextlfb.c
··· 59 60 if(rateindex > 0) rateindex--; 61 62 - #ifdef SIS315H 63 switch(ModeNo) { 64 case 0x5a: ModeNo = 0x50; break; 65 case 0x5b: ModeNo = 0x56; ··· 103 104 if(rateindex > 0) rateindex--; 105 106 - #ifdef SIS315H 107 switch(ModeNo) { 108 case 0x5a: ModeNo = 0x50; break; 109 case 0x5b: ModeNo = 0x56; ··· 187 188 if(rateindex > 0) rateindex--; 189 190 - #ifdef SIS315H 191 switch(ModeNo) { 192 case 0x5a: ModeNo = 0x50; break; 193 case 0x5b: ModeNo = 0x56;
··· 59 60 if(rateindex > 0) rateindex--; 61 62 + #ifdef CONFIG_FB_SIS_315 63 switch(ModeNo) { 64 case 0x5a: ModeNo = 0x50; break; 65 case 0x5b: ModeNo = 0x56; ··· 103 104 if(rateindex > 0) rateindex--; 105 106 + #ifdef CONFIG_FB_SIS_315 107 switch(ModeNo) { 108 case 0x5a: ModeNo = 0x50; break; 109 case 0x5b: ModeNo = 0x56; ··· 187 188 if(rateindex > 0) rateindex--; 189 190 + #ifdef CONFIG_FB_SIS_315 191 switch(ModeNo) { 192 case 0x5a: ModeNo = 0x50; break; 193 case 0x5b: ModeNo = 0x56;
+1 -9
drivers/video/sis/osdef.h
··· 82 /* LINUX KERNEL */ 83 /**********************************************************************/ 84 85 - #ifdef CONFIG_FB_SIS_300 86 - #define SIS300 87 - #endif 88 - 89 - #ifdef CONFIG_FB_SIS_315 90 - #define SIS315H 91 - #endif 92 - 93 - #if !defined(SIS300) && !defined(SIS315H) 94 #warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set 95 #warning sisfb will not work! 96 #endif
··· 82 /* LINUX KERNEL */ 83 /**********************************************************************/ 84 85 + #if !defined(CONFIG_FB_SIS_300) && !defined(CONFIG_FB_SIS_315) 86 #warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set 87 #warning sisfb will not work! 88 #endif