summaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb/XGI_main_26.c
diff options
context:
space:
mode:
authorMiguel Gómez <magomez@igalia.com>2012-07-06 12:40:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-11 16:59:27 -0700
commit949eb0aeb939f5c7022c02358f98ffd235b45ac0 (patch)
tree3020d4ca0f3292527287645bfb60775482fc76c3 /drivers/staging/xgifb/XGI_main_26.c
parentf12db36d3fd7ab75c29015c32a12d49697e11f61 (diff)
Staging: xgifb: Comment cleaning.
Remove commented code and useless comments. Leave only those with relevant hints to the code. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/xgifb/XGI_main_26.c')
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c133
1 files changed, 18 insertions, 115 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index fe9061d37ce8..b226458272a3 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -36,36 +36,6 @@ static void dumpVGAReg(void)
u8 i, reg;
xgifb_reg_set(XGISR, 0x05, 0x86);
- /*
- xgifb_reg_set(XGISR, 0x08, 0x4f);
- xgifb_reg_set(XGISR, 0x0f, 0x20);
- xgifb_reg_set(XGISR, 0x11, 0x4f);
- xgifb_reg_set(XGISR, 0x13, 0x45);
- xgifb_reg_set(XGISR, 0x14, 0x51);
- xgifb_reg_set(XGISR, 0x1e, 0x41);
- xgifb_reg_set(XGISR, 0x1f, 0x0);
- xgifb_reg_set(XGISR, 0x20, 0xa1);
- xgifb_reg_set(XGISR, 0x22, 0xfb);
- xgifb_reg_set(XGISR, 0x26, 0x22);
- xgifb_reg_set(XGISR, 0x3e, 0x07);
- */
-
- /* xgifb_reg_set(XGICR, 0x19, 0x00); */
- /* xgifb_reg_set(XGICR, 0x1a, 0x3C); */
- /* xgifb_reg_set(XGICR, 0x22, 0xff); */
- /* xgifb_reg_set(XGICR, 0x3D, 0x10); */
-
- /* xgifb_reg_set(XGICR, 0x4a, 0xf3); */
-
- /* xgifb_reg_set(XGICR, 0x57, 0x0); */
- /* xgifb_reg_set(XGICR, 0x7a, 0x2c); */
-
- /* xgifb_reg_set(XGICR, 0x82, 0xcc); */
- /* xgifb_reg_set(XGICR, 0x8c, 0x0); */
- /*
- xgifb_reg_set(XGICR, 0x99, 0x1);
- xgifb_reg_set(XGICR, 0x41, 0x40);
- */
for (i = 0; i < 0x4f; i++) {
reg = xgifb_reg_get(XGISR, i);
@@ -78,30 +48,6 @@ static void dumpVGAReg(void)
pr_debug("\no 3d4 %x", i);
pr_debug("\ni 3d5 => %x", reg);
}
- /*
- xgifb_reg_set(XGIPART1,0x2F,1);
- for (i=1; i < 0x50; i++) {
- reg = xgifb_reg_get(XGIPART1, i);
- pr_debug("\no d004 %x", i);
- pr_debug("\ni d005 => %x", reg);
- }
-
- for (i=0; i < 0x50; i++) {
- reg = xgifb_reg_get(XGIPART2, i);
- pr_debug("\no d010 %x", i);
- pr_debug("\ni d011 => %x", reg);
- }
- for (i=0; i < 0x50; i++) {
- reg = xgifb_reg_get(XGIPART3, i);
- pr_debug("\no d012 %x",i);
- pr_debug("\ni d013 => %x",reg);
- }
- for (i=0; i < 0x50; i++) {
- reg = xgifb_reg_get(XGIPART4, i);
- pr_debug("\no d014 %x",i);
- pr_debug("\ni d015 => %x",reg);
- }
- */
}
#else
static inline void dumpVGAReg(void)
@@ -215,15 +161,6 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
| ((unsigned short) (sr_data & 0x01) << 10);
A = VT + 2;
- /* cr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[10]; */
-
- /* Vertical display enable end */
- /*
- VDE = (cr_data & 0xff) |
- ((unsigned short) (cr_data2 & 0x02) << 7) |
- ((unsigned short) (cr_data2 & 0x40) << 3) |
- ((unsigned short) (sr_data & 0x02) << 9);
- */
VDE = XGI_Pr->RefIndex[RefreshRateTableIndex].YRes - 1;
E = VDE + 1;
@@ -590,7 +527,7 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex)
if (XGIbios_mode[myindex].yres != 576)
return -1;
}
- /* TW: LVDS/CHRONTEL does not support 720 */
+ /* LVDS/CHRONTEL does not support 720 */
if (xgifb_info->hasVB == HASVB_LVDS_CHRONTEL ||
xgifb_info->hasVB == HASVB_CHRONTEL) {
return -1;
@@ -794,26 +731,25 @@ static void XGIfb_post_setmode(struct xgifb_video_info *xgifb_info)
{
u8 reg;
unsigned char doit = 1;
- /*
- xgifb_reg_set(XGISR,IND_SIS_PASSWORD,SIS_PASSWORD);
- xgifb_reg_set(XGICR, 0x13, 0x00);
- xgifb_reg_and_or(XGISR,0x0E, 0xF0, 0x01);
- *test*
- */
+
if (xgifb_info->video_bpp == 8) {
- /* TW: We can't switch off CRT1 on LVDS/Chrontel
- * in 8bpp Modes */
+ /*
+ * We can't switch off CRT1 on LVDS/Chrontel
+ * in 8bpp Modes
+ */
if ((xgifb_info->hasVB == HASVB_LVDS) ||
(xgifb_info->hasVB == HASVB_LVDS_CHRONTEL)) {
doit = 0;
}
- /* TW: We can't switch off CRT1 on 301B-DH
- * in 8bpp Modes if using LCD */
+ /*
+ * We can't switch off CRT1 on 301B-DH
+ * in 8bpp Modes if using LCD
+ */
if (xgifb_info->display2 == XGIFB_DISP_LCD)
doit = 0;
}
- /* TW: We can't switch off CRT1 if bridge is in slave mode */
+ /* We can't switch off CRT1 if bridge is in slave mode */
if (xgifb_info->hasVB != HASVB_NONE) {
reg = xgifb_reg_get(XGIPART1, 0x00);
@@ -1038,7 +974,6 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
unsigned int drate = 0, hrate = 0;
int found_mode = 0;
int old_mode;
- /* unsigned char reg, reg1; */
info->var.xres_virtual = var->xres_virtual;
info->var.yres_virtual = var->yres_virtual;
@@ -1049,8 +984,6 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
else if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE)
vtotal <<= 2;
else if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
- /* vtotal <<= 1; */
- /* var->yres <<= 1; */
}
if (!htotal || !vtotal) {
@@ -1388,16 +1321,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
xgifb_info->refresh_rate = 60;
}
- /*
- if ((var->pixclock) && (htotal)) {
- drate = 1E12 / var->pixclock;
- hrate = drate / htotal;
- refresh_rate = (unsigned int) (hrate / vtotal * 2 + 0.5);
- } else {
- refresh_rate = 60;
- }
- */
- /* TW: Calculation wrong for 1024x600 - force it to 60Hz */
+ /* Calculation wrong for 1024x600 - force it to 60Hz */
if ((var->xres == 1024) && (var->yres == 600))
refresh_rate = 60;
@@ -1446,8 +1370,6 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
}
}
- /* TW: TODO: Check the refresh rate */
-
/* Adapt RGB settings */
XGIfb_bpp_to_var(xgifb_info, var);
@@ -1462,16 +1384,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->xres_virtual = var->xres;
if (var->yres != var->yres_virtual)
var->yres_virtual = var->yres;
- } /* else { */
- /* TW: Now patch yres_virtual if we use panning */
- /* May I do this? */
- /* var->yres_virtual = xgifb_info->heapstart /
- (var->xres * (var->bits_per_pixel >> 3)); */
- /* if (var->yres_virtual <= var->yres) { */
- /* TW: Paranoia check */
- /* var->yres_virtual = var->yres; */
- /* } */
- /* } */
+ }
/* Truncate offsets to maximum if too high */
if (var->xoffset > var->xres_virtual - var->xres)
@@ -1553,7 +1466,6 @@ static struct fb_ops XGIfb_ops = {
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
- /* .fb_mmap = XGIfb_mmap, */
};
/* ---------------- Chip generation dependent routines ---------------- */
@@ -1630,9 +1542,6 @@ static int XGIfb_get_dram_size(struct xgifb_video_info *xgifb_info)
}
xgifb_info->video_size = xgifb_info->video_size * ChannelNum;
- /* PLiad fixed for benchmarking and fb set */
- /* xgifb_info->video_size = 0x200000; */ /* 1024x768x16 */
- /* xgifb_info->video_size = 0x1000000; */ /* benchmark */
pr_info("SR14=%x DramSzie %x ChannelNum %x\n",
reg,
@@ -1680,7 +1589,7 @@ static void XGIfb_detect_VB(struct xgifb_video_info *xgifb_info)
}
if (XGIfb_tvplug != -1)
- /* PR/TW: Override with option */
+ /* Override with option */
xgifb_info->TV_plug = XGIfb_tvplug;
else if (cr32 & SIS_VB_HIVISION) {
xgifb_info->TV_type = TVMODE_HIVISION;
@@ -1700,7 +1609,7 @@ static void XGIfb_detect_VB(struct xgifb_video_info *xgifb_info)
xgifb_info->TV_type = TVMODE_NTSC;
}
- /* TW: Copy forceCRT1 option to CRT1off if option is given */
+ /* Copy forceCRT1 option to CRT1off if option is given */
if (XGIfb_forcecrt1 != -1) {
if (XGIfb_forcecrt1)
XGIfb_crt1off = 0;
@@ -1794,7 +1703,7 @@ static int __init XGIfb_setup(char *options)
XGIfb_search_tvstd(this_opt + 7);
} else if (!strncmp(this_opt, "dstn", 4)) {
enable_dstn = 1;
- /* TW: DSTN overrules forcecrt2type */
+ /* DSTN overrules forcecrt2type */
XGIfb_crt2type = XGIFB_DISP_LCD;
} else if (!strncmp(this_opt, "noypan", 6)) {
XGIfb_ypan = 0;
@@ -1981,13 +1890,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
dev_info(&pdev->dev,
"XGI301LV bridge detected (revision 0x%02x)\n",
reg);
- }
- /* else if (reg >= 0xB0) {
- hw_info->ujVBChipID = VB_CHIP_301B;
- reg1 = xgifb_reg_get(XGIPART4, 0x23);
- pr_debug("XGIfb: XGI301B bridge detected\n");
- } */
- else {
+ } else {
hw_info->ujVBChipID = VB_CHIP_301;
dev_info(&pdev->dev, "XGI301 bridge detected\n");
}
@@ -2104,7 +2007,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
goto error_1;
}
- /* yilin set default refresh rate */
+ /* set default refresh rate */
xgifb_info->refresh_rate = refresh_rate;
if (xgifb_info->refresh_rate == 0)
xgifb_info->refresh_rate = 60;