FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/isa/sb.h>
#include <dev/sound/pci/als4000.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 | playback_command |
struct | sb16props |
Macros | |
#define | DEB(x) /* x */ |
#define | ALS_DEFAULT_BUFSZ 16384 |
#define | ALS_8BIT_CMD(x, y) { (x), (y), DSP_DMA8, DSP_CMD_DMAPAUSE_8 } |
#define | ALS_16BIT_CMD(x, y) { (x), (y), DSP_DMA16, DSP_CMD_DMAPAUSE_16 } |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static u_int32_t | als_gcr_rd (struct sc_info *sc, int index) |
static void | als_gcr_wr (struct sc_info *sc, int index, int data) |
static u_int8_t | als_intr_rd (struct sc_info *sc) |
static void | als_intr_wr (struct sc_info *sc, u_int8_t data) |
static u_int8_t | als_mix_rd (struct sc_info *sc, u_int8_t index) |
static void | als_mix_wr (struct sc_info *sc, u_int8_t index, u_int8_t data) |
static void | als_esp_wr (struct sc_info *sc, u_int8_t data) |
static int | als_esp_reset (struct sc_info *sc) |
static u_int8_t | als_ack_read (struct sc_info *sc, u_int8_t addr) |
static void * | alschan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static int | alschan_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | alschan_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static u_int32_t | alschan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static u_int32_t | alschan_getptr (kobj_t obj, void *data) |
static struct pcmchan_caps * | alschan_getcaps (kobj_t obj, void *data) |
static void | als_set_speed (struct sc_chinfo *ch) |
static const struct playback_command * | als_get_playback_command (u_int32_t format) |
static void | als_playback_start (struct sc_chinfo *ch) |
static int | als_playback_stop (struct sc_chinfo *ch) |
static int | alspchan_trigger (kobj_t obj, void *data, int go) |
CHANNEL_DECLARE (alspchan) | |
static u_int8_t | als_get_fifo_format (struct sc_info *sc, u_int32_t format) |
static void | als_capture_start (struct sc_chinfo *ch) |
static int | als_capture_stop (struct sc_chinfo *ch) |
static int | alsrchan_trigger (kobj_t obj, void *data, int go) |
CHANNEL_DECLARE (alsrchan) | |
static int | alsmix_init (struct snd_mixer *m) |
static int | alsmix_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) |
static u_int32_t | alsmix_setrecsrc (struct snd_mixer *m, u_int32_t src) |
MIXER_DECLARE (als_mixer) | |
static void | als_intr (void *p) |
static int | als_init (struct sc_info *sc) |
static void | als_uninit (struct sc_info *sc) |
static int | als_pci_probe (device_t dev) |
static void | als_resource_free (device_t dev, struct sc_info *sc) |
static int | als_resource_grab (device_t dev, struct sc_info *sc) |
static int | als_pci_attach (device_t dev) |
static int | als_pci_detach (device_t dev) |
static int | als_pci_suspend (device_t dev) |
static int | als_pci_resume (device_t dev) |
DRIVER_MODULE (snd_als4000, pci, als_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_als4000, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_als4000, 1) | |
Variables | |
static u_int32_t | als_format [] |
static struct pcmchan_caps | als_caps = { 4000, 44100, als_format, 0 } |
struct playback_command | playback_cmds [] |
static kobj_method_t | alspchan_methods [] |
static kobj_method_t | alsrchan_methods [] |
struct sb16props | amt [SOUND_MIXER_NRDEVICES] |
static kobj_method_t | als_mixer_methods [] |
static device_method_t | als_methods [] |
static driver_t | als_driver |
#define ALS_16BIT_CMD | ( | x, | |
y | |||
) | { (x), (y), DSP_DMA16, DSP_CMD_DMAPAUSE_16 } |
#define ALS_8BIT_CMD | ( | x, | |
y | |||
) | { (x), (y), DSP_DMA8, DSP_CMD_DMAPAUSE_8 } |
|
static |
Definition at line 197 of file als4000.c.
References addr, r, sc_info::sh, and sc_info::st.
Referenced by als_intr().
|
static |
Definition at line 451 of file als4000.c.
References AFMT_16BIT, als_esp_wr(), ALS_FIFO1_CONTROL, ALS_FIFO1_LENGTH_HI, ALS_FIFO1_LENGTH_LO, ALS_FIFO1_RUN, ALS_GCR_FIFO1_COUNT, ALS_GCR_FIFO1_START, als_gcr_wr(), als_get_fifo_format(), als_mix_wr(), als_set_speed(), buf, sc_chinfo::buffer, sc_info::bufsz, sc_info::ch, count, sc_chinfo::dma_active, DSP_CMD_SPKON, sc_chinfo::format, sc_chinfo::parent, sndbuf_getbufaddr(), and sndbuf_getsize().
Referenced by als_pci_resume(), and alsrchan_trigger().
|
static |
Definition at line 479 of file als4000.c.
References ALS_FIFO1_CONTROL, ALS_FIFO1_STOP, als_mix_wr(), sc_info::ch, sc_chinfo::dma_active, and sc_chinfo::parent.
Referenced by als_pci_suspend(), and alsrchan_trigger().
|
static |
Definition at line 169 of file als4000.c.
References ALS_ESP_RD_DATA, ALS_ESP_RD_STATUS8, ALS_ESP_RST, sc_info::dev, sc_info::sh, and sc_info::st.
Referenced by als_init().
|
static |
Definition at line 150 of file als4000.c.
References ALS_ESP_WR_DATA, ALS_ESP_WR_STATUS, data, sc_info::dev, sc_info::sh, and sc_info::st.
Referenced by als_capture_start(), als_playback_start(), als_playback_stop(), and als_set_speed().
|
static |
Definition at line 110 of file als4000.c.
References ALS_GCR_DATA, ALS_GCR_INDEX, index, sc_info::sh, and sc_info::st.
Referenced by als_init(), and alschan_getptr().
|
static |
Definition at line 117 of file als4000.c.
References ALS_GCR_DATA, ALS_GCR_INDEX, data, index, sc_info::sh, and sc_info::st.
Referenced by als_capture_start(), als_init(), als_playback_start(), and als_uninit().
|
static |
Definition at line 434 of file als4000.c.
References ALS_FIFO1_8BIT, ALS_FIFO1_SIGNED, ALS_FIFO1_STEREO, sc_info::dev, format, and SND_FORMAT.
Referenced by als_capture_start().
|
static |
Definition at line 331 of file als4000.c.
References DEB, format, n, playback_command::pcm_format, and playback_cmds.
Referenced by als_playback_start(), and als_playback_stop().
|
static |
Definition at line 680 of file als4000.c.
References als_esp_reset(), ALS_GCR_DMA_EMULATION, ALS_GCR_MISC, als_gcr_rd(), als_gcr_wr(), als_mix_rd(), als_mix_wr(), ALS_SB16_CONFIG, ALS_SB16_DMA_SETUP, and DEB.
Referenced by als_pci_attach(), and als_pci_resume().
|
static |
Definition at line 637 of file als4000.c.
References als_ack_read(), ALS_CR1E_ACK_PORT, ALS_ESP_RD_STATUS16, ALS_ESP_RD_STATUS8, als_intr_rd(), als_intr_wr(), ALS_IRQ_CR1E, ALS_IRQ_MPUIN, ALS_IRQ_STATUS16, ALS_IRQ_STATUS8, ALS_MIDI_DATA, als_mix_rd(), sc_chinfo::channel, chn_intr(), intr, IRQ_STAT, sc_info::lock, sc_info::pch, sc_info::rch, snd_mtxlock, and snd_mtxunlock.
Referenced by als_resource_grab().
|
static |
Definition at line 124 of file als4000.c.
References ALS_SB_MPU_IRQ, sc_info::sh, and sc_info::st.
Referenced by als_intr().
|
static |
Definition at line 130 of file als4000.c.
References ALS_SB_MPU_IRQ, data, sc_info::sh, and sc_info::st.
Referenced by als_intr().
|
static |
Definition at line 136 of file als4000.c.
References ALS_MIXER_DATA, ALS_MIXER_INDEX, index, sc_info::sh, and sc_info::st.
Referenced by als_init(), als_intr(), and alsmix_set().
|
static |
Definition at line 143 of file als4000.c.
References ALS_MIXER_DATA, ALS_MIXER_INDEX, data, index, sc_info::sh, and sc_info::st.
Referenced by als_capture_start(), als_capture_stop(), als_init(), alsmix_set(), and alsmix_setrecsrc().
|
static |
Definition at line 807 of file als4000.c.
References als_init(), als_resource_free(), als_resource_grab(), sc_info::dev, dev, free, sc_info::irq, sc_info::lock, mixer_init(), pcm_addchan(), PCM_KLDSTRING, pcm_register(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, sc_info::reg, snd_mtxcreate(), SND_STATUSLEN, and status.
|
static |
Definition at line 864 of file als4000.c.
References als_resource_free(), als_uninit(), dev, free, pcm_getdevinfo(), pcm_unregister(), and r.
|
static |
Definition at line 726 of file als4000.c.
References ALS_PCI_ID0, and dev.
|
static |
Definition at line 894 of file als4000.c.
References als_capture_start(), als_init(), als_playback_start(), dev, sc_chinfo::dma_was_active, sc_info::lock, mixer_reinit(), sc_info::pch, pcm_getdevinfo(), sc_info::rch, snd_mtxlock, and snd_mtxunlock.
|
static |
Definition at line 881 of file als4000.c.
References als_capture_stop(), als_playback_stop(), als_uninit(), dev, sc_chinfo::dma_was_active, sc_info::lock, sc_info::pch, pcm_getdevinfo(), sc_info::rch, snd_mtxlock, and snd_mtxunlock.
|
static |
Definition at line 347 of file als4000.c.
References AFMT_16BIT, als_esp_wr(), ALS_GCR_DMA0_MODE, ALS_GCR_DMA0_START, als_gcr_wr(), als_get_playback_command(), als_set_speed(), buf, sc_chinfo::buffer, sc_info::bufsz, sc_info::ch, count, sc_chinfo::dma_active, playback_command::dma_prog, DSP_CMD_SPKON, DSP_F16_AUTO, DSP_F16_DAC, DSP_F16_FIFO_ON, sc_chinfo::format, playback_command::format_val, sc_chinfo::parent, sndbuf_getbufaddr(), and sndbuf_getsize().
Referenced by als_pci_resume(), and alspchan_trigger().
|
static |
Definition at line 378 of file als4000.c.
References als_esp_wr(), als_get_playback_command(), sc_info::ch, sc_chinfo::dma_active, playback_command::dma_stop, sc_chinfo::format, and sc_chinfo::parent.
Referenced by als_pci_suspend(), and alspchan_trigger().
|
static |
Definition at line 736 of file als4000.c.
References dev, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::lock, sc_info::parent_dmat, sc_info::reg, sc_info::regid, and snd_mtxfree().
Referenced by als_pci_attach(), als_pci_detach(), and als_resource_grab().
|
static |
Definition at line 761 of file als4000.c.
References ALS_DEFAULT_BUFSZ, als_intr(), als_resource_free(), sc_info::bufsz, dev, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::parent_dmat, PCIR_BAR, pcm_getbuffersize(), sc_info::reg, sc_info::regid, sc_info::sh, snd_setup_intr(), and sc_info::st.
Referenced by als_pci_attach().
|
static |
Definition at line 297 of file als4000.c.
References ALS_ESP_SAMPLE_RATE, als_esp_wr(), sc_info::ch, DEB, sc_chinfo::dir, sc_chinfo::dma_active, sc_chinfo::parent, sc_info::pch, PCMDIR_PLAY, sc_info::rch, and sc_chinfo::speed.
Referenced by als_capture_start(), and als_playback_start().
|
static |
Definition at line 716 of file als4000.c.
References ALS_GCR_MISC, and als_gcr_wr().
Referenced by als_pci_detach(), and als_pci_suspend().
|
static |
|
static |
Definition at line 277 of file als4000.c.
References als_gcr_rd(), sc_chinfo::buffer, sc_info::ch, data, sc_chinfo::gcr_fifo_status, sc_info::lock, sc_chinfo::parent, snd_mtxlock, snd_mtxunlock, and sndbuf_getsize().
|
static |
Definition at line 207 of file als4000.c.
References ALS_GCR_FIFO0_STATUS, ALS_GCR_FIFO1_STATUS, b, sc_chinfo::bps, sc_chinfo::buffer, sc_info::bufsz, c, sc_chinfo::channel, devinfo, sc_chinfo::dir, dir, DSP_DEFAULT_SPEED, sc_chinfo::format, sc_chinfo::gcr_fifo_status, sc_info::lock, sc_chinfo::parent, sc_info::parent_dmat, sc_info::pch, PCMDIR_PLAY, sc_info::rch, SND_FORMAT, snd_mtxlock, snd_mtxunlock, sndbuf_alloc(), and sc_chinfo::speed.
|
static |
Definition at line 264 of file als4000.c.
References blocksize, sc_chinfo::buffer, sc_info::bufsz, sc_info::ch, data, sc_chinfo::parent, and sndbuf_resize().
|
static |
Definition at line 237 of file als4000.c.
References data, format, and sc_chinfo::format.
|
static |
Definition at line 246 of file als4000.c.
References sc_info::ch, data, sc_chinfo::dir, sc_chinfo::parent, sc_info::pch, PCMDIR_PLAY, sc_info::rch, speed, and sc_chinfo::speed.
|
static |
Definition at line 554 of file als4000.c.
References amt, m, mix_setdevs(), and mix_setrecdevs().
|
static |
Definition at line 571 of file als4000.c.
References als_mix_rd(), als_mix_wr(), amt, sb16props::bits, dev, left, m, mask, mix_getdevinfo(), sb16props::oselect, r, right, and SB16_OMASK.
|
static |
Definition at line 603 of file als4000.c.
References als_mix_wr(), amt, sb16props::iselect, m, mix_getdevinfo(), r, SB16_IMASK_L, SB16_IMASK_R, and src.
|
static |
Definition at line 394 of file als4000.c.
References als_playback_start(), als_playback_stop(), sc_info::ch, data, go, sc_info::lock, sc_chinfo::parent, PCMTRIG_ABORT, PCMTRIG_COMMON, PCMTRIG_START, PCMTRIG_STOP, snd_mtxlock, and snd_mtxunlock.
|
static |
Definition at line 493 of file als4000.c.
References als_capture_start(), als_capture_stop(), sc_info::ch, data, go, sc_info::lock, sc_chinfo::parent, PCMTRIG_ABORT, PCMTRIG_START, PCMTRIG_STOP, snd_mtxlock, and snd_mtxunlock.
CHANNEL_DECLARE | ( | alspchan | ) |
CHANNEL_DECLARE | ( | alsrchan | ) |
DRIVER_MODULE | ( | snd_als4000 | , |
pci | , | ||
als_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
MIXER_DECLARE | ( | als_mixer | ) |
MODULE_DEPEND | ( | snd_als4000 | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_als4000 | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 104 of file als4000.c.
Referenced by alschan_getcaps().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
struct sb16props amt[SOUND_MIXER_NRDEVICES] |
Referenced by alsmix_init(), alsmix_set(), alsmix_setrecsrc(), chn_dmaupdate(), chn_rdfeed(), and chn_wrfeed().
struct playback_command playback_cmds[] |
Referenced by als_get_playback_command().