opms_jazzio.c revision 1.2
1/* $NetBSD: opms_jazzio.c,v 1.2 2002/09/27 20:30:32 thorpej Exp $ */
2
3/*
4 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved.
6 *
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 *
19 * Carnegie Mellon requests users of this software to return to
20 *
21 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22 *  School of Computer Science
23 *  Carnegie Mellon University
24 *  Pittsburgh PA 15213-3890
25 *
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
28 */
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/device.h>
33#include <sys/tty.h>
34
35#include <machine/autoconf.h>
36#include <machine/bus.h>
37
38#include <arc/dev/pcconsvar.h>
39#include <arc/dev/opmsvar.h>
40#include <arc/jazz/jazziovar.h>
41#include <arc/jazz/pccons_jazziovar.h>
42
43int	opms_jazzio_match __P((struct device *, struct cfdata *, void *));
44void	opms_jazzio_attach __P((struct device *, struct device *, void *));
45
46const struct cfattach opms_jazzio_ca = {
47	sizeof(struct opms_softc),
48	opms_jazzio_match, opms_jazzio_attach,
49};
50
51int
52opms_jazzio_match(parent, match, aux)
53	struct device *parent;
54	struct cfdata *match;
55	void *aux;
56{
57	struct jazzio_attach_args *ja = aux;
58
59	if (strcmp(ja->ja_name, "pms") != 0)
60		return (0);
61
62	if (!opms_common_match(ja->ja_bust, &pccons_jazzio_conf))
63		return (0);
64
65	return (1);
66}
67
68void
69opms_jazzio_attach(parent, self, aux)
70	struct device *parent, *self;
71	void *aux;
72{
73	struct opms_softc *sc = (struct opms_softc *)self;
74	struct jazzio_attach_args *ja = aux;
75
76	printf("\n");
77
78	jazzio_intr_establish(ja->ja_intr, opmsintr, self);
79	opms_common_attach(sc, ja->ja_bust, &pccons_jazzio_conf);
80}
81