ppc_puc.c revision 129879
118099Spst/*- 2104862Sru * Copyright (c) 1997-2000 Nicolas Souchu 318099Spst * Copyright (c) 2001 Alcove - Nicolas Souchu 418099Spst * All rights reserved. 518099Spst * 618099Spst * Redistribution and use in source and binary forms, with or without 718099Spst * modification, are permitted provided that the following conditions 818099Spst * are met: 918099Spst * 1. Redistributions of source code must retain the above copyright 1018099Spst * notice, this list of conditions and the following disclaimer. 1118099Spst * 2. Redistributions in binary form must reproduce the above copyright 1218099Spst * notice, this list of conditions and the following disclaimer in the 1318099Spst * documentation and/or other materials provided with the distribution. 1418099Spst * 1518099Spst * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1618099Spst * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1718099Spst * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1818099Spst * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1918099Spst * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2055839Sasmodai * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2118099Spst * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2255839Sasmodai * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2318099Spst * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2418099Spst * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2555839Sasmodai * SUCH DAMAGE. 2618099Spst * 2718099Spst * $FreeBSD: head/sys/dev/ppc/ppc_puc.c 129879 2004-05-30 20:08:47Z phk $ 2818099Spst * 2918099Spst */ 3018099Spst 3118099Spst#include <sys/param.h> 3255839Sasmodai#include <sys/kernel.h> 3318099Spst#include <sys/module.h> 3455839Sasmodai#include <sys/bus.h> 3518099Spst 3618099Spst#include <machine/bus.h> 3718099Spst 3818099Spst#include <dev/ppbus/ppbconf.h> 3918099Spst#include <dev/ppbus/ppb_msq.h> 4018099Spst#include <dev/ppc/ppcvar.h> 4118099Spst#include <dev/ppc/ppcreg.h> 4218099Spst 4355839Sasmodai#include "ppbus_if.h" 4455839Sasmodai 4518099Spststatic int ppc_puc_probe(device_t dev); 4618099Spst 4718099Spststatic device_method_t ppc_puc_methods[] = { 4818099Spst /* device interface */ 4918099Spst DEVMETHOD(device_probe, ppc_puc_probe), 5018099Spst DEVMETHOD(device_attach, ppc_attach), 5118099Spst 5255839Sasmodai /* bus interface */ 5355839Sasmodai DEVMETHOD(bus_read_ivar, ppc_read_ivar), 5418099Spst DEVMETHOD(bus_setup_intr, ppc_setup_intr), 5518099Spst DEVMETHOD(bus_teardown_intr, ppc_teardown_intr), 5655839Sasmodai DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), 5718099Spst 5869626Sru /* ppbus interface */ 5955839Sasmodai DEVMETHOD(ppbus_io, ppc_io), 6055839Sasmodai DEVMETHOD(ppbus_exec_microseq, ppc_exec_microseq), 61104862Sru DEVMETHOD(ppbus_reset_epp, ppc_reset_epp), 62104862Sru DEVMETHOD(ppbus_setmode, ppc_setmode), 63104862Sru DEVMETHOD(ppbus_ecp_sync, ppc_ecp_sync), 64104862Sru DEVMETHOD(ppbus_read, ppc_read), 65104862Sru DEVMETHOD(ppbus_write, ppc_write), 66104862Sru 67104862Sru { 0, 0 } 68104862Sru }; 69104862Sru 70104862Srustatic driver_t ppc_puc_driver = { 71104862Sru "ppc", 72104862Sru ppc_puc_methods, 73104862Sru sizeof(struct ppc_data), 74104862Sru}; 75104862Sru 76104862Srustatic int 77104862Sruppc_puc_probe(dev) 78104862Sru device_t dev; 79104862Sru{ 80104862Sru device_set_desc(dev, "Parallel port"); 81104862Sru return (ppc_probe(dev)); 82104862Sru} 83104862Sru 84104862SruDRIVER_MODULE(ppc, puc, ppc_puc_driver, ppc_devclass, 0, 0); 85104862Sru