lkml.org 
[lkml]   [2004]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[Patch]: Fix rivafb's OF parsing
Hi,
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...
Cheers,
-- Guido

signed-off-by: Guido Günther <agx@sigxpu.org>
--- ../linux-2.6.7-rc2.orig/drivers/video/riva/fbdev.c 2004-05-30 11:40:32.000000000 -0300
+++ drivers/video/riva/fbdev.c 2004-06-01 00:57:37.060599712 -0300
@@ -1620,14 +1632,27 @@
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 */
\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.101 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site