955c2f909d
Allow to enable the game port on an ES1888, in case the firmware didn't this. (Otherwise we still rely on the firmware having mapped the sound related registers.) Limit this to the "isa" attachment for now because this is the only one I'm able to test. Attach the "joy" device directly at "ess" to make sure the port is enabled before the "joy" probe/attach. This makes the joystick port usable on a "PWS" alpha (Miata).
44 lines
1007 B
C
44 lines
1007 B
C
/* $NetBSD: joy_ess.c,v 1.1 2004/08/04 18:53:55 drochner Exp $ */
|
|
|
|
#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>
|
|
#include <machine/bus.h>
|
|
|
|
#include <dev/isa/isavar.h>
|
|
#include <dev/isa/essvar.h>
|
|
#include <dev/ic/joyvar.h>
|
|
|
|
int joy_ess_match(struct device *, struct cfdata *, void *);
|
|
void joy_ess_attach(struct device *, struct device *, void *);
|
|
|
|
CFATTACH_DECL(joy_ess, sizeof (struct joy_softc),
|
|
joy_ess_match, joy_ess_attach, NULL, NULL);
|
|
|
|
int
|
|
joy_ess_match(struct device *parent, struct cfdata *match, void *aux)
|
|
{
|
|
struct audio_attach_args *aa = aux;
|
|
|
|
if (aa->type != AUDIODEV_TYPE_AUX)
|
|
return (0);
|
|
return (1);
|
|
}
|
|
|
|
void
|
|
joy_ess_attach(struct device *parent, struct device *self, void *aux)
|
|
{
|
|
struct ess_softc *esc = (struct ess_softc *)parent;
|
|
struct joy_softc *sc = (struct joy_softc *)self;
|
|
|
|
printf("\n");
|
|
|
|
sc->sc_iot = esc->sc_joy_iot;
|
|
sc->sc_ioh = esc->sc_joy_ioh;
|
|
|
|
joyattach(sc);
|
|
}
|