Home | History | Annotate | Line # | Download | only in isa
joy_ess.c revision 1.4.8.1
      1  1.4.8.1       mjf /* $NetBSD: joy_ess.c,v 1.4.8.1 2008/04/03 12:42:44 mjf Exp $ */
      2      1.4     lukem 
      3      1.4     lukem #include <sys/cdefs.h>
      4      1.4     lukem __KERNEL_RCSID(0, "$NetBSD: joy_ess.c,v 1.4.8.1 2008/04/03 12:42:44 mjf Exp $");
      5      1.1  drochner 
      6      1.1  drochner #include <sys/param.h>
      7      1.1  drochner #include <sys/systm.h>
      8      1.1  drochner #include <sys/kernel.h>
      9      1.1  drochner #include <sys/device.h>
     10      1.1  drochner #include <sys/audioio.h>
     11      1.1  drochner #include <dev/audio_if.h>
     12      1.3        ad #include <sys/bus.h>
     13      1.1  drochner 
     14      1.1  drochner #include <dev/isa/isavar.h>
     15      1.1  drochner #include <dev/isa/essvar.h>
     16      1.1  drochner #include <dev/ic/joyvar.h>
     17      1.1  drochner 
     18  1.4.8.1       mjf static int 	joy_ess_match(device_t, cfdata_t, void *);
     19  1.4.8.1       mjf static void 	joy_ess_attach(device_t, device_t, void *);
     20      1.1  drochner 
     21  1.4.8.1       mjf CFATTACH_DECL_NEW(joy_ess, sizeof (struct joy_softc),
     22      1.1  drochner 	      joy_ess_match, joy_ess_attach, NULL, NULL);
     23      1.1  drochner 
     24  1.4.8.1       mjf static int
     25  1.4.8.1       mjf joy_ess_match(device_t parent, cfdata_t match, void *aux)
     26      1.1  drochner {
     27      1.1  drochner 	struct audio_attach_args *aa = aux;
     28      1.1  drochner 
     29      1.1  drochner 	if (aa->type != AUDIODEV_TYPE_AUX)
     30  1.4.8.1       mjf 		return 0;
     31  1.4.8.1       mjf 	return 1;
     32      1.1  drochner }
     33      1.1  drochner 
     34  1.4.8.1       mjf static void
     35  1.4.8.1       mjf joy_ess_attach(device_t parent, device_t self, void *aux)
     36      1.1  drochner {
     37  1.4.8.1       mjf 	struct ess_softc *esc = device_private(parent);
     38  1.4.8.1       mjf 	struct joy_softc *sc = device_private(self);
     39      1.1  drochner 
     40  1.4.8.1       mjf 	aprint_normal("\n");
     41      1.1  drochner 
     42      1.1  drochner 	sc->sc_iot = esc->sc_joy_iot;
     43      1.1  drochner 	sc->sc_ioh = esc->sc_joy_ioh;
     44  1.4.8.1       mjf 	sc->sc_dev = self;
     45      1.1  drochner 
     46      1.1  drochner 	joyattach(sc);
     47      1.1  drochner }
     48