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