xref: /openbsd/sys/arch/sparc64/dev/ifb_ident.c (revision 73471bf0)
1 /*	$OpenBSD: ifb_ident.c,v 1.2 2009/06/27 22:43:41 miod Exp $	*/
2 
3 /*
4  * Copyright (c) 2007, 2008 Miodrag Vallat.
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /*
20  * Identify an Expert3D card.
21  * Used by both vgafb and ifb.
22  */
23 
24 #include <sys/param.h>
25 #include <sys/systm.h>
26 #include <sys/device.h>
27 
28 #include <machine/autoconf.h>
29 #include <machine/openfirm.h>
30 
31 #include <dev/pci/pcireg.h>
32 #include <dev/pci/pcivar.h>
33 
34 #include <dev/wscons/wsdisplayvar.h>
35 #include <dev/rasops/rasops.h>
36 
37 #include <machine/fbvar.h>
38 
39 int
40 ifb_ident(void *aux)
41 {
42 	struct pci_attach_args *paa = aux;
43 	int node;
44 	char *name;
45 
46 	node = PCITAG_NODE(paa->pa_tag);
47 	name = getpropstring(node, "name");
48 
49 	if (strcmp(name, "SUNW,Expert3D") == 0 ||
50 	    strcmp(name, "SUNW,Expert3D-Lite") == 0 ||
51 	    strcmp(name, "SUNW,XVR-500") == 0 ||
52 	    strcmp(name, "SUNW,XVR-600") == 0 ||
53 	    strcmp(name, "SUNW,XVR-1200") == 0)
54 		return 1;
55 
56 	return 0;
57 }
58