diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/video/nvidia/nv_of.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/video/nvidia/nv_of.c')
-rw-r--r-- | drivers/video/nvidia/nv_of.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c new file mode 100644 index 000000000000..7d12eb85310d --- /dev/null +++ b/drivers/video/nvidia/nv_of.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * linux/drivers/video/nvidia/nv_of.c | ||
3 | * | ||
4 | * Copyright 2004 Antonino A. Daplas <adaplas @pol.net> | ||
5 | * | ||
6 | * Based on rivafb-i2c.c | ||
7 | * | ||
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 | ||
10 | * for more details. | ||
11 | */ | ||
12 | |||
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> | ||
19 | #include <linux/fb.h> | ||
20 | |||
21 | #include <asm/io.h> | ||
22 | |||
23 | #include <asm/prom.h> | ||
24 | #include <asm/pci-bridge.h> | ||
25 | |||
26 | #include "nv_type.h" | ||
27 | #include "nv_local.h" | ||
28 | #include "nv_proto.h" | ||
29 | |||
30 | void nvidia_create_i2c_busses(struct nvidia_par *par) {} | ||
31 | void nvidia_delete_i2c_busses(struct nvidia_par *par) {} | ||
32 | |||
33 | int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid) | ||
34 | { | ||
35 | struct device_node *dp; | ||
36 | unsigned char *pedid = NULL; | ||
37 | unsigned char *disptype = NULL; | ||
38 | static char *propnames[] = { | ||
39 | "DFP,EDID", "LCD,EDID", "EDID", "EDID1", "EDID,B", "EDID,A", NULL }; | ||
40 | int i; | ||
41 | |||
42 | dp = pci_device_to_OF_node(par->pci_dev); | ||
43 | for (; dp != NULL; dp = dp->child) { | ||
44 | disptype = (unsigned char *)get_property(dp, "display-type", NULL); | ||
45 | if (disptype == NULL) | ||
46 | continue; | ||
47 | if (strncmp(disptype, "LCD", 3) != 0) | ||
48 | continue; | ||
49 | for (i = 0; propnames[i] != NULL; ++i) { | ||
50 | pedid = (unsigned char *) | ||
51 | get_property(dp, propnames[i], NULL); | ||
52 | if (pedid != NULL) { | ||
53 | *out_edid = pedid; | ||
54 | return 0; | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | return 1; | ||
59 | } | ||