aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sis
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2010-11-19 16:58:46 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-11-24 02:02:51 -0500
commitb6c30ca6136c6c6900a086b6b843f738a588a2f3 (patch)
treef8f405758c94f330393cff45d679d48f1132c229 /drivers/video/sis
parente7d828ab91c95e9fdc85f5167f236a8c85fb2445 (diff)
sisfb: delete redudant #define SIS_LINUX_KERNEL
It's not needed anymore with SIS_XORG_XF86 gone. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/sis')
-rw-r--r--drivers/video/sis/init.c50
-rw-r--r--drivers/video/sis/init.h14
-rw-r--r--drivers/video/sis/init301.c23
-rw-r--r--drivers/video/sis/init301.h14
-rw-r--r--drivers/video/sis/osdef.h7
-rw-r--r--drivers/video/sis/vgatypes.h2
-rw-r--r--drivers/video/sis/vstruct.h6
7 files changed, 0 insertions, 116 deletions
diff --git a/drivers/video/sis/init.c b/drivers/video/sis/init.c
index 53e30ea56507..5634dfb46624 100644
--- a/drivers/video/sis/init.c
+++ b/drivers/video/sis/init.c
@@ -1150,9 +1150,7 @@ SiSInitPCIetc(struct SiS_Private *SiS_Pr)
1150/* HELPER: SetLVDSetc */ 1150/* HELPER: SetLVDSetc */
1151/*********************************************/ 1151/*********************************************/
1152 1152
1153#ifdef SIS_LINUX_KERNEL
1154static 1153static
1155#endif
1156void 1154void
1157SiSSetLVDSetc(struct SiS_Private *SiS_Pr) 1155SiSSetLVDSetc(struct SiS_Private *SiS_Pr)
1158{ 1156{
@@ -1418,9 +1416,7 @@ SiS_ResetSegmentRegisters(struct SiS_Private *SiS_Pr)
1418/* HELPER: GetVBType */ 1416/* HELPER: GetVBType */
1419/*********************************************/ 1417/*********************************************/
1420 1418
1421#ifdef SIS_LINUX_KERNEL
1422static 1419static
1423#endif
1424void 1420void
1425SiS_GetVBType(struct SiS_Private *SiS_Pr) 1421SiS_GetVBType(struct SiS_Private *SiS_Pr)
1426{ 1422{
@@ -1485,7 +1481,6 @@ SiS_GetVBType(struct SiS_Private *SiS_Pr)
1485/* HELPER: Check RAM size */ 1481/* HELPER: Check RAM size */
1486/*********************************************/ 1482/*********************************************/
1487 1483
1488#ifdef SIS_LINUX_KERNEL
1489static bool 1484static bool
1490SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1485SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1491 unsigned short ModeIdIndex) 1486 unsigned short ModeIdIndex)
@@ -1499,7 +1494,6 @@ SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1499 if(AdapterMemSize < memorysize) return false; 1494 if(AdapterMemSize < memorysize) return false;
1500 return true; 1495 return true;
1501} 1496}
1502#endif
1503 1497
1504/*********************************************/ 1498/*********************************************/
1505/* HELPER: Get DRAM type */ 1499/* HELPER: Get DRAM type */
@@ -1572,7 +1566,6 @@ SiS_GetMCLK(struct SiS_Private *SiS_Pr)
1572/* HELPER: ClearBuffer */ 1566/* HELPER: ClearBuffer */
1573/*********************************************/ 1567/*********************************************/
1574 1568
1575#ifdef SIS_LINUX_KERNEL
1576static void 1569static void
1577SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 1570SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
1578{ 1571{
@@ -1597,7 +1590,6 @@ SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
1597 SiS_SetMemory(memaddr, 0x8000, 0); 1590 SiS_SetMemory(memaddr, 0x8000, 0);
1598 } 1591 }
1599} 1592}
1600#endif
1601 1593
1602/*********************************************/ 1594/*********************************************/
1603/* HELPER: SearchModeID */ 1595/* HELPER: SearchModeID */
@@ -2504,11 +2496,7 @@ SiS_SetCRT1FIFO_630(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
2504 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data); 2496 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data);
2505 2497
2506 /* Write foreground and background queue */ 2498 /* Write foreground and background queue */
2507#ifdef SIS_LINUX_KERNEL
2508 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); 2499 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50);
2509#else
2510 templ = pciReadLong(0x00000000, 0x50);
2511#endif
2512 2500
2513 if(SiS_Pr->ChipType == SIS_730) { 2501 if(SiS_Pr->ChipType == SIS_730) {
2514 2502
@@ -2528,13 +2516,8 @@ SiS_SetCRT1FIFO_630(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
2528 2516
2529 } 2517 }
2530 2518
2531#ifdef SIS_LINUX_KERNEL
2532 sisfb_write_nbridge_pci_dword(SiS_Pr, 0x50, templ); 2519 sisfb_write_nbridge_pci_dword(SiS_Pr, 0x50, templ);
2533 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xA0); 2520 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xA0);
2534#else
2535 pciWriteLong(0x00000000, 0x50, templ);
2536 templ = pciReadLong(0x00000000, 0xA0);
2537#endif
2538 2521
2539 /* GUI grant timer (PCI config 0xA3) */ 2522 /* GUI grant timer (PCI config 0xA3) */
2540 if(SiS_Pr->ChipType == SIS_730) { 2523 if(SiS_Pr->ChipType == SIS_730) {
@@ -2550,11 +2533,7 @@ SiS_SetCRT1FIFO_630(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
2550 2533
2551 } 2534 }
2552 2535
2553#ifdef SIS_LINUX_KERNEL
2554 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ); 2536 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ);
2555#else
2556 pciWriteLong(0x00000000, 0xA0, templ);
2557#endif
2558} 2537}
2559#endif /* SIS300 */ 2538#endif /* SIS300 */
2560 2539
@@ -3063,11 +3042,9 @@ SiS_SetCRT1Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sho
3063 3042
3064 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); 3043 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex);
3065 3044
3066#ifdef SIS_LINUX_KERNEL
3067 if(SiS_Pr->SiS_flag_clearbuffer) { 3045 if(SiS_Pr->SiS_flag_clearbuffer) {
3068 SiS_ClearBuffer(SiS_Pr, ModeNo); 3046 SiS_ClearBuffer(SiS_Pr, ModeNo);
3069 } 3047 }
3070#endif
3071 3048
3072 if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) { 3049 if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) {
3073 SiS_WaitRetrace1(SiS_Pr); 3050 SiS_WaitRetrace1(SiS_Pr);
@@ -3163,11 +3140,7 @@ SiS_Handle760(struct SiS_Private *SiS_Pr)
3163 (!(SiS_Pr->SiS_SysFlags & SF_760UMA)) ) 3140 (!(SiS_Pr->SiS_SysFlags & SF_760UMA)) )
3164 return; 3141 return;
3165 3142
3166#ifdef SIS_LINUX_KERNEL
3167 somebase = sisfb_read_mio_pci_word(SiS_Pr, 0x74); 3143 somebase = sisfb_read_mio_pci_word(SiS_Pr, 0x74);
3168#else
3169 somebase = pciReadWord(0x00001000, 0x74);
3170#endif
3171 somebase &= 0xffff; 3144 somebase &= 0xffff;
3172 3145
3173 if(somebase == 0) return; 3146 if(somebase == 0) return;
@@ -3183,13 +3156,8 @@ SiS_Handle760(struct SiS_Private *SiS_Pr)
3183 temp2 = 0x0b; 3156 temp2 = 0x0b;
3184 } 3157 }
3185 3158
3186#ifdef SIS_LINUX_KERNEL
3187 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x7e, temp1); 3159 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x7e, temp1);
3188 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x8d, temp2); 3160 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x8d, temp2);
3189#else
3190 pciWriteByte(0x00000000, 0x7e, temp1);
3191 pciWriteByte(0x00000000, 0x8d, temp2);
3192#endif
3193 3161
3194 SiS_SetRegByte((somebase + 0x85), temp3); 3162 SiS_SetRegByte((somebase + 0x85), temp3);
3195#endif 3163#endif
@@ -3205,21 +3173,17 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3205 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3173 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress;
3206 unsigned short RealModeNo, ModeIdIndex; 3174 unsigned short RealModeNo, ModeIdIndex;
3207 unsigned char backupreg = 0; 3175 unsigned char backupreg = 0;
3208#ifdef SIS_LINUX_KERNEL
3209 unsigned short KeepLockReg; 3176 unsigned short KeepLockReg;
3210 3177
3211 SiS_Pr->UseCustomMode = false; 3178 SiS_Pr->UseCustomMode = false;
3212 SiS_Pr->CRT1UsesCustomMode = false; 3179 SiS_Pr->CRT1UsesCustomMode = false;
3213#endif
3214 3180
3215 SiS_Pr->SiS_flag_clearbuffer = 0; 3181 SiS_Pr->SiS_flag_clearbuffer = 0;
3216 3182
3217 if(SiS_Pr->UseCustomMode) { 3183 if(SiS_Pr->UseCustomMode) {
3218 ModeNo = 0xfe; 3184 ModeNo = 0xfe;
3219 } else { 3185 } else {
3220#ifdef SIS_LINUX_KERNEL
3221 if(!(ModeNo & 0x80)) SiS_Pr->SiS_flag_clearbuffer = 1; 3186 if(!(ModeNo & 0x80)) SiS_Pr->SiS_flag_clearbuffer = 1;
3222#endif
3223 ModeNo &= 0x7f; 3187 ModeNo &= 0x7f;
3224 } 3188 }
3225 3189
@@ -3233,9 +3197,7 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3233 3197
3234 SiS_Pr->SiS_VGAINFO = 0x11; 3198 SiS_Pr->SiS_VGAINFO = 0x11;
3235 3199
3236#ifdef SIS_LINUX_KERNEL
3237 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); 3200 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
3238#endif
3239 SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3201 SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
3240 3202
3241 SiSInitPCIetc(SiS_Pr); 3203 SiSInitPCIetc(SiS_Pr);
@@ -3272,12 +3234,10 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3272 SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3234 SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex);
3273 SiS_SetLowModeTest(SiS_Pr, ModeNo); 3235 SiS_SetLowModeTest(SiS_Pr, ModeNo);
3274 3236
3275#ifdef SIS_LINUX_KERNEL
3276 /* Check memory size (kernel framebuffer driver only) */ 3237 /* Check memory size (kernel framebuffer driver only) */
3277 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) { 3238 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) {
3278 return false; 3239 return false;
3279 } 3240 }
3280#endif
3281 3241
3282 SiS_OpenCRTC(SiS_Pr); 3242 SiS_OpenCRTC(SiS_Pr);
3283 3243
@@ -3356,10 +3316,8 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3356 3316
3357 SiS_Handle760(SiS_Pr); 3317 SiS_Handle760(SiS_Pr);
3358 3318
3359#ifdef SIS_LINUX_KERNEL
3360 /* We never lock registers in XF86 */ 3319 /* We never lock registers in XF86 */
3361 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00); 3320 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00);
3362#endif
3363 3321
3364 return true; 3322 return true;
3365} 3323}
@@ -3581,9 +3539,7 @@ SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
3581void 3539void
3582SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, 3540SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
3583 int xres, int yres, 3541 int xres, int yres,
3584#ifdef SIS_LINUX_KERNEL
3585 struct fb_var_screeninfo *var, bool writeres 3542 struct fb_var_screeninfo *var, bool writeres
3586#endif
3587) 3543)
3588{ 3544{
3589 unsigned short HRE, HBE, HRS, HBS, HDE, HT; 3545 unsigned short HRE, HBE, HRS, HBS, HDE, HT;
@@ -3627,12 +3583,10 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
3627 3583
3628 D = B - F - C; 3584 D = B - F - C;
3629 3585
3630#ifdef SIS_LINUX_KERNEL
3631 if(writeres) var->xres = xres = E * 8; 3586 if(writeres) var->xres = xres = E * 8;
3632 var->left_margin = D * 8; 3587 var->left_margin = D * 8;
3633 var->right_margin = F * 8; 3588 var->right_margin = F * 8;
3634 var->hsync_len = C * 8; 3589 var->hsync_len = C * 8;
3635#endif
3636 3590
3637 /* Vertical */ 3591 /* Vertical */
3638 sr_data = crdata[13]; 3592 sr_data = crdata[13];
@@ -3679,12 +3633,10 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
3679 3633
3680 D = B - F - C; 3634 D = B - F - C;
3681 3635
3682#ifdef SIS_LINUX_KERNEL
3683 if(writeres) var->yres = yres = E; 3636 if(writeres) var->yres = yres = E;
3684 var->upper_margin = D; 3637 var->upper_margin = D;
3685 var->lower_margin = F; 3638 var->lower_margin = F;
3686 var->vsync_len = C; 3639 var->vsync_len = C;
3687#endif
3688 3640
3689 if((xres == 320) && ((yres == 200) || (yres == 240))) { 3641 if((xres == 320) && ((yres == 200) || (yres == 240))) {
3690 /* Terrible hack, but correct CRTC data for 3642 /* Terrible hack, but correct CRTC data for
@@ -3693,11 +3645,9 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
3693 * a negative D. The CRT controller does not 3645 * a negative D. The CRT controller does not
3694 * seem to like correcting HRE to 50) 3646 * seem to like correcting HRE to 50)
3695 */ 3647 */
3696#ifdef SIS_LINUX_KERNEL
3697 var->left_margin = (400 - 376); 3648 var->left_margin = (400 - 376);
3698 var->right_margin = (328 - 320); 3649 var->right_margin = (328 - 320);
3699 var->hsync_len = (376 - 328); 3650 var->hsync_len = (376 - 328);
3700#endif
3701 3651
3702 } 3652 }
3703 3653
diff --git a/drivers/video/sis/init.h b/drivers/video/sis/init.h
index 4a75c73e134a..1d54759a49d4 100644
--- a/drivers/video/sis/init.h
+++ b/drivers/video/sis/init.h
@@ -56,7 +56,6 @@
56#include "osdef.h" 56#include "osdef.h"
57#include "initdef.h" 57#include "initdef.h"
58 58
59#ifdef SIS_LINUX_KERNEL
60#include "vgatypes.h" 59#include "vgatypes.h"
61#include "vstruct.h" 60#include "vstruct.h"
62#ifdef SIS_CP 61#ifdef SIS_CP
@@ -67,7 +66,6 @@
67#include <linux/fb.h> 66#include <linux/fb.h>
68#include "sis.h" 67#include "sis.h"
69#include <video/sisfb.h> 68#include <video/sisfb.h>
70#endif
71 69
72/* Mode numbers */ 70/* Mode numbers */
73static const unsigned short ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f}; 71static const unsigned short ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f};
@@ -1535,17 +1533,11 @@ void SiS_SetRegOR(SISIOADDRESS Port,unsigned short Index, unsigned short DataOR
1535void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 1533void SiS_DisplayOn(struct SiS_Private *SiS_Pr);
1536void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 1534void SiS_DisplayOff(struct SiS_Private *SiS_Pr);
1537void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 1535void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
1538#ifndef SIS_LINUX_KERNEL
1539void SiSSetLVDSetc(struct SiS_Private *SiS_Pr);
1540#endif
1541void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 1536void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable);
1542void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 1537void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable);
1543unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1538unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1544 unsigned short ModeIdIndex); 1539 unsigned short ModeIdIndex);
1545bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 1540bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr);
1546#ifndef SIS_LINUX_KERNEL
1547void SiS_GetVBType(struct SiS_Private *SiS_Pr);
1548#endif
1549 1541
1550bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 1542bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
1551 unsigned short *ModeIdIndex); 1543 unsigned short *ModeIdIndex);
@@ -1564,16 +1556,12 @@ unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2
1564unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1556unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index);
1565#endif 1557#endif
1566void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1558void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
1567#ifdef SIS_LINUX_KERNEL
1568bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1559bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
1569#endif
1570void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1560void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth);
1571void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1561void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1572 unsigned short ModeIdIndex); 1562 unsigned short ModeIdIndex);
1573#ifdef SIS_LINUX_KERNEL
1574void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1563void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres,
1575 int yres, struct fb_var_screeninfo *var, bool writeres); 1564 int yres, struct fb_var_screeninfo *var, bool writeres);
1576#endif
1577 1565
1578/* From init301.c: */ 1566/* From init301.c: */
1579extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1567extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
@@ -1597,7 +1585,6 @@ extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short
1597extern bool SiS_IsVAMode(struct SiS_Private *); 1585extern bool SiS_IsVAMode(struct SiS_Private *);
1598extern bool SiS_IsDualEdge(struct SiS_Private *); 1586extern bool SiS_IsDualEdge(struct SiS_Private *);
1599 1587
1600#ifdef SIS_LINUX_KERNEL
1601#ifdef SIS300 1588#ifdef SIS300
1602extern 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);
1603extern 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,
@@ -1608,7 +1595,6 @@ extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg,
1608 unsigned char val); 1595 unsigned char val);
1609extern 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);
1610#endif 1597#endif
1611#endif
1612 1598
1613#endif 1599#endif
1614 1600
diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index a4b344e2dea1..78055f610907 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -87,9 +87,7 @@
87#define SiS_I2CDELAYSHORT 150 87#define SiS_I2CDELAYSHORT 150
88 88
89static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr); 89static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr);
90#ifdef SIS_LINUX_KERNEL
91static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 90static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
92#endif
93 91
94/*********************************************/ 92/*********************************************/
95/* HELPER: Lock/Unlock CRT2 */ 93/* HELPER: Lock/Unlock CRT2 */
@@ -106,9 +104,7 @@ SiS_UnLockCRT2(struct SiS_Private *SiS_Pr)
106 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); 104 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01);
107} 105}
108 106
109#ifdef SIS_LINUX_KERNEL
110static 107static
111#endif
112void 108void
113SiS_LockCRT2(struct SiS_Private *SiS_Pr) 109SiS_LockCRT2(struct SiS_Private *SiS_Pr)
114{ 110{
@@ -923,11 +919,7 @@ SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo)
923 919
924 if(!(SiS_Pr->SiS_ChSW)) return; 920 if(!(SiS_Pr->SiS_ChSW)) return;
925 921
926#ifdef SIS_LINUX_KERNEL
927 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); 922 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74);
928#else
929 acpibase = pciReadLong(0x00000800, 0x74);
930#endif
931 acpibase &= 0xFFFF; 923 acpibase &= 0xFFFF;
932 if(!acpibase) return; 924 if(!acpibase) return;
933 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ 925 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */
@@ -1160,12 +1152,10 @@ SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1160 } 1152 }
1161#endif 1153#endif
1162 1154
1163#ifdef SIS_LINUX_KERNEL
1164#if 0 1155#if 0
1165 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n", 1156 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n",
1166 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1157 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag);
1167#endif 1158#endif
1168#endif
1169} 1159}
1170 1160
1171/*********************************************/ 1161/*********************************************/
@@ -2150,12 +2140,10 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
2150 SiS_Pr->SiS_SetFlag |= LCDVESATiming; 2140 SiS_Pr->SiS_SetFlag |= LCDVESATiming;
2151 } 2141 }
2152 2142
2153#ifdef SIS_LINUX_KERNEL
2154#if 0 2143#if 0
2155 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n", 2144 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n",
2156 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); 2145 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo);
2157#endif 2146#endif
2158#endif
2159} 2147}
2160 2148
2161/*********************************************/ 2149/*********************************************/
@@ -4246,9 +4234,7 @@ SiS_DisableBridge(struct SiS_Private *SiS_Pr)
4246 * from outside the context of a mode switch! 4234 * from outside the context of a mode switch!
4247 * MUST call getVBType before calling this 4235 * MUST call getVBType before calling this
4248 */ 4236 */
4249#ifdef SIS_LINUX_KERNEL
4250static 4237static
4251#endif
4252void 4238void
4253SiS_EnableBridge(struct SiS_Private *SiS_Pr) 4239SiS_EnableBridge(struct SiS_Private *SiS_Pr)
4254{ 4240{
@@ -5096,13 +5082,8 @@ SiS_SetCRT2FIFO_300(struct SiS_Private *SiS_Pr,unsigned short ModeNo)
5096 5082
5097 } else { 5083 } else {
5098 5084
5099#ifdef SIS_LINUX_KERNEL
5100 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); 5085 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50);
5101 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); 5086 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0);
5102#else
5103 pci50 = pciReadLong(0x00000000, 0x50);
5104 pciA0 = pciReadLong(0x00000000, 0xA0);
5105#endif
5106 5087
5107 if(SiS_Pr->ChipType == SIS_730) { 5088 if(SiS_Pr->ChipType == SIS_730) {
5108 5089
@@ -8872,9 +8853,7 @@ SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val)
8872 SiS_SetChReg(SiS_Pr, reg, val, 0); 8853 SiS_SetChReg(SiS_Pr, reg, val, 0);
8873} 8854}
8874 8855
8875#ifdef SIS_LINUX_KERNEL
8876static 8856static
8877#endif
8878void 8857void
8879SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) 8858SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val)
8880{ 8859{
@@ -8961,9 +8940,7 @@ SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempbx)
8961 8940
8962/* Read from Chrontel 70xx */ 8941/* Read from Chrontel 70xx */
8963/* Parameter is [Register no (S7-S0)] */ 8942/* Parameter is [Register no (S7-S0)] */
8964#ifdef SIS_LINUX_KERNEL
8965static 8943static
8966#endif
8967unsigned short 8944unsigned short
8968SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempbx) 8945SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempbx)
8969{ 8946{
diff --git a/drivers/video/sis/init301.h b/drivers/video/sis/init301.h
index c379dc7a9973..31e24ae6c6e6 100644
--- a/drivers/video/sis/init301.h
+++ b/drivers/video/sis/init301.h
@@ -56,7 +56,6 @@
56#include "osdef.h" 56#include "osdef.h"
57#include "initdef.h" 57#include "initdef.h"
58 58
59#ifdef SIS_LINUX_KERNEL
60#include "vgatypes.h" 59#include "vgatypes.h"
61#include "vstruct.h" 60#include "vstruct.h"
62#ifdef SIS_CP 61#ifdef SIS_CP
@@ -67,7 +66,6 @@
67#include <linux/fb.h> 66#include <linux/fb.h>
68#include "sis.h" 67#include "sis.h"
69#include <video/sisfb.h> 68#include <video/sisfb.h>
70#endif
71 69
72static const unsigned char SiS_YPbPrTable[3][64] = { 70static const unsigned char SiS_YPbPrTable[3][64] = {
73 { 71 {
@@ -351,9 +349,6 @@ static unsigned char SiS300_TrumpionData[14][80] = {
351#endif 349#endif
352 350
353void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 351void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr);
354#ifndef SIS_LINUX_KERNEL
355void SiS_LockCRT2(struct SiS_Private *SiS_Pr);
356#endif
357void SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 352void SiS_EnableCRT2(struct SiS_Private *SiS_Pr);
358unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 353unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
359void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 354void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr);
@@ -370,9 +365,6 @@ unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo
370 unsigned short RefreshRateTableIndex); 365 unsigned short RefreshRateTableIndex);
371unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex); 366unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex);
372void SiS_DisableBridge(struct SiS_Private *SiS_Pr); 367void SiS_DisableBridge(struct SiS_Private *SiS_Pr);
373#ifndef SIS_LINUX_KERNEL
374void SiS_EnableBridge(struct SiS_Private *SiS_Pr);
375#endif
376bool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 368bool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
377void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 369void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr);
378void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); 370void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr);
@@ -381,10 +373,6 @@ void SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned cha
381unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 373unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax);
382void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 374void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
383unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 375unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax);
384#ifndef SIS_LINUX_KERNEL
385void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
386unsigned short SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempax);
387#endif
388void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 376void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg,
389 unsigned char orval,unsigned short andval); 377 unsigned char orval,unsigned short andval);
390#ifdef SIS315H 378#ifdef SIS315H
@@ -473,10 +461,8 @@ extern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned s
473 unsigned short *tempcl); 461 unsigned short *tempcl);
474extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl); 462extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl);
475extern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 463extern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index);
476#ifdef SIS_LINUX_KERNEL
477extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 464extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg);
478extern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 465extern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg);
479#endif 466#endif
480#endif
481 467
482#endif 468#endif
diff --git a/drivers/video/sis/osdef.h b/drivers/video/sis/osdef.h
index e24d21a7ae4b..bc185a9a4d84 100644
--- a/drivers/video/sis/osdef.h
+++ b/drivers/video/sis/osdef.h
@@ -54,9 +54,6 @@
54#ifndef _SIS_OSDEF_H_ 54#ifndef _SIS_OSDEF_H_
55#define _SIS_OSDEF_H_ 55#define _SIS_OSDEF_H_
56 56
57/* The choices are: */
58#define SIS_LINUX_KERNEL /* Linux kernel framebuffer */
59
60#ifdef OutPortByte 57#ifdef OutPortByte
61#undef OutPortByte 58#undef OutPortByte
62#endif 59#endif
@@ -85,8 +82,6 @@
85/* LINUX KERNEL */ 82/* LINUX KERNEL */
86/**********************************************************************/ 83/**********************************************************************/
87 84
88#ifdef SIS_LINUX_KERNEL
89
90#ifdef CONFIG_FB_SIS_300 85#ifdef CONFIG_FB_SIS_300
91#define SIS300 86#define SIS300
92#endif 87#endif
@@ -108,6 +103,4 @@
108#define InPortLong(p) inl((SISIOADDRESS)(p)) 103#define InPortLong(p) inl((SISIOADDRESS)(p))
109#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize) 104#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize)
110 105
111#endif /* LINUX_KERNEL */
112
113#endif /* _OSDEF_H_ */ 106#endif /* _OSDEF_H_ */
diff --git a/drivers/video/sis/vgatypes.h b/drivers/video/sis/vgatypes.h
index f499062bba94..12c0dfaf2518 100644
--- a/drivers/video/sis/vgatypes.h
+++ b/drivers/video/sis/vgatypes.h
@@ -55,12 +55,10 @@
55 55
56#define SISIOMEMTYPE 56#define SISIOMEMTYPE
57 57
58#ifdef SIS_LINUX_KERNEL
59typedef unsigned long SISIOADDRESS; 58typedef unsigned long SISIOADDRESS;
60#include <linux/types.h> /* Need __iomem */ 59#include <linux/types.h> /* Need __iomem */
61#undef SISIOMEMTYPE 60#undef SISIOMEMTYPE
62#define SISIOMEMTYPE __iomem 61#define SISIOMEMTYPE __iomem
63#endif
64 62
65typedef enum _SIS_CHIP_TYPE { 63typedef enum _SIS_CHIP_TYPE {
66 SIS_VGALegacy = 0, 64 SIS_VGALegacy = 0,
diff --git a/drivers/video/sis/vstruct.h b/drivers/video/sis/vstruct.h
index a860039c1122..ea94d214dcff 100644
--- a/drivers/video/sis/vstruct.h
+++ b/drivers/video/sis/vstruct.h
@@ -233,21 +233,15 @@ struct SiS_Private
233{ 233{
234 unsigned char ChipType; 234 unsigned char ChipType;
235 unsigned char ChipRevision; 235 unsigned char ChipRevision;
236#ifdef SIS_LINUX_KERNEL
237 void *ivideo; 236 void *ivideo;
238#endif
239 unsigned char *VirtualRomBase; 237 unsigned char *VirtualRomBase;
240 bool UseROM; 238 bool UseROM;
241#ifdef SIS_LINUX_KERNEL
242 unsigned char SISIOMEMTYPE *VideoMemoryAddress; 239 unsigned char SISIOMEMTYPE *VideoMemoryAddress;
243 unsigned int VideoMemorySize; 240 unsigned int VideoMemorySize;
244#endif
245 SISIOADDRESS IOAddress; 241 SISIOADDRESS IOAddress;
246 SISIOADDRESS IOAddress2; /* For dual chip XGI volari */ 242 SISIOADDRESS IOAddress2; /* For dual chip XGI volari */
247 243
248#ifdef SIS_LINUX_KERNEL
249 SISIOADDRESS RelIO; 244 SISIOADDRESS RelIO;
250#endif
251 SISIOADDRESS SiS_P3c4; 245 SISIOADDRESS SiS_P3c4;
252 SISIOADDRESS SiS_P3d4; 246 SISIOADDRESS SiS_P3d4;
253 SISIOADDRESS SiS_P3c0; 247 SISIOADDRESS SiS_P3c0;