Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97269
b: refs/heads/master
c: 673b460
h: refs/heads/master
i:
  97267: 4a9e68b
v: v3
  • Loading branch information
Ben Dooks authored and Linus Torvalds committed May 24, 2008
1 parent 62927f4 commit e708469
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cdc83ae2453ddb19060e05e6afd22b1254128c42
refs/heads/master: 673b4600e3b3cc6689025e6a6fc6909b6e53dd5e
49 changes: 29 additions & 20 deletions trunk/drivers/video/s3c2410fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,27 @@ static int s3c2410fb_setcolreg(unsigned regno,
return 0;
}

/* s3c2410fb_lcd_enable
*
* shutdown the lcd controller
*/
static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable)
{
unsigned long flags;

local_irq_save(flags);

if (enable)
fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID;
else
fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;

writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);

local_irq_restore(flags);
}


/*
* s3c2410fb_blank
* @blank_mode: the blank mode we want.
Expand All @@ -589,9 +610,6 @@ static int s3c2410fb_setcolreg(unsigned regno,
* blanking succeeded, != 0 if un-/blanking failed due to e.g. a
* video mode which doesn't support it. Implements VESA suspend
* and powerdown modes on hardware that supports disabling hsync/vsync:
* blank_mode == 2: suspend vsync
* blank_mode == 3: suspend hsync
* blank_mode == 4: powerdown
*
* Returns negative errno on error, or zero on success.
*
Expand All @@ -605,6 +623,12 @@ static int s3c2410fb_blank(int blank_mode, struct fb_info *info)

tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL;

if (blank_mode == FB_BLANK_POWERDOWN) {
s3c2410fb_lcd_enable(fbi, 0);
} else {
s3c2410fb_lcd_enable(fbi, 1);
}

if (blank_mode == FB_BLANK_UNBLANK)
writel(0x0, tpal_reg);
else {
Expand Down Expand Up @@ -983,21 +1007,6 @@ static int __init s3c2412fb_probe(struct platform_device *pdev)
return s3c24xxfb_probe(pdev, DRV_S3C2412);
}

/* s3c2410fb_stop_lcd
*
* shutdown the lcd controller
*/
static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
{
unsigned long flags;

local_irq_save(flags);

fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);

local_irq_restore(flags);
}

/*
* Cleanup
Expand All @@ -1010,7 +1019,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)

unregister_framebuffer(fbinfo);

s3c2410fb_stop_lcd(info);
s3c2410fb_lcd_enable(info, 0);
msleep(1);

s3c2410fb_unmap_video_memory(fbinfo);
Expand Down Expand Up @@ -1043,7 +1052,7 @@ static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
struct fb_info *fbinfo = platform_get_drvdata(dev);
struct s3c2410fb_info *info = fbinfo->par;

s3c2410fb_stop_lcd(info);
s3c2410fb_lcd_enable(info, 0);

/* sleep before disabling the clock, we need to ensure
* the LCD DMA engine is not going to get back on the bus
Expand Down

0 comments on commit e708469

Please sign in to comment.