Home | History | Annotate | Line # | Download | only in isa
joy_ess.c revision 1.5.38.1
      1  1.5.38.1      yamt /* $NetBSD: joy_ess.c,v 1.5.38.1 2012/04/17 00:07:39 yamt Exp $ */
      2       1.4     lukem 
      3       1.4     lukem #include <sys/cdefs.h>
      4  1.5.38.1      yamt __KERNEL_RCSID(0, "$NetBSD: joy_ess.c,v 1.5.38.1 2012/04/17 00:07:39 yamt 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.5   xtraeme static int 	joy_ess_match(device_t, cfdata_t, void *);
     19       1.5   xtraeme static void 	joy_ess_attach(device_t, device_t, void *);
     20       1.1  drochner 
     21       1.5   xtraeme 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.5   xtraeme static int
     25       1.5   xtraeme 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.5   xtraeme 		return 0;
     31       1.5   xtraeme 	return 1;
     32       1.1  drochner }
     33       1.1  drochner 
     34       1.5   xtraeme static void
     35       1.5   xtraeme joy_ess_attach(device_t parent, device_t self, void *aux)
     36       1.1  drochner {
     37       1.5   xtraeme 	struct ess_softc *esc = device_private(parent);
     38       1.5   xtraeme 	struct joy_softc *sc = device_private(self);
     39       1.1  drochner 
     40       1.5   xtraeme 	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.5   xtraeme 	sc->sc_dev = self;
     45  1.5.38.1      yamt 	sc->sc_lock = &esc->sc_lock;
     46       1.1  drochner 
     47       1.1  drochner 	joyattach(sc);
     48       1.1  drochner }
     49