This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / video / pxafb.c
index a8389c6..3e2bb2d 100644 (file)
@@ -371,10 +371,9 @@ static int pxafb_blank(int blank, struct fb_info *info)
        DPRINTK("pxafb_blank: blank=%d\n", blank);
 
        switch (blank) {
-       case FB_BLANK_POWERDOWN:
-       case FB_BLANK_VSYNC_SUSPEND:
-       case FB_BLANK_HSYNC_SUSPEND:
-       case FB_BLANK_NORMAL:
+       case VESA_POWERDOWN:
+       case VESA_VSYNC_SUSPEND:
+       case VESA_HSYNC_SUSPEND:
                if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
                    fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
                        for (i = 0; i < fbi->palette_size; i++)
@@ -384,7 +383,7 @@ static int pxafb_blank(int blank, struct fb_info *info)
                //TODO if (pxafb_blank_helper) pxafb_blank_helper(blank);
                break;
 
-       case FB_BLANK_UNBLANK:
+       case VESA_NO_BLANKING:
                //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)
@@ -653,7 +652,6 @@ static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
 
 static void pxafb_setup_gpio(struct pxafb_info *fbi)
 {
-       int gpio, ldd_bits;
         unsigned int lccr0 = fbi->lccr0;
 
        /*
@@ -664,31 +662,49 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi)
        if ((lccr0 & LCCR0_CMS) == LCCR0_Mono &&
            (lccr0 & LCCR0_SDS) == LCCR0_Sngl &&
            (lccr0 & LCCR0_DPD) == LCCR0_4PixMono)
-               ldd_bits = 4;
+       {
+               // bits 58-61
+               GPDR1 |= (0xf << 26);
+               GAFR1_U = (GAFR1_U & ~(0xff << 20)) | (0xaa << 20);
+
+               // bits 74-77
+               GPDR2 |= (0xf << 10);
+               GAFR2_L = (GAFR2_L & ~(0xff << 20)) | (0xaa << 20);
+       }
 
        /* 8 bit interface */
         else if (((lccr0 & LCCR0_CMS) == LCCR0_Mono &&
                  ((lccr0 & LCCR0_SDS) == LCCR0_Dual || (lccr0 & LCCR0_DPD) == LCCR0_8PixMono)) ||
                  ((lccr0 & LCCR0_CMS) == LCCR0_Color &&
                  (lccr0 & LCCR0_PAS) == LCCR0_Pas && (lccr0 & LCCR0_SDS) == LCCR0_Sngl))
-               ldd_bits = 8;
+       {
+               // bits 58-65
+               GPDR1 |= (0x3f << 26);
+               GPDR2 |= (0x3);
+
+               GAFR1_U = (GAFR1_U & ~(0xfff << 20)) | (0xaaa << 20);
+               GAFR2_L = (GAFR2_L & ~0xf) | (0xa);
+
+               // bits 74-77
+               GPDR2 |= (0xf << 10);
+               GAFR2_L = (GAFR2_L & ~(0xff << 20)) | (0xaa << 20);
+       }
 
        /* 16 bit interface */
        else if ((lccr0 & LCCR0_CMS) == LCCR0_Color &&
                 ((lccr0 & LCCR0_SDS) == LCCR0_Dual || (lccr0 & LCCR0_PAS) == LCCR0_Act))
-               ldd_bits = 16;
+       {
+               // bits 58-77
+               GPDR1 |= (0x3f << 26);
+               GPDR2 |= 0x00003fff;
+
+               GAFR1_U = (GAFR1_U & ~(0xfff << 20)) | (0xaaa << 20);
+               GAFR2_L = (GAFR2_L & 0xf0000000) | 0x0aaaaaaa;
+       }
 
        else {
                printk(KERN_ERR "pxafb_setup_gpio: unable to determine bits per pixel\n");
-               return;
         }
-
-       for (gpio = 58; ldd_bits; gpio++, ldd_bits--)
-               pxa_gpio_mode(gpio | GPIO_ALT_FN_2_OUT);
-       pxa_gpio_mode(GPIO74_LCD_FCLK_MD);
-       pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
-       pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
-       pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
 }
 
 static void pxafb_enable_controller(struct pxafb_info *fbi)
@@ -1027,6 +1043,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
        fbi->fb.fbops           = &pxafb_ops;
        fbi->fb.flags           = FBINFO_DEFAULT;
        fbi->fb.node            = -1;
+       fbi->fb.currcon         = -1;
 
        addr = fbi;
        addr = addr + sizeof(struct pxafb_info);