lpt_elb.c revision 1.1
11.1Shannken/*	$NetBSD: lpt_elb.c,v 1.1 2003/03/11 10:57:57 hannken Exp $	*/
21.1Shannken
31.1Shannken/*-
41.1Shannken * Copyright (c) 2003 The NetBSD Foundation, Inc.
51.1Shannken * All rights reserved.
61.1Shannken *
71.1Shannken * This code is derived from software contributed to The NetBSD Foundation
81.1Shannken * by Juergen Hannken-Illjes.
91.1Shannken *
101.1Shannken * Redistribution and use in source and binary forms, with or without
111.1Shannken * modification, are permitted provided that the following conditions
121.1Shannken * are met:
131.1Shannken * 1. Redistributions of source code must retain the above copyright
141.1Shannken *    notice, this list of conditions and the following disclaimer.
151.1Shannken * 2. Redistributions in binary form must reproduce the above copyright
161.1Shannken *    notice, this list of conditions and the following disclaimer in the
171.1Shannken *    documentation and/or other materials provided with the distribution.
181.1Shannken * 3. All advertising materials mentioning features or use of this software
191.1Shannken *    must display the following acknowledgement:
201.1Shannken *      This product includes software developed by the NetBSD
211.1Shannken *      Foundation, Inc. and its contributors.
221.1Shannken * 4. Neither the name of The NetBSD Foundation nor the names of its
231.1Shannken *    contributors may be used to endorse or promote products derived
241.1Shannken *    from this software without specific prior written permission.
251.1Shannken *
261.1Shannken * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Shannken * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Shannken * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Shannken * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Shannken * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Shannken * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Shannken * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Shannken * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Shannken * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Shannken * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Shannken * POSSIBILITY OF SUCH DAMAGE.
371.1Shannken */
381.1Shannken
391.1Shannken#include <sys/param.h>
401.1Shannken#include <sys/conf.h>
411.1Shannken#include <sys/device.h>
421.1Shannken#include <sys/systm.h>
431.1Shannken#include <sys/tty.h>
441.1Shannken
451.1Shannken#include <machine/bus.h>
461.1Shannken
471.1Shannken#include <dev/ic/lptreg.h>
481.1Shannken#include <dev/ic/lptvar.h>
491.1Shannken
501.1Shannken#include <evbppc/explora/dev/elbvar.h>
511.1Shannken
521.1Shannkenstatic int	lpt_elb_probe(struct device *, struct cfdata *, void *);
531.1Shannkenstatic void	lpt_elb_attach(struct device *, struct device *, void *);
541.1Shannken
551.1ShannkenCFATTACH_DECL(lpt_elb, sizeof(struct lpt_softc),
561.1Shannken    lpt_elb_probe, lpt_elb_attach, NULL, NULL);
571.1Shannken
581.1Shannkenint
591.1Shannkenlpt_elb_probe(struct device *parent, struct cfdata *cf, void *aux)
601.1Shannken{
611.1Shannken	struct elb_attach_args *oaa = aux;
621.1Shannken
631.1Shannken	if (strcmp(oaa->elb_name, cf->cf_name) != 0)
641.1Shannken		return 0;
651.1Shannken
661.1Shannken	return (1);
671.1Shannken}
681.1Shannken
691.1Shannkenvoid
701.1Shannkenlpt_elb_attach(struct device *parent, struct device *self, void *aux)
711.1Shannken{
721.1Shannken	struct lpt_softc *sc = (struct lpt_softc *)self;
731.1Shannken	struct elb_attach_args *eaa = aux;
741.1Shannken
751.1Shannken	sc->sc_iot = eaa->elb_bt;
761.1Shannken	bus_space_map(sc->sc_iot, eaa->elb_base, LPT_NPORTS, 0, &sc->sc_ioh);
771.1Shannken
781.1Shannken	printf("\n");
791.1Shannken
801.1Shannken	lpt_attach_subr(sc);
811.1Shannken}
82