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