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/config.h>
14 #include <linux/module.h>
15 #include <linux/kernel.h>
16 #include <linux/sched.h>
17 #include <linux/delay.h>
18 #include <linux/pci.h>
24 #include <asm/pci-bridge.h>
32 int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
34 struct nvidia_par *par = info->par;
35 struct device_node *parent, *dp;
36 unsigned char *pedid = NULL;
37 static char *propnames[] = {
38 "DFP,EDID", "LCD,EDID", "EDID", "EDID1",
39 "EDID,B", "EDID,A", NULL };
42 parent = pci_device_to_OF_node(par->pci_dev);
50 (dp = of_get_next_child(parent, dp)) != NULL;) {
51 pname = (char *)get_property(dp, "name", NULL);
55 if ((pname[len-1] == 'A' && conn == 1) ||
56 (pname[len-1] == 'B' && conn == 2)) {
57 for (i = 0; propnames[i] != NULL; ++i) {
58 pedid = (unsigned char *)
59 get_property(dp, propnames[i],
70 for (i = 0; propnames[i] != NULL; ++i) {
71 pedid = (unsigned char *)
72 get_property(parent, propnames[i], NULL);
78 *out_edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
79 if (*out_edid == NULL)
81 memcpy(*out_edid, pedid, EDID_LENGTH);
82 printk(KERN_DEBUG "nvidiafb: Found OF EDID for head %d\n", conn);