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>
Go to the source code of this file.
Data Structures | |
struct | fm801_chinfo |
struct | fm801_info |
Macros | |
#define | PCI_VENDOR_FORTEMEDIA 0x1319 |
#define | PCI_DEVICE_FORTEMEDIA1 0x08011319 /* Audio controller */ |
#define | PCI_DEVICE_FORTEMEDIA2 0x08021319 /* Joystick controller */ |
#define | FM_PCM_VOLUME 0x00 |
#define | FM_FM_VOLUME 0x02 |
#define | FM_I2S_VOLUME 0x04 |
#define | FM_RECORD_SOURCE 0x06 |
#define | FM_PLAY_CTL 0x08 |
#define | FM_PLAY_RATE_MASK 0x0f00 |
#define | FM_PLAY_BUF1_LAST 0x0001 |
#define | FM_PLAY_BUF2_LAST 0x0002 |
#define | FM_PLAY_START 0x0020 |
#define | FM_PLAY_PAUSE 0x0040 |
#define | FM_PLAY_STOPNOW 0x0080 |
#define | FM_PLAY_16BIT 0x4000 |
#define | FM_PLAY_STEREO 0x8000 |
#define | FM_PLAY_DMALEN 0x0a |
#define | FM_PLAY_DMABUF1 0x0c |
#define | FM_PLAY_DMABUF2 0x10 |
#define | FM_REC_CTL 0x14 |
#define | FM_REC_RATE_MASK 0x0f00 |
#define | FM_REC_BUF1_LAST 0x0001 |
#define | FM_REC_BUF2_LAST 0x0002 |
#define | FM_REC_START 0x0020 |
#define | FM_REC_PAUSE 0x0040 |
#define | FM_REC_STOPNOW 0x0080 |
#define | FM_REC_16BIT 0x4000 |
#define | FM_REC_STEREO 0x8000 |
#define | FM_REC_DMALEN 0x16 |
#define | FM_REC_DMABUF1 0x18 |
#define | FM_REC_DMABUF2 0x1c |
#define | FM_CODEC_CTL 0x22 |
#define | FM_VOLUME 0x26 |
#define | FM_VOLUME_MUTE 0x8000 |
#define | FM_CODEC_CMD 0x2a |
#define | FM_CODEC_CMD_READ 0x0080 |
#define | FM_CODEC_CMD_VALID 0x0100 |
#define | FM_CODEC_CMD_BUSY 0x0200 |
#define | FM_CODEC_DATA 0x2c |
#define | FM_IO_CTL 0x52 |
#define | FM_CARD_CTL 0x54 |
#define | FM_INTMASK 0x56 |
#define | FM_INTMASK_PLAY 0x0001 |
#define | FM_INTMASK_REC 0x0002 |
#define | FM_INTMASK_VOL 0x0040 |
#define | FM_INTMASK_MPU 0x0080 |
#define | FM_INTSTATUS 0x5a |
#define | FM_INTSTATUS_PLAY 0x0100 |
#define | FM_INTSTATUS_REC 0x0200 |
#define | FM_INTSTATUS_VOL 0x4000 |
#define | FM_INTSTATUS_MPU 0x8000 |
#define | FM801_DEFAULT_BUFSZ 4096 /* Other values do not work!!! */ |
#define | DPRINT if(0) printf |
#define | TIMO 50 |
#define | FM801_MAXPLAYCH 1 |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static u_int32_t | fm801_rd (struct fm801_info *fm801, int regno, int size) |
static void | fm801_wr (struct fm801_info *fm801, int regno, u_int32_t data, int size) |
static int | fm801_rdcd (kobj_t obj, void *devinfo, int regno) |
static int | fm801_wrcd (kobj_t obj, void *devinfo, int regno, u_int32_t data) |
AC97_DECLARE (fm801_ac97) | |
static void | fm801_intr (void *p) |
static void * | fm801ch_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static int | fm801ch_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | fm801ch_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static u_int32_t | fm801ch_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static int | fm801ch_trigger (kobj_t obj, void *data, int go) |
static u_int32_t | fm801ch_getptr (kobj_t obj, void *data) |
static struct pcmchan_caps * | fm801ch_getcaps (kobj_t obj, void *data) |
CHANNEL_DECLARE (fm801ch) | |
static int | fm801_init (struct fm801_info *fm801) |
static int | fm801_pci_attach (device_t dev) |
static int | fm801_pci_detach (device_t dev) |
static int | fm801_pci_probe (device_t dev) |
static struct resource * | fm801_alloc_resource (device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
static int | fm801_release_resource (device_t bus, device_t child, int type, int rid, struct resource *r) |
DRIVER_MODULE (snd_fm801, pci, fm801_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_fm801, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_fm801, 1) | |
Variables | |
static u_int32_t | fmts [] |
static struct pcmchan_caps | fm801ch_caps |
static kobj_method_t | fm801_ac97_methods [] |
struct { | |
u_int32_t limit | |
u_int32_t rate | |
} | fm801_rates [11] |
static kobj_method_t | fm801ch_methods [] |
static device_method_t | fm801_methods [] |
static driver_t | fm801_driver |
#define FM801_DEFAULT_BUFSZ 4096 /* Other values do not work!!! */ |
#define FM801_MAXPLAYCH 1 |
#define PCI_DEVICE_FORTEMEDIA1 0x08011319 /* Audio controller */ |
#define PCI_DEVICE_FORTEMEDIA2 0x08021319 /* Joystick controller */ |
AC97_DECLARE | ( | fm801_ac97 | ) |
CHANNEL_DECLARE | ( | fm801ch | ) |
DRIVER_MODULE | ( | snd_fm801 | , |
pci | , | ||
fm801_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
Definition at line 717 of file fm801.c.
References bus, PCIR_BAR, pcm_getdevinfo(), fm801_info::reg, rid, and type.
|
static |
Definition at line 541 of file fm801.c.
References DPRINT, fm801_rd(), fm801_wr(), FM_CODEC_CTL, FM_FM_VOLUME, FM_I2S_VOLUME, FM_INTMASK, FM_INTMASK_MPU, FM_INTMASK_PLAY, FM_INTMASK_REC, FM_INTMASK_VOL, FM_INTSTATUS, FM_INTSTATUS_MPU, FM_INTSTATUS_PLAY, FM_INTSTATUS_REC, FM_INTSTATUS_VOL, FM_PCM_VOLUME, and FM_RECORD_SOURCE.
Referenced by fm801_pci_attach().
|
static |
Definition at line 289 of file fm801.c.
References fm801_chinfo::channel, chn_intr(), DPRINT, fm801_rd(), fm801_wr(), FM_INTSTATUS, FM_INTSTATUS_MPU, FM_INTSTATUS_PLAY, FM_INTSTATUS_REC, FM_INTSTATUS_VOL, FM_PLAY_DMABUF1, FM_PLAY_DMABUF2, FM_REC_DMABUF1, FM_REC_DMABUF2, fm801_info::play_flip, fm801_info::play_nextblk, fm801_info::play_start, fm801_info::rch, fm801_info::rec_flip, fm801_info::rec_nextblk, and fm801_info::rec_start.
Referenced by fm801_pci_attach().
|
static |
Definition at line 572 of file fm801.c.
References AC97_CREATE, ac97_destroy(), ac97_getmixerclass(), fm801_info::bufsz, dev, FM801_DEFAULT_BUFSZ, fm801_init(), fm801_intr(), FM801_MAXPLAYCH, free, fm801_info::ih, fm801_info::irq, fm801_info::irqid, mixer_init(), fm801_info::parent_dmat, PCI_MAXMAPS_0, PCIR_BAR, pcm_addchan(), pcm_getbuffersize(), PCM_KLDSTRING, pcm_register(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, fm801_info::radio, fm801_info::reg, fm801_info::regid, fm801_info::regtype, fm801_info::sh, snd_setup_intr(), SND_STATUSLEN, fm801_info::st, status, and fm801_info::type.
|
static |
Definition at line 667 of file fm801.c.
References dev, DPRINT, free, fm801_info::ih, fm801_info::irq, fm801_info::irqid, fm801_info::parent_dmat, pcm_getdevinfo(), pcm_unregister(), r, fm801_info::radio, fm801_info::reg, fm801_info::regid, and fm801_info::regtype.
|
static |
Definition at line 699 of file fm801.c.
References dev, id, and PCI_DEVICE_FORTEMEDIA1.
|
static |
Definition at line 174 of file fm801.c.
References regno, fm801_info::sh, size, and fm801_info::st.
Referenced by fm801_init(), fm801_intr(), fm801_rdcd(), fm801_wrcd(), fm801ch_getptr(), and fm801ch_trigger().
|
static |
Definition at line 211 of file fm801.c.
References devinfo, DPRINT, fm801_rd(), fm801_wr(), FM_CODEC_CMD, FM_CODEC_CMD_BUSY, FM_CODEC_CMD_READ, FM_CODEC_CMD_VALID, FM_CODEC_DATA, regno, and TIMO.
|
static |
|
static |
Definition at line 189 of file fm801.c.
References data, regno, fm801_info::sh, size, and fm801_info::st.
Referenced by fm801_init(), fm801_intr(), fm801_rdcd(), fm801_wrcd(), and fm801ch_trigger().
|
static |
Definition at line 241 of file fm801.c.
References data, devinfo, DPRINT, fm801_rd(), fm801_wr(), FM_CODEC_CMD, FM_CODEC_CMD_BUSY, FM_CODEC_DATA, regno, and TIMO.
|
static |
Definition at line 518 of file fm801.c.
References fm801ch_caps.
|
static |
Definition at line 496 of file fm801.c.
References data, fm801_chinfo::dir, fm801_rd(), FM_PLAY_DMABUF1, FM_PLAY_DMABUF2, FM_REC_DMABUF1, FM_REC_DMABUF2, fm801_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, fm801_info::play_flip, fm801_info::play_start, fm801_info::rec_flip, and fm801_info::rec_start.
|
static |
Definition at line 331 of file fm801.c.
References b, fm801_chinfo::buffer, fm801_info::bufsz, c, fm801_chinfo::channel, devinfo, fm801_chinfo::dir, dir, DPRINT, fm801_chinfo::parent, fm801_info::parent_dmat, PCMDIR_PLAY, fm801_info::rch, and sndbuf_alloc().
|
static |
Definition at line 419 of file fm801.c.
References blocksize, data, fm801_chinfo::dir, DPRINT, fm801_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, fm801_info::play_blksize, and fm801_info::rec_blksize.
|
static |
Definition at line 347 of file fm801.c.
References AFMT_16BIT, AFMT_BIGENDIAN, AFMT_CHANNEL, AFMT_SIGNED, data, fm801_chinfo::dir, DPRINT, FM_PLAY_16BIT, FM_PLAY_STEREO, FM_REC_STEREO, format, fm801_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, fm801_info::play_fmt, and fm801_info::rec_fmt.
|
static |
Definition at line 393 of file fm801.c.
References data, fm801_chinfo::dir, fm801_rates, FM_PLAY_RATE_MASK, FM_REC_RATE_MASK, fm801_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, fm801_info::play_shift, fm801_info::rch, fm801_info::rec_shift, fm801_chinfo::spd, and speed.
|
static |
Definition at line 441 of file fm801.c.
References fm801_chinfo::buffer, data, fm801_chinfo::dir, DPRINT, fm801_rd(), fm801_wr(), FM_PLAY_BUF1_LAST, FM_PLAY_BUF2_LAST, FM_PLAY_CTL, FM_PLAY_DMABUF1, FM_PLAY_DMABUF2, FM_PLAY_DMALEN, FM_PLAY_START, FM_PLAY_STOPNOW, FM_REC_BUF1_LAST, FM_REC_BUF2_LAST, FM_REC_CTL, FM_REC_DMABUF1, FM_REC_DMABUF2, FM_REC_DMALEN, FM_REC_START, FM_REC_STOPNOW, go, fm801_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, PCMTRIG_COMMON, PCMTRIG_START, fm801_info::play_blksize, fm801_info::play_flip, fm801_info::play_fmt, fm801_info::play_nextblk, fm801_info::play_shift, fm801_info::play_start, fm801_info::rec_blksize, fm801_info::rec_flip, fm801_info::rec_fmt, fm801_info::rec_nextblk, fm801_info::rec_shift, fm801_info::rec_start, and sndbuf_getbufaddr().
MODULE_DEPEND | ( | snd_fm801 | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_fm801 | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
|
static |
|
static |
struct { ... } fm801_rates[11] |
Referenced by fm801ch_setspeed().
|
static |
Definition at line 120 of file fm801.c.
Referenced by fm801ch_getcaps().
|
static |
|
static |
Definition at line 112 of file fm801.c.
Referenced by chn_getformats(), dsp_oss_audioinfo(), mss_format(), snd_fmtbest(), snd_fmtbestbit(), snd_fmtbestchannel(), snd_fmtbestfunc(), sndstat_build_sound4_nvlist(), and sndstat_get_caps().
u_int32_t limit |
Definition at line 375 of file fm801.c.
Referenced by chn_resizebuf().