intelfb: support 945GME (as used in ASUS Eee 901)
[safe/jmp/linux-2.6] / drivers / video / au1100fb.c
index ef5c16f..62bd444 100644 (file)
@@ -115,6 +115,52 @@ static int nocursor = 0;
 module_param(nocursor, int, 0644);
 MODULE_PARM_DESC(nocursor, "cursor enable/disable");
 
+/* fb_blank
+ * Blank the screen. Depending on the mode, the screen will be
+ * activated with the backlight color, or desactivated
+ */
+static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
+{
+       struct au1100fb_device *fbdev = to_au1100fb_device(fbi);
+
+       print_dbg("fb_blank %d %p", blank_mode, fbi);
+
+       switch (blank_mode) {
+
+       case VESA_NO_BLANKING:
+                       /* Turn on panel */
+                       fbdev->regs->lcd_control |= LCD_CONTROL_GO;
+#ifdef CONFIG_MIPS_PB1100
+                       if (drv_info.panel_idx == 1) {
+                               au_writew(au_readw(PB1100_G_CONTROL)
+                                         | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
+                       PB1100_G_CONTROL);
+                       }
+#endif
+               au_sync();
+               break;
+
+       case VESA_VSYNC_SUSPEND:
+       case VESA_HSYNC_SUSPEND:
+       case VESA_POWERDOWN:
+                       /* Turn off panel */
+                       fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
+#ifdef CONFIG_MIPS_PB1100
+                       if (drv_info.panel_idx == 1) {
+                               au_writew(au_readw(PB1100_G_CONTROL)
+                                         & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
+                       PB1100_G_CONTROL);
+                       }
+#endif
+               au_sync();
+               break;
+       default:
+               break;
+
+       }
+       return 0;
+}
+
 /*
  * Set hardware with var settings. This will enable the controller with a specific
  * mode, normally validated with the fb_check_var method
@@ -272,52 +318,6 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned
        return 0;
 }
 
-/* fb_blank
- * Blank the screen. Depending on the mode, the screen will be
- * activated with the backlight color, or desactivated
- */
-int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
-{
-       struct au1100fb_device *fbdev = to_au1100fb_device(fbi);
-
-       print_dbg("fb_blank %d %p", blank_mode, fbi);
-
-       switch (blank_mode) {
-
-       case VESA_NO_BLANKING:
-                       /* Turn on panel */
-                       fbdev->regs->lcd_control |= LCD_CONTROL_GO;
-#ifdef CONFIG_MIPS_PB1100
-                       if (drv_info.panel_idx == 1) {
-                               au_writew(au_readw(PB1100_G_CONTROL)
-                                         | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
-                       PB1100_G_CONTROL);
-                       }
-#endif
-               au_sync();
-               break;
-
-       case VESA_VSYNC_SUSPEND:
-       case VESA_HSYNC_SUSPEND:
-       case VESA_POWERDOWN:
-                       /* Turn off panel */
-                       fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
-#ifdef CONFIG_MIPS_PB1100
-                       if (drv_info.panel_idx == 1) {
-                               au_writew(au_readw(PB1100_G_CONTROL)
-                                         & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
-                       PB1100_G_CONTROL);
-                       }
-#endif
-               au_sync();
-               break;
-       default:
-               break;
-
-       }
-       return 0;
-}
-
 /* fb_pan_display
  * Pan display in x and/or y as specified
  */
@@ -457,7 +457,7 @@ static struct fb_ops au1100fb_ops =
 
 /* AU1100 LCD controller device driver */
 
-int au1100fb_drv_probe(struct device *dev)
+static int __init au1100fb_drv_probe(struct device *dev)
 {
        struct au1100fb_device *fbdev = NULL;
        struct resource *regs_res;
@@ -468,11 +468,10 @@ int au1100fb_drv_probe(struct device *dev)
                        return -EINVAL;
 
        /* Allocate new device private */
-       if (!(fbdev = kmalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) {
+       if (!(fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) {
                print_err("fail to allocate device private record");
                return -ENOMEM;
        }
-       memset((void*)fbdev, 0, sizeof(struct au1100fb_device));
 
        fbdev->panel = &known_lcd_panels[drv_info.panel_idx];
 
@@ -549,10 +548,9 @@ int au1100fb_drv_probe(struct device *dev)
        fbdev->info.fbops = &au1100fb_ops;
        fbdev->info.fix = au1100fb_fix;
 
-       if (!(fbdev->info.pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL))) {
+       if (!(fbdev->info.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL))) {
                return -ENOMEM;
        }
-       memset(fbdev->info.pseudo_palette, 0, sizeof(u32) * 16);
 
        if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
                print_err("Fail to allocate colormap (%d entries)",