2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
5 * Derived from the public domain Linux driver
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
29 #include <dev/sound/pcm/sound.h>
30 #include <dev/sound/pcm/ac97.h>
31 #include <dev/sound/pci/neomagic.h>
32 #include <dev/sound/pci/neomagic-coeff.h>
34 #include <pci/pcireg.h>
35 #include <pci/pcivar.h>
37 SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/neomagic.c,v 1.7.2.11 2002/04/22 15:49:32 cg Exp $");
39 /* -------------------------------------------------------------------- */
41 #define NM_BUFFSIZE 16384
43 #define NM256AV_PCI_ID 0x800510c8
44 #define NM256ZX_PCI_ID 0x800610c8
48 /* channel registers */
50 int active, spd, dir, fmt;
51 u_int32_t blksize, wmark;
52 struct snd_dbuf *buffer;
53 struct pcm_channel *channel;
54 struct sc_info *parent;
57 /* device private data */
62 struct resource *reg, *irq, *buf;
63 int regid, irqid, bufid;
66 u_int32_t ac97_base, ac97_status, ac97_busy;
67 u_int32_t buftop, pbuf, rbuf, cbuf, acbuf;
68 u_int32_t playint, recint, misc1int, misc2int;
69 u_int32_t irsz, badintr;
71 struct sc_chinfo pch, rch;
74 /* -------------------------------------------------------------------- */
81 static int nm_loadcoeff(struct sc_info *sc, int dir, int num);
82 static int nm_setch(struct sc_chinfo *ch);
83 static int nm_init(struct sc_info *);
84 static void nm_intr(void *);
86 /* talk to the card */
87 static u_int32_t nm_rd(struct sc_info *, int, int);
88 static void nm_wr(struct sc_info *, int, u_int32_t, int);
89 static u_int32_t nm_rdbuf(struct sc_info *, int, int);
90 static void nm_wrbuf(struct sc_info *, int, u_int32_t, int);
92 static u_int32_t badcards[] = {
98 #define NUM_BADCARDS (sizeof(badcards) / sizeof(u_int32_t))
100 /* The actual rates supported by the card. */
101 static int samplerates[9] = {
113 /* -------------------------------------------------------------------- */
115 static u_int32_t nm_fmt[] = {
117 AFMT_STEREO | AFMT_U8,
119 AFMT_STEREO | AFMT_S16_LE,
122 static struct pcmchan_caps nm_caps = {4000, 48000, nm_fmt, 0};
124 /* -------------------------------------------------------------------- */
128 nm_rd(struct sc_info *sc, int regno, int size)
130 bus_space_tag_t st = rman_get_bustag(sc->reg);
131 bus_space_handle_t sh = rman_get_bushandle(sc->reg);
135 return bus_space_read_1(st, sh, regno);
137 return bus_space_read_2(st, sh, regno);
139 return bus_space_read_4(st, sh, regno);
146 nm_wr(struct sc_info *sc, int regno, u_int32_t data, int size)
148 bus_space_tag_t st = rman_get_bustag(sc->reg);
149 bus_space_handle_t sh = rman_get_bushandle(sc->reg);
153 bus_space_write_1(st, sh, regno, data);
156 bus_space_write_2(st, sh, regno, data);
159 bus_space_write_4(st, sh, regno, data);
165 nm_rdbuf(struct sc_info *sc, int regno, int size)
167 bus_space_tag_t st = rman_get_bustag(sc->buf);
168 bus_space_handle_t sh = rman_get_bushandle(sc->buf);
172 return bus_space_read_1(st, sh, regno);
174 return bus_space_read_2(st, sh, regno);
176 return bus_space_read_4(st, sh, regno);
183 nm_wrbuf(struct sc_info *sc, int regno, u_int32_t data, int size)
185 bus_space_tag_t st = rman_get_bustag(sc->buf);
186 bus_space_handle_t sh = rman_get_bushandle(sc->buf);
190 bus_space_write_1(st, sh, regno, data);
193 bus_space_write_2(st, sh, regno, data);
196 bus_space_write_4(st, sh, regno, data);
201 /* -------------------------------------------------------------------- */
204 nm_waitcd(struct sc_info *sc)
210 if (nm_rd(sc, sc->ac97_status, 2) & sc->ac97_busy) {
221 nm_initcd(kobj_t obj, void *devinfo)
223 struct sc_info *sc = (struct sc_info *)devinfo;
225 nm_wr(sc, 0x6c0, 0x01, 1);
226 nm_wr(sc, 0x6cc, 0x87, 1);
227 nm_wr(sc, 0x6cc, 0x80, 1);
228 nm_wr(sc, 0x6cc, 0x00, 1);
233 nm_rdcd(kobj_t obj, void *devinfo, int regno)
235 struct sc_info *sc = (struct sc_info *)devinfo;
238 if (!nm_waitcd(sc)) {
239 x = nm_rd(sc, sc->ac97_base + regno, 2);
243 device_printf(sc->dev, "ac97 codec not ready\n");
249 nm_wrcd(kobj_t obj, void *devinfo, int regno, u_int32_t data)
251 struct sc_info *sc = (struct sc_info *)devinfo;
254 if (!nm_waitcd(sc)) {
256 nm_wr(sc, sc->ac97_base + regno, data, 2);
257 if (!nm_waitcd(sc)) {
263 device_printf(sc->dev, "ac97 codec not ready\n");
267 static kobj_method_t nm_ac97_methods[] = {
268 KOBJMETHOD(ac97_init, nm_initcd),
269 KOBJMETHOD(ac97_read, nm_rdcd),
270 KOBJMETHOD(ac97_write, nm_wrcd),
273 AC97_DECLARE(nm_ac97);
275 /* -------------------------------------------------------------------- */
278 nm_ackint(struct sc_info *sc, u_int32_t num)
280 if (sc->type == NM256AV_PCI_ID) {
281 nm_wr(sc, NM_INT_REG, num << 1, 2);
282 } else if (sc->type == NM256ZX_PCI_ID) {
283 nm_wr(sc, NM_INT_REG, num, 4);
288 nm_loadcoeff(struct sc_info *sc, int dir, int num)
293 addr = (dir == PCMDIR_PLAY)? 0x01c : 0x21c;
294 if (dir == PCMDIR_REC)
296 sz = coefficientSizes[num];
299 ofs+= coefficientSizes[num];
300 for (i = 0; i < sz; i++)
301 nm_wrbuf(sc, sc->cbuf + i, coefficients[ofs + i], 1);
302 nm_wr(sc, addr, sc->cbuf, 4);
303 if (dir == PCMDIR_PLAY)
305 nm_wr(sc, addr + 4, sc->cbuf + sz, 4);
310 nm_setch(struct sc_chinfo *ch)
312 struct sc_info *sc = ch->parent;
316 for (x = 0; x < 8; x++)
317 if (ch->spd < (samplerates[x] + samplerates[x + 1]) / 2)
320 if (x == 8) return 1;
322 ch->spd = samplerates[x];
323 nm_loadcoeff(sc, ch->dir, x);
327 if (ch->fmt & AFMT_16BIT) x |= NM_RATE_BITS_16;
328 if (ch->fmt & AFMT_STEREO) x |= NM_RATE_STEREO;
330 base = (ch->dir == PCMDIR_PLAY)? NM_PLAYBACK_REG_OFFSET : NM_RECORD_REG_OFFSET;
331 nm_wr(sc, base + NM_RATE_REG_OFFSET, x, 1);
335 /* channel interface */
337 nmchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
339 struct sc_info *sc = devinfo;
340 struct sc_chinfo *ch;
343 chnbuf = (dir == PCMDIR_PLAY)? sc->pbuf : sc->rbuf;
344 ch = (dir == PCMDIR_PLAY)? &sc->pch : &sc->rch;
349 sndbuf_setup(ch->buffer, (u_int8_t *)rman_get_virtual(sc->buf) + chnbuf, NM_BUFFSIZE);
351 device_printf(sc->dev, "%s buf %p\n", (dir == PCMDIR_PLAY)?
352 "play" : "rec", sndbuf_getbuf(ch->buffer));
360 nmchan_free(kobj_t obj, void *data)
366 nmchan_setformat(kobj_t obj, void *data, u_int32_t format)
368 struct sc_chinfo *ch = data;
375 nmchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
377 struct sc_chinfo *ch = data;
380 return nm_setch(ch)? 0 : ch->spd;
384 nmchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
386 struct sc_chinfo *ch = data;
388 ch->blksize = blocksize;
394 nmchan_trigger(kobj_t obj, void *data, int go)
396 struct sc_chinfo *ch = data;
397 struct sc_info *sc = ch->parent;
400 if (go == PCMTRIG_EMLDMAWR || go == PCMTRIG_EMLDMARD)
403 ssz = (ch->fmt & AFMT_16BIT)? 2 : 1;
404 if (ch->fmt & AFMT_STEREO)
407 if (ch->dir == PCMDIR_PLAY) {
408 if (go == PCMTRIG_START) {
410 ch->wmark = ch->blksize;
411 nm_wr(sc, NM_PBUFFER_START, sc->pbuf, 4);
412 nm_wr(sc, NM_PBUFFER_END, sc->pbuf + NM_BUFFSIZE - ssz, 4);
413 nm_wr(sc, NM_PBUFFER_CURRP, sc->pbuf, 4);
414 nm_wr(sc, NM_PBUFFER_WMARK, sc->pbuf + ch->wmark, 4);
415 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, NM_PLAYBACK_FREERUN |
416 NM_PLAYBACK_ENABLE_FLAG, 1);
417 nm_wr(sc, NM_AUDIO_MUTE_REG, 0, 2);
420 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, 0, 1);
421 nm_wr(sc, NM_AUDIO_MUTE_REG, NM_AUDIO_MUTE_BOTH, 2);
424 if (go == PCMTRIG_START) {
426 ch->wmark = ch->blksize;
427 nm_wr(sc, NM_RECORD_ENABLE_REG, NM_RECORD_FREERUN |
428 NM_RECORD_ENABLE_FLAG, 1);
429 nm_wr(sc, NM_RBUFFER_START, sc->rbuf, 4);
430 nm_wr(sc, NM_RBUFFER_END, sc->rbuf + NM_BUFFSIZE, 4);
431 nm_wr(sc, NM_RBUFFER_CURRP, sc->rbuf, 4);
432 nm_wr(sc, NM_RBUFFER_WMARK, sc->rbuf + ch->wmark, 4);
435 nm_wr(sc, NM_RECORD_ENABLE_REG, 0, 1);
442 nmchan_getptr(kobj_t obj, void *data)
444 struct sc_chinfo *ch = data;
445 struct sc_info *sc = ch->parent;
447 if (ch->dir == PCMDIR_PLAY)
448 return nm_rd(sc, NM_PBUFFER_CURRP, 4) - sc->pbuf;
450 return nm_rd(sc, NM_RBUFFER_CURRP, 4) - sc->rbuf;
453 static struct pcmchan_caps *
454 nmchan_getcaps(kobj_t obj, void *data)
459 static kobj_method_t nmchan_methods[] = {
460 KOBJMETHOD(channel_init, nmchan_init),
461 KOBJMETHOD(channel_free, nmchan_free),
462 KOBJMETHOD(channel_setformat, nmchan_setformat),
463 KOBJMETHOD(channel_setspeed, nmchan_setspeed),
464 KOBJMETHOD(channel_setblocksize, nmchan_setblocksize),
465 KOBJMETHOD(channel_trigger, nmchan_trigger),
466 KOBJMETHOD(channel_getptr, nmchan_getptr),
467 KOBJMETHOD(channel_getcaps, nmchan_getcaps),
470 CHANNEL_DECLARE(nmchan);
472 /* The interrupt handler */
476 struct sc_info *sc = (struct sc_info *)p;
479 status = nm_rd(sc, NM_INT_REG, sc->irsz);
483 if (status & sc->playint) {
484 status &= ~sc->playint;
485 sc->pch.wmark += sc->pch.blksize;
486 sc->pch.wmark %= NM_BUFFSIZE;
487 nm_wr(sc, NM_PBUFFER_WMARK, sc->pbuf + sc->pch.wmark, 4);
489 nm_ackint(sc, sc->playint);
490 chn_intr(sc->pch.channel);
492 if (status & sc->recint) {
493 status &= ~sc->recint;
494 sc->rch.wmark += sc->rch.blksize;
495 sc->rch.wmark %= NM_BUFFSIZE;
496 nm_wr(sc, NM_RBUFFER_WMARK, sc->rbuf + sc->rch.wmark, 4);
498 nm_ackint(sc, sc->recint);
499 chn_intr(sc->rch.channel);
501 if (status & sc->misc1int) {
502 status &= ~sc->misc1int;
503 nm_ackint(sc, sc->misc1int);
504 x = nm_rd(sc, 0x400, 1);
505 nm_wr(sc, 0x400, x | 2, 1);
506 device_printf(sc->dev, "misc int 1\n");
508 if (status & sc->misc2int) {
509 status &= ~sc->misc2int;
510 nm_ackint(sc, sc->misc2int);
511 x = nm_rd(sc, 0x400, 1);
512 nm_wr(sc, 0x400, x & ~2, 1);
513 device_printf(sc->dev, "misc int 2\n");
516 nm_ackint(sc, status);
517 device_printf(sc->dev, "unknown int\n");
521 /* -------------------------------------------------------------------- */
524 * Probe and attach the card
528 nm_init(struct sc_info *sc)
532 if (sc->type == NM256AV_PCI_ID) {
533 sc->ac97_base = NM_MIXER_OFFSET;
534 sc->ac97_status = NM_MIXER_STATUS_OFFSET;
535 sc->ac97_busy = NM_MIXER_READY_MASK;
537 sc->buftop = 2560 * 1024;
540 sc->playint = NM_PLAYBACK_INT;
541 sc->recint = NM_RECORD_INT;
542 sc->misc1int = NM_MISC_INT_1;
543 sc->misc2int = NM_MISC_INT_2;
544 } else if (sc->type == NM256ZX_PCI_ID) {
545 sc->ac97_base = NM_MIXER_OFFSET;
546 sc->ac97_status = NM2_MIXER_STATUS_OFFSET;
547 sc->ac97_busy = NM2_MIXER_READY_MASK;
549 sc->buftop = (nm_rd(sc, 0xa0b, 2)? 6144 : 4096) * 1024;
552 sc->playint = NM2_PLAYBACK_INT;
553 sc->recint = NM2_RECORD_INT;
554 sc->misc1int = NM2_MISC_INT_1;
555 sc->misc2int = NM2_MISC_INT_2;
558 ofs = sc->buftop - 0x0400;
559 sc->buftop -= 0x1400;
562 device_printf(sc->dev, "buftop is 0x%08x\n", sc->buftop);
563 if ((nm_rdbuf(sc, ofs, 4) & NM_SIG_MASK) == NM_SIGNATURE) {
564 i = nm_rdbuf(sc, ofs + 4, 4);
565 if (i != 0 && i != 0xffffffff) {
567 device_printf(sc->dev, "buftop is changed to 0x%08x\n", i);
572 sc->cbuf = sc->buftop - NM_MAX_COEFFICIENT;
573 sc->rbuf = sc->cbuf - NM_BUFFSIZE;
574 sc->pbuf = sc->rbuf - NM_BUFFSIZE;
575 sc->acbuf = sc->pbuf - (NM_TOTAL_COEFF_COUNT * 4);
577 nm_wr(sc, 0, 0x11, 1);
578 nm_wr(sc, NM_RECORD_ENABLE_REG, 0, 1);
579 nm_wr(sc, 0x214, 0, 2);
585 nm_pci_probe(device_t dev)
587 struct sc_info *sc = NULL;
589 u_int32_t subdev, i, data;
591 subdev = (pci_get_subdevice(dev) << 16) | pci_get_subvendor(dev);
592 switch (pci_get_devid(dev)) {
595 while ((i < NUM_BADCARDS) && (badcards[i] != subdev))
598 /* Try to catch other non-ac97 cards */
600 if (i == NUM_BADCARDS) {
601 if (!(sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO))) {
602 device_printf(dev, "cannot allocate softc\n");
606 data = pci_read_config(dev, PCIR_COMMAND, 2);
607 pci_write_config(dev, PCIR_COMMAND, data |
608 PCIM_CMD_PORTEN | PCIM_CMD_MEMEN |
609 PCIM_CMD_BUSMASTEREN, 2);
611 sc->regid = PCIR_MAPS + 4;
612 sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY,
613 &sc->regid, 0, ~0, 1,
617 device_printf(dev, "unable to map register space\n");
618 pci_write_config(dev, PCIR_COMMAND, data, 2);
624 * My Panasonic CF-M2EV needs resetting device
625 * before checking mixer is present or not.
626 * t.ichinoseki@nifty.com.
628 nm_wr(sc, 0, 0x11, 1); /* reset device */
629 if ((nm_rd(sc, NM_MIXER_PRESENCE, 2) &
630 NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
631 i = 0; /* non-ac97 card, but not listed */
632 DEB(device_printf(dev, "subdev = 0x%x - badcard?\n",
635 pci_write_config(dev, PCIR_COMMAND, data, 2);
636 bus_release_resource(dev, SYS_RES_MEMORY, sc->regid,
641 if (i == NUM_BADCARDS)
642 s = "NeoMagic 256AV";
644 DEB(device_printf(dev, "this is a non-ac97 NM256AV, not attaching\n"));
649 s = "NeoMagic 256ZX";
653 if (s) device_set_desc(dev, s);
658 nm_pci_attach(device_t dev)
662 struct ac97_info *codec = 0;
663 char status[SND_STATUSLEN];
665 if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) {
666 device_printf(dev, "cannot allocate softc\n");
671 sc->type = pci_get_devid(dev);
673 data = pci_read_config(dev, PCIR_COMMAND, 2);
674 data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
675 pci_write_config(dev, PCIR_COMMAND, data, 2);
676 data = pci_read_config(dev, PCIR_COMMAND, 2);
678 sc->bufid = PCIR_MAPS;
679 sc->buf = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->bufid,
680 0, ~0, 1, RF_ACTIVE);
681 sc->regid = PCIR_MAPS + 4;
682 sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid,
683 0, ~0, 1, RF_ACTIVE);
685 if (!sc->buf || !sc->reg) {
686 device_printf(dev, "unable to map register space\n");
690 if (nm_init(sc) == -1) {
691 device_printf(dev, "unable to initialize the card\n");
695 codec = AC97_CREATE(dev, sc, nm_ac97);
696 if (codec == NULL) goto bad;
697 if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad;
700 sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
701 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
702 if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, nm_intr, sc, &sc->ih)) {
703 device_printf(dev, "unable to map interrupt\n");
707 snprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld",
708 rman_get_start(sc->buf), rman_get_start(sc->reg),
709 rman_get_start(sc->irq));
711 if (pcm_register(dev, sc, 1, 1)) goto bad;
712 pcm_addchan(dev, PCMDIR_REC, &nmchan_class, sc);
713 pcm_addchan(dev, PCMDIR_PLAY, &nmchan_class, sc);
714 pcm_setstatus(dev, status);
719 if (codec) ac97_destroy(codec);
720 if (sc->buf) bus_release_resource(dev, SYS_RES_MEMORY, sc->bufid, sc->buf);
721 if (sc->reg) bus_release_resource(dev, SYS_RES_MEMORY, sc->regid, sc->reg);
722 if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih);
723 if (sc->irq) bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq);
729 nm_pci_detach(device_t dev)
734 r = pcm_unregister(dev);
738 sc = pcm_getdevinfo(dev);
739 bus_release_resource(dev, SYS_RES_MEMORY, sc->bufid, sc->buf);
740 bus_release_resource(dev, SYS_RES_MEMORY, sc->regid, sc->reg);
741 bus_teardown_intr(dev, sc->irq, sc->ih);
742 bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq);
749 nm_pci_suspend(device_t dev)
753 sc = pcm_getdevinfo(dev);
756 if (sc->pch.active) {
757 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, 0, 1);
758 nm_wr(sc, NM_AUDIO_MUTE_REG, NM_AUDIO_MUTE_BOTH, 2);
761 if (sc->rch.active) {
762 nm_wr(sc, NM_RECORD_ENABLE_REG, 0, 1);
768 nm_pci_resume(device_t dev)
772 sc = pcm_getdevinfo(dev);
775 * Reinit audio device.
776 * Don't call nm_init(). It would change buftop if X ran or
777 * is running. This makes playing and recording buffer address
778 * shift but these buffers of channel layer are not changed.
779 * As a result of this inconsistency, periodic noise will be
780 * generated while playing.
782 nm_wr(sc, 0, 0x11, 1);
783 nm_wr(sc, 0x214, 0, 2);
786 if (mixer_reinit(dev) == -1) {
787 device_printf(dev, "unable to reinitialize the mixer\n");
790 /* restart playing */
791 if (sc->pch.active) {
792 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, NM_PLAYBACK_FREERUN |
793 NM_PLAYBACK_ENABLE_FLAG, 1);
794 nm_wr(sc, NM_AUDIO_MUTE_REG, 0, 2);
796 /* restart recording */
797 if (sc->rch.active) {
798 nm_wr(sc, NM_RECORD_ENABLE_REG, NM_RECORD_FREERUN |
799 NM_RECORD_ENABLE_FLAG, 1);
804 static device_method_t nm_methods[] = {
805 /* Device interface */
806 DEVMETHOD(device_probe, nm_pci_probe),
807 DEVMETHOD(device_attach, nm_pci_attach),
808 DEVMETHOD(device_detach, nm_pci_detach),
809 DEVMETHOD(device_suspend, nm_pci_suspend),
810 DEVMETHOD(device_resume, nm_pci_resume),
814 static driver_t nm_driver = {
820 DRIVER_MODULE(snd_neomagic, pci, nm_driver, pcm_devclass, 0, 0);
821 MODULE_DEPEND(snd_neomagic, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER);
822 MODULE_VERSION(snd_neomagic, 1);