aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c26
-rw-r--r--drivers/staging/xgifb/vb_def.h1
-rw-r--r--drivers/staging/xgifb/vb_init.c3
-rw-r--r--drivers/staging/xgifb/vb_setmode.c43
-rw-r--r--drivers/staging/xgifb/vb_struct.h2
-rw-r--r--drivers/staging/xgifb/vb_table.h3
-rw-r--r--drivers/staging/xgifb/vgatypes.h7
7 files changed, 34 insertions, 51 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 89f5b55ed546..7eadf922b21f 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -226,7 +226,6 @@ void XGIRegInit(struct vb_device_info *XGI_Pr, unsigned long BaseAddr)
XGI_Pr->Part4Port = BaseAddr + SIS_CRT2_PORT_14;
/* 301 palette address port registers */
XGI_Pr->Part5Port = BaseAddr + SIS_CRT2_PORT_14 + 2;
-
}
/* ------------------ Internal helper routines ----------------- */
@@ -315,10 +314,8 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex)
if (XGIbios_mode[myindex].bpp > 8)
return -1;
}
-
}
goto check_memory;
-
}
/* FIXME: for now, all is valid on XG27 */
@@ -518,7 +515,6 @@ check_memory:
if (required_mem > xgifb_info->video_size)
return -1;
return myindex;
-
}
static void XGIfb_search_crt2type(const char *name)
@@ -655,26 +651,26 @@ static void XGIfb_pre_setmode(struct xgifb_video_info *xgifb_info)
switch (xgifb_info->display2) {
case XGIFB_DISP_CRT:
- cr30 = (SIS_VB_OUTPUT_CRT2 | SIS_SIMULTANEOUS_VIEW_ENABLE);
+ cr30 = SIS_VB_OUTPUT_CRT2 | SIS_SIMULTANEOUS_VIEW_ENABLE;
cr31 |= SIS_DRIVER_MODE;
break;
case XGIFB_DISP_LCD:
- cr30 = (SIS_VB_OUTPUT_LCD | SIS_SIMULTANEOUS_VIEW_ENABLE);
+ cr30 = SIS_VB_OUTPUT_LCD | SIS_SIMULTANEOUS_VIEW_ENABLE;
cr31 |= SIS_DRIVER_MODE;
break;
case XGIFB_DISP_TV:
if (xgifb_info->TV_type == TVMODE_HIVISION)
- cr30 = (SIS_VB_OUTPUT_HIVISION
- | SIS_SIMULTANEOUS_VIEW_ENABLE);
+ cr30 = SIS_VB_OUTPUT_HIVISION
+ | SIS_SIMULTANEOUS_VIEW_ENABLE;
else if (xgifb_info->TV_plug == TVPLUG_SVIDEO)
- cr30 = (SIS_VB_OUTPUT_SVIDEO
- | SIS_SIMULTANEOUS_VIEW_ENABLE);
+ cr30 = SIS_VB_OUTPUT_SVIDEO
+ | SIS_SIMULTANEOUS_VIEW_ENABLE;
else if (xgifb_info->TV_plug == TVPLUG_COMPOSITE)
- cr30 = (SIS_VB_OUTPUT_COMPOSITE
- | SIS_SIMULTANEOUS_VIEW_ENABLE);
+ cr30 = SIS_VB_OUTPUT_COMPOSITE
+ | SIS_SIMULTANEOUS_VIEW_ENABLE;
else if (xgifb_info->TV_plug == TVPLUG_SCART)
- cr30 = (SIS_VB_OUTPUT_SCART
- | SIS_SIMULTANEOUS_VIEW_ENABLE);
+ cr30 = SIS_VB_OUTPUT_SCART
+ | SIS_SIMULTANEOUS_VIEW_ENABLE;
cr31 |= SIS_DRIVER_MODE;
if (XGIfb_tvmode == 1 || xgifb_info->TV_type == TVMODE_PAL)
@@ -2064,8 +2060,6 @@ static struct pci_driver xgifb_driver = {
.remove = xgifb_remove
};
-
-
/*****************************************************/
/* MODULE */
/*****************************************************/
diff --git a/drivers/staging/xgifb/vb_def.h b/drivers/staging/xgifb/vb_def.h
index d9524a2e9ce4..94e2e3c7c264 100644
--- a/drivers/staging/xgifb/vb_def.h
+++ b/drivers/staging/xgifb/vb_def.h
@@ -228,7 +228,6 @@
#define RES1280x960x85 0x46
#define RES1280x960x120 0x47
-
#define XG27_CR8F 0x0C
#define XG27_SR36 0x30
#define XG27_SR40 0x04
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 879a7e6751ac..26b539bc6faf 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -57,7 +57,8 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
data = xgifb_reg_get(pVBInfo->P3d4, 0x48);
/* HOTPLUG_SUPPORT */
/* for current XG20 & XG21, GPIOH is floating, driver will
- * fix DDR temporarily */
+ * fix DDR temporarily
+ */
/* DVI read GPIOH */
data &= 0x01; /* 1=DDRII, 0=DDR */
/* ~HOTPLUG_SUPPORT */
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index c886dd2892a4..f97c77d88173 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -61,7 +61,6 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
if (((temp & 0x88) == 0x80) || ((temp & 0x88) == 0x08))
pVBInfo->XGINew_CR97 = 0x80;
}
-
}
static void XGI_SetSeqRegs(struct vb_device_info *pVBInfo)
@@ -155,7 +154,6 @@ static void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo)
static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo)
{
-
xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x20);
xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[0].SR2B);
xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[0].SR2C);
@@ -274,12 +272,12 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
for (i = 0x01; i <= 0x04; i++) {
data = pVBInfo->TimingH.data[i];
- xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 1), data);
+ xgifb_reg_set(pVBInfo->P3d4, (unsigned short)(i + 1), data);
}
for (i = 0x05; i <= 0x06; i++) {
data = pVBInfo->TimingH.data[i];
- xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i + 6), data);
+ xgifb_reg_set(pVBInfo->P3c4, (unsigned short)(i + 6), data);
}
j = xgifb_reg_get(pVBInfo->P3c4, 0x0e);
@@ -325,17 +323,17 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex,
for (i = 0x00; i <= 0x01; i++) {
data = pVBInfo->TimingV.data[i];
- xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 6), data);
+ xgifb_reg_set(pVBInfo->P3d4, (unsigned short)(i + 6), data);
}
for (i = 0x02; i <= 0x03; i++) {
data = pVBInfo->TimingV.data[i];
- xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x0e), data);
+ xgifb_reg_set(pVBInfo->P3d4, (unsigned short)(i + 0x0e), data);
}
for (i = 0x04; i <= 0x05; i++) {
data = pVBInfo->TimingV.data[i];
- xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x11), data);
+ xgifb_reg_set(pVBInfo->P3d4, (unsigned short)(i + 0x11), data);
}
j = xgifb_reg_get(pVBInfo->P3c4, 0x0a);
@@ -433,7 +431,7 @@ static void XGI_SetXG21CRTC(unsigned short RefreshRateTableIndex,
Temp2 |= 0x40; /* Temp2 + 0x40 */
Temp2 &= 0xFF;
- Tempax = (unsigned char) Temp2; /* Tempax: HRE[7:0] */
+ Tempax = (unsigned char)Temp2; /* Tempax: HRE[7:0] */
Tempax <<= 2; /* Tempax[7:2]: HRE[5:0] */
Tempdx >>= 6; /* Tempdx[7:6]->[1:0] HRS[9:8] */
Tempax |= Tempdx; /* HRE[5:0]HRS[9:8] */
@@ -483,11 +481,11 @@ static void XGI_SetXG21CRTC(unsigned short RefreshRateTableIndex,
Temp2 |= 0x20; /* VRE + 0x20 */
Temp2 &= 0xFF;
- Tempax = (unsigned char) Temp2; /* Tempax: VRE[7:0] */
+ Tempax = (unsigned char)Temp2; /* Tempax: VRE[7:0] */
Tempax <<= 2; /* Tempax[7:0]; VRE[5:0]00 */
Temp1 &= 0x600; /* Temp1[10:9]: VRS[10:9] */
Temp1 >>= 9; /* Temp1[1:0]: VRS[10:9] */
- Tempbx = (unsigned char) Temp1;
+ Tempbx = (unsigned char)Temp1;
Tempax |= Tempbx; /* Tempax[7:0]: VRE[5:0]VRS[10:9] */
Tempax &= 0x7F;
/* SR3F D[7:2]->VRE D[1:0]->VRS */
@@ -592,7 +590,6 @@ static void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo)
xgifb_reg_and_or(pVBInfo->P3c4, 0x06, ~0xc0, temp & 0x80);
/* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: 24bits */
xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80);
-
}
static void xgifb_set_lcd(int chip_id,
@@ -716,10 +713,10 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex,
data = xgifb_reg_get(pVBInfo->P3d4, 0x11);
data &= 0x7F;
xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */
- xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short) (tempcx & 0xff));
+ xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short)(tempcx & 0xff));
xgifb_reg_and_or(pVBInfo->P3d4, 0x0b, ~0x0c,
- (unsigned short) ((tempcx & 0x0ff00) >> 10));
- xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short) (tempbx & 0xff));
+ (unsigned short)((tempcx & 0x0ff00) >> 10));
+ xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short)(tempbx & 0xff));
tempax = 0;
tempbx >>= 8;
@@ -930,7 +927,6 @@ static void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo)
xgifb_reg_and_or(pVBInfo->P3c4, 0x06, ~0x40, temp);
/* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: dual 12bits */
xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80);
-
}
static void XGI_SetCRT1FIFO(struct xgi_hw_device_info *HwDeviceExtension,
@@ -990,7 +986,6 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension,
xgifb_reg_and_or(pVBInfo->P3c4, 0x07, 0xFC, data2);
if (HwDeviceExtension->jChipType >= XG27)
xgifb_reg_and_or(pVBInfo->P3c4, 0x40, 0xFC, data2 & 0x03);
-
}
static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
@@ -1072,7 +1067,6 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
data = 0x6c;
xgifb_reg_set(pVBInfo->P3d4, 0x52, data);
}
-
}
static void XGI_WriteDAC(unsigned short dl,
@@ -1905,8 +1899,8 @@ static void XGI_GetVBInfo(unsigned short ModeIdIndex,
push <<= 8;
tempax = temp << 8;
tempbx = tempbx | tempax;
- temp = (SetCRT2ToDualEdge | SetCRT2ToYPbPr525750 | XGI_SetCRT2ToLCDA
- | SetInSlaveMode | DisableCRT2Display);
+ temp = SetCRT2ToDualEdge | SetCRT2ToYPbPr525750 | XGI_SetCRT2ToLCDA
+ | SetInSlaveMode | DisableCRT2Display;
temp = 0xFFFF ^ temp;
tempbx &= temp;
@@ -2887,7 +2881,7 @@ static void XGI_SetGroup1(unsigned short ModeIdIndex,
xgifb_reg_set(pVBInfo->Part1Port, 0x0C, temp);
temp = tempcx & 0x00FF;
xgifb_reg_set(pVBInfo->Part1Port, 0x0D, temp);
- tempcx = (pVBInfo->VGAVT - 1);
+ tempcx = pVBInfo->VGAVT - 1;
temp = tempcx & 0x00FF;
xgifb_reg_set(pVBInfo->Part1Port, 0x0E, temp);
@@ -2925,7 +2919,7 @@ static void XGI_SetGroup1(unsigned short ModeIdIndex,
temp = tempbx & 0x00FF;
xgifb_reg_set(pVBInfo->Part1Port, 0x10, temp);
temp = ((tempbx & 0xFF00) >> 8) << 4;
- temp = ((tempcx & 0x000F) | (temp));
+ temp = (tempcx & 0x000F) | (temp);
xgifb_reg_set(pVBInfo->Part1Port, 0x11, temp);
tempax = 0;
@@ -4080,7 +4074,7 @@ static void XGI_SetGroup4(unsigned short ModeIdIndex,
tempcx |= 0x04000;
if (tempeax <= tempebx) {
- tempcx = (tempcx & (~0x4000));
+ tempcx = tempcx & (~0x4000);
tempeax = pVBInfo->VGAVDE;
} else {
tempeax -= tempebx;
@@ -4130,7 +4124,7 @@ static void XGI_SetGroup4(unsigned short ModeIdIndex,
temp = (tempax & 0xFF00) >> 8;
temp = (temp & 0x0003) << 4;
xgifb_reg_set(pVBInfo->Part4Port, 0x1E, temp);
- temp = (tempax & 0x00FF);
+ temp = tempax & 0x00FF;
xgifb_reg_set(pVBInfo->Part4Port, 0x1D, temp);
if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToHiVision)) {
@@ -4932,7 +4926,7 @@ static void XGI_SetCRT2ModeRegs(struct vb_device_info *pVBInfo)
tempcl -= ModeVGA;
if (tempcl >= 0) {
/* BT Color */
- tempah = (0x008 >> tempcl);
+ tempah = 0x008 >> tempcl;
if (tempah == 0)
tempah = 1;
tempah |= 0x040;
@@ -5073,7 +5067,6 @@ reg_and_or:
}
}
-
void XGI_UnLockCRT2(struct vb_device_info *pVBInfo)
{
xgifb_reg_and_or(pVBInfo->Part1Port, 0x2f, 0xFF, 0x01);
diff --git a/drivers/staging/xgifb/vb_struct.h b/drivers/staging/xgifb/vb_struct.h
index 0d27594554ca..2fd1a5935e1d 100644
--- a/drivers/staging/xgifb/vb_struct.h
+++ b/drivers/staging/xgifb/vb_struct.h
@@ -65,7 +65,6 @@ struct XGI330_TVDataTablStruct {
struct SiS_TVData const *DATAPTR;
};
-
struct XGI_TimingHStruct {
unsigned char data[8];
};
@@ -117,7 +116,6 @@ struct XGI_CRT1TableStruct {
unsigned char CR[16];
};
-
struct XGI301C_Tap4TimingStruct {
unsigned short DE;
unsigned char Reg[64]; /* C0-FF */
diff --git a/drivers/staging/xgifb/vb_table.h b/drivers/staging/xgifb/vb_table.h
index f17e5b9bd333..45f2c992cd44 100644
--- a/drivers/staging/xgifb/vb_table.h
+++ b/drivers/staging/xgifb/vb_table.h
@@ -1140,7 +1140,6 @@ static const struct SiS_LVDSData XGI_LVDS1024x768Data_1[] = {
{1344, 806, 1344, 806} /* 06 (512x384,1024x768) */
};
-
static const struct SiS_LVDSData XGI_LVDS1024x768Data_2[] = {
{1344, 806, 1344, 806},
{1344, 806, 1344, 806},
@@ -1228,7 +1227,6 @@ static const struct SiS_LVDSData XGI_LVDS1024x768Data_1x75[] = {
{1312, 800, 1312, 800}, /* 06 (512x384,1024x768) */
};
-
static const struct SiS_LVDSData XGI_LVDS1024x768Data_2x75[] = {
{1312, 800, 1312, 800}, /* ; 00 (320x200,320x400,640x200,640x400) */
{1312, 800, 1312, 800}, /* ; 01 (320x350,640x350) */
@@ -2314,7 +2312,6 @@ static const unsigned char TVAntiFlickList[] = {/* NTSCAntiFlicker */
0x00 /* ; 1 new anti-flicker ? */
};
-
static const unsigned char TVEdgeList[] = {
0x00, /* ; 0 NTSC No Edge enhance */
0x04, /* ; 1 NTSC Adaptive Edge enhance */
diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h
index 61fa10fd470f..de80e5c108dc 100644
--- a/drivers/staging/xgifb/vgatypes.h
+++ b/drivers/staging/xgifb/vgatypes.h
@@ -27,14 +27,16 @@ struct xgi_hw_device_info {
/* of Linear VGA memory */
unsigned long ulVideoMemorySize; /* size, in bytes, of the
- memory on the board */
+ * memory on the board
+ */
unsigned char jChipType; /* Used to Identify Graphics Chip */
/* defined in the data structure type */
/* "XGI_CHIP_TYPE" */
unsigned char jChipRevision; /* Used to Identify Graphics
- Chip Revision */
+ * Chip Revision
+ */
unsigned char ujVBChipID; /* the ID of video bridge */
/* defined in the data structure type */
@@ -46,4 +48,3 @@ struct xgi_hw_device_info {
/* Additional IOCTL for communication xgifb <> X driver */
/* If changing this, xgifb.h must also be changed (for xgifb) */
#endif
-