Commit 6931a764 authored by Arnaud Patard's avatar Arnaud Patard Committed by Linus Torvalds

[PATCH] s3c2410fb: Fix resume

regs.lcdcon1 was not updated on suspend.  The result was a garbaged display on
resume.  This bug was first noticed by Christer Weinigel.  This patch is a
modified version of the one he sent to me.
Signed-off-by: default avatarArnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c72755b3
...@@ -641,6 +641,7 @@ static int __init s3c2410fb_probe(struct platform_device *pdev) ...@@ -641,6 +641,7 @@ static int __init s3c2410fb_probe(struct platform_device *pdev)
int ret; int ret;
int irq; int irq;
int i; int i;
u32 lcdcon1;
mach_info = pdev->dev.platform_data; mach_info = pdev->dev.platform_data;
if (mach_info == NULL) { if (mach_info == NULL) {
...@@ -672,6 +673,11 @@ static int __init s3c2410fb_probe(struct platform_device *pdev) ...@@ -672,6 +673,11 @@ static int __init s3c2410fb_probe(struct platform_device *pdev)
memcpy(&info->regs, &mach_info->regs, sizeof(info->regs)); memcpy(&info->regs, &mach_info->regs, sizeof(info->regs));
/* Stop the video and unset ENVID if set */
info->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
lcdcon1 = readl(S3C2410_LCDCON1);
writel(lcdcon1 & ~S3C2410_LCDCON1_ENVID, S3C2410_LCDCON1);
info->mach_info = pdev->dev.platform_data; info->mach_info = pdev->dev.platform_data;
fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
...@@ -794,15 +800,14 @@ static int __init s3c2410fb_probe(struct platform_device *pdev) ...@@ -794,15 +800,14 @@ static int __init s3c2410fb_probe(struct platform_device *pdev)
* shutdown the lcd controller * shutdown the lcd controller
*/ */
static void s3c2410fb_stop_lcd(void) static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
{ {
unsigned long flags; unsigned long flags;
unsigned long tmp;
local_irq_save(flags); local_irq_save(flags);
tmp = readl(S3C2410_LCDCON1); fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
writel(tmp & ~S3C2410_LCDCON1_ENVID, S3C2410_LCDCON1); writel(fbi->regs.lcdcon1, S3C2410_LCDCON1);
local_irq_restore(flags); local_irq_restore(flags);
} }
...@@ -816,7 +821,7 @@ static int s3c2410fb_remove(struct platform_device *pdev) ...@@ -816,7 +821,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)
struct s3c2410fb_info *info = fbinfo->par; struct s3c2410fb_info *info = fbinfo->par;
int irq; int irq;
s3c2410fb_stop_lcd(); s3c2410fb_stop_lcd(info);
msleep(1); msleep(1);
s3c2410fb_unmap_video_memory(info); s3c2410fb_unmap_video_memory(info);
...@@ -844,7 +849,7 @@ static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state) ...@@ -844,7 +849,7 @@ static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
struct fb_info *fbinfo = platform_get_drvdata(dev); struct fb_info *fbinfo = platform_get_drvdata(dev);
struct s3c2410fb_info *info = fbinfo->par; struct s3c2410fb_info *info = fbinfo->par;
s3c2410fb_stop_lcd(); s3c2410fb_stop_lcd(info);
/* sleep before disabling the clock, we need to ensure /* sleep before disabling the clock, we need to ensure
* the LCD DMA engine is not going to get back on the bus * the LCD DMA engine is not going to get back on the bus
......
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