]> err.no Git - linux-2.6/blobdiff - drivers/video/geode/lxfb_core.c
Merge commit 'gcl/gcl-next'
[linux-2.6] / drivers / video / geode / lxfb_core.c
index 1da944bdb11a06862872895b7daa5d9c2aec8749..2cd9b74d222545ea771d653cf1d558be43c2173b 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/console.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
+#include <linux/suspend.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
 static char *mode_option;
 static int noclear, nopanel, nocrt;
 static int vram;
+static int vt_switch;
 
 /* Most of these modes are sorted in ascending order, but
  * since the first entry in this table is the "default" mode,
  * we try to make it something sane - 640x480-60 is sane
  */
 
-static const struct fb_videomode geode_modedb[] __initdata = {
+static struct fb_videomode geode_modedb[] __initdata = {
        /* 640x480-60 */
        { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2,
          FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
@@ -215,6 +217,35 @@ static const struct fb_videomode geode_modedb[] __initdata = {
          0, FB_VMODE_NONINTERLACED, 0 },
 };
 
+#ifdef CONFIG_OLPC
+#include <asm/olpc.h>
+
+static struct fb_videomode olpc_dcon_modedb[] __initdata = {
+       /* The only mode the DCON has is 1200x900 */
+       { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
+         FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+         FB_VMODE_NONINTERLACED, 0 }
+};
+
+static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size)
+{
+       if (olpc_has_dcon()) {
+               *modedb = (struct fb_videomode *) olpc_dcon_modedb;
+               *size = ARRAY_SIZE(olpc_dcon_modedb);
+       } else {
+               *modedb = (struct fb_videomode *) geode_modedb;
+               *size = ARRAY_SIZE(geode_modedb);
+       }
+}
+
+#else
+static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size)
+{
+       *modedb = (struct fb_videomode *) geode_modedb;
+       *size = ARRAY_SIZE(geode_modedb);
+}
+#endif
+
 static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
        if (var->xres > 1920 || var->yres > 1440)
@@ -475,7 +506,7 @@ static int __init lxfb_probe(struct pci_dev *pdev,
        int ret;
 
        struct fb_videomode *modedb_ptr;
-       int modedb_size;
+       unsigned int modedb_size;
 
        info = lxfb_init_fbinfo(&pdev->dev);
 
@@ -500,9 +531,7 @@ static int __init lxfb_probe(struct pci_dev *pdev,
 
        /* Set up the mode database */
 
-       modedb_ptr = (struct fb_videomode *) geode_modedb;
-       modedb_size = ARRAY_SIZE(geode_modedb);
-
+       get_modedb(&modedb_ptr, &modedb_size);
        ret = fb_find_mode(&info->var, info, mode_option,
                           modedb_ptr, modedb_size, NULL, 16);
 
@@ -523,6 +552,8 @@ static int __init lxfb_probe(struct pci_dev *pdev,
        lxfb_check_var(&info->var, info);
        lxfb_set_par(info);
 
+       pm_set_vt_switch(vt_switch);
+
        if (register_framebuffer(info) < 0) {
                ret = -EINVAL;
                goto err;
@@ -648,5 +679,8 @@ MODULE_PARM_DESC(mode_option, "video mode (<x>x<y>[-<bpp>][@<refr>])");
 module_param(vram, int, 0);
 MODULE_PARM_DESC(vram, "video memory size");
 
+module_param(vt_switch, int, 0);
+MODULE_PARM_DESC(vt_switch, "enable VT switch during suspend/resume");
+
 MODULE_DESCRIPTION("Framebuffer driver for the AMD Geode LX");
 MODULE_LICENSE("GPL");