joy_isa.c revision 97748
187384Simp/*- 287384Simp * Copyright (c) 1995 Jean-Marc Zucconi 387384Simp * All rights reserved. 487384Simp * 587384Simp * Redistribution and use in source and binary forms, with or without 687384Simp * modification, are permitted provided that the following conditions 787384Simp * are met: 887384Simp * 1. Redistributions of source code must retain the above copyright 987384Simp * notice, this list of conditions and the following disclaimer 1087384Simp * in this position and unchanged. 1187384Simp * 2. Redistributions in binary form must reproduce the above copyright 1287384Simp * notice, this list of conditions and the following disclaimer in the 1387384Simp * documentation and/or other materials provided with the distribution. 1487384Simp * 3. The name of the author may not be used to endorse or promote products 1597748Sschweikh * derived from this software without specific prior written permission 1687384Simp * 1787384Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1887384Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1987384Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2087384Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2187384Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2287384Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2387384Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2487384Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2587384Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2687384Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2787384Simp * 2887384Simp * $FreeBSD: head/sys/dev/joy/joy_isa.c 97748 2002-06-02 20:05:59Z schweikh $ 2987384Simp */ 3087384Simp 3187384Simp#include <sys/param.h> 3287384Simp#include <sys/systm.h> 3387384Simp#include <sys/conf.h> 3487384Simp#include <sys/uio.h> 3587384Simp#include <sys/kernel.h> 3687384Simp#include <sys/module.h> 3787384Simp#include <sys/bus.h> 3887384Simp#include <machine/bus.h> 3987384Simp#include <machine/resource.h> 4087384Simp#include <sys/rman.h> 4187384Simp#include <sys/time.h> 4287384Simp#include <dev/joy/joyvar.h> 4387384Simp 4487384Simp#include <isa/isavar.h> 4587384Simp#include "isa_if.h" 4687384Simp 4787384Simpstatic int joy_isa_probe (device_t); 4887384Simp 4987384Simpstatic struct isa_pnp_id joy_ids[] = { 5087384Simp {0x0100630e, "CSC0001 PnP Joystick"}, /* CSC0001 */ 5187384Simp {0x0101630e, "CSC0101 PnP Joystick"}, /* CSC0101 */ 5287384Simp {0x01100002, "ALS0110 PnP Joystick"}, /* @P@1001 */ 5387384Simp {0x01200002, "ALS0120 PnP Joystick"}, /* @P@2001 */ 5487384Simp {0x01007316, "ESS0001 PnP Joystick"}, /* ESS0001 */ 5587384Simp {0x2fb0d041, "Generic PnP Joystick"}, /* PNPb02f */ 5687384Simp {0x2200a865, "YMH0022 PnP Joystick"}, /* YMH0022 */ 5787384Simp {0x82719304, NULL}, /* ADS7182 */ 5887384Simp {0} 5987384Simp}; 6087384Simp 6187384Simpstatic int 6287384Simpjoy_isa_probe(device_t dev) 6387384Simp{ 6487384Simp if (ISA_PNP_PROBE(device_get_parent(dev), dev, joy_ids) == ENXIO) 6587384Simp return ENXIO; 6687384Simp return (joy_probe(dev)); 6787384Simp} 6887384Simp 6987384Simpstatic device_method_t joy_methods[] = { 7087384Simp DEVMETHOD(device_probe, joy_isa_probe), 7187384Simp DEVMETHOD(device_attach, joy_attach), 7287384Simp DEVMETHOD(device_detach, joy_detach), 7387384Simp { 0, 0 } 7487384Simp}; 7587384Simp 7687384Simpstatic driver_t joy_isa_driver = { 7787384Simp "joy", 7887384Simp joy_methods, 7987384Simp sizeof (struct joy_softc) 8087384Simp}; 8187384Simp 8287384SimpDRIVER_MODULE(joy, isa, joy_isa_driver, joy_devclass, 0, 0); 8387384SimpDRIVER_MODULE(joy, acpi, joy_isa_driver, joy_devclass, 0, 0); 84