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 */ 2987384Simp 30119418Sobrien#include <sys/cdefs.h> 31119418Sobrien__FBSDID("$FreeBSD: releng/10.3/sys/dev/joy/joy_isa.c 119418 2003-08-24 17:55:58Z obrien $"); 32119418Sobrien 3387384Simp#include <sys/param.h> 3487384Simp#include <sys/systm.h> 3587384Simp#include <sys/conf.h> 3687384Simp#include <sys/uio.h> 3787384Simp#include <sys/kernel.h> 3887384Simp#include <sys/module.h> 3987384Simp#include <sys/bus.h> 4087384Simp#include <machine/bus.h> 4187384Simp#include <machine/resource.h> 4287384Simp#include <sys/rman.h> 4387384Simp#include <sys/time.h> 4487384Simp#include <dev/joy/joyvar.h> 4587384Simp 4687384Simp#include <isa/isavar.h> 4787384Simp#include "isa_if.h" 4887384Simp 4987384Simpstatic int joy_isa_probe (device_t); 5087384Simp 5187384Simpstatic struct isa_pnp_id joy_ids[] = { 5287384Simp {0x0100630e, "CSC0001 PnP Joystick"}, /* CSC0001 */ 5387384Simp {0x0101630e, "CSC0101 PnP Joystick"}, /* CSC0101 */ 5487384Simp {0x01100002, "ALS0110 PnP Joystick"}, /* @P@1001 */ 5587384Simp {0x01200002, "ALS0120 PnP Joystick"}, /* @P@2001 */ 5687384Simp {0x01007316, "ESS0001 PnP Joystick"}, /* ESS0001 */ 5787384Simp {0x2fb0d041, "Generic PnP Joystick"}, /* PNPb02f */ 5887384Simp {0x2200a865, "YMH0022 PnP Joystick"}, /* YMH0022 */ 5987384Simp {0x82719304, NULL}, /* ADS7182 */ 6087384Simp {0} 6187384Simp}; 6287384Simp 6387384Simpstatic int 6487384Simpjoy_isa_probe(device_t dev) 6587384Simp{ 6687384Simp if (ISA_PNP_PROBE(device_get_parent(dev), dev, joy_ids) == ENXIO) 6787384Simp return ENXIO; 6887384Simp return (joy_probe(dev)); 6987384Simp} 7087384Simp 7187384Simpstatic device_method_t joy_methods[] = { 7287384Simp DEVMETHOD(device_probe, joy_isa_probe), 7387384Simp DEVMETHOD(device_attach, joy_attach), 7487384Simp DEVMETHOD(device_detach, joy_detach), 7587384Simp { 0, 0 } 7687384Simp}; 7787384Simp 7887384Simpstatic driver_t joy_isa_driver = { 7987384Simp "joy", 8087384Simp joy_methods, 8187384Simp sizeof (struct joy_softc) 8287384Simp}; 8387384Simp 8487384SimpDRIVER_MODULE(joy, isa, joy_isa_driver, joy_devclass, 0, 0); 8587384SimpDRIVER_MODULE(joy, acpi, joy_isa_driver, joy_devclass, 0, 0); 86