lpt_elb.c revision 1.5
11.5Scube/* $NetBSD: lpt_elb.c,v 1.5 2008/03/07 17:15:51 cube 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.2Slukem 391.2Slukem#include <sys/cdefs.h> 401.5Scube__KERNEL_RCSID(0, "$NetBSD: lpt_elb.c,v 1.5 2008/03/07 17:15:51 cube Exp $"); 411.1Shannken 421.1Shannken#include <sys/param.h> 431.1Shannken#include <sys/conf.h> 441.1Shannken#include <sys/device.h> 451.1Shannken#include <sys/systm.h> 461.1Shannken#include <sys/tty.h> 471.1Shannken 481.1Shannken#include <machine/bus.h> 491.1Shannken 501.1Shannken#include <dev/ic/lptreg.h> 511.1Shannken#include <dev/ic/lptvar.h> 521.1Shannken 531.1Shannken#include <evbppc/explora/dev/elbvar.h> 541.1Shannken 551.5Scubestatic int lpt_elb_probe(device_t, cfdata_t , void *); 561.5Scubestatic void lpt_elb_attach(device_t, device_t, void *); 571.1Shannken 581.5ScubeCFATTACH_DECL_NEW(lpt_elb, sizeof(struct lpt_softc), 591.1Shannken lpt_elb_probe, lpt_elb_attach, NULL, NULL); 601.1Shannken 611.1Shannkenint 621.5Scubelpt_elb_probe(device_t parent, cfdata_t cf, void *aux) 631.1Shannken{ 641.1Shannken struct elb_attach_args *oaa = aux; 651.1Shannken 661.1Shannken if (strcmp(oaa->elb_name, cf->cf_name) != 0) 671.1Shannken return 0; 681.1Shannken 691.1Shannken return (1); 701.1Shannken} 711.1Shannken 721.1Shannkenvoid 731.5Scubelpt_elb_attach(device_t parent, device_t self, void *aux) 741.1Shannken{ 751.5Scube struct lpt_softc *sc = device_private(self); 761.1Shannken struct elb_attach_args *eaa = aux; 771.1Shannken 781.5Scube sc->sc_dev = self; 791.1Shannken sc->sc_iot = eaa->elb_bt; 801.4Shannken bus_space_map(sc->sc_iot, 811.4Shannken _BUS_SPACE_UNSTRIDE(sc->sc_iot, eaa->elb_base), LPT_NPORTS, 821.4Shannken 0, &sc->sc_ioh); 831.1Shannken 841.5Scube aprint_normal("\n"); 851.1Shannken 861.1Shannken lpt_attach_subr(sc); 871.1Shannken} 88