FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pci/vibes.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include "mixer_if.h"
Go to the source code of this file.
Data Structures | |
struct | sc_chinfo |
struct | sc_info |
struct | sv_mix_props |
Macros | |
#define | SV_PCI_ID 0xca005333 |
#define | SV_DEFAULT_BUFSZ 16384 |
#define | SV_MIN_BLKSZ 128 |
#define | SV_INTR_PER_BUFFER 2 |
#define | DEB(x) /* (x) */ |
#define | sv_direct_set(x, y, z) _sv_direct_set(x, y, z, __LINE__) |
#define | sv_indirect_set(x, y, z) _sv_indirect_set(x, y, z, __LINE__) |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static u_int8_t | sv_direct_get (struct sc_info *sc, u_int8_t reg) |
static void | _sv_direct_set (struct sc_info *sc, u_int8_t reg, u_int8_t val, int line) |
static u_int8_t | sv_indirect_get (struct sc_info *sc, u_int8_t reg) |
static void | _sv_indirect_set (struct sc_info *sc, u_int8_t reg, u_int8_t val, int line) |
static void | sv_dma_set_config (bus_space_tag_t st, bus_space_handle_t sh, u_int32_t base, u_int32_t count, u_int8_t mode) |
static u_int32_t | sv_dma_get_count (bus_space_tag_t st, bus_space_handle_t sh) |
static void * | svchan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static struct pcmchan_caps * | svchan_getcaps (kobj_t obj, void *data) |
static u_int32_t | svchan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static int | svchan_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | svchan_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static int | sv_set_recspeed (struct sc_info *sc, u_int32_t speed) |
static int | svrchan_trigger (kobj_t obj, void *data, int go) |
static u_int32_t | svrchan_getptr (kobj_t obj, void *data) |
CHANNEL_DECLARE (svrchan) | |
static int | svpchan_trigger (kobj_t obj, void *data, int go) |
static u_int32_t | svpchan_getptr (kobj_t obj, void *data) |
CHANNEL_DECLARE (svpchan) | |
static void | sv_channel_gain (struct sc_info *sc, u_int32_t dev, u_int32_t gain, u_int32_t channel) |
static int | sv_gain (struct sc_info *sc, u_int32_t dev, u_int32_t left, u_int32_t right) |
static void | sv_mix_mute_all (struct sc_info *sc) |
static int | sv_mix_init (struct snd_mixer *m) |
static int | sv_mix_set (struct snd_mixer *m, u_int32_t dev, u_int32_t left, u_int32_t right) |
static u_int32_t | sv_mix_setrecsrc (struct snd_mixer *m, u_int32_t mask) |
MIXER_DECLARE (sv_mixer) | |
static void | sv_power (struct sc_info *sc, int state) |
static int | sv_init (struct sc_info *sc) |
static int | sv_suspend (device_t dev) |
static int | sv_resume (device_t dev) |
static void | sv_intr (void *data) |
static int | sv_probe (device_t dev) |
static int | sv_attach (device_t dev) |
static int | sv_detach (device_t dev) |
DRIVER_MODULE (snd_vibes, pci, sonicvibes_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_vibes, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_vibes, 1) | |
Variables | |
static u_int32_t | sc_fmt [] |
static struct pcmchan_caps | sc_caps = {8000, 48000, sc_fmt, 0} |
static kobj_method_t | svrchan_methods [] |
static kobj_method_t | svpchan_methods [] |
struct sv_mix_props | mt [SOUND_MIXER_NRDEVICES] |
static kobj_method_t | sv_mixer_methods [] |
static device_method_t | sc_methods [] |
static driver_t | sonicvibes_driver |
#define sv_direct_set | ( | x, | |
y, | |||
z | |||
) | _sv_direct_set(x, y, z, __LINE__) |
#define sv_indirect_set | ( | x, | |
y, | |||
z | |||
) | _sv_indirect_set(x, y, z, __LINE__) |
|
static |
Definition at line 129 of file vibes.c.
References sc_info::dev, sc_info::enh_sh, sc_info::enh_st, n, reg, sv_direct_get(), and val.
|
static |
Definition at line 153 of file vibes.c.
References sc_info::dev, sc_info::enh_sh, sc_info::enh_st, n, reg, SV_CM_DATA, SV_CM_INDEX, SV_CM_INDEX_MCE, sv_indirect_get(), SV_REG_ADC_PLLM, SV_REG_ANALOG_PWR, SV_REG_FORMAT, and val.
CHANNEL_DECLARE | ( | svpchan | ) |
CHANNEL_DECLARE | ( | svrchan | ) |
DRIVER_MODULE | ( | snd_vibes | , |
pci | , | ||
sonicvibes_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
MIXER_DECLARE | ( | sv_mixer | ) |
MODULE_DEPEND | ( | snd_vibes | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_vibes | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 724 of file vibes.c.
References sc_info::bufsz, count, data, DEB, sc_info::dev, dev, sc_info::dmaa_reg, sc_info::dmaa_rid, sc_info::dmaa_sh, sc_info::dmaa_st, sc_info::dmaa_type, sc_info::dmac_reg, sc_info::dmac_rid, sc_info::dmac_sh, sc_info::dmac_st, sc_info::dmac_type, sc_info::enh_reg, sc_info::enh_rid, sc_info::enh_sh, sc_info::enh_st, sc_info::enh_type, fail, sc_info::ih, sc_info::irq, sc_info::irqid, mixer_init(), sc_info::parent_dmat, pcm_addchan(), pcm_getbuffersize(), PCM_KLDSTRING, pcm_register(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, sc_info::rev, snd_setup_intr(), SND_STATUSLEN, status, SV_DEFAULT_BUFSZ, sv_init(), sv_intr(), sv_mix_mute_all(), SV_PCI_DMA_ENABLE, SV_PCI_DMA_EXTENDED, SV_PCI_DMAA, SV_PCI_DMAA_SIZE, SV_PCI_DMAC, SV_PCI_DMAC_SIZE, SV_PCI_ENHANCED, SV_PCI_GAMES, SV_PCI_MIDI, and sv_power().
|
static |
Definition at line 483 of file vibes.c.
References channel, dev, sv_mix_props::max, mt, reg, sv_indirect_get(), sv_indirect_set, and SV_MUTE.
Referenced by sv_gain().
|
static |
Definition at line 904 of file vibes.c.
References dev, sc_info::dmaa_reg, sc_info::dmaa_rid, sc_info::dmaa_type, sc_info::dmac_reg, sc_info::dmac_rid, sc_info::dmac_type, sc_info::enh_reg, sc_info::enh_rid, sc_info::enh_type, free, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::parent_dmat, pcm_getdevinfo(), pcm_unregister(), r, sv_mix_mute_all(), and sv_power().
|
static |
Definition at line 123 of file vibes.c.
References sc_info::enh_sh, sc_info::enh_st, and reg.
Referenced by _sv_direct_set(), sv_init(), and sv_intr().
|
static |
Definition at line 184 of file vibes.c.
References SV_DMA_COUNT.
Referenced by svpchan_getptr(), and svrchan_getptr().
|
static |
Definition at line 172 of file vibes.c.
References base, count, DEB, SV_DMA_ADDR, SV_DMA_COUNT, and SV_DMA_MODE.
Referenced by svpchan_trigger(), and svrchan_trigger().
|
static |
Definition at line 505 of file vibes.c.
References dev, left, mt, right, stereo, and sv_channel_gain().
Referenced by sv_mix_mute_all(), and sv_mix_set().
|
static |
Definition at line 141 of file vibes.c.
References sc_info::enh_sh, sc_info::enh_st, reg, SV_CM_DATA, SV_CM_INDEX, SV_CM_INDEX_MCE, SV_REG_ANALOG_PWR, and SV_REG_FORMAT.
Referenced by _sv_indirect_set(), sv_channel_gain(), sv_init(), sv_mix_setrecsrc(), sv_power(), sv_set_recspeed(), svpchan_trigger(), and svrchan_trigger().
|
static |
Definition at line 602 of file vibes.c.
References sc_info::rev, SV_CM_CONTROL, SV_CM_CONTROL_ENHANCED, SV_CM_CONTROL_RESET, SV_CM_IMR, SV_CM_IMR_AMSK, SV_CM_IMR_CMSK, SV_CM_IMR_SMSK, sv_direct_get(), sv_direct_set, sv_indirect_get(), sv_indirect_set, SV_REG_CLOCK_SOURCE, SV_REG_LOOPBACK, SV_REG_REVISION, SV_REG_SRS_SPACE, and SV_SRS_DISABLED.
Referenced by sv_attach(), and sv_resume().
|
static |
Definition at line 693 of file vibes.c.
References sc_chinfo::channel, chn_intr(), data, DEB, sc_info::pch, sc_info::rch, status, SV_CM_STATUS, SV_CM_STATUS_AINT, SV_CM_STATUS_CINT, and sv_direct_get().
Referenced by sv_attach().
|
static |
Definition at line 523 of file vibes.c.
References m, max, mix_setdevs(), mix_setrecdevs(), and mt.
|
static |
Definition at line 514 of file vibes.c.
References mt, reg, and sv_gain().
Referenced by sv_attach(), sv_detach(), sv_resume(), and sv_suspend().
|
static |
|
static |
Definition at line 548 of file vibes.c.
References DEB, sv_mix_props::iselect, m, mask, mix_getdevinfo(), mt, sv_indirect_get(), sv_indirect_set, SV_INPUT_GAIN_MASK, and SV_REG_ADC_INPUT.
|
static |
Definition at line 576 of file vibes.c.
References DEB, state, SV_ANALOG_OFF, SV_ANALOG_OFF_SPLL, SV_ANALOG_OFF_SRS, SV_DIGITAL_OFF, SV_DIGITAL_OFF_GP, SV_DIGITAL_OFF_MU, SV_DIGITAL_OFF_SYN, sv_indirect_get(), sv_indirect_set, SV_REG_ANALOG_PWR, and SV_REG_DIGITAL_PWR.
Referenced by sv_attach(), sv_detach(), sv_resume(), and sv_suspend().
|
static |
|
static |
Definition at line 662 of file vibes.c.
References dev, sc_chinfo::dma_was_active, mixer_reinit(), sc_info::pch, pcm_getdevinfo(), PCMTRIG_START, sc_info::rch, sv_init(), sv_mix_mute_all(), sv_power(), svpchan_trigger(), and svrchan_trigger().
|
static |
Definition at line 258 of file vibes.c.
References DEB, m, n, r, r2, speed, SV_ADC_PLLN, SV_ADC_PLLR, SV_F_REF, SV_F_SCALE, sv_indirect_get(), sv_indirect_set, SV_REG_ADC_PLLM, and SV_REG_ADC_PLLN.
Referenced by svrchan_trigger().
|
static |
Definition at line 645 of file vibes.c.
References dev, sc_chinfo::dma_active, sc_chinfo::dma_was_active, sc_info::pch, pcm_getdevinfo(), PCMTRIG_ABORT, sc_info::rch, sv_mix_mute_all(), sv_power(), and svrchan_trigger().
|
static |
|
static |
Definition at line 193 of file vibes.c.
References b, sc_chinfo::buffer, sc_info::bufsz, c, sc_chinfo::channel, DEB, devinfo, sc_chinfo::dir, dir, sc_chinfo::dma_active, sc_chinfo::dma_was_active, DSP_DEFAULT_SPEED, sc_chinfo::fmt, sc_chinfo::parent, sc_info::parent_dmat, sc_info::pch, PCMDIR_PLAY, sc_info::rch, SND_FORMAT, sndbuf_alloc(), and sc_chinfo::spd.
|
static |
Definition at line 222 of file vibes.c.
References blocksize, sc_chinfo::buffer, sc_info::bufsz, sc_info::ch, data, DEB, sc_chinfo::parent, RANGE, sndbuf_resize(), SV_INTR_PER_BUFFER, and SV_MIN_BLKSZ.
|
static |
Definition at line 235 of file vibes.c.
References AFMT_16BIT, AFMT_CHANNEL, data, sc_chinfo::fmt, format, SV_AFMT_MONO, SV_AFMT_S16, SV_AFMT_STEREO, and SV_AFMT_U8.
|
static |
|
static |
Definition at line 436 of file vibes.c.
References sc_chinfo::buffer, sc_info::ch, data, sc_info::dmaa_sh, sc_info::dmaa_st, sc_chinfo::parent, sndbuf_getsize(), and sv_dma_get_count().
|
static |
Definition at line 387 of file vibes.c.
References sc_chinfo::buffer, sc_info::ch, count, data, sc_chinfo::dma_active, sc_info::dmaa_sh, sc_info::dmaa_st, enable, sc_chinfo::fmt, go, sc_chinfo::parent, PCMTRIG_ABORT, PCMTRIG_START, PCMTRIG_STOP, sndbuf_getbufaddr(), sndbuf_getsize(), sc_chinfo::spd, speed, SV_AFMT_DMAA, SV_DMA_MODE_AUTO, SV_DMA_MODE_WR, sv_dma_set_config(), sv_indirect_get(), sv_indirect_set, SV_INTR_PER_BUFFER, SV_PLAY_ENABLE, SV_PLAYBACK_PAUSE, SV_REG_DMAA_COUNT_HI, SV_REG_DMAA_COUNT_LO, SV_REG_ENABLE, SV_REG_FORMAT, SV_REG_PCM_SAMPLING_HI, and SV_REG_PCM_SAMPLING_LO.
Referenced by sv_resume().
|
static |
Definition at line 359 of file vibes.c.
References sc_chinfo::buffer, sc_info::ch, data, sc_info::dmac_sh, sc_info::dmac_st, sc_chinfo::parent, sndbuf_getsize(), and sv_dma_get_count().
|
static |
Definition at line 315 of file vibes.c.
References sc_chinfo::buffer, sc_info::ch, count, data, sc_chinfo::dma_active, sc_info::dmac_sh, sc_info::dmac_st, enable, sc_chinfo::fmt, go, sc_chinfo::parent, PCMTRIG_ABORT, PCMTRIG_START, PCMTRIG_STOP, sndbuf_getbufaddr(), sndbuf_getsize(), sc_chinfo::spd, SV_AFMT_DMAC, SV_DMA_MODE_AUTO, SV_DMA_MODE_RD, sv_dma_set_config(), sv_indirect_get(), sv_indirect_set, SV_INTR_PER_BUFFER, SV_RECORD_ENABLE, SV_REG_DMAC_COUNT_HI, SV_REG_DMAC_COUNT_LO, SV_REG_ENABLE, SV_REG_FORMAT, and sv_set_recspeed().
Referenced by sv_resume(), and sv_suspend().
struct sv_mix_props mt[SOUND_MIXER_NRDEVICES] |
Referenced by sv_channel_gain(), sv_gain(), sv_mix_init(), sv_mix_mute_all(), and sv_mix_setrecsrc().
|
static |
Definition at line 115 of file vibes.c.
Referenced by svchan_getcaps().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |