blob: 4fa2cf9a8af2adbf6e673022ea2655c9810e5de6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
30void nvidia_create_i2c_busses(struct nvidia_par *par) {}
31void nvidia_delete_i2c_busses(struct nvidia_par *par) {}
32
Alexey Dobriyan2d212472005-09-11 04:01:09 +040033int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
Linus Torvalds1da177e2005-04-16 15:20:36 -070034{
Alexey Dobriyan2d212472005-09-11 04:01:09 +040035 struct nvidia_par *par = info->par;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 struct device_node *dp;
37 unsigned char *pedid = NULL;
38 unsigned char *disptype = NULL;
39 static char *propnames[] = {
40 "DFP,EDID", "LCD,EDID", "EDID", "EDID1", "EDID,B", "EDID,A", NULL };
41 int i;
42
43 dp = pci_device_to_OF_node(par->pci_dev);
44 for (; dp != NULL; dp = dp->child) {
45 disptype = (unsigned char *)get_property(dp, "display-type", NULL);
46 if (disptype == NULL)
47 continue;
48 if (strncmp(disptype, "LCD", 3) != 0)
49 continue;
50 for (i = 0; propnames[i] != NULL; ++i) {
51 pedid = (unsigned char *)
52 get_property(dp, propnames[i], NULL);
53 if (pedid != NULL) {
54 *out_edid = pedid;
55 return 0;
56 }
57 }
58 }
59 return 1;
60}