ppc_puc.c revision 158057
1118292Sambrisko/*- 2118292Sambrisko * Copyright (c) 1997-2000 Nicolas Souchu 3118292Sambrisko * Copyright (c) 2001 Alcove - Nicolas Souchu 4118292Sambrisko * All rights reserved. 5118292Sambrisko * 6118292Sambrisko * Redistribution and use in source and binary forms, with or without 7118292Sambrisko * modification, are permitted provided that the following conditions 8118292Sambrisko * are met: 9118292Sambrisko * 1. Redistributions of source code must retain the above copyright 10118292Sambrisko * notice, this list of conditions and the following disclaimer. 11118292Sambrisko * 2. Redistributions in binary form must reproduce the above copyright 12118292Sambrisko * notice, this list of conditions and the following disclaimer in the 13118292Sambrisko * documentation and/or other materials provided with the distribution. 14118292Sambrisko * 15118292Sambrisko * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16118292Sambrisko * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17118292Sambrisko * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18118292Sambrisko * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19118292Sambrisko * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20118292Sambrisko * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21118292Sambrisko * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22118292Sambrisko * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23118292Sambrisko * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24118292Sambrisko * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25118292Sambrisko * SUCH DAMAGE. 26118292Sambrisko */ 27118292Sambrisko 28158057Smarcel#include <sys/cdefs.h> 29158057Smarcel__FBSDID("$FreeBSD: head/sys/dev/ppc/ppc_puc.c 158057 2006-04-26 21:25:13Z marcel $"); 30158057Smarcel 31118292Sambrisko#include <sys/param.h> 32118292Sambrisko#include <sys/kernel.h> 33129879Sphk#include <sys/module.h> 34118292Sambrisko#include <sys/bus.h> 35158057Smarcel 36118292Sambrisko#include <machine/bus.h> 37118292Sambrisko 38118292Sambrisko#include <dev/ppbus/ppbconf.h> 39118292Sambrisko#include <dev/ppbus/ppb_msq.h> 40118292Sambrisko#include <dev/ppc/ppcvar.h> 41118292Sambrisko#include <dev/ppc/ppcreg.h> 42118292Sambrisko 43118292Sambrisko#include "ppbus_if.h" 44118292Sambrisko 45118292Sambriskostatic int ppc_puc_probe(device_t dev); 46118292Sambrisko 47118292Sambriskostatic device_method_t ppc_puc_methods[] = { 48118292Sambrisko /* device interface */ 49158057Smarcel DEVMETHOD(device_probe, ppc_puc_probe), 50158057Smarcel DEVMETHOD(device_attach, ppc_attach), 51118292Sambrisko 52118292Sambrisko /* bus interface */ 53118292Sambrisko DEVMETHOD(bus_read_ivar, ppc_read_ivar), 54118292Sambrisko DEVMETHOD(bus_setup_intr, ppc_setup_intr), 55118292Sambrisko DEVMETHOD(bus_teardown_intr, ppc_teardown_intr), 56158057Smarcel DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), 57118292Sambrisko 58118292Sambrisko /* ppbus interface */ 59118292Sambrisko DEVMETHOD(ppbus_io, ppc_io), 60118292Sambrisko DEVMETHOD(ppbus_exec_microseq, ppc_exec_microseq), 61118292Sambrisko DEVMETHOD(ppbus_reset_epp, ppc_reset_epp), 62118292Sambrisko DEVMETHOD(ppbus_setmode, ppc_setmode), 63118292Sambrisko DEVMETHOD(ppbus_ecp_sync, ppc_ecp_sync), 64118292Sambrisko DEVMETHOD(ppbus_read, ppc_read), 65118292Sambrisko DEVMETHOD(ppbus_write, ppc_write), 66118292Sambrisko 67158057Smarcel { 0, 0 } 68158057Smarcel}; 69158057Smarcel 70118292Sambriskostatic driver_t ppc_puc_driver = { 71158005Smarcel ppc_driver_name, 72118292Sambrisko ppc_puc_methods, 73118292Sambrisko sizeof(struct ppc_data), 74118292Sambrisko}; 75118292Sambrisko 76118292Sambriskostatic int 77158057Smarcelppc_puc_probe(device_t dev) 78118292Sambrisko{ 79118292Sambrisko device_set_desc(dev, "Parallel port"); 80158005Smarcel return (ppc_probe(dev, 0)); 81118292Sambrisko} 82118292Sambrisko 83118292SambriskoDRIVER_MODULE(ppc, puc, ppc_puc_driver, ppc_devclass, 0, 0); 84