aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/s1d13xxxfb.c23
-rw-r--r--include/video/s1d13xxxfb.h3
2 files changed, 21 insertions, 5 deletions
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index b829dc7c5edf..a7b01d2724b5 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -50,6 +50,11 @@
50#define dbg(fmt, args...) do { } while (0) 50#define dbg(fmt, args...) do { } while (0)
51#endif 51#endif
52 52
53static const int __devinitconst s1d13xxxfb_revisions[] = {
54 S1D13506_CHIP_REV, /* Rev.4 on HP Jornada 7xx S1D13506 */
55 S1D13806_CHIP_REV, /* Rev.7 on .. */
56};
57
53/* 58/*
54 * Here we define the default struct fb_fix_screeninfo 59 * Here we define the default struct fb_fix_screeninfo
55 */ 60 */
@@ -538,6 +543,7 @@ s1d13xxxfb_probe(struct platform_device *pdev)
538 struct fb_info *info; 543 struct fb_info *info;
539 struct s1d13xxxfb_pdata *pdata = NULL; 544 struct s1d13xxxfb_pdata *pdata = NULL;
540 int ret = 0; 545 int ret = 0;
546 int i;
541 u8 revision; 547 u8 revision;
542 548
543 dbg("probe called: device is %p\n", pdev); 549 dbg("probe called: device is %p\n", pdev);
@@ -607,10 +613,19 @@ s1d13xxxfb_probe(struct platform_device *pdev)
607 goto bail; 613 goto bail;
608 } 614 }
609 615
610 revision = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE); 616 revision = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE) >> 2;
611 if ((revision >> 2) != S1D_CHIP_REV) { 617
612 printk(KERN_INFO PFX "chip not found: %i\n", (revision >> 2)); 618 ret = -ENODEV;
613 ret = -ENODEV; 619
620 for (i = 0; i < ARRAY_SIZE(s1d13xxxfb_revisions); i++) {
621 if (revision == s1d13xxxfb_revisions[i])
622 ret = 0;
623 }
624
625 if (!ret)
626 printk(KERN_INFO PFX "chip revision %i\n", revision);
627 else {
628 printk(KERN_INFO PFX "unknown chip revision %i\n", revision);
614 goto bail; 629 goto bail;
615 } 630 }
616 631
diff --git a/include/video/s1d13xxxfb.h b/include/video/s1d13xxxfb.h
index c99d261df8f7..fe41b8407946 100644
--- a/include/video/s1d13xxxfb.h
+++ b/include/video/s1d13xxxfb.h
@@ -14,7 +14,8 @@
14#define S1D13XXXFB_H 14#define S1D13XXXFB_H
15 15
16#define S1D_PALETTE_SIZE 256 16#define S1D_PALETTE_SIZE 256
17#define S1D_CHIP_REV 7 /* expected chip revision number for s1d13806 */ 17#define S1D13506_CHIP_REV 4 /* expected chip revision number for s1d13506 */
18#define S1D13806_CHIP_REV 7 /* expected chip revision number for s1d13806 */
18#define S1D_FBID "S1D13806" 19#define S1D_FBID "S1D13806"
19#define S1D_DEVICENAME "s1d13806fb" 20#define S1D_DEVICENAME "s1d13806fb"
20 21