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 <dev/sound/pci/cs4281.h>
Go to the source code of this file.
Data Structures | |
struct | sc_chinfo |
struct | sc_info |
Macros | |
#define | CS4281_DEFAULT_BUFSZ 16384 |
#define | CS4281_FIFO_SIZE 15 |
#define | CS4281_DMA_PLAY 0 |
#define | CS4281_DMA_REC 1 |
#define | inline __inline |
#define | DEB(x) /* x */ |
#define | CS4281_NUM_RATES sizeof(cs4281_rates)/sizeof(cs4281_rates[0]) |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static u_int32_t | adcdac_go (struct sc_chinfo *ch, u_int32_t go) |
static void | adcdac_prog (struct sc_chinfo *ch) |
static void | cs4281_intr (void *) |
static int | cs4281_power (struct sc_info *, int) |
static int | cs4281_init (struct sc_info *) |
static u_int32_t | cs4281_rd (struct sc_info *, int) |
static void | cs4281_wr (struct sc_info *, int, u_int32_t) |
static u_int8_t | cs4281_rate_to_rv (u_int32_t) |
static u_int32_t | cs4281_format_to_dmr (u_int32_t) |
static u_int32_t | cs4281_format_to_bps (u_int32_t) |
static void | cs4281_clr4 (struct sc_info *sc, int regno, u_int32_t mask) |
static void | cs4281_set4 (struct sc_info *sc, int regno, u_int32_t mask) |
static int | cs4281_waitset (struct sc_info *sc, int regno, u_int32_t mask, int tries) |
static int | cs4281_waitclr (struct sc_info *sc, int regno, u_int32_t mask, int tries) |
static u_int32_t | cs4281_rv_to_rate (u_int8_t rv) |
static int | cs4281_rdcd (kobj_t obj, void *devinfo, int regno) |
static int | cs4281_wrcd (kobj_t obj, void *devinfo, int regno, u_int32_t data) |
AC97_DECLARE (cs4281_ac97) | |
static void * | cs4281chan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static u_int32_t | cs4281chan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static u_int32_t | cs4281chan_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static int | cs4281chan_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | cs4281chan_getptr (kobj_t obj, void *data) |
static int | cs4281chan_trigger (kobj_t obj, void *data, int go) |
static struct pcmchan_caps * | cs4281chan_getcaps (kobj_t obj, void *data) |
CHANNEL_DECLARE (cs4281chan) | |
static int | cs4281_pci_probe (device_t dev) |
static int | cs4281_pci_attach (device_t dev) |
static int | cs4281_pci_detach (device_t dev) |
static int | cs4281_pci_suspend (device_t dev) |
static int | cs4281_pci_resume (device_t dev) |
DRIVER_MODULE (snd_cs4281, pci, cs4281_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_cs4281, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_cs4281, 1) | |
Variables | |
static u_int32_t | cs4281_fmts [] |
static struct pcmchan_caps | cs4281_caps = {6024, 48000, cs4281_fmts, 0} |
static u_int32_t | cs4281_rates [] = {48000, 44100, 22050, 16000, 11025, 8000} |
static kobj_method_t | cs4281_ac97_methods [] |
static kobj_method_t | cs4281chan_methods [] |
static device_method_t | cs4281_methods [] |
static driver_t | cs4281_driver |
#define CS4281_NUM_RATES sizeof(cs4281_rates)/sizeof(cs4281_rates[0]) |
AC97_DECLARE | ( | cs4281_ac97 | ) |
|
static |
Definition at line 476 of file cs4281.c.
References sc_info::ch, cs4281_clr4(), cs4281_rd(), cs4281_set4(), cs4281_wr(), CS4281PCI_DCR, CS4281PCI_DCR_MSK, CS4281PCI_HICR, CS4281PCI_HICR_EOI, sc_chinfo::dma_chan, go, and sc_chinfo::parent.
Referenced by adcdac_prog(), cs4281_pci_resume(), cs4281_pci_suspend(), cs4281chan_init(), cs4281chan_setblocksize(), cs4281chan_setformat(), cs4281chan_setspeed(), and cs4281chan_trigger().
|
static |
Definition at line 494 of file cs4281.c.
References adcdac_go(), sc_chinfo::bps, sc_chinfo::buffer, sc_info::ch, cs4281_wr(), CS4281PCI_DBA, CS4281PCI_DBC, sc_chinfo::dma_chan, sc_chinfo::dma_setup, go, sc_chinfo::parent, sndbuf_getbufaddr(), and sndbuf_getsize().
Referenced by cs4281chan_init(), cs4281chan_setblocksize(), and cs4281chan_trigger().
CHANNEL_DECLARE | ( | cs4281chan | ) |
|
inlinestatic |
Definition at line 162 of file cs4281.c.
References cs4281_rd(), cs4281_wr(), mask, r, and regno.
Referenced by adcdac_go(), cs4281_init(), and cs4281_power().
|
inlinestatic |
Definition at line 247 of file cs4281.c.
References AFMT_8BIT, AFMT_CHANNEL, and format.
Referenced by cs4281chan_setformat().
|
inlinestatic |
Definition at line 236 of file cs4281.c.
References AFMT_8BIT, AFMT_BIGENDIAN, AFMT_CHANNEL, AFMT_SIGNED, CS4281PCI_DMR_BEND, CS4281PCI_DMR_MONO, CS4281PCI_DMR_SIZE8, CS4281PCI_DMR_USIGN, and format.
Referenced by cs4281chan_setformat().
|
static |
Definition at line 565 of file cs4281.c.
References AC97_MIX_AUXOUT, AC97_MIX_MASTER, AC97_REG_POWER, cs4281_clr4(), CS4281_DMA_PLAY, CS4281_DMA_REC, CS4281_FIFO_SIZE, cs4281_rdcd(), cs4281_set4(), cs4281_waitset(), cs4281_wr(), cs4281_wrcd(), CS4281PCI_ACCTL, CS4281PCI_ACCTL_ESYN, CS4281PCI_ACCTL_VFRM, CS4281PCI_ACISV, CS4281PCI_ACISV_ISV, CS4281PCI_ACOSV, CS4281PCI_ACOSV_SLV, CS4281PCI_ACSTS, CS4281PCI_ACSTS_CRDY, CS4281PCI_CLKCR1, CS4281PCI_CLKCR1_DLLP, CS4281PCI_CLKCR1_DLLRDY, CS4281PCI_CLKCR1_SWCE, CS4281PCI_DCR, CS4281PCI_DCR_HTCIE, CS4281PCI_DCR_MSK, CS4281PCI_DCR_TCIE, CS4281PCI_DMR, CS4281PCI_DMR_AUTO, CS4281PCI_DMR_DMA, CS4281PCI_DMR_TR_PLAY, CS4281PCI_DMR_TR_REC, CS4281PCI_FCR, CS4281PCI_FCR_FEN, CS4281PCI_FCR_LS, CS4281PCI_FCR_OF, CS4281PCI_FCR_PSH, CS4281PCI_FCR_RS, CS4281PCI_FCR_SZ, CS4281PCI_HIMR, CS4281PCI_HIMR_DMA, CS4281PCI_HIMR_DMAI, CS4281PCI_LPCM_PLAY_SLOT, CS4281PCI_LPCM_REC_SLOT, CS4281PCI_PPLVC, CS4281PCI_PPRVC, CS4281PCI_RPCM_PLAY_SLOT, CS4281PCI_RPCM_REC_SLOT, CS4281PCI_SERMC, CS4281PCI_SERMC_PTC_AC97, CS4281PCI_SPMC, CS4281PCI_SPMC_RSTN, CS4281PCI_SRCSA, CS4281PCI_SRCSA_CLSS, CS4281PCI_SRCSA_CRSS, CS4281PCI_SRCSA_PLSS, CS4281PCI_SRCSA_PRSS, CS4281PCI_SSPM, CS4281PCI_SSPM_ACLEN, CS4281PCI_SSPM_CSRCEN, CS4281PCI_SSPM_MIXEN, CS4281PCI_SSPM_PSRCEN, and sc_info::dev.
Referenced by cs4281_pci_attach(), and cs4281_pci_resume().
|
static |
Definition at line 514 of file cs4281.c.
References sc_chinfo::channel, chn_intr(), CS4281_DMA_PLAY, CS4281_DMA_REC, cs4281_rd(), cs4281_wr(), CS4281PCI_HDSR, CS4281PCI_HICR, CS4281PCI_HICR_EOI, CS4281PCI_HISR, CS4281PCI_HISR_DMA, sc_info::pch, and sc_info::rch.
Referenced by cs4281_pci_attach().
|
static |
Definition at line 761 of file cs4281.c.
References AC97_CREATE, ac97_destroy(), ac97_getmixerclass(), sc_info::bufsz, CS4281_DEFAULT_BUFSZ, cs4281_init(), cs4281_intr(), cs4281_power(), sc_info::dev, dev, free, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::mem, sc_info::memid, mixer_init(), sc_info::parent_dmat, PCIR_BAR, pcm_addchan(), pcm_getbuffersize(), PCM_KLDSTRING, pcm_register(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, sc_info::reg, sc_info::regid, sc_info::regtype, sc_info::sh, snd_setup_intr(), SND_STATUSLEN, sc_info::st, status, and sc_info::type.
|
static |
Definition at line 880 of file cs4281.c.
References cs4281_power(), dev, free, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::mem, sc_info::memid, sc_info::parent_dmat, pcm_getdevinfo(), pcm_unregister(), r, sc_info::reg, sc_info::regid, and sc_info::regtype.
|
static |
Definition at line 745 of file cs4281.c.
References CS4281_PCI_ID, and dev.
|
static |
Definition at line 920 of file cs4281.c.
References adcdac_go(), sc_chinfo::blksz, cs4281_init(), cs4281_power(), cs4281chan_setblocksize(), cs4281chan_setformat(), cs4281chan_setspeed(), dev, sc_chinfo::dma_active, sc_chinfo::fmt, mixer_reinit(), sc_info::pch, pcm_getdevinfo(), sc_info::rch, and sc_chinfo::spd.
|
static |
Definition at line 905 of file cs4281.c.
References adcdac_go(), cs4281_power(), dev, sc_chinfo::dma_active, sc_info::pch, pcm_getdevinfo(), and sc_info::rch.
|
static |
Definition at line 541 of file cs4281.c.
References cs4281_clr4(), cs4281_set4(), cs4281_wr(), CS4281PCI_CWPR, CS4281PCI_CWPR_MAGIC, CS4281PCI_EPPMC, CS4281PCI_EPPMC_FPDN, CS4281PCI_SPMC, CS4281PCI_SPMC_RSTN, DEB, sc_info::power, and state.
Referenced by cs4281_pci_attach(), cs4281_pci_detach(), cs4281_pci_resume(), and cs4281_pci_suspend().
|
static |
Definition at line 212 of file cs4281.c.
References CS4281_NUM_RATES, cs4281_rates, and rate.
Referenced by cs4281chan_setspeed().
|
inlinestatic |
Definition at line 149 of file cs4281.c.
References regno, sc_info::sh, and sc_info::st.
Referenced by adcdac_go(), cs4281_clr4(), cs4281_intr(), cs4281_rdcd(), cs4281_set4(), cs4281_waitset(), and cs4281chan_getptr().
|
static |
Definition at line 257 of file cs4281.c.
References cs4281_rd(), cs4281_waitclr(), cs4281_waitset(), cs4281_wr(), CS4281PCI_ACCAD, CS4281PCI_ACCDA, CS4281PCI_ACCTL, CS4281PCI_ACCTL_CRW, CS4281PCI_ACCTL_DCV, CS4281PCI_ACCTL_ESYN, CS4281PCI_ACCTL_VFRM, CS4281PCI_ACSDA, CS4281PCI_ACSTS, CS4281PCI_ACSTS_VSTS, sc_info::dev, devinfo, and regno.
Referenced by cs4281_init().
|
static |
Definition at line 226 of file cs4281.c.
References CS4281_NUM_RATES, cs4281_rates, and r.
Referenced by cs4281chan_setspeed().
|
inlinestatic |
Definition at line 170 of file cs4281.c.
References cs4281_rd(), cs4281_wr(), mask, and regno.
Referenced by adcdac_go(), cs4281_init(), and cs4281_power().
|
static |
Definition at line 192 of file cs4281.c.
Referenced by cs4281_rdcd(), and cs4281_wrcd().
|
static |
Definition at line 178 of file cs4281.c.
References cs4281_rd(), mask, and regno.
Referenced by cs4281_init(), and cs4281_rdcd().
|
inlinestatic |
Definition at line 155 of file cs4281.c.
References data, regno, sc_info::sh, and sc_info::st.
Referenced by adcdac_go(), adcdac_prog(), cs4281_clr4(), cs4281_init(), cs4281_intr(), cs4281_power(), cs4281_rdcd(), cs4281_set4(), cs4281_wrcd(), cs4281chan_setformat(), and cs4281chan_setspeed().
|
static |
Definition at line 291 of file cs4281.c.
References cs4281_waitclr(), cs4281_wr(), CS4281PCI_ACCAD, CS4281PCI_ACCDA, CS4281PCI_ACCTL, CS4281PCI_ACCTL_DCV, CS4281PCI_ACCTL_ESYN, CS4281PCI_ACCTL_VFRM, data, sc_info::dev, devinfo, and regno.
Referenced by cs4281_init().
|
static |
Definition at line 452 of file cs4281.c.
References cs4281_caps.
|
static |
Definition at line 414 of file cs4281.c.
References sc_chinfo::buffer, sc_info::ch, cs4281_rd(), CS4281PCI_DBA, CS4281PCI_DCA, data, sc_chinfo::dma_chan, sc_chinfo::parent, and sndbuf_getsize().
|
static |
Definition at line 322 of file cs4281.c.
References adcdac_go(), adcdac_prog(), b, sc_chinfo::blksz, sc_chinfo::bps, sc_chinfo::buffer, sc_info::bufsz, c, sc_chinfo::channel, CS4281_DMA_PLAY, CS4281_DMA_REC, devinfo, dir, sc_chinfo::dma_chan, sc_chinfo::dma_setup, 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(), sndbuf_getsize(), and sc_chinfo::spd.
|
static |
Definition at line 349 of file cs4281.c.
References adcdac_go(), adcdac_prog(), sc_chinfo::blksz, blocksize, sc_chinfo::buffer, sc_info::bufsz, sc_info::ch, data, DEB, sc_chinfo::dma_setup, go, sc_chinfo::parent, and sndbuf_resize().
Referenced by cs4281_pci_resume().
|
static |
Definition at line 388 of file cs4281.c.
References adcdac_go(), sc_chinfo::bps, sc_info::ch, CS4281_DMA_PLAY, cs4281_format_to_bps(), cs4281_format_to_dmr(), cs4281_wr(), CS4281PCI_DMR, CS4281PCI_DMR_AUTO, CS4281PCI_DMR_DMA, CS4281PCI_DMR_TR_PLAY, CS4281PCI_DMR_TR_REC, data, sc_chinfo::dma_chan, sc_chinfo::dma_setup, sc_chinfo::fmt, format, go, and sc_chinfo::parent.
Referenced by cs4281_pci_resume().
|
static |
Definition at line 371 of file cs4281.c.
References adcdac_go(), sc_info::ch, CS4281_DMA_PLAY, cs4281_rate_to_rv(), cs4281_rv_to_rate(), cs4281_wr(), CS4281PCI_ADCSR, CS4281PCI_DACSR, data, sc_chinfo::dma_chan, go, sc_chinfo::parent, r, sc_chinfo::spd, and speed.
Referenced by cs4281_pci_resume().
|
static |
Definition at line 430 of file cs4281.c.
References adcdac_go(), adcdac_prog(), data, go, PCMTRIG_ABORT, PCMTRIG_START, and PCMTRIG_STOP.
DRIVER_MODULE | ( | snd_cs4281 | , |
pci | , | ||
cs4281_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
MODULE_DEPEND | ( | snd_cs4281 | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_cs4281 | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
|
static |
Definition at line 143 of file cs4281.c.
Referenced by cs4281chan_getcaps().
|
static |
|
static |
|
static |
|
static |
Definition at line 208 of file cs4281.c.
Referenced by cs4281_rate_to_rv(), and cs4281_rv_to_rate().
|
static |