]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/s1d13xxxfb.c
Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / drivers / video / s1d13xxxfb.c
index feec47bdd47996dbe4ab22ee8fbbc3859585a8dd..a7b01d2724b5110ce4365fa35e8c32c05c6b385c 100644 (file)
@@ -28,7 +28,6 @@
  * more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #define dbg(fmt, args...) do { } while (0)
 #endif
 
+static const int __devinitconst s1d13xxxfb_revisions[] = {
+       S1D13506_CHIP_REV,      /* Rev.4 on HP Jornada 7xx S1D13506 */
+       S1D13806_CHIP_REV,      /* Rev.7 on .. */
+};
+
 /*
  * Here we define the default struct fb_fix_screeninfo
  */
@@ -539,9 +543,10 @@ s1d13xxxfb_probe(struct platform_device *pdev)
        struct fb_info *info;
        struct s1d13xxxfb_pdata *pdata = NULL;
        int ret = 0;
+       int i;
        u8 revision;
 
-       dbg("probe called: device is %p\n", dev);
+       dbg("probe called: device is %p\n", pdev);
 
        printk(KERN_INFO "Epson S1D13XXX FB Driver\n");
 
@@ -608,10 +613,19 @@ s1d13xxxfb_probe(struct platform_device *pdev)
                goto bail;
        }
 
-       revision = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE);
-       if ((revision >> 2) != S1D_CHIP_REV) {
-               printk(KERN_INFO PFX "chip not found: %i\n", (revision >> 2));
-               ret = -ENODEV;
+       revision = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE) >> 2;
+
+       ret = -ENODEV;
+
+       for (i = 0; i < ARRAY_SIZE(s1d13xxxfb_revisions); i++) {
+               if (revision == s1d13xxxfb_revisions[i])
+                       ret = 0;
+       }
+
+       if (!ret)
+               printk(KERN_INFO PFX "chip revision %i\n", revision);
+       else {
+               printk(KERN_INFO PFX "unknown chip revision %i\n", revision);
                goto bail;
        }
 
@@ -754,8 +768,11 @@ static struct platform_driver s1d13xxxfb_driver = {
 static int __init
 s1d13xxxfb_init(void)
 {
+
+#ifndef MODULE
        if (fb_get_options("s1d13xxxfb", NULL))
                return -ENODEV;
+#endif
 
        return platform_driver_register(&s1d13xxxfb_driver);
 }