2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
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
28 * $FreeBSD: src/sys/dev/sound/pci/neomagic.c,v 1.34.2.1 2005/12/30 19:55:53 netchild Exp $
31 #include <dev/sound/pcm/sound.h>
32 #include <dev/sound/pcm/ac97.h>
33 #include <dev/sound/pci/neomagic.h>
34 #include <dev/sound/pci/neomagic-coeff.h>
36 #include <bus/pci/pcireg.h>
37 #include <bus/pci/pcivar.h>
39 SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.7 2007/01/04 21:47:02 corecode Exp $");
41 /* -------------------------------------------------------------------- */
43 #define NM_BUFFSIZE 16384
45 #define NM256AV_PCI_ID 0x800510c8
46 #define NM256ZX_PCI_ID 0x800610c8
50 /* channel registers */
52 int active, spd, dir, fmt;
53 u_int32_t blksize, wmark;
54 struct snd_dbuf *buffer;
55 struct pcm_channel *channel;
56 struct sc_info *parent;
59 /* device private data */
64 struct resource *reg, *irq, *buf;
65 int regid, irqid, bufid;
68 u_int32_t ac97_base, ac97_status, ac97_busy;
69 u_int32_t buftop, pbuf, rbuf, cbuf, acbuf;
70 u_int32_t playint, recint, misc1int, misc2int;
71 u_int32_t irsz, badintr;
73 struct sc_chinfo pch, rch;
76 /* -------------------------------------------------------------------- */
83 static int nm_loadcoeff(struct sc_info *sc, int dir, int num);
84 static int nm_setch(struct sc_chinfo *ch);
85 static int nm_init(struct sc_info *);
86 static void nm_intr(void *);
88 /* talk to the card */
89 static u_int32_t nm_rd(struct sc_info *, int, int);
90 static void nm_wr(struct sc_info *, int, u_int32_t, int);
91 static u_int32_t nm_rdbuf(struct sc_info *, int, int);
92 static void nm_wrbuf(struct sc_info *, int, u_int32_t, int);
94 static u_int32_t badcards[] = {
100 #define NUM_BADCARDS (sizeof(badcards) / sizeof(u_int32_t))
102 /* The actual rates supported by the card. */
103 static int samplerates[9] = {
115 /* -------------------------------------------------------------------- */
117 static u_int32_t nm_fmt[] = {
119 AFMT_STEREO | AFMT_U8,
121 AFMT_STEREO | AFMT_S16_LE,
124 static struct pcmchan_caps nm_caps = {4000, 48000, nm_fmt, 0};
126 /* -------------------------------------------------------------------- */
130 nm_rd(struct sc_info *sc, int regno, int size)
132 bus_space_tag_t st = rman_get_bustag(sc->reg);
133 bus_space_handle_t sh = rman_get_bushandle(sc->reg);
137 return bus_space_read_1(st, sh, regno);
139 return bus_space_read_2(st, sh, regno);
141 return bus_space_read_4(st, sh, regno);
148 nm_wr(struct sc_info *sc, int regno, u_int32_t data, int size)
150 bus_space_tag_t st = rman_get_bustag(sc->reg);
151 bus_space_handle_t sh = rman_get_bushandle(sc->reg);
155 bus_space_write_1(st, sh, regno, data);
158 bus_space_write_2(st, sh, regno, data);
161 bus_space_write_4(st, sh, regno, data);
167 nm_rdbuf(struct sc_info *sc, int regno, int size)
169 bus_space_tag_t st = rman_get_bustag(sc->buf);
170 bus_space_handle_t sh = rman_get_bushandle(sc->buf);
174 return bus_space_read_1(st, sh, regno);
176 return bus_space_read_2(st, sh, regno);
178 return bus_space_read_4(st, sh, regno);
185 nm_wrbuf(struct sc_info *sc, int regno, u_int32_t data, int size)
187 bus_space_tag_t st = rman_get_bustag(sc->buf);
188 bus_space_handle_t sh = rman_get_bushandle(sc->buf);
192 bus_space_write_1(st, sh, regno, data);
195 bus_space_write_2(st, sh, regno, data);
198 bus_space_write_4(st, sh, regno, data);
203 /* -------------------------------------------------------------------- */
206 nm_waitcd(struct sc_info *sc)
212 if (nm_rd(sc, sc->ac97_status, 2) & sc->ac97_busy) {
223 nm_initcd(kobj_t obj, void *devinfo)
225 struct sc_info *sc = (struct sc_info *)devinfo;
227 nm_wr(sc, 0x6c0, 0x01, 1);
230 * The following code-line may cause a hang for some chipsets, see
232 * In case of a bugreport without this line have a look at the PR and
233 * conditionize the code-line based upon the specific version of
236 nm_wr(sc, 0x6cc, 0x87, 1);
238 nm_wr(sc, 0x6cc, 0x80, 1);
239 nm_wr(sc, 0x6cc, 0x00, 1);
244 nm_rdcd(kobj_t obj, void *devinfo, int regno)
246 struct sc_info *sc = (struct sc_info *)devinfo;
249 if (!nm_waitcd(sc)) {
250 x = nm_rd(sc, sc->ac97_base + regno, 2);
254 device_printf(sc->dev, "ac97 codec not ready\n");
260 nm_wrcd(kobj_t obj, void *devinfo, int regno, u_int32_t data)
262 struct sc_info *sc = (struct sc_info *)devinfo;
265 if (!nm_waitcd(sc)) {
267 nm_wr(sc, sc->ac97_base + regno, data, 2);
268 if (!nm_waitcd(sc)) {
274 device_printf(sc->dev, "ac97 codec not ready\n");
278 static kobj_method_t nm_ac97_methods[] = {
279 KOBJMETHOD(ac97_init, nm_initcd),
280 KOBJMETHOD(ac97_read, nm_rdcd),
281 KOBJMETHOD(ac97_write, nm_wrcd),
284 AC97_DECLARE(nm_ac97);
286 /* -------------------------------------------------------------------- */
289 nm_ackint(struct sc_info *sc, u_int32_t num)
291 if (sc->type == NM256AV_PCI_ID) {
292 nm_wr(sc, NM_INT_REG, num << 1, 2);
293 } else if (sc->type == NM256ZX_PCI_ID) {
294 nm_wr(sc, NM_INT_REG, num, 4);
299 nm_loadcoeff(struct sc_info *sc, int dir, int num)
304 addr = (dir == PCMDIR_PLAY)? 0x01c : 0x21c;
305 if (dir == PCMDIR_REC)
307 sz = coefficientSizes[num];
310 ofs+= coefficientSizes[num];
311 for (i = 0; i < sz; i++)
312 nm_wrbuf(sc, sc->cbuf + i, coefficients[ofs + i], 1);
313 nm_wr(sc, addr, sc->cbuf, 4);
314 if (dir == PCMDIR_PLAY)
316 nm_wr(sc, addr + 4, sc->cbuf + sz, 4);
321 nm_setch(struct sc_chinfo *ch)
323 struct sc_info *sc = ch->parent;
327 for (x = 0; x < 8; x++)
328 if (ch->spd < (samplerates[x] + samplerates[x + 1]) / 2)
331 if (x == 8) return 1;
333 ch->spd = samplerates[x];
334 nm_loadcoeff(sc, ch->dir, x);
338 if (ch->fmt & AFMT_16BIT) x |= NM_RATE_BITS_16;
339 if (ch->fmt & AFMT_STEREO) x |= NM_RATE_STEREO;
341 base = (ch->dir == PCMDIR_PLAY)? NM_PLAYBACK_REG_OFFSET : NM_RECORD_REG_OFFSET;
342 nm_wr(sc, base + NM_RATE_REG_OFFSET, x, 1);
346 /* channel interface */
348 nmchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
350 struct sc_info *sc = devinfo;
351 struct sc_chinfo *ch;
354 chnbuf = (dir == PCMDIR_PLAY)? sc->pbuf : sc->rbuf;
355 ch = (dir == PCMDIR_PLAY)? &sc->pch : &sc->rch;
360 sndbuf_setup(ch->buffer, (u_int8_t *)rman_get_virtual(sc->buf) + chnbuf, NM_BUFFSIZE);
362 device_printf(sc->dev, "%s buf %p\n", (dir == PCMDIR_PLAY)?
363 "play" : "rec", sndbuf_getbuf(ch->buffer));
371 nmchan_free(kobj_t obj, void *data)
377 nmchan_setformat(kobj_t obj, void *data, u_int32_t format)
379 struct sc_chinfo *ch = data;
386 nmchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
388 struct sc_chinfo *ch = data;
391 return nm_setch(ch)? 0 : ch->spd;
395 nmchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
397 struct sc_chinfo *ch = data;
399 ch->blksize = blocksize;
405 nmchan_trigger(kobj_t obj, void *data, int go)
407 struct sc_chinfo *ch = data;
408 struct sc_info *sc = ch->parent;
411 if (go == PCMTRIG_EMLDMAWR || go == PCMTRIG_EMLDMARD)
414 ssz = (ch->fmt & AFMT_16BIT)? 2 : 1;
415 if (ch->fmt & AFMT_STEREO)
418 if (ch->dir == PCMDIR_PLAY) {
419 if (go == PCMTRIG_START) {
421 ch->wmark = ch->blksize;
422 nm_wr(sc, NM_PBUFFER_START, sc->pbuf, 4);
423 nm_wr(sc, NM_PBUFFER_END, sc->pbuf + NM_BUFFSIZE - ssz, 4);
424 nm_wr(sc, NM_PBUFFER_CURRP, sc->pbuf, 4);
425 nm_wr(sc, NM_PBUFFER_WMARK, sc->pbuf + ch->wmark, 4);
426 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, NM_PLAYBACK_FREERUN |
427 NM_PLAYBACK_ENABLE_FLAG, 1);
428 nm_wr(sc, NM_AUDIO_MUTE_REG, 0, 2);
431 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, 0, 1);
432 nm_wr(sc, NM_AUDIO_MUTE_REG, NM_AUDIO_MUTE_BOTH, 2);
435 if (go == PCMTRIG_START) {
437 ch->wmark = ch->blksize;
438 nm_wr(sc, NM_RECORD_ENABLE_REG, NM_RECORD_FREERUN |
439 NM_RECORD_ENABLE_FLAG, 1);
440 nm_wr(sc, NM_RBUFFER_START, sc->rbuf, 4);
441 nm_wr(sc, NM_RBUFFER_END, sc->rbuf + NM_BUFFSIZE, 4);
442 nm_wr(sc, NM_RBUFFER_CURRP, sc->rbuf, 4);
443 nm_wr(sc, NM_RBUFFER_WMARK, sc->rbuf + ch->wmark, 4);
446 nm_wr(sc, NM_RECORD_ENABLE_REG, 0, 1);
453 nmchan_getptr(kobj_t obj, void *data)
455 struct sc_chinfo *ch = data;
456 struct sc_info *sc = ch->parent;
458 if (ch->dir == PCMDIR_PLAY)
459 return nm_rd(sc, NM_PBUFFER_CURRP, 4) - sc->pbuf;
461 return nm_rd(sc, NM_RBUFFER_CURRP, 4) - sc->rbuf;
464 static struct pcmchan_caps *
465 nmchan_getcaps(kobj_t obj, void *data)
470 static kobj_method_t nmchan_methods[] = {
471 KOBJMETHOD(channel_init, nmchan_init),
472 KOBJMETHOD(channel_free, nmchan_free),
473 KOBJMETHOD(channel_setformat, nmchan_setformat),
474 KOBJMETHOD(channel_setspeed, nmchan_setspeed),
475 KOBJMETHOD(channel_setblocksize, nmchan_setblocksize),
476 KOBJMETHOD(channel_trigger, nmchan_trigger),
477 KOBJMETHOD(channel_getptr, nmchan_getptr),
478 KOBJMETHOD(channel_getcaps, nmchan_getcaps),
481 CHANNEL_DECLARE(nmchan);
483 /* The interrupt handler */
487 struct sc_info *sc = (struct sc_info *)p;
490 status = nm_rd(sc, NM_INT_REG, sc->irsz);
494 if (status & sc->playint) {
495 status &= ~sc->playint;
496 sc->pch.wmark += sc->pch.blksize;
497 sc->pch.wmark %= NM_BUFFSIZE;
498 nm_wr(sc, NM_PBUFFER_WMARK, sc->pbuf + sc->pch.wmark, 4);
500 nm_ackint(sc, sc->playint);
501 chn_intr(sc->pch.channel);
503 if (status & sc->recint) {
504 status &= ~sc->recint;
505 sc->rch.wmark += sc->rch.blksize;
506 sc->rch.wmark %= NM_BUFFSIZE;
507 nm_wr(sc, NM_RBUFFER_WMARK, sc->rbuf + sc->rch.wmark, 4);
509 nm_ackint(sc, sc->recint);
510 chn_intr(sc->rch.channel);
512 if (status & sc->misc1int) {
513 status &= ~sc->misc1int;
514 nm_ackint(sc, sc->misc1int);
515 x = nm_rd(sc, 0x400, 1);
516 nm_wr(sc, 0x400, x | 2, 1);
517 device_printf(sc->dev, "misc int 1\n");
519 if (status & sc->misc2int) {
520 status &= ~sc->misc2int;
521 nm_ackint(sc, sc->misc2int);
522 x = nm_rd(sc, 0x400, 1);
523 nm_wr(sc, 0x400, x & ~2, 1);
524 device_printf(sc->dev, "misc int 2\n");
527 nm_ackint(sc, status);
528 device_printf(sc->dev, "unknown int\n");
532 /* -------------------------------------------------------------------- */
535 * Probe and attach the card
539 nm_init(struct sc_info *sc)
543 if (sc->type == NM256AV_PCI_ID) {
544 sc->ac97_base = NM_MIXER_OFFSET;
545 sc->ac97_status = NM_MIXER_STATUS_OFFSET;
546 sc->ac97_busy = NM_MIXER_READY_MASK;
548 sc->buftop = 2560 * 1024;
551 sc->playint = NM_PLAYBACK_INT;
552 sc->recint = NM_RECORD_INT;
553 sc->misc1int = NM_MISC_INT_1;
554 sc->misc2int = NM_MISC_INT_2;
555 } else if (sc->type == NM256ZX_PCI_ID) {
556 sc->ac97_base = NM_MIXER_OFFSET;
557 sc->ac97_status = NM2_MIXER_STATUS_OFFSET;
558 sc->ac97_busy = NM2_MIXER_READY_MASK;
560 sc->buftop = (nm_rd(sc, 0xa0b, 2)? 6144 : 4096) * 1024;
563 sc->playint = NM2_PLAYBACK_INT;
564 sc->recint = NM2_RECORD_INT;
565 sc->misc1int = NM2_MISC_INT_1;
566 sc->misc2int = NM2_MISC_INT_2;
569 ofs = sc->buftop - 0x0400;
570 sc->buftop -= 0x1400;
573 device_printf(sc->dev, "buftop is 0x%08x\n", sc->buftop);
574 if ((nm_rdbuf(sc, ofs, 4) & NM_SIG_MASK) == NM_SIGNATURE) {
575 i = nm_rdbuf(sc, ofs + 4, 4);
576 if (i != 0 && i != 0xffffffff) {
578 device_printf(sc->dev, "buftop is changed to 0x%08x\n", i);
583 sc->cbuf = sc->buftop - NM_MAX_COEFFICIENT;
584 sc->rbuf = sc->cbuf - NM_BUFFSIZE;
585 sc->pbuf = sc->rbuf - NM_BUFFSIZE;
586 sc->acbuf = sc->pbuf - (NM_TOTAL_COEFF_COUNT * 4);
588 nm_wr(sc, 0, 0x11, 1);
589 nm_wr(sc, NM_RECORD_ENABLE_REG, 0, 1);
590 nm_wr(sc, 0x214, 0, 2);
596 nm_pci_probe(device_t dev)
598 struct sc_info *sc = NULL;
600 u_int32_t subdev, i, data;
602 subdev = (pci_get_subdevice(dev) << 16) | pci_get_subvendor(dev);
603 switch (pci_get_devid(dev)) {
606 while ((i < NUM_BADCARDS) && (badcards[i] != subdev))
609 /* Try to catch other non-ac97 cards */
611 if (i == NUM_BADCARDS) {
612 sc = kmalloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
613 data = pci_read_config(dev, PCIR_COMMAND, 2);
614 pci_write_config(dev, PCIR_COMMAND, data |
615 PCIM_CMD_PORTEN | PCIM_CMD_MEMEN |
616 PCIM_CMD_BUSMASTEREN, 2);
618 sc->regid = PCIR_BAR(1);
619 sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
624 device_printf(dev, "unable to map register space\n");
625 pci_write_config(dev, PCIR_COMMAND, data, 2);
631 * My Panasonic CF-M2EV needs resetting device
632 * before checking mixer is present or not.
633 * t.ichinoseki@nifty.com.
635 nm_wr(sc, 0, 0x11, 1); /* reset device */
636 if ((nm_rd(sc, NM_MIXER_PRESENCE, 2) &
637 NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
638 i = 0; /* non-ac97 card, but not listed */
639 DEB(device_printf(dev, "subdev = 0x%x - badcard?\n",
642 pci_write_config(dev, PCIR_COMMAND, data, 2);
643 bus_release_resource(dev, SYS_RES_MEMORY, sc->regid,
648 if (i == NUM_BADCARDS)
649 s = "NeoMagic 256AV";
651 DEB(device_printf(dev, "this is a non-ac97 NM256AV, not attaching\n"));
656 s = "NeoMagic 256ZX";
660 if (s) device_set_desc(dev, s);
665 nm_pci_attach(device_t dev)
669 struct ac97_info *codec = NULL;
670 char status[SND_STATUSLEN];
672 sc = kmalloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
674 sc->type = pci_get_devid(dev);
676 data = pci_read_config(dev, PCIR_COMMAND, 2);
677 data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
678 pci_write_config(dev, PCIR_COMMAND, data, 2);
679 data = pci_read_config(dev, PCIR_COMMAND, 2);
681 sc->bufid = PCIR_BAR(0);
682 sc->buf = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->bufid,
684 sc->regid = PCIR_BAR(1);
685 sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regid,
688 if (!sc->buf || !sc->reg) {
689 device_printf(dev, "unable to map register space\n");
693 if (nm_init(sc) == -1) {
694 device_printf(dev, "unable to initialize the card\n");
698 codec = AC97_CREATE(dev, sc, nm_ac97);
699 if (codec == NULL) goto bad;
700 if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad;
703 sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
704 RF_ACTIVE | RF_SHAREABLE);
705 if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, nm_intr, sc, &sc->ih)) {
706 device_printf(dev, "unable to map interrupt\n");
710 ksnprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld %s",
711 rman_get_start(sc->buf), rman_get_start(sc->reg),
712 rman_get_start(sc->irq),PCM_KLDSTRING(snd_neomagic));
714 if (pcm_register(dev, sc, 1, 1)) goto bad;
715 pcm_addchan(dev, PCMDIR_REC, &nmchan_class, sc);
716 pcm_addchan(dev, PCMDIR_PLAY, &nmchan_class, sc);
717 pcm_setstatus(dev, status);
722 if (codec) ac97_destroy(codec);
723 if (sc->buf) bus_release_resource(dev, SYS_RES_MEMORY, sc->bufid, sc->buf);
724 if (sc->reg) bus_release_resource(dev, SYS_RES_MEMORY, sc->regid, sc->reg);
725 if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih);
726 if (sc->irq) bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq);
732 nm_pci_detach(device_t dev)
737 r = pcm_unregister(dev);
741 sc = pcm_getdevinfo(dev);
742 bus_release_resource(dev, SYS_RES_MEMORY, sc->bufid, sc->buf);
743 bus_release_resource(dev, SYS_RES_MEMORY, sc->regid, sc->reg);
744 bus_teardown_intr(dev, sc->irq, sc->ih);
745 bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq);
752 nm_pci_suspend(device_t dev)
756 sc = pcm_getdevinfo(dev);
759 if (sc->pch.active) {
760 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, 0, 1);
761 nm_wr(sc, NM_AUDIO_MUTE_REG, NM_AUDIO_MUTE_BOTH, 2);
764 if (sc->rch.active) {
765 nm_wr(sc, NM_RECORD_ENABLE_REG, 0, 1);
771 nm_pci_resume(device_t dev)
775 sc = pcm_getdevinfo(dev);
778 * Reinit audio device.
779 * Don't call nm_init(). It would change buftop if X ran or
780 * is running. This makes playing and recording buffer address
781 * shift but these buffers of channel layer are not changed.
782 * As a result of this inconsistency, periodic noise will be
783 * generated while playing.
785 nm_wr(sc, 0, 0x11, 1);
786 nm_wr(sc, 0x214, 0, 2);
789 if (mixer_reinit(dev) == -1) {
790 device_printf(dev, "unable to reinitialize the mixer\n");
793 /* restart playing */
794 if (sc->pch.active) {
795 nm_wr(sc, NM_PLAYBACK_ENABLE_REG, NM_PLAYBACK_FREERUN |
796 NM_PLAYBACK_ENABLE_FLAG, 1);
797 nm_wr(sc, NM_AUDIO_MUTE_REG, 0, 2);
799 /* restart recording */
800 if (sc->rch.active) {
801 nm_wr(sc, NM_RECORD_ENABLE_REG, NM_RECORD_FREERUN |
802 NM_RECORD_ENABLE_FLAG, 1);
807 static device_method_t nm_methods[] = {
808 /* Device interface */
809 DEVMETHOD(device_probe, nm_pci_probe),
810 DEVMETHOD(device_attach, nm_pci_attach),
811 DEVMETHOD(device_detach, nm_pci_detach),
812 DEVMETHOD(device_suspend, nm_pci_suspend),
813 DEVMETHOD(device_resume, nm_pci_resume),
817 static driver_t nm_driver = {
823 DRIVER_MODULE(snd_neomagic, pci, nm_driver, pcm_devclass, NULL, NULL);
824 MODULE_DEPEND(snd_neomagic, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER);
825 MODULE_VERSION(snd_neomagic, 1);