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