Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139282
b: refs/heads/master
c: afbb9d8
h: refs/heads/master
v: v3
  • Loading branch information
Kristoffer Ericson authored and Linus Torvalds committed Apr 1, 2009
1 parent 5d52e1a commit 047cb00
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91ad1203535da95bb13072bdb59e1dc3ca76ec5d
refs/heads/master: afbb9d8d5266b4121cb503b4e097f8e65286a077
48 changes: 36 additions & 12 deletions trunk/drivers/video/s1d13xxxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,22 @@
#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 .. */
/*
* List of card production ids
*/
static const int s1d13xxxfb_prod_ids[] = {
S1D13505_PROD_ID,
S1D13506_PROD_ID,
S1D13806_PROD_ID,
};

/*
* List of card strings
*/
static const char *s1d13xxxfb_prod_names[] = {
"S1D13505",
"S1D13506",
"S1D13806",
};

/*
Expand Down Expand Up @@ -377,7 +390,6 @@ s1d13xxxfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
return 0;
}


/* framebuffer information structures */

static struct fb_ops s1d13xxxfb_fbops = {
Expand Down Expand Up @@ -544,7 +556,7 @@ s1d13xxxfb_probe(struct platform_device *pdev)
struct s1d13xxxfb_pdata *pdata = NULL;
int ret = 0;
int i;
u8 revision;
u8 revision, prod_id;

dbg("probe called: device is %p\n", pdev);

Expand Down Expand Up @@ -613,19 +625,31 @@ s1d13xxxfb_probe(struct platform_device *pdev)
goto bail;
}

revision = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE) >> 2;

/* production id is top 6 bits */
prod_id = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE) >> 2;
/* revision id is lower 2 bits */
revision = s1d13xxxfb_readreg(default_par, S1DREG_REV_CODE) & 0x3;
ret = -ENODEV;

for (i = 0; i < ARRAY_SIZE(s1d13xxxfb_revisions); i++) {
if (revision == s1d13xxxfb_revisions[i])
for (i = 0; i < ARRAY_SIZE(s1d13xxxfb_prod_ids); i++) {
if (prod_id == s1d13xxxfb_prod_ids[i]) {
/* looks like we got it in our list */
default_par->prod_id = prod_id;
default_par->revision = revision;
ret = 0;
break;
}
}

if (!ret)
if (!ret) {
printk(KERN_INFO PFX "chip production id %i = %s\n",
prod_id, s1d13xxxfb_prod_names[i]);
printk(KERN_INFO PFX "chip revision %i\n", revision);
else {
printk(KERN_INFO PFX "unknown chip revision %i\n", revision);
} else {
printk(KERN_INFO PFX
"unknown chip production id %i, revision %i\n",
prod_id, revision);
printk(KERN_INFO PFX "please contant maintainer\n");
goto bail;
}

Expand Down
16 changes: 10 additions & 6 deletions trunk/include/video/s1d13xxxfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
#define S1D13XXXFB_H

#define S1D_PALETTE_SIZE 256
#define S1D13506_CHIP_REV 4 /* expected chip revision number for s1d13506 */
#define S1D13806_CHIP_REV 7 /* expected chip revision number for s1d13806 */
#define S1D_FBID "S1D13806"
#define S1D_DEVICENAME "s1d13806fb"
#define S1D_FBID "S1D13xxx"
#define S1D_DEVICENAME "s1d13xxxfb"

/* S1DREG_REV_CODE register = prod_id (6 bits) + revision (2 bits) */
#define S1D13505_PROD_ID 0x3 /* 000011 */
#define S1D13506_PROD_ID 0x4 /* 000100 */
#define S1D13806_PROD_ID 0x7 /* 000111 */

/* register definitions (tested on s1d13896) */
#define S1DREG_REV_CODE 0x0000 /* Revision Code Register */
#define S1DREG_REV_CODE 0x0000 /* Prod + Rev Code Register */
#define S1DREG_MISC 0x0001 /* Miscellaneous Register */
#define S1DREG_GPIO_CNF0 0x0004 /* General IO Pins Configuration Register 0 */
#define S1DREG_GPIO_CNF1 0x0005 /* General IO Pins Configuration Register 1 */
Expand Down Expand Up @@ -141,10 +144,11 @@ struct s1d13xxxfb_regval {
u8 value;
};


struct s1d13xxxfb_par {
void __iomem *regs;
unsigned char display;
unsigned char prod_id;
unsigned char revision;

unsigned int pseudo_palette[16];
#ifdef CONFIG_PM
Expand Down

0 comments on commit 047cb00

Please sign in to comment.