]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/geode/gx1fb_core.c
Merge commit 'kumar/kumar-next' into next
[linux-2.6-omap-h63xx.git] / drivers / video / geode / gx1fb_core.c
index bcf9cea54d8ba7448ad298dd75c13648c48d5047..751e491ca8c8ee61cdc1211f7b3548783efe853a 100644 (file)
@@ -217,8 +217,7 @@ static int __init gx1fb_map_video_memory(struct fb_info *info, struct pci_dev *d
        ret = pci_request_region(dev, 0, "gx1fb (video)");
        if (ret < 0)
                return ret;
-       par->vid_regs = ioremap(pci_resource_start(dev, 0),
-                               pci_resource_len(dev, 0));
+       par->vid_regs = pci_ioremap_bar(dev, 0);
        if (!par->vid_regs)
                return -ENOMEM;
 
@@ -401,6 +400,30 @@ static void gx1fb_remove(struct pci_dev *pdev)
        framebuffer_release(info);
 }
 
+#ifndef MODULE
+static void __init gx1fb_setup(char *options)
+{
+       char *this_opt;
+
+       if (!options || !*options)
+               return;
+
+       while ((this_opt = strsep(&options, ","))) {
+               if (!*this_opt)
+                       continue;
+
+               if (!strncmp(this_opt, "mode:", 5))
+                       strlcpy(mode_option, this_opt + 5, sizeof(mode_option));
+               else if (!strncmp(this_opt, "crt:", 4))
+                       crt_option = !!simple_strtoul(this_opt + 4, NULL, 0);
+               else if (!strncmp(this_opt, "panel:", 6))
+                       strlcpy(panel_option, this_opt + 6, sizeof(panel_option));
+               else
+                       strlcpy(mode_option, this_opt, sizeof(mode_option));
+       }
+}
+#endif
+
 static struct pci_device_id gx1fb_id_table[] = {
        { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_VIDEO,
          PCI_ANY_ID, PCI_ANY_ID, PCI_BASE_CLASS_DISPLAY << 16,
@@ -420,8 +443,11 @@ static struct pci_driver gx1fb_driver = {
 static int __init gx1fb_init(void)
 {
 #ifndef MODULE
-       if (fb_get_options("gx1fb", NULL))
+       char *option = NULL;
+
+       if (fb_get_options("gx1fb", &option))
                return -ENODEV;
+       gx1fb_setup(option);
 #endif
        return pci_register_driver(&gx1fb_driver);
 }