FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/isa/sb.h>
#include <dev/sound/chip.h>
#include <isa/isavar.h>
#include "mixer_if.h"
Go to the source code of this file.
Data Structures | |
struct | sb_chinfo |
struct | sb_info |
struct | sb16_mixent |
Macros | |
#define | SB16_BUFFSIZE 4096 |
#define | PLAIN_SB16(x) ((((x)->bd_flags) & (BD_F_SB16|BD_F_SB16X)) == BD_F_SB16) |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static void | sb_lock (struct sb_info *sb) |
static void | sb_lockassert (struct sb_info *sb) |
static void | sb_unlock (struct sb_info *sb) |
static int | port_rd (struct resource *port, int off) |
static void | port_wr (struct resource *port, int off, u_int8_t data) |
static int | sb_rd (struct sb_info *sb, int reg) |
static void | sb_wr (struct sb_info *sb, int reg, u_int8_t val) |
static int | sb_dspwr (struct sb_info *sb, u_char val) |
static int | sb_cmd (struct sb_info *sb, u_char val) |
static int | sb_cmd2 (struct sb_info *sb, u_char cmd, int val) |
static void | sb_setmixer (struct sb_info *sb, u_int port, u_int value) |
static int | sb_getmixer (struct sb_info *sb, u_int port) |
static u_int | sb_get_byte (struct sb_info *sb) |
static int | sb_reset_dsp (struct sb_info *sb) |
static int | sb16mix_init (struct snd_mixer *m) |
static int | rel2abs_volume (int x, int max) |
static int | sb16mix_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) |
static u_int32_t | sb16mix_setrecsrc (struct snd_mixer *m, u_int32_t src) |
MIXER_DECLARE (sb16mix_mixer) | |
static void | sb16_release_resources (struct sb_info *sb, device_t dev) |
static int | sb16_alloc_resources (struct sb_info *sb, device_t dev) |
static void | sb_intr (void *arg) |
static int | sb_setup (struct sb_info *sb) |
static void * | sb16chan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static int | sb16chan_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | sb16chan_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static u_int32_t | sb16chan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static int | sb16chan_trigger (kobj_t obj, void *data, int go) |
static u_int32_t | sb16chan_getptr (kobj_t obj, void *data) |
static struct pcmchan_caps * | sb16chan_getcaps (kobj_t obj, void *data) |
static int | sb16chan_resetdone (kobj_t obj, void *data) |
CHANNEL_DECLARE (sb16chan) | |
static int | sb16_probe (device_t dev) |
static int | sb16_attach (device_t dev) |
static int | sb16_detach (device_t dev) |
DRIVER_MODULE (snd_sb16, sbc, sb16_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_sb16, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_DEPEND (snd_sb16, snd_sbc, 1, 1, 1) | |
MODULE_VERSION (snd_sb16, 1) | |
Variables | |
static u_int32_t | sb16_fmt8 [] |
static struct pcmchan_caps | sb16_caps8 = {5000, 45000, sb16_fmt8, 0} |
static u_int32_t | sb16_fmt16 [] |
static struct pcmchan_caps | sb16_caps16 = {5000, 45000, sb16_fmt16, 0} |
static u_int32_t | sb16x_fmt [] |
static struct pcmchan_caps | sb16x_caps = {5000, 49000, sb16x_fmt, 0} |
static const struct sb16_mixent | sb16_mixtab [32] |
static kobj_method_t | sb16mix_mixer_methods [] |
static kobj_method_t | sb16chan_methods [] |
static device_method_t | sb16_methods [] |
static driver_t | sb16_driver |
#define PLAIN_SB16 | ( | x | ) | ((((x)->bd_flags) & (BD_F_SB16|BD_F_SB16X)) == BD_F_SB16) |
CHANNEL_DECLARE | ( | sb16chan | ) |
DRIVER_MODULE | ( | snd_sb16 | , |
sbc | , | ||
sb16_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
MIXER_DECLARE | ( | sb16mix_mixer | ) |
MODULE_DEPEND | ( | snd_sb16 | , |
snd_sbc | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | snd_sb16 | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_sb16 | , |
1 | |||
) |
|
static |
|
static |
|
static |
Definition at line 333 of file sb16.c.
References max.
Referenced by sb16mix_set().
|
static |
Definition at line 463 of file sb16.c.
References sb_info::bufsize, dev, sb_info::drq1, sb_info::drq2, sb_info::io_base, sb_info::irq, pcm_getflags(), pcm_setflags(), rid, and SD_F_SIMPLEX.
Referenced by sb16_attach().
|
static |
Definition at line 811 of file sb16.c.
References BD_F_SB16X, sb_info::bd_flags, sb_info::bd_id, sb_info::bufsize, dev, sb_info::drq1, sb_info::drq2, sb_info::ih, sb_info::io_base, sb_info::irq, mixer_init(), sb_info::parent_dev, sb_info::parent_dmat, pcm_addchan(), pcm_getbuffersize(), pcm_getflags(), PCM_KLDSTRING, pcm_register(), pcm_setflags(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, sb_info::prio, sb16_alloc_resources(), SB16_BUFFSIZE, sb16_release_resources(), sb_intr(), sb_lock(), sb_reset_dsp(), sb_unlock(), SD_F_SIMPLEX, snd_setup_intr(), SND_STATUSLEN, and status.
|
static |
Definition at line 881 of file sb16.c.
References dev, pcm_getdevinfo(), pcm_unregister(), r, and sb16_release_resources().
|
static |
|
static |
Definition at line 431 of file sb16.c.
References dev, sb_info::drq1, sb_info::drq2, free, sb_info::ih, sb_info::io_base, sb_info::irq, and sb_info::parent_dmat.
Referenced by sb16_attach(), and sb16_detach().
|
static |
Definition at line 750 of file sb16.c.
References data, sb_chinfo::dir, sb_chinfo::parent, sb_info::prio, sb_info::prio16, sb16_caps16, sb16_caps8, and sb16x_caps.
|
static |
Definition at line 742 of file sb16.c.
References sb_chinfo::buffer, data, and sndbuf_dmaptr().
|
static |
Definition at line 675 of file sb16.c.
References b, sb_chinfo::buffer, sb_info::bufsize, c, sb_chinfo::channel, devinfo, sb_chinfo::dir, dir, sb_chinfo::parent, sb_info::parent_dmat, PCMDIR_PLAY, sb_info::rch, and sndbuf_alloc().
|
static |
Definition at line 762 of file sb16.c.
References data, sb_chinfo::parent, and sb_info::prio.
|
static |
Definition at line 714 of file sb16.c.
References sb_chinfo::blksz, blocksize, and data.
|
static |
Definition at line 692 of file sb16.c.
References AFMT_16BIT, data, sb_chinfo::dir, sb_chinfo::fmt, format, sb_chinfo::parent, sb_info::prio, and sb_info::prio16.
|
static |
Definition at line 705 of file sb16.c.
References data, sb_chinfo::spd, and speed.
|
static |
Definition at line 723 of file sb16.c.
References data, go, sb_chinfo::parent, PCMTRIG_COMMON, PCMTRIG_START, sb_chinfo::run, and sb_setup().
|
static |
Definition at line 312 of file sb16.c.
References m, mix_getdevinfo(), mix_setdevs(), mix_setrecdevs(), and sb_setmixer().
|
static |
Definition at line 346 of file sb16.c.
References sb16_mixent::bits, dev, left, m, max, mix_getdevinfo(), sb16_mixent::ofs, sb16_mixent::reg, rel2abs_volume(), right, sb16_mixtab, sb_setmixer(), and sb16_mixent::stereo.
|
static |
Definition at line 371 of file sb16.c.
References m, mix_getdevinfo(), SB16_IMASK_L, SB16_IMASK_R, SB16_OMASK, sb_setmixer(), and src.
|
static |
Definition at line 184 of file sb16.c.
References sb_dspwr(), and val.
Referenced by sb_setup().
|
static |
Definition at line 206 of file sb16.c.
References r, sb_dspwr(), sb_lockassert(), and val.
Referenced by sb_setup().
|
static |
|
static |
Definition at line 256 of file sb16.c.
References DSP_DATA_AVAIL, DSP_READ, and sb_rd().
Referenced by sb_reset_dsp().
|
static |
Definition at line 242 of file sb16.c.
References sb_lockassert(), SB_MIX_ADDR, SB_MIX_DATA, sb_rd(), sb_wr(), and val.
Referenced by sb_intr().
|
static |
Definition at line 504 of file sb16.c.
References AFMT_16BIT, AFMT_8BIT, BD_F_SB16X, sb_info::bd_flags, c, sb_chinfo::channel, chn_intr(), sb_chinfo::dch, DSP_DATA_AVAIL, DSP_DATA_AVL16, sb_chinfo::fmt, IRQ_STAT, sb_info::rch, sb_chinfo::run, sb_getmixer(), sb_lock(), sb_rd(), and sb_unlock().
Referenced by sb16_attach().
|
static |
Definition at line 127 of file sb16.c.
References sb_info::parent_dev, and sbc_lock().
Referenced by sb16_attach(), sb_intr(), sb_setmixer(), and sb_setup().
|
static |
Definition at line 132 of file sb16.c.
References sb_info::parent_dev, and sbc_lockassert().
Referenced by sb_cmd2(), sb_getmixer(), and sb_reset_dsp().
|
static |
Definition at line 154 of file sb16.c.
References sb_info::io_base, port_rd(), and reg.
Referenced by sb_dspwr(), sb_get_byte(), sb_getmixer(), and sb_intr().
|
static |
Definition at line 270 of file sb16.c.
References b, DEB, sb_info::io_base, sb_get_byte(), sb_lockassert(), sb_wr(), and SBDSP_RST.
Referenced by sb16_attach(), and sb_setup().
|
static |
Definition at line 231 of file sb16.c.
References sb_lock(), SB_MIX_ADDR, SB_MIX_DATA, sb_unlock(), sb_wr(), and value.
Referenced by sb16mix_init(), sb16mix_set(), and sb16mix_setrecsrc().
|
static |
Definition at line 567 of file sb16.c.
References AFMT_16BIT, AFMT_CHANNEL, AFMT_SIGNED, BD_F_DMARUN, BD_F_DMARUN2, BD_F_SB16X, sb_info::bd_flags, sb_chinfo::blksz, sb_chinfo::buffer, sb_chinfo::dch, sb_info::drq1, sb_info::drq2, DSP_CMD_IN16, DSP_CMD_OUT16, DSP_DMA16, DSP_DMA8, DSP_F16_ADC, DSP_F16_AUTO, DSP_F16_DAC, DSP_F16_FIFO_ON, DSP_F16_SIGNED, DSP_F16_STEREO, sb_chinfo::fmt, PCMDIR_PLAY, PCMDIR_REC, PCMTRIG_START, PCMTRIG_STOP, RANGE, sb_info::rch, sb_chinfo::run, sb_cmd(), sb_cmd2(), sb_lock(), sb_reset_dsp(), sb_unlock(), sndbuf_dma(), sndbuf_dmasetdir(), sndbuf_dmasetup(), and sb_chinfo::spd.
Referenced by sb16chan_trigger().
|
static |
Definition at line 137 of file sb16.c.
References sb_info::parent_dev, and sbc_unlock().
Referenced by sb16_attach(), sb_intr(), sb_setmixer(), and sb_setup().
|
static |
Definition at line 160 of file sb16.c.
References sb_info::io_base, port_wr(), reg, and val.
Referenced by sb_dspwr(), sb_getmixer(), sb_reset_dsp(), and sb_setmixer().
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 64 of file sb16.c.
Referenced by sb16chan_getcaps().
|
static |
Definition at line 57 of file sb16.c.
Referenced by sb16chan_getcaps().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 296 of file sb16.c.
Referenced by sb16mix_set().
|
static |
|
static |
|
static |
Definition at line 73 of file sb16.c.
Referenced by sb16chan_getcaps().
|
static |