Commit 0411197c authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbdev: Convert drivers to use the new FB_BLANK_* constants

This patch converts most drivers to use the new FB_BLANK_* constants.
These drivers have correct fb_blank() implementations.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8d5b3b97
......@@ -2469,6 +2469,7 @@ static void amifb_deinit(void)
static int amifb_blank(int blank, struct fb_info *info)
{
do_blank = blank ? blank : -1;
return 0;
}
......@@ -3247,20 +3248,20 @@ static void ami_do_blank(void)
custom.dmacon = DMAF_RASTER | DMAF_SPRITE;
red = green = blue = 0;
if (!IS_OCS && do_blank > 1) {
switch (do_blank-1) {
case VESA_VSYNC_SUSPEND:
switch (do_blank) {
case FB_BLANK_VSYNC_SUSPEND:
custom.hsstrt = hsstrt2hw(par->hsstrt);
custom.hsstop = hsstop2hw(par->hsstop);
custom.vsstrt = vsstrt2hw(par->vtotal+4);
custom.vsstop = vsstop2hw(par->vtotal+4);
break;
case VESA_HSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
custom.hsstrt = hsstrt2hw(par->htotal+16);
custom.hsstop = hsstop2hw(par->htotal+16);
custom.vsstrt = vsstrt2hw(par->vsstrt);
custom.vsstop = vsstrt2hw(par->vsstop);
break;
case VESA_POWERDOWN:
case FB_BLANK_POWERDOWN:
custom.hsstrt = hsstrt2hw(par->htotal+16);
custom.hsstop = hsstop2hw(par->htotal+16);
custom.vsstrt = vsstrt2hw(par->vtotal+4);
......
......@@ -2042,11 +2042,11 @@ static int aty128fb_blank(int blank, struct fb_info *fb)
set_backlight_enable(0);
#endif /* CONFIG_PMAC_BACKLIGHT */
if (blank & VESA_VSYNC_SUSPEND)
if (blank & FB_BLANK_VSYNC_SUSPEND)
state |= 2;
if (blank & VESA_HSYNC_SUSPEND)
if (blank & FB_BLANK_HSYNC_SUSPEND)
state |= 1;
if (blank & VESA_POWERDOWN)
if (blank & FB_BLANK_POWERDOWN)
state |= 4;
aty_st_8(CRTC_EXT_CNTL+1, state);
......
......@@ -2045,7 +2045,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, u32 state)
aty_reset_engine(par);
/* Blank display and LCD */
atyfb_blank(VESA_POWERDOWN + 1, info);
atyfb_blank(FB_BLANK_POWERDOWN, info);
par->asleep = 1;
par->lock_blank = 1;
......@@ -2054,7 +2054,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, u32 state)
if (aty_power_mgmt(1, par)) {
par->asleep = 0;
par->lock_blank = 0;
atyfb_blank(0, info);
atyfb_blank(FB_BLANK_UNBLANK, info);
fb_set_suspend(info, 0);
release_console_sem();
return -EIO;
......@@ -2089,7 +2089,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev)
/* Unblank */
par->lock_blank = 0;
atyfb_blank(0, info);
atyfb_blank(FB_BLANK_UNBLANK, info);
release_console_sem();
......@@ -2625,22 +2625,23 @@ static int atyfb_blank(int blank, struct fb_info *info)
#endif
gen_cntl = aty_ld_8(CRTC_GEN_CNTL, par);
if (blank > 0)
switch (blank - 1) {
case VESA_NO_BLANKING:
switch (blank) {
case FB_BLANK_UNBLANK:
gen_cntl &= ~(0x4c);
break;
case FB_BLANK_NORMAL:
gen_cntl |= 0x40;
break;
case VESA_VSYNC_SUSPEND:
case FB_BLANK_VSYNC_SUSPEND:
gen_cntl |= 0x8;
break;
case VESA_HSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
gen_cntl |= 0x4;
break;
case VESA_POWERDOWN:
case FB_BLANK_POWERDOWN:
gen_cntl |= 0x4c;
break;
} else
gen_cntl &= ~(0x4c);
}
aty_st_8(CRTC_GEN_CNTL, gen_cntl, par);
#ifdef CONFIG_PMAC_BACKLIGHT
......
......@@ -138,17 +138,17 @@ bw2_blank(int blank, struct fb_info *info)
spin_lock_irqsave(&par->lock, flags);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readb(&regs->control);
val |= BWTWO_CTL_ENABLE_VIDEO;
sbus_writeb(val, &regs->control);
par->flags &= ~BW2_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case 2: /* VESA blank (vsync off) */
case 3: /* VESA blank (hsync off) */
case 4: /* Poweroff */
case FB_BLANK_NORMAL: /* Normal blanking */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readb(&regs->control);
val &= ~BWTWO_CTL_ENABLE_VIDEO;
sbus_writeb(val, &regs->control);
......
......@@ -197,17 +197,17 @@ cg3_blank(int blank, struct fb_info *info)
spin_lock_irqsave(&par->lock, flags);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readl(&regs->control);
val |= CG3_CR_ENABLE_VIDEO;
sbus_writel(val, &regs->control);
par->flags &= ~CG3_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case 2: /* VESA blank (vsync off) */
case 3: /* VESA blank (hsync off) */
case 4: /* Poweroff */
case FB_BLANK_NORMAL: /* Normal blanking */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readl(&regs->control);
val |= CG3_CR_ENABLE_VIDEO;
sbus_writel(val, &regs->control);
......
......@@ -456,17 +456,17 @@ cg6_blank(int blank, struct fb_info *info)
spin_lock_irqsave(&par->lock, flags);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readl(&thc->thc_misc);
val |= CG6_THC_MISC_VIDEO;
sbus_writel(val, &thc->thc_misc);
par->flags &= ~CG6_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case 2: /* VESA blank (vsync off) */
case 3: /* VESA blank (hsync off) */
case 4: /* Poweroff */
case FB_BLANK_NORMAL: /* Normal blanking */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readl(&thc->thc_misc);
val &= ~CG6_THC_MISC_VIDEO;
sbus_writel(val, &thc->thc_misc);
......
......@@ -329,17 +329,17 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)
ctrl = ld_le32(CNTRL_REG(p,ctrl));
if (blank_mode > 0)
switch (blank_mode - 1) {
case VESA_VSYNC_SUSPEND:
switch (blank_mode) {
case FB_BLANK_VSYNC_SUSPEND:
ctrl &= ~3;
break;
case VESA_HSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
ctrl &= ~0x30;
break;
case VESA_POWERDOWN:
case FB_BLANK_POWERDOWN:
ctrl &= ~0x33;
/* fall through */
case VESA_NO_BLANKING:
case FB_BLANK_NORMAL:
ctrl |= 0x400;
break;
default:
......
......@@ -1003,16 +1003,16 @@ static int cyber2000fb_blank(int blank, struct fb_info *info)
int i;
switch (blank) {
case 4: /* powerdown - both sync lines down */
case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */
sync = EXT_SYNC_CTL_VS_0 | EXT_SYNC_CTL_HS_0;
break;
case 3: /* hsync off */
case FB_BLANK_HSYNC_SUSPEND: /* hsync off */
sync = EXT_SYNC_CTL_VS_NORMAL | EXT_SYNC_CTL_HS_0;
break;
case 2: /* vsync off */
case FB_BLANK_VSYNC_SUSPEND: /* vsync off */
sync = EXT_SYNC_CTL_VS_0 | EXT_SYNC_CTL_HS_NORMAL;
break;
case 1: /* soft blank */
case FB_BLANK_NORMAL: /* soft blank */
default: /* unblank */
break;
}
......
......@@ -676,7 +676,7 @@ ffb_blank(int blank, struct fb_info *info)
FFBWait(par);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
upa_writel(0x6000, &dac->type);
tmp = (upa_readl(&dac->value) | 0x1);
upa_writel(0x6000, &dac->type);
......@@ -684,10 +684,10 @@ ffb_blank(int blank, struct fb_info *info)
par->flags &= ~FFB_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case 2: /* VESA blank (vsync off) */
case 3: /* VESA blank (hsync off) */
case 4: /* Poweroff */
case FB_BLANK_NORMAL: /* Normal blanking */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
case FB_BLANK_POWERDOWN: /* Poweroff */
upa_writel(0x6000, &dac->type);
tmp = (upa_readl(&dac->value) & ~0x1);
upa_writel(0x6000, &dac->type);
......
......@@ -384,11 +384,11 @@ static int gbefb_blank(int blank, struct fb_info *info)
{
/* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */
switch (blank) {
case 0: /* unblank */
case FB_BLANK_UNBLANK: /* unblank */
gbe_turn_on();
break;
case 1: /* blank */
case FB_BLANK_NORMAL: /* blank */
gbe_turn_off();
break;
......
......@@ -940,9 +940,9 @@ imsttfb_blank(int blank, struct fb_info *info)
ctrl = read_reg_le32(par->dc_regs, STGCTL);
if (blank > 0) {
switch (blank - 1) {
case VESA_NO_BLANKING:
case VESA_POWERDOWN:
switch (blank) {
case FB_BLANK_NORMAL:
case FB_BLANK_POWERDOWN:
ctrl &= ~0x00000380;
if (par->ramdac == IBM) {
par->cmap_regs[PIDXHI] = 0; eieio();
......@@ -958,10 +958,10 @@ imsttfb_blank(int blank, struct fb_info *info)
par->cmap_regs[PIDXDATA] = 0xc0;
}
break;
case VESA_VSYNC_SUSPEND:
case FB_BLANK_VSYNC_SUSPEND:
ctrl &= ~0x00000020;
break;
case VESA_HSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
ctrl &= ~0x00000010;
break;
}
......
......@@ -1191,7 +1191,7 @@ intelfb_set_par(struct fb_info *info)
DBG_MSG("intelfb_set_par (%dx%d-%d)\n", info->var.xres,
info->var.yres, info->var.bits_per_pixel);
intelfb_blank(1, info);
intelfb_blank(FB_BLANK_POWERDOWN, info);
if (dinfo->accel)
intelfbhw_2d_stop(dinfo);
......@@ -1214,7 +1214,7 @@ intelfb_set_par(struct fb_info *info)
intelfb_pan_display(&info->var, info);
intelfb_blank(0, info);
intelfb_blank(FB_BLANK_UNBLANK, info);
if (ACCEL(dinfo, info)) {
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
......
......@@ -341,17 +341,17 @@ intelfbhw_do_blank(int blank, struct fb_info *info)
/* Set DPMS level */
tmp = INREG(ADPA) & ~ADPA_DPMS_CONTROL_MASK;
switch (blank) {
case 0:
case 1:
case FB_BLANK_UNBLANK:
case FB_BLANK_NORMAL:
tmp |= ADPA_DPMS_D0;
break;
case 2:
case FB_BLANK_VSYNC_SUSPEND:
tmp |= ADPA_DPMS_D1;
break;
case 3:
case FB_BLANK_HSYNC_SUSPEND:
tmp |= ADPA_DPMS_D2;
break;
case 4:
case FB_BLANK_POWERDOWN:
tmp |= ADPA_DPMS_D3;
break;
}
......
......@@ -270,17 +270,17 @@ static int leo_blank(int blank, struct fb_info *info)
spin_lock_irqsave(&par->lock, flags);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readl(&lx_krn->krn_csr);
val |= LEO_KRN_CSR_ENABLE;
sbus_writel(val, &lx_krn->krn_csr);
par->flags &= ~LEO_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case 2: /* VESA blank (vsync off) */
case 3: /* VESA blank (hsync off) */
case 4: /* Poweroff */
case FB_BLANK_NORMAL: /* Normal blanking */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readl(&lx_krn->krn_csr);
val &= ~LEO_KRN_CSR_ENABLE;
sbus_writel(val, &lx_krn->krn_csr);
......
......@@ -1183,11 +1183,11 @@ static int matroxfb_blank(int blank, struct fb_info *info)
return 1;
switch (blank) {
case 1: seq = 0x20; crtc = 0x00; break; /* works ??? */
case 2: seq = 0x20; crtc = 0x10; break;
case 3: seq = 0x20; crtc = 0x20; break;
case 4: seq = 0x20; crtc = 0x30; break;
default: seq = 0x00; crtc = 0x00; break;
case FB_BLANK_NORMAL: seq = 0x20; crtc = 0x00; break; /* works ??? */
case FB_BLANK_VSYNC_SUSPEND: seq = 0x20; crtc = 0x10; break;
case FB_BLANK_HSYNC_SUSPEND: seq = 0x20; crtc = 0x20; break;
case FB_BLANK_POWERDOWN: seq = 0x20; crtc = 0x30; break;
default: seq = 0x00; crtc = 0x00; break;
}
CRITBEGIN
......
......@@ -1340,7 +1340,7 @@ int neofb_blank(int blank_mode, struct fb_info *info)
int seqflags, lcdflags, dpmsflags, reg;
switch (blank_mode) {
case 4: /* powerdown - both sync lines down */
case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */
seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
lcdflags = 0; /* LCD off */
dpmsflags = NEO_GR01_SUPPRESS_HSYNC |
......@@ -1358,22 +1358,22 @@ int neofb_blank(int blank_mode, struct fb_info *info)
}
#endif
break;
case 3: /* hsync off */
case FB_BLANK_HSYNC_SUSPEND: /* hsync off */
seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
lcdflags = 0; /* LCD off */
dpmsflags = NEO_GR01_SUPPRESS_HSYNC;
break;
case 2: /* vsync off */
case FB_BLANK_VSYNC_SUSPEND: /* vsync off */
seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
lcdflags = 0; /* LCD off */
dpmsflags = NEO_GR01_SUPPRESS_VSYNC;
break;
case 1: /* just blank screen (backlight stays on) */
case FB_BLANK_NORMAL: /* just blank screen (backlight stays on) */
seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */
dpmsflags = 0; /* no hsync/vsync suppression */
break;
case 0: /* unblank */
case FB_BLANK_UNBLANK: /* unblank */
seqflags = 0; /* Enable sequencer */
lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */
dpmsflags = 0x00; /* no hsync/vsync suppression */
......
......@@ -193,17 +193,17 @@ p9100_blank(int blank, struct fb_info *info)
spin_lock_irqsave(&par->lock, flags);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
val = sbus_readl(&regs->vid_screenpaint_timectl1);
val |= SCREENPAINT_TIMECTL1_ENABLE_VIDEO;
sbus_writel(val, &regs->vid_screenpaint_timectl1);
par->flags &= ~P9100_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case 2: /* VESA blank (vsync off) */
case 3: /* VESA blank (hsync off) */
case 4: /* Poweroff */
case FB_BLANK_NORMAL: /* Normal blanking */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
case FB_BLANK_POWERDOWN: /* Poweroff */
val = sbus_readl(&regs->vid_screenpaint_timectl1);
val &= ~SCREENPAINT_TIMECTL1_ENABLE_VIDEO;
sbus_writel(val, &regs->vid_screenpaint_timectl1);
......
......@@ -971,23 +971,23 @@ static int pm2fb_blank(int blank_mode, struct fb_info *info)
DPRINTK("blank_mode %d\n", blank_mode);
switch (blank_mode) {
case 0:
case FB_BLANK_UNBLANK:
/* Screen: On */
video |= PM2F_VIDEO_ENABLE;
break;
case VESA_NO_BLANKING + 1:
case FB_BLANK_NORMAL:
/* Screen: Off */
video &= ~PM2F_VIDEO_ENABLE;
break;
case VESA_VSYNC_SUSPEND + 1:
case FB_BLANK_VSYNC_SUSPEND:
/* VSync: Off */
video &= ~(PM2F_VSYNC_MASK | PM2F_BLANK_LOW );
break;
case VESA_HSYNC_SUSPEND + 1:
case FB_BLANK_HSYNC_SUSPEND:
/* HSync: Off */
video &= ~(PM2F_HSYNC_MASK | PM2F_BLANK_LOW );
break;
case VESA_POWERDOWN + 1:
case FB_BLANK_POWERDOWN:
/* HSync: Off, VSync: Off */
video &= ~(PM2F_VSYNC_MASK | PM2F_HSYNC_MASK| PM2F_BLANK_LOW);
break;
......
......@@ -371,9 +371,10 @@ static int pxafb_blank(int blank, struct fb_info *info)
DPRINTK("pxafb_blank: blank=%d\n", blank);
switch (blank) {
case VESA_POWERDOWN:
case VESA_VSYNC_SUSPEND:
case VESA_HSYNC_SUSPEND:
case FB_BLANK_POWERDOWN:
case FB_BLANK_VSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_NORMAL:
if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
for (i = 0; i < fbi->palette_size; i++)
......@@ -383,7 +384,7 @@ static int pxafb_blank(int blank, struct fb_info *info)
//TODO if (pxafb_blank_helper) pxafb_blank_helper(blank);
break;
case VESA_NO_BLANKING:
case FB_BLANK_UNBLANK:
//TODO if (pxafb_blank_helper) pxafb_blank_helper(blank);
if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
......
......@@ -1240,22 +1240,25 @@ static int rivafb_blank(int blank, struct fb_info *info)
vesa = CRTCin(par, 0x1a) & ~0xc0; /* sync on/off */
NVTRACE_ENTER();
if (blank) {
if (blank)
tmp |= 0x20;
switch (blank - 1) {
case VESA_NO_BLANKING:
break;
case VESA_VSYNC_SUSPEND:
vesa |= 0x80;
break;
case VESA_HSYNC_SUSPEND:
vesa |= 0x40;
break;
case VESA_POWERDOWN:
vesa |= 0xc0;
break;
}
switch (blank) {
case FB_BLANK_UNBLANK:
case FB_BLANK_NORMAL:
break;
case FB_BLANK_VSYNC_SUSPEND:
vesa |= 0x80;
break;
case FB_BLANK_HSYNC_SUSPEND:
vesa |= 0x40;
break;
case FB_BLANK_POWERDOWN:
vesa |= 0xc0;
break;
}
SEQout(par, 0x01, tmp);
CRTCout(par, 0x1a, vesa);
......@@ -1266,6 +1269,7 @@ static int rivafb_blank(int blank, struct fb_info *info)
#endif
NVTRACE_LEAVE();
return 0;
}
......
......@@ -1061,9 +1061,10 @@ static int sa1100fb_blank(int blank, struct fb_info *info)
DPRINTK("sa1100fb_blank: blank=%d\n", blank);
switch (blank) {
case VESA_POWERDOWN:
case VESA_VSYNC_SUSPEND:
case VESA_HSYNC_SUSPEND:
case FB_BLANK_POWERDOWN:
case FB_BLANK_VSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_NORMAL:
if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
for (i = 0; i < fbi->palette_size; i++)
......@@ -1071,7 +1072,7 @@ static int sa1100fb_blank(int blank, struct fb_info *info)
sa1100fb_schedule_work(fbi, C_DISABLE);
break;
case VESA_NO_BLANKING:
case FB_BLANK_UNBLANK:
if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
fb_set_cmap(&fbi->fb.cmap, info);
......
......@@ -207,26 +207,26 @@ tcx_blank(int blank, struct fb_info *info)
val = sbus_readl(&thc->thc_misc);
switch (blank) {
case 0: /* Unblanking */
case FB_BLAnK_UNBLANK: /* Unblanking */
val &= ~(TCX_THC_MISC_VSYNC_DIS |
TCX_THC_MISC_HSYNC_DIS);
val |= TCX_THC_MISC_VIDEO;
par->flags &= ~TCX_FLAG_BLANKED;
break;
case 1: /* Normal blanking */
case FB_BLANK_NORMAL: /* Normal blanking */
val &= ~TCX_THC_MISC_VIDEO;
par->flags |= TCX_FLAG_BLANKED;
break;
case 2: /* VESA blank (vsync off) */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
val |= TCX_THC_MISC_VSYNC_DIS;
break;
case 3: /* VESA blank (hsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
val |= TCX_THC_MISC_HSYNC_DIS;
break;
case 4: /* Poweroff */
case FB_BLANK_POWERDOWN: /* Poweroff */
break;
};
......
......@@ -837,23 +837,23 @@ static int tdfxfb_blank(int blank, struct fb_info *info)
dacmode = tdfx_inl(par, DACMODE);
switch (blank) {
case 0: /* Screen: On; HSync: On, VSync: On */
case FB_BLANK_UNBLANK: /* Screen: On; HSync: On, VSync: On */
state = 0;
vgablank = 0;
break;
case 1: /* Screen: Off; HSync: On, VSync: On */
case FB_BLANK_NORMAL: /* Screen: Off; HSync: On, VSync: On */
state = 0;
vgablank = 1;
break;
case 2: /* Screen: Off; HSync: On, VSync: Off */
case FB_BLANK_VSYNC_SUSPEND: /* Screen: Off; HSync: On, VSync: Off */
state = BIT(3);
vgablank = 1;
break;
case 3: /* Screen: Off; HSync: Off, VSync: On */
case FB_BLANK_HSYNC_SUSPEND: /* Screen: Off; HSync: Off, VSync: On */
state = BIT(1);
vgablank = 1;
break;
case 4: /* Screen: Off; HSync: Off, VSync: Off */
case FB_BLANK_POWERDOWN: /* Screen: Off; HSync: Off, VSync: Off */
state = BIT(1) | BIT(3);
vgablank = 1;
break;
......
......@@ -468,7 +468,7 @@ tgafb_blank(int blank, struct fb_info *info)
vvvr &= ~(TGA_VALID_VIDEO | TGA_VALID_BLANK);
switch (blank) {
case 0: /* Unblanking */
case FB_BLANK_UNBLANK: /* Unblanking */
if (par->vesa_blanked) {
TGA_WRITE_REG(par, vhcr & 0xbfffffff, TGA_HORIZ_REG);
TGA_WRITE_REG(par, vvcr & 0xbfffffff, TGA_VERT_REG);
......@@ -477,24 +477,24 @@ tgafb_blank(int blank, struct fb_info *info)
TGA_WRITE_REG(par, vvvr | TGA_VALID_VIDEO, TGA_VALID_REG);
break;
case 1: /* Normal blanking */
case FB_BLANK_NORMAL: /* Normal blanking */
TGA_WRITE_REG(par, vvvr | TGA_VALID_VIDEO | TGA_VALID_BLANK,
TGA_VALID_REG);
break;
case 2: /* VESA blank (vsync off) */
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
TGA_WRITE_REG(par, vvcr | 0x40000000, TGA_VERT_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG);
par->vesa_blanked = 1;
break;
case 3: /* VESA blank (hsync off) */
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
TGA_WRITE_REG(par, vhcr | 0x40000000, TGA_HORIZ_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG);
par->vesa_blanked = 1;
break;
case 4: /* Poweroff */
case FB_BLANK_POWERDOWN: /* Poweroff */
TGA_WRITE_REG(par, vhcr | 0x40000000, TGA_HORIZ_REG);
TGA_WRITE_REG(par, vvcr | 0x40000000, TGA_VERT_REG);
TGA_WRITE_REG(par, vvvr | TGA_VALID_BLANK, TGA_VALID_REG);
......
......@@ -1017,22 +1017,24 @@ static int tridentfb_blank(int blank_mode, struct fb_info *info)
DPMSCont = read3CE(PowerStatus) & 0xFC;
switch (blank_mode)
{
case VESA_NO_BLANKING:
case FB_BLANK_UNBLANK:
/* Screen: On, HSync: On, VSync: On */
case FB_BLANK_NORMAL:
/* Screen: Off, HSync: On, VSync: On */
PMCont |= 0x03;
DPMSCont |= 0x00;
break;
case VESA_HSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
/* Screen: Off, HSync: Off, VSync: On */
PMCont |= 0x02;
DPMSCont |= 0x01;
break;
case VESA_VSYNC_SUSPEND:
case FB_BLANK_VSYNC_SUSPEND:
/* Screen: Off, HSync: On, VSync: Off */
PMCont |= 0x02;
DPMSCont |= 0x02;
break;
case VESA_POWERDOWN:
case FB_BLANK_POWERDOWN:
/* Screen: Off, HSync: Off, VSync: Off */
PMCont |= 0x00;
DPMSCont |= 0x03;
......@@ -1044,7 +1046,9 @@ static int tridentfb_blank(int blank_mode, struct fb_info *info)
t_outb(PMCont,0x83C6);
debug("exit\n");
return 0;
/* let fbcon do a softblank for us */
return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0;
}
static int __devinit trident_pci_probe(struct pci_dev * dev, const struct pci_device_id * id)
......
......@@ -207,13 +207,13 @@ static int valkyriefb_blank(int blank_mode, struct fb_info *info)
return 1;
switch (blank_mode) {
case 0: /* unblank */
case FB_BLANK_UNBLANK: /* unblank */
out_8(&p->valkyrie_regs->mode.r, init->mode);
break;
case 1:
case FB_BLANK_NORMAL:
return 1; /* get caller to set CLUT to all black */
case VESA_VSYNC_SUSPEND+1:
case VESA_HSYNC_SUSPEND+1:
case FB_BLANK_VSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
/*
* [kps] Value extracted from MacOS. I don't know
* whether this bit disables hsync or vsync, or
......@@ -221,7 +221,7 @@ static int valkyriefb_blank(int blank_mode, struct fb_info *info)
*/
out_8(&p->valkyrie_regs->mode.r, init->mode | 0x40);
break;
case VESA_POWERDOWN+1:
case FB_BLANK_POWERDOWN:
out_8(&p->valkyrie_regs->mode.r, 0x66);
break;
}
......
......@@ -771,7 +771,7 @@ static void vga_vesa_blank(struct vga16fb_par *par, int mode)
* <Start of vertical Retrace> to maximum (incl. overflow)
* Result: turn off vertical sync (VSync) pulse.
*/
if (mode & VESA_VSYNC_SUSPEND) {
if (mode & FB_BLANK_VSYNC_SUSPEND) {
outb_p(0x10,vga_video_port_reg); /* StartVertRetrace */
outb_p(0xff,vga_video_port_val); /* maximum value */
outb_p(0x11,vga_video_port_reg); /* EndVertRetrace */
......@@ -780,7 +780,7 @@ static void vga_vesa_blank(struct vga16fb_par *par, int mode)
outb_p(par->vga_state.Overflow | 0x84,vga_video_port_val); /* bits 9,10 of vert. retrace */
}
if (mode & VESA_HSYNC_SUSPEND) {
if (mode & FB_BLANK_HSYNC_SUSPEND) {
/*
* Set <End of horizontal retrace> to minimum (0) and
* <Start of horizontal Retrace> to maximum
......@@ -853,7 +853,7 @@ static int vga16fb_blank(int blank, struct fb_info *info)
struct vga16fb_par *par = (struct vga16fb_par *) info->par;
switch (blank) {
case 0: /* Unblank */
case FB_BLANK_UNBLANK: /* Unblank */
if (par->vesa_blanked) {
vga_vesa_unblank(par);
par->vesa_blanked = 0;
......@@ -862,12 +862,12 @@ static int vga16fb_blank(int blank, struct fb_info *info)
par->palette_blanked = 0;
}
break;
case 1: /* blank */
case FB_BLANK_NORMAL: /* blank */
vga_pal_blank();
par->palette_blanked = 1;
break;
default: /* VESA blanking */
vga_vesa_blank(par, blank-1);
vga_vesa_blank(par, blank);
par->vesa_blanked = 1;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment