opms_jazzio.c revision 1.3
1/* $NetBSD: opms_jazzio.c,v 1.3 2002/10/02 04:59:49 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
46CFATTACH_DECL(opms_jazzio, sizeof(struct opms_softc),
47    opms_jazzio_match, opms_jazzio_attach, NULL, NULL);
48
49int
50opms_jazzio_match(parent, match, aux)
51	struct device *parent;
52	struct cfdata *match;
53	void *aux;
54{
55	struct jazzio_attach_args *ja = aux;
56
57	if (strcmp(ja->ja_name, "pms") != 0)
58		return (0);
59
60	if (!opms_common_match(ja->ja_bust, &pccons_jazzio_conf))
61		return (0);
62
63	return (1);
64}
65
66void
67opms_jazzio_attach(parent, self, aux)
68	struct device *parent, *self;
69	void *aux;
70{
71	struct opms_softc *sc = (struct opms_softc *)self;
72	struct jazzio_attach_args *ja = aux;
73
74	printf("\n");
75
76	jazzio_intr_establish(ja->ja_intr, opmsintr, self);
77	opms_common_attach(sc, ja->ja_bust, &pccons_jazzio_conf);
78}
79