FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <sys/sysctl.h>
#include <dev/sound/pci/via82c686.h>
Go to the source code of this file.
Data Structures | |
struct | via_dma_op |
struct | via_chinfo |
struct | via_info |
Macros | |
#define | VIA_PCI_ID 0x30581106 |
#define | NSEGS 4 /* Number of segments in SGD table */ |
#define | SEGS_PER_CHAN (NSEGS/2) |
#define | TIMEOUT 50 |
#define | VIA_DEFAULT_BUFSZ 0x1000 |
#define | DEB(x) |
#define | VIA_DMAOP_EOL 0x80000000 |
#define | VIA_DMAOP_FLAG 0x40000000 |
#define | VIA_DMAOP_STOP 0x20000000 |
#define | VIA_DMAOP_COUNT(x) ((x)&0x00FFFFFF) |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static __inline u_int32_t | via_rd (struct via_info *via, int regno, int size) |
static __inline void | via_wr (struct via_info *via, int regno, u_int32_t data, int size) |
static int | via_waitready_codec (struct via_info *via) |
static int | via_waitvalid_codec (struct via_info *via) |
static int | via_write_codec (kobj_t obj, void *addr, int reg, u_int32_t val) |
static int | via_read_codec (kobj_t obj, void *addr, int reg) |
AC97_DECLARE (via_ac97) | |
static int | via_buildsgdt (struct via_chinfo *ch) |
static void * | viachan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static int | viachan_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | viachan_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static u_int32_t | viachan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static int | viachan_trigger (kobj_t obj, void *data, int go) |
static u_int32_t | viachan_getptr (kobj_t obj, void *data) |
static struct pcmchan_caps * | viachan_getcaps (kobj_t obj, void *data) |
CHANNEL_DECLARE (viachan) | |
static void | via_intr (void *p) |
static int | via_probe (device_t dev) |
static void | dma_cb (void *p, bus_dma_segment_t *bds, int a, int b) |
static int | via_attach (device_t dev) |
static int | via_detach (device_t dev) |
DRIVER_MODULE (snd_via82c686, pci, via_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_via82c686, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_via82c686, 1) | |
Variables | |
static u_int32_t | via_fmt [] |
static struct pcmchan_caps | via_vracaps = {4000, 48000, via_fmt, 0} |
static struct pcmchan_caps | via_caps = {48000, 48000, via_fmt, 0} |
static kobj_method_t | via_ac97_methods [] |
static kobj_method_t | viachan_methods [] |
static device_method_t | via_methods [] |
static driver_t | via_driver |
#define DEB | ( | x | ) |
Definition at line 53 of file via82c686.c.
#define NSEGS 4 /* Number of segments in SGD table */ |
Definition at line 45 of file via82c686.c.
#define SEGS_PER_CHAN (NSEGS/2) |
Definition at line 47 of file via82c686.c.
#define TIMEOUT 50 |
Definition at line 49 of file via82c686.c.
#define VIA_DEFAULT_BUFSZ 0x1000 |
Definition at line 50 of file via82c686.c.
#define VIA_DMAOP_COUNT | ( | x | ) | ((x)&0x00FFFFFF) |
Definition at line 62 of file via82c686.c.
#define VIA_DMAOP_EOL 0x80000000 |
Definition at line 59 of file via82c686.c.
#define VIA_DMAOP_FLAG 0x40000000 |
Definition at line 60 of file via82c686.c.
#define VIA_DMAOP_STOP 0x20000000 |
Definition at line 61 of file via82c686.c.
#define VIA_PCI_ID 0x30581106 |
Definition at line 44 of file via82c686.c.
AC97_DECLARE | ( | via_ac97 | ) |
CHANNEL_DECLARE | ( | viachan | ) |
|
static |
Definition at line 467 of file via82c686.c.
References via_info::sgd_addr.
Referenced by via_attach().
DRIVER_MODULE | ( | snd_via82c686 | , |
pci | , | ||
via_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
MODULE_DEPEND | ( | snd_via82c686 | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_via82c686 | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 474 of file via82c686.c.
References AC97_CREATE, ac97_destroy(), AC97_EXTCAP_VRA, AC97_EXTCAP_VRM, ac97_getextcaps(), ac97_getmixerclass(), ac97_setextmode(), via_info::bufsz, via_info::codec, via_info::codec_caps, data, dev, dma_cb(), free, via_info::ih, via_info::irq, via_info::irqid, via_info::lock, mixer_init(), NSEGS, via_info::parent_dmat, PCIR_BAR, pcm_addchan(), pcm_getbuffersize(), PCM_KLDSTRING, pcm_register(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, via_info::reg, via_info::regid, via_info::sgd_addr, via_info::sgd_dmamap, via_info::sgd_dmat, via_info::sgd_table, via_info::sh, snd_mtxcreate(), snd_mtxfree(), snd_setup_intr(), SND_STATUSLEN, via_info::st, status, VIA_AC97STATUS, VIA_AC97STATUS_RDY, VIA_ACLINK_DESIRED, VIA_ACLINK_EN, VIA_ACLINK_NRST, VIA_ACLINK_SYNC, VIA_ACLINKCTRL, VIA_DEFAULT_BUFSZ, via_intr(), VIA_PLAY_MODE, VIA_RECORD_MODE, VIA_RPMODE_AUTOSTART, VIA_RPMODE_INTR_EOL, VIA_RPMODE_INTR_FLAG, and via_wr().
|
static |
Definition at line 219 of file via82c686.c.
References via_chinfo::blksz, via_chinfo::buffer, via_dma_op::flags, via_dma_op::ptr, via_chinfo::sgd_table, sndbuf_getbufaddr(), sndbuf_getsize(), VIA_DMAOP_EOL, and VIA_DMAOP_FLAG.
Referenced by viachan_trigger().
|
static |
Definition at line 614 of file via82c686.c.
References dev, free, via_info::ih, via_info::irq, via_info::irqid, via_info::lock, via_info::parent_dmat, pcm_getdevinfo(), pcm_unregister(), r, via_info::reg, via_info::regid, via_info::sgd_dmamap, via_info::sgd_dmat, via_info::sgd_table, and snd_mtxfree().
|
static |
Definition at line 429 of file via82c686.c.
References via_chinfo::channel, chn_intr(), via_info::lock, via_info::pch, via_info::rch, snd_mtxlock, snd_mtxunlock, VIA_PLAY_STAT, via_rd(), VIA_RECORD_STAT, VIA_RPSTAT_INTR, and via_wr().
Referenced by via_attach().
|
static |
Definition at line 457 of file via82c686.c.
References dev, and VIA_PCI_ID.
|
static |
Definition at line 109 of file via82c686.c.
References regno, via_info::sh, size, and via_info::st.
Referenced by via_intr(), via_read_codec(), via_waitready_codec(), via_waitvalid_codec(), viachan_getptr(), and viachan_setformat().
|
static |
Definition at line 191 of file via82c686.c.
References addr, reg, VIA_CODEC_CTL, VIA_CODEC_INDEX, VIA_CODEC_PRIVALID, VIA_CODEC_READ, via_rd(), via_waitready_codec(), via_waitvalid_codec(), and via_wr().
|
static |
Definition at line 145 of file via82c686.c.
References TIMEOUT, VIA_CODEC_BUSY, VIA_CODEC_CTL, and via_rd().
Referenced by via_read_codec(), and via_write_codec().
|
static |
Definition at line 162 of file via82c686.c.
References TIMEOUT, VIA_CODEC_CTL, VIA_CODEC_PRIVALID, and via_rd().
Referenced by via_read_codec().
|
static |
Definition at line 125 of file via82c686.c.
References data, regno, via_info::sh, size, and via_info::st.
Referenced by via_attach(), via_intr(), via_read_codec(), via_write_codec(), viachan_setformat(), and viachan_trigger().
|
static |
Definition at line 179 of file via82c686.c.
References addr, reg, val, VIA_CODEC_CTL, VIA_CODEC_INDEX, VIA_CODEC_PRIVALID, via_waitready_codec(), and via_wr().
|
static |
Definition at line 406 of file via82c686.c.
References AC97_EXTCAP_VRA, via_info::codec_caps, data, via_chinfo::parent, via_caps, and via_vracaps.
|
static |
Definition at line 367 of file via82c686.c.
References base, via_chinfo::base, via_chinfo::buffer, via_chinfo::count, data, DEB, via_chinfo::dir, len, via_info::lock, via_chinfo::parent, PCMDIR_REC, via_dma_op::ptr, SEGS_PER_CHAN, via_chinfo::sgd_addr, via_chinfo::sgd_table, snd_mtxlock, snd_mtxunlock, sndbuf_getsize(), and via_rd().
|
static |
Definition at line 245 of file via82c686.c.
References b, via_chinfo::base, via_chinfo::buffer, via_info::bufsz, c, via_chinfo::channel, via_chinfo::count, via_chinfo::ctrl, devinfo, dir, via_chinfo::dir, via_info::lock, via_chinfo::mode, via_chinfo::parent, via_info::parent_dmat, via_info::pch, PCMDIR_PLAY, via_info::rch, SEGS_PER_CHAN, via_chinfo::sgd_addr, via_info::sgd_addr, via_chinfo::sgd_table, via_info::sgd_table, snd_mtxlock, snd_mtxunlock, sndbuf_alloc(), VIA_PLAY_CONTROL, VIA_PLAY_DMAOPS_BASE, VIA_PLAY_DMAOPS_COUNT, VIA_PLAY_MODE, VIA_RECORD_CONTROL, VIA_RECORD_DMAOPS_BASE, VIA_RECORD_DMAOPS_COUNT, and VIA_RECORD_MODE.
|
static |
Definition at line 329 of file via82c686.c.
References via_chinfo::blksz, blocksize, via_chinfo::buffer, data, SEGS_PER_CHAN, and sndbuf_resize().
|
static |
Definition at line 282 of file via82c686.c.
References AFMT_CHANNEL, data, DEB, via_chinfo::dir, format, via_info::lock, via_chinfo::mode, via_chinfo::parent, snd_mtxlock, snd_mtxunlock, via_rd(), VIA_RPMODE_16BIT, VIA_RPMODE_STEREO, and via_wr().
|
static |
Definition at line 306 of file via82c686.c.
References AC97_EXTCAP_VRA, AC97_REGEXT_FDACRATE, AC97_REGEXT_LADCRATE, ac97_setrate(), via_info::codec, via_info::codec_caps, data, via_chinfo::dir, via_chinfo::parent, PCMDIR_PLAY, reg, and speed.
|
static |
Definition at line 340 of file via82c686.c.
References via_chinfo::base, via_chinfo::ctrl, data, DEB, go, via_info::lock, via_chinfo::parent, PCMTRIG_COMMON, PCMTRIG_START, via_chinfo::sgd_addr, via_chinfo::sgd_table, snd_mtxlock, snd_mtxunlock, via_buildsgdt(), VIA_RPCTRL_START, VIA_RPCTRL_TERMINATE, and via_wr().
|
static |
Definition at line 209 of file via82c686.c.
|
static |
Definition at line 106 of file via82c686.c.
Referenced by viachan_getcaps().
|
static |
Definition at line 643 of file via82c686.c.
|
static |
Definition at line 98 of file via82c686.c.
|
static |
Definition at line 636 of file via82c686.c.
|
static |
Definition at line 105 of file via82c686.c.
Referenced by viachan_getcaps().
|
static |
Definition at line 414 of file via82c686.c.