opms_jazzio.c revision 1.5
11.5Stsutsui/* $NetBSD: opms_jazzio.c,v 1.5 2005/01/22 07:35:34 tsutsui Exp $ */ 21.1Ssoda 31.1Ssoda/* 41.1Ssoda * Copyright (c) 1995, 1996 Carnegie-Mellon University. 51.1Ssoda * All rights reserved. 61.1Ssoda * 71.1Ssoda * Author: Chris G. Demetriou 81.1Ssoda * 91.1Ssoda * Permission to use, copy, modify and distribute this software and 101.1Ssoda * its documentation is hereby granted, provided that both the copyright 111.1Ssoda * notice and this permission notice appear in all copies of the 121.1Ssoda * software, derivative works or modified versions, and any portions 131.1Ssoda * thereof, and that both notices appear in supporting documentation. 141.1Ssoda * 151.1Ssoda * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 161.1Ssoda * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 171.1Ssoda * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 181.1Ssoda * 191.1Ssoda * Carnegie Mellon requests users of this software to return to 201.1Ssoda * 211.1Ssoda * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 221.1Ssoda * School of Computer Science 231.1Ssoda * Carnegie Mellon University 241.1Ssoda * Pittsburgh PA 15213-3890 251.1Ssoda * 261.1Ssoda * any improvements or extensions that they make and grant Carnegie the 271.1Ssoda * rights to redistribute these changes. 281.1Ssoda */ 291.4Slukem 301.4Slukem#include <sys/cdefs.h> 311.5Stsutsui__KERNEL_RCSID(0, "$NetBSD: opms_jazzio.c,v 1.5 2005/01/22 07:35:34 tsutsui Exp $"); 321.1Ssoda 331.1Ssoda#include <sys/param.h> 341.1Ssoda#include <sys/systm.h> 351.1Ssoda#include <sys/device.h> 361.1Ssoda#include <sys/tty.h> 371.1Ssoda 381.1Ssoda#include <machine/autoconf.h> 391.1Ssoda#include <machine/bus.h> 401.1Ssoda 411.1Ssoda#include <arc/dev/pcconsvar.h> 421.1Ssoda#include <arc/dev/opmsvar.h> 431.1Ssoda#include <arc/jazz/jazziovar.h> 441.1Ssoda#include <arc/jazz/pccons_jazziovar.h> 451.1Ssoda 461.5Stsutsuiint opms_jazzio_match(struct device *, struct cfdata *, void *); 471.5Stsutsuivoid opms_jazzio_attach(struct device *, struct device *, void *); 481.1Ssoda 491.3SthorpejCFATTACH_DECL(opms_jazzio, sizeof(struct opms_softc), 501.3Sthorpej opms_jazzio_match, opms_jazzio_attach, NULL, NULL); 511.1Ssoda 521.1Ssodaint 531.5Stsutsuiopms_jazzio_match(struct device *parent, struct cfdata *match, void *aux) 541.1Ssoda{ 551.1Ssoda struct jazzio_attach_args *ja = aux; 561.1Ssoda 571.1Ssoda if (strcmp(ja->ja_name, "pms") != 0) 581.5Stsutsui return 0; 591.1Ssoda 601.1Ssoda if (!opms_common_match(ja->ja_bust, &pccons_jazzio_conf)) 611.5Stsutsui return 0; 621.1Ssoda 631.5Stsutsui return 1; 641.1Ssoda} 651.1Ssoda 661.1Ssodavoid 671.5Stsutsuiopms_jazzio_attach(struct device *parent, struct device *self, void *aux) 681.1Ssoda{ 691.1Ssoda struct opms_softc *sc = (struct opms_softc *)self; 701.1Ssoda struct jazzio_attach_args *ja = aux; 711.1Ssoda 721.1Ssoda printf("\n"); 731.1Ssoda 741.1Ssoda jazzio_intr_establish(ja->ja_intr, opmsintr, self); 751.1Ssoda opms_common_attach(sc, ja->ja_bust, &pccons_jazzio_conf); 761.1Ssoda} 77