Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-06-04 20:58:50 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-04 20:58:50 -0700
commit4dfd32b643ad65fcbf33c0c8bbc7c7df7b8d9180 (patch)
tree129116f0361e67bf749a8392ee829e28c948f229
parenta2ea2d4ce970a2a59b3d3a7ef5f69d314db69298 (diff)
[PATCH] Fix rivafb's OpenFirmware parsing
The attached patch fixes the EDID parsing for PPC on rivafb. It actually finds the EDID info in the OF Tree now. I grabbed this from BenHs Tree as of 2.6.5-rc3. The current code has no chance to work since it doesn't walk the device tree. This helps rivafb on PPC at least a bit further... Signed-off-by: Guido Guenther <agx@sigxcpu.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/video/riva/fbdev.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 1dc6e9555c21..1df67bcbcdb5 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1620,14 +1620,27 @@ static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
struct riva_par *par = (struct riva_par *) info->par;
struct device_node *dp;
unsigned char *pedid = NULL;
+ unsigned char *disptype = NULL;
+ static char *propnames[] = {
+ "DFP,EDID", "LCD,EDID", "EDID", "EDID1", "EDID,B", "EDID,A", NULL };
+ int i;
dp = pci_device_to_OF_node(pd);
- pedid = (unsigned char *)get_property(dp, "EDID,B", 0);
-
- if (pedid) {
+ for (; dp != NULL; dp = dp->child) {
+ disptype = (unsigned char *)get_property(dp, "display-type", NULL);
+ if (disptype == NULL)
+ continue;
+ if (strncmp(disptype, "LCD", 3) != 0)
+ continue;
+ for (i = 0; propnames[i] != NULL; ++i) {
+ pedid = (unsigned char *)
+ get_property(dp, propnames[i], NULL);
+ if (pedid != NULL) {
par->EDID = pedid;
return 1;
- } else
+ }
+ }
+ }
return 0;
}
#endif /* CONFIG_PPC_OF */