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