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>

authored by Aaro Koskinen and committed by Paul Mundt b6c30ca6 e7d828ab

-116
-50
drivers/video/sis/init.c
··· 1150 1150 /* HELPER: SetLVDSetc */ 1151 1151 /*********************************************/ 1152 1152 1153 - #ifdef SIS_LINUX_KERNEL 1154 1153 static 1155 - #endif 1156 1154 void 1157 1155 SiSSetLVDSetc(struct SiS_Private *SiS_Pr) 1158 1156 { ··· 1416 1418 /* HELPER: GetVBType */ 1417 1419 /*********************************************/ 1418 1420 1419 - #ifdef SIS_LINUX_KERNEL 1420 1421 static 1421 - #endif 1422 1422 void 1423 1423 SiS_GetVBType(struct SiS_Private *SiS_Pr) 1424 1424 { ··· 1481 1485 /* HELPER: Check RAM size */ 1482 1486 /*********************************************/ 1483 1487 1484 - #ifdef SIS_LINUX_KERNEL 1485 1488 static bool 1486 1489 SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1487 1490 unsigned short ModeIdIndex) ··· 1494 1499 if(AdapterMemSize < memorysize) return false; 1495 1500 return true; 1496 1501 } 1497 - #endif 1498 1502 1499 1503 /*********************************************/ 1500 1504 /* HELPER: Get DRAM type */ ··· 1566 1572 /* HELPER: ClearBuffer */ 1567 1573 /*********************************************/ 1568 1574 1569 - #ifdef SIS_LINUX_KERNEL 1570 1575 static void 1571 1576 SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 1572 1577 { ··· 1590 1597 SiS_SetMemory(memaddr, 0x8000, 0); 1591 1598 } 1592 1599 } 1593 - #endif 1594 1600 1595 1601 /*********************************************/ 1596 1602 /* HELPER: SearchModeID */ ··· 2496 2504 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data); 2497 2505 2498 2506 /* Write foreground and background queue */ 2499 - #ifdef SIS_LINUX_KERNEL 2500 2507 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); 2501 - #else 2502 - templ = pciReadLong(0x00000000, 0x50); 2503 - #endif 2504 2508 2505 2509 if(SiS_Pr->ChipType == SIS_730) { 2506 2510 ··· 2516 2528 2517 2529 } 2518 2530 2519 - #ifdef SIS_LINUX_KERNEL 2520 2531 sisfb_write_nbridge_pci_dword(SiS_Pr, 0x50, templ); 2521 2532 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xA0); 2522 - #else 2523 - pciWriteLong(0x00000000, 0x50, templ); 2524 - templ = pciReadLong(0x00000000, 0xA0); 2525 - #endif 2526 2533 2527 2534 /* GUI grant timer (PCI config 0xA3) */ 2528 2535 if(SiS_Pr->ChipType == SIS_730) { ··· 2533 2550 2534 2551 } 2535 2552 2536 - #ifdef SIS_LINUX_KERNEL 2537 2553 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ); 2538 - #else 2539 - pciWriteLong(0x00000000, 0xA0, templ); 2540 - #endif 2541 2554 } 2542 2555 #endif /* SIS300 */ 2543 2556 ··· 3042 3063 3043 3064 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); 3044 3065 3045 - #ifdef SIS_LINUX_KERNEL 3046 3066 if(SiS_Pr->SiS_flag_clearbuffer) { 3047 3067 SiS_ClearBuffer(SiS_Pr, ModeNo); 3048 3068 } 3049 - #endif 3050 3069 3051 3070 if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) { 3052 3071 SiS_WaitRetrace1(SiS_Pr); ··· 3140 3163 (!(SiS_Pr->SiS_SysFlags & SF_760UMA)) ) 3141 3164 return; 3142 3165 3143 - #ifdef SIS_LINUX_KERNEL 3144 3166 somebase = sisfb_read_mio_pci_word(SiS_Pr, 0x74); 3145 - #else 3146 - somebase = pciReadWord(0x00001000, 0x74); 3147 - #endif 3148 3167 somebase &= 0xffff; 3149 3168 3150 3169 if(somebase == 0) return; ··· 3156 3183 temp2 = 0x0b; 3157 3184 } 3158 3185 3159 - #ifdef SIS_LINUX_KERNEL 3160 3186 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x7e, temp1); 3161 3187 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x8d, temp2); 3162 - #else 3163 - pciWriteByte(0x00000000, 0x7e, temp1); 3164 - pciWriteByte(0x00000000, 0x8d, temp2); 3165 - #endif 3166 3188 3167 3189 SiS_SetRegByte((somebase + 0x85), temp3); 3168 3190 #endif ··· 3173 3205 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3174 3206 unsigned short RealModeNo, ModeIdIndex; 3175 3207 unsigned char backupreg = 0; 3176 - #ifdef SIS_LINUX_KERNEL 3177 3208 unsigned short KeepLockReg; 3178 3209 3179 3210 SiS_Pr->UseCustomMode = false; 3180 3211 SiS_Pr->CRT1UsesCustomMode = false; 3181 - #endif 3182 3212 3183 3213 SiS_Pr->SiS_flag_clearbuffer = 0; 3184 3214 3185 3215 if(SiS_Pr->UseCustomMode) { 3186 3216 ModeNo = 0xfe; 3187 3217 } else { 3188 - #ifdef SIS_LINUX_KERNEL 3189 3218 if(!(ModeNo & 0x80)) SiS_Pr->SiS_flag_clearbuffer = 1; 3190 - #endif 3191 3219 ModeNo &= 0x7f; 3192 3220 } 3193 3221 ··· 3197 3233 3198 3234 SiS_Pr->SiS_VGAINFO = 0x11; 3199 3235 3200 - #ifdef SIS_LINUX_KERNEL 3201 3236 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); 3202 - #endif 3203 3237 SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3204 3238 3205 3239 SiSInitPCIetc(SiS_Pr); ··· 3234 3272 SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3235 3273 SiS_SetLowModeTest(SiS_Pr, ModeNo); 3236 3274 3237 - #ifdef SIS_LINUX_KERNEL 3238 3275 /* Check memory size (kernel framebuffer driver only) */ 3239 3276 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) { 3240 3277 return false; 3241 3278 } 3242 - #endif 3243 3279 3244 3280 SiS_OpenCRTC(SiS_Pr); 3245 3281 ··· 3316 3356 3317 3357 SiS_Handle760(SiS_Pr); 3318 3358 3319 - #ifdef SIS_LINUX_KERNEL 3320 3359 /* We never lock registers in XF86 */ 3321 3360 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00); 3322 - #endif 3323 3361 3324 3362 return true; 3325 3363 } ··· 3539 3581 void 3540 3582 SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, 3541 3583 int xres, int yres, 3542 - #ifdef SIS_LINUX_KERNEL 3543 3584 struct fb_var_screeninfo *var, bool writeres 3544 - #endif 3545 3585 ) 3546 3586 { 3547 3587 unsigned short HRE, HBE, HRS, HBS, HDE, HT; ··· 3583 3627 3584 3628 D = B - F - C; 3585 3629 3586 - #ifdef SIS_LINUX_KERNEL 3587 3630 if(writeres) var->xres = xres = E * 8; 3588 3631 var->left_margin = D * 8; 3589 3632 var->right_margin = F * 8; 3590 3633 var->hsync_len = C * 8; 3591 - #endif 3592 3634 3593 3635 /* Vertical */ 3594 3636 sr_data = crdata[13]; ··· 3633 3679 3634 3680 D = B - F - C; 3635 3681 3636 - #ifdef SIS_LINUX_KERNEL 3637 3682 if(writeres) var->yres = yres = E; 3638 3683 var->upper_margin = D; 3639 3684 var->lower_margin = F; 3640 3685 var->vsync_len = C; 3641 - #endif 3642 3686 3643 3687 if((xres == 320) && ((yres == 200) || (yres == 240))) { 3644 3688 /* Terrible hack, but correct CRTC data for ··· 3645 3693 * a negative D. The CRT controller does not 3646 3694 * seem to like correcting HRE to 50) 3647 3695 */ 3648 - #ifdef SIS_LINUX_KERNEL 3649 3696 var->left_margin = (400 - 376); 3650 3697 var->right_margin = (328 - 320); 3651 3698 var->hsync_len = (376 - 328); 3652 - #endif 3653 3699 3654 3700 } 3655 3701
-14
drivers/video/sis/init.h
··· 56 56 #include "osdef.h" 57 57 #include "initdef.h" 58 58 59 - #ifdef SIS_LINUX_KERNEL 60 59 #include "vgatypes.h" 61 60 #include "vstruct.h" 62 61 #ifdef SIS_CP ··· 66 67 #include <linux/fb.h> 67 68 #include "sis.h" 68 69 #include <video/sisfb.h> 69 - #endif 70 70 71 71 /* Mode numbers */ 72 72 static const unsigned short ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f}; ··· 1533 1535 void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 1534 1536 void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 1535 1537 void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 1536 - #ifndef SIS_LINUX_KERNEL 1537 - void SiSSetLVDSetc(struct SiS_Private *SiS_Pr); 1538 - #endif 1539 1538 void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 1540 1539 void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 1541 1540 unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1542 1541 unsigned short ModeIdIndex); 1543 1542 bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 1544 - #ifndef SIS_LINUX_KERNEL 1545 - void SiS_GetVBType(struct SiS_Private *SiS_Pr); 1546 - #endif 1547 1543 1548 1544 bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 1549 1545 unsigned short *ModeIdIndex); ··· 1556 1564 unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1557 1565 #endif 1558 1566 void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1559 - #ifdef SIS_LINUX_KERNEL 1560 1567 bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1561 - #endif 1562 1568 void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1563 1569 void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1564 1570 unsigned short ModeIdIndex); 1565 - #ifdef SIS_LINUX_KERNEL 1566 1571 void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1567 1572 int yres, struct fb_var_screeninfo *var, bool writeres); 1568 - #endif 1569 1573 1570 1574 /* From init301.c: */ 1571 1575 extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, ··· 1585 1597 extern bool SiS_IsVAMode(struct SiS_Private *); 1586 1598 extern bool SiS_IsDualEdge(struct SiS_Private *); 1587 1599 1588 - #ifdef SIS_LINUX_KERNEL 1589 1600 #ifdef SIS300 1590 1601 extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1591 1602 extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, ··· 1594 1607 extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, 1595 1608 unsigned char val); 1596 1609 extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); 1597 - #endif 1598 1610 #endif 1599 1611 1600 1612 #endif
-23
drivers/video/sis/init301.c
··· 87 87 #define SiS_I2CDELAYSHORT 150 88 88 89 89 static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr); 90 - #ifdef SIS_LINUX_KERNEL 91 90 static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 92 - #endif 93 91 94 92 /*********************************************/ 95 93 /* HELPER: Lock/Unlock CRT2 */ ··· 104 106 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); 105 107 } 106 108 107 - #ifdef SIS_LINUX_KERNEL 108 109 static 109 - #endif 110 110 void 111 111 SiS_LockCRT2(struct SiS_Private *SiS_Pr) 112 112 { ··· 919 923 920 924 if(!(SiS_Pr->SiS_ChSW)) return; 921 925 922 - #ifdef SIS_LINUX_KERNEL 923 926 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); 924 - #else 925 - acpibase = pciReadLong(0x00000800, 0x74); 926 - #endif 927 927 acpibase &= 0xFFFF; 928 928 if(!acpibase) return; 929 929 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ ··· 1152 1160 } 1153 1161 #endif 1154 1162 1155 - #ifdef SIS_LINUX_KERNEL 1156 1163 #if 0 1157 1164 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n", 1158 1165 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1159 - #endif 1160 1166 #endif 1161 1167 } 1162 1168 ··· 2140 2150 SiS_Pr->SiS_SetFlag |= LCDVESATiming; 2141 2151 } 2142 2152 2143 - #ifdef SIS_LINUX_KERNEL 2144 2153 #if 0 2145 2154 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n", 2146 2155 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); 2147 - #endif 2148 2156 #endif 2149 2157 } 2150 2158 ··· 4234 4246 * from outside the context of a mode switch! 4235 4247 * MUST call getVBType before calling this 4236 4248 */ 4237 - #ifdef SIS_LINUX_KERNEL 4238 4249 static 4239 - #endif 4240 4250 void 4241 4251 SiS_EnableBridge(struct SiS_Private *SiS_Pr) 4242 4252 { ··· 5082 5096 5083 5097 } else { 5084 5098 5085 - #ifdef SIS_LINUX_KERNEL 5086 5099 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); 5087 5100 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); 5088 - #else 5089 - pci50 = pciReadLong(0x00000000, 0x50); 5090 - pciA0 = pciReadLong(0x00000000, 0xA0); 5091 - #endif 5092 5101 5093 5102 if(SiS_Pr->ChipType == SIS_730) { 5094 5103 ··· 8853 8872 SiS_SetChReg(SiS_Pr, reg, val, 0); 8854 8873 } 8855 8874 8856 - #ifdef SIS_LINUX_KERNEL 8857 8875 static 8858 - #endif 8859 8876 void 8860 8877 SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) 8861 8878 { ··· 8940 8961 8941 8962 /* Read from Chrontel 70xx */ 8942 8963 /* Parameter is [Register no (S7-S0)] */ 8943 - #ifdef SIS_LINUX_KERNEL 8944 8964 static 8945 - #endif 8946 8965 unsigned short 8947 8966 SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempbx) 8948 8967 {
-14
drivers/video/sis/init301.h
··· 56 56 #include "osdef.h" 57 57 #include "initdef.h" 58 58 59 - #ifdef SIS_LINUX_KERNEL 60 59 #include "vgatypes.h" 61 60 #include "vstruct.h" 62 61 #ifdef SIS_CP ··· 66 67 #include <linux/fb.h> 67 68 #include "sis.h" 68 69 #include <video/sisfb.h> 69 - #endif 70 70 71 71 static const unsigned char SiS_YPbPrTable[3][64] = { 72 72 { ··· 349 351 #endif 350 352 351 353 void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 352 - #ifndef SIS_LINUX_KERNEL 353 - void SiS_LockCRT2(struct SiS_Private *SiS_Pr); 354 - #endif 355 354 void SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 356 355 unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 357 356 void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); ··· 365 370 unsigned short RefreshRateTableIndex); 366 371 unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex); 367 372 void SiS_DisableBridge(struct SiS_Private *SiS_Pr); 368 - #ifndef SIS_LINUX_KERNEL 369 - void SiS_EnableBridge(struct SiS_Private *SiS_Pr); 370 - #endif 371 373 bool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 372 374 void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 373 375 void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); ··· 373 381 unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 374 382 void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 375 383 unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 376 - #ifndef SIS_LINUX_KERNEL 377 - void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 378 - unsigned short SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempax); 379 - #endif 380 384 void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 381 385 unsigned char orval,unsigned short andval); 382 386 #ifdef SIS315H ··· 461 473 unsigned short *tempcl); 462 474 extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl); 463 475 extern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 464 - #ifdef SIS_LINUX_KERNEL 465 476 extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 466 477 extern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 467 - #endif 468 478 #endif 469 479 470 480 #endif
-7
drivers/video/sis/osdef.h
··· 54 54 #ifndef _SIS_OSDEF_H_ 55 55 #define _SIS_OSDEF_H_ 56 56 57 - /* The choices are: */ 58 - #define SIS_LINUX_KERNEL /* Linux kernel framebuffer */ 59 - 60 57 #ifdef OutPortByte 61 58 #undef OutPortByte 62 59 #endif ··· 82 85 /* LINUX KERNEL */ 83 86 /**********************************************************************/ 84 87 85 - #ifdef SIS_LINUX_KERNEL 86 - 87 88 #ifdef CONFIG_FB_SIS_300 88 89 #define SIS300 89 90 #endif ··· 102 107 #define InPortWord(p) inw((SISIOADDRESS)(p)) 103 108 #define InPortLong(p) inl((SISIOADDRESS)(p)) 104 109 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize) 105 - 106 - #endif /* LINUX_KERNEL */ 107 110 108 111 #endif /* _OSDEF_H_ */
-2
drivers/video/sis/vgatypes.h
··· 55 55 56 56 #define SISIOMEMTYPE 57 57 58 - #ifdef SIS_LINUX_KERNEL 59 58 typedef unsigned long SISIOADDRESS; 60 59 #include <linux/types.h> /* Need __iomem */ 61 60 #undef SISIOMEMTYPE 62 61 #define SISIOMEMTYPE __iomem 63 - #endif 64 62 65 63 typedef enum _SIS_CHIP_TYPE { 66 64 SIS_VGALegacy = 0,
-6
drivers/video/sis/vstruct.h
··· 233 233 { 234 234 unsigned char ChipType; 235 235 unsigned char ChipRevision; 236 - #ifdef SIS_LINUX_KERNEL 237 236 void *ivideo; 238 - #endif 239 237 unsigned char *VirtualRomBase; 240 238 bool UseROM; 241 - #ifdef SIS_LINUX_KERNEL 242 239 unsigned char SISIOMEMTYPE *VideoMemoryAddress; 243 240 unsigned int VideoMemorySize; 244 - #endif 245 241 SISIOADDRESS IOAddress; 246 242 SISIOADDRESS IOAddress2; /* For dual chip XGI volari */ 247 243 248 - #ifdef SIS_LINUX_KERNEL 249 244 SISIOADDRESS RelIO; 250 - #endif 251 245 SISIOADDRESS SiS_P3c4; 252 246 SISIOADDRESS SiS_P3d4; 253 247 SISIOADDRESS SiS_P3c0;