All pastes #234788 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-11-02 20:36 UTC
rendered paste body
Index: linux-2.6/drivers/video/s3c2410fb.c
===================================================================
--- linux-2.6.orig/drivers/video/s3c2410fb.c    2006-01-05 22:36:32.000000000 +0100
+++ linux-2.6/drivers/video/s3c2410fb.c 2006-01-09 21:50:47.000000000 +0100
@@ -769,6 +769,7 @@
        int ret;
        int irq;
        int i;
+       u32 lcdcon1;
                                                                                                                                                             
        mach_info = pdev->dev.platform_data;
        if (mach_info == NULL) {
@@ -800,6 +801,11 @@
                                                                                                                                                             
        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);
+
        info->mach_info             = pdev->dev.platform_data;
                                                                                                                                                             
        fbinfo->fix.type            = FB_TYPE_PACKED_PIXELS;
@@ -924,15 +930,14 @@
  * shutdown the lcd controller
 */
                                                                                                                                                             
-static void s3c2410fb_stop_lcd(void)
+static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
 {
        unsigned long flags;
-       unsigned long tmp;
                                                                                                                                                             
        local_irq_save(flags);
                                                                                                                                                             
-       tmp = readl(S3C2410_LCDCON1);
-       writel(tmp & ~S3C2410_LCDCON1_ENVID, S3C2410_LCDCON1);
+       fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
+       writel(fbi->regs.lcdcon1, S3C2410_LCDCON1);
                                                                                                                                                             
        local_irq_restore(flags);
 }
@@ -946,7 +951,7 @@
        struct s3c2410fb_info *info = fbinfo->par;
        int irq;
  
-       s3c2410fb_stop_lcd();
+       s3c2410fb_stop_lcd(info);
        msleep(1);
  
        s3c2410fb_unmap_video_memory(info);
@@ -975,7 +980,7 @@
        struct fb_info     *fbinfo = platform_get_drvdata(dev);
        struct s3c2410fb_info *info = fbinfo->par;
  
-       s3c2410fb_stop_lcd();
+       s3c2410fb_stop_lcd(info);
  
        /* sleep before disabling the clock, we need to ensure
         * the LCD DMA engine is not going to get back on the bus