2 * linux/drivers/video/nvidia/nv_of.c
4 * Copyright 2004 Antonino A. Daplas <adaplas @pol.net>
6 * Based on rivafb-i2c.c
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/delay.h>
16 #include <linux/pci.h>
22 #include <asm/pci-bridge.h>
30 int nvidia_probe_of_connector(struct fb_info
*info
, int conn
, u8
**out_edid
)
32 struct nvidia_par
*par
= info
->par
;
33 struct device_node
*parent
, *dp
;
34 const unsigned char *pedid
= NULL
;
35 static char *propnames
[] = {
36 "DFP,EDID", "LCD,EDID", "EDID", "EDID1",
37 "EDID,B", "EDID,A", NULL
};
40 parent
= pci_device_to_OF_node(par
->pci_dev
);
48 (dp
= of_get_next_child(parent
, dp
)) != NULL
;) {
49 pname
= of_get_property(dp
, "name", NULL
);
53 if ((pname
[len
-1] == 'A' && conn
== 1) ||
54 (pname
[len
-1] == 'B' && conn
== 2)) {
55 for (i
= 0; propnames
[i
] != NULL
; ++i
) {
56 pedid
= of_get_property(dp
,
67 for (i
= 0; propnames
[i
] != NULL
; ++i
) {
68 pedid
= of_get_property(parent
, propnames
[i
], NULL
);
74 *out_edid
= kmemdup(pedid
, EDID_LENGTH
, GFP_KERNEL
);
75 if (*out_edid
== NULL
)
77 printk(KERN_DEBUG
"nvidiafb: Found OF EDID for head %d\n", conn
);