2011-11-24 03:07:28 +04:00
|
|
|
/* $NetBSD: joy_ess.c,v 1.6 2011/11/23 23:07:32 jmcneill Exp $ */
|
2007-12-11 14:52:26 +03:00
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
2011-11-24 03:07:28 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: joy_ess.c,v 1.6 2011/11/23 23:07:32 jmcneill Exp $");
|
2004-08-04 22:53:55 +04:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
#include <sys/audioio.h>
|
|
|
|
#include <dev/audio_if.h>
|
2007-10-19 15:59:34 +04:00
|
|
|
#include <sys/bus.h>
|
2004-08-04 22:53:55 +04:00
|
|
|
|
|
|
|
#include <dev/isa/isavar.h>
|
|
|
|
#include <dev/isa/essvar.h>
|
|
|
|
#include <dev/ic/joyvar.h>
|
|
|
|
|
2008-03-26 21:27:07 +03:00
|
|
|
static int joy_ess_match(device_t, cfdata_t, void *);
|
|
|
|
static void joy_ess_attach(device_t, device_t, void *);
|
2004-08-04 22:53:55 +04:00
|
|
|
|
2008-03-26 21:27:07 +03:00
|
|
|
CFATTACH_DECL_NEW(joy_ess, sizeof (struct joy_softc),
|
2004-08-04 22:53:55 +04:00
|
|
|
joy_ess_match, joy_ess_attach, NULL, NULL);
|
|
|
|
|
2008-03-26 21:27:07 +03:00
|
|
|
static int
|
|
|
|
joy_ess_match(device_t parent, cfdata_t match, void *aux)
|
2004-08-04 22:53:55 +04:00
|
|
|
{
|
|
|
|
struct audio_attach_args *aa = aux;
|
|
|
|
|
|
|
|
if (aa->type != AUDIODEV_TYPE_AUX)
|
2008-03-26 21:27:07 +03:00
|
|
|
return 0;
|
|
|
|
return 1;
|
2004-08-04 22:53:55 +04:00
|
|
|
}
|
|
|
|
|
2008-03-26 21:27:07 +03:00
|
|
|
static void
|
|
|
|
joy_ess_attach(device_t parent, device_t self, void *aux)
|
2004-08-04 22:53:55 +04:00
|
|
|
{
|
2008-03-26 21:27:07 +03:00
|
|
|
struct ess_softc *esc = device_private(parent);
|
|
|
|
struct joy_softc *sc = device_private(self);
|
2004-08-04 22:53:55 +04:00
|
|
|
|
2008-03-26 21:27:07 +03:00
|
|
|
aprint_normal("\n");
|
2004-08-04 22:53:55 +04:00
|
|
|
|
|
|
|
sc->sc_iot = esc->sc_joy_iot;
|
|
|
|
sc->sc_ioh = esc->sc_joy_ioh;
|
2008-03-26 21:27:07 +03:00
|
|
|
sc->sc_dev = self;
|
2011-11-24 03:07:28 +04:00
|
|
|
sc->sc_lock = &esc->sc_lock;
|
2004-08-04 22:53:55 +04:00
|
|
|
|
|
|
|
joyattach(sc);
|
|
|
|
}
|