FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
#include <dev/sound/chip.h>
#include <dev/sound/pci/csareg.h>
#include <dev/sound/pci/csavar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
Go to the source code of this file.
Data Structures | |
struct | csa_chinfo |
struct | csa_info |
Macros | |
#define | CS461x_BUFFSIZE (4 * 1024) |
#define | GOF_PER_SEC 200 |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static int | csa_init (struct csa_info *) |
static void | csa_intr (void *) |
static void | csa_setplaysamplerate (csa_res *resp, u_long ulInRate) |
static void | csa_setcapturesamplerate (csa_res *resp, u_long ulOutRate) |
static void | csa_startplaydma (struct csa_info *csa) |
static void | csa_startcapturedma (struct csa_info *csa) |
static void | csa_stopplaydma (struct csa_info *csa) |
static void | csa_stopcapturedma (struct csa_info *csa) |
static int | csa_startdsp (csa_res *resp) |
static int | csa_stopdsp (csa_res *resp) |
static int | csa_allocres (struct csa_info *scp, device_t dev) |
static void | csa_releaseres (struct csa_info *scp, device_t dev) |
static void | csa_ac97_suspend (struct csa_info *csa) |
static void | csa_ac97_resume (struct csa_info *csa) |
static int | csa_active (struct csa_info *csa, int run) |
static int | csa_rdcd (kobj_t obj, void *devinfo, int regno) |
static int | csa_wrcd (kobj_t obj, void *devinfo, int regno, u_int32_t data) |
AC97_DECLARE (csa_ac97) | |
static int | csa_setupchan (struct csa_chinfo *ch) |
static void * | csachan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static int | csachan_setformat (kobj_t obj, void *data, u_int32_t format) |
static u_int32_t | csachan_setspeed (kobj_t obj, void *data, u_int32_t speed) |
static u_int32_t | csachan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize) |
static int | csachan_trigger (kobj_t obj, void *data, int go) |
static u_int32_t | csachan_getptr (kobj_t obj, void *data) |
static struct pcmchan_caps * | csachan_getcaps (kobj_t obj, void *data) |
CHANNEL_DECLARE (csachan) | |
static int | pcmcsa_probe (device_t dev) |
static int | pcmcsa_attach (device_t dev) |
static int | pcmcsa_detach (device_t dev) |
static int | pcmcsa_suspend (device_t dev) |
static int | pcmcsa_resume (device_t dev) |
DRIVER_MODULE (snd_csapcm, csa, pcmcsa_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_csapcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_DEPEND (snd_csapcm, snd_csa, 1, 1, 1) | |
MODULE_VERSION (snd_csapcm, 1) | |
Variables | |
static u_int32_t | csa_playfmt [] |
static struct pcmchan_caps | csa_playcaps = {8000, 48000, csa_playfmt, 0} |
static u_int32_t | csa_recfmt [] |
static struct pcmchan_caps | csa_reccaps = {11025, 48000, csa_recfmt, 0} |
static kobj_method_t | csa_ac97_methods [] |
static kobj_method_t | csachan_methods [] |
static device_method_t | pcmcsa_methods [] |
static driver_t | pcmcsa_driver |
AC97_DECLARE | ( | csa_ac97 | ) |
CHANNEL_DECLARE | ( | csachan | ) |
|
static |
Definition at line 910 of file csapcm.c.
References csa_info::ac97, csa_info::ac97_general_purpose, csa_info::ac97_powerdown, BA0_AC97_GENERAL_PURPOSE, BA0_AC97_POWERDOWN, BA0_AC97_RESET, count, CS461x_AC97_HIGHESTREGTORESTORE, CS461x_AC97_NUMBER_RESTORE_REGS, csa_writecodec(), and csa_info::res.
Referenced by pcmcsa_resume().
|
static |
Definition at line 868 of file csapcm.c.
References csa_info::ac97, csa_info::ac97_general_purpose, csa_info::ac97_powerdown, BA0_AC97_GENERAL_PURPOSE, BA0_AC97_HEADPHONE_VOLUME, BA0_AC97_MASTER_VOLUME, BA0_AC97_MASTER_VOLUME_MONO, BA0_AC97_PCM_OUT_VOLUME, BA0_AC97_POWERDOWN, BA0_AC97_RESET, count, CS461x_AC97_HIGHESTREGTORESTORE, CS461x_AC97_NUMBER_RESTORE_REGS, CS_AC97_POWER_CONTROL_ADC, CS_AC97_POWER_CONTROL_DAC, CS_AC97_POWER_CONTROL_MIXVON, csa_readcodec(), csa_writecodec(), and csa_info::res.
Referenced by pcmcsa_suspend().
|
static |
Definition at line 124 of file csapcm.c.
References csa_info::active, csa_card::active, and csa_info::card.
Referenced by csa_rdcd(), csa_wrcd(), csachan_trigger(), pcmcsa_attach(), pcmcsa_resume(), and pcmcsa_suspend().
|
static |
Definition at line 689 of file csapcm.c.
References CS461x_BUFFSIZE, dev, csa_info::parent_dmat, csa_info::res, and resp.
Referenced by pcmcsa_attach().
|
static |
Definition at line 659 of file csapcm.c.
References BA0_EGPIODR, BA0_EGPIOPTR, csa_readio(), csa_setcapturesamplerate(), csa_setplaysamplerate(), csa_startdsp(), csa_stopcapturedma(), csa_stopplaydma(), csa_writeio(), EGPIODR_GPOE0, EGPIODR_GPOE2, EGPIOPTR_GPPT0, EGPIOPTR_GPPT2, csa_info::pfie, csa_info::res, and resp.
Referenced by pcmcsa_attach().
|
static |
Definition at line 642 of file csapcm.c.
References csa_info::binfo, csa_chinfo::channel, chn_intr(), csa_bridgeinfo::hisr, HISR_VC0, HISR_VC1, and csa_info::rch.
Referenced by pcmcsa_attach().
|
static |
Definition at line 143 of file csapcm.c.
References BA0_AC97_RESET, csa_active(), csa_readcodec(), data, devinfo, regno, and csa_info::res.
|
static |
Definition at line 728 of file csapcm.c.
References dev, free, csa_info::ih, csa_info::parent_dmat, csa_info::res, and resp.
Referenced by pcmcsa_attach(), and pcmcsa_detach().
|
static |
Definition at line 222 of file csapcm.c.
References BA1_CCI, BA1_CCST, BA1_CD, BA1_CFG1, BA1_CFG2, BA1_CPI, BA1_CSPB, BA1_CSRC, BA1_VARIDEC_BUF_1, csa_writemem(), GOF_PER_SEC, and resp.
Referenced by csa_init(), and csa_setupchan().
|
static |
Definition at line 176 of file csapcm.c.
References BA1_PPI, BA1_PSRC, csa_writemem(), GOF_PER_SEC, and resp.
Referenced by csa_init(), and csa_setupchan().
|
static |
Definition at line 481 of file csapcm.c.
References AFMT_16BIT, AFMT_8BIT, AFMT_BIGENDIAN, AFMT_CHANNEL, AFMT_SIGNED, BA1_CBA, BA1_CIE, BA1_PBA, BA1_PDTC, BA1_PFIE, csa_chinfo::buffer, csa_readmem(), csa_setcapturesamplerate(), csa_setplaysamplerate(), csa_writemem(), csa_chinfo::dir, csa_chinfo::fmt, csa_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, csa_info::pfie, csa_info::res, resp, sndbuf_getbufaddr(), and csa_chinfo::spd.
Referenced by csachan_trigger(), and pcmcsa_resume().
|
static |
Definition at line 352 of file csapcm.c.
References BA1_CCTL, BA1_CVOL, csa_info::cctl, csa_readmem(), csa_writemem(), csa_chinfo::dma, csa_info::rch, csa_info::res, and resp.
Referenced by csachan_trigger(), and pcmcsa_resume().
|
static |
Definition at line 422 of file csapcm.c.
References BA1_FRMT, BA1_SPCR, csa_readmem(), csa_writemem(), resp, SPCR_DRQEN, SPCR_RUN, and SPCR_RUNFR.
Referenced by csa_init(), and pcmcsa_resume().
|
static |
Definition at line 336 of file csapcm.c.
References BA1_PCTL, BA1_PVOL, csa_readmem(), csa_writemem(), csa_info::pctl, csa_info::res, and resp.
Referenced by csachan_trigger(), and pcmcsa_resume().
|
static |
Definition at line 395 of file csapcm.c.
References BA0_SERBSP, BA1_CCTL, BA1_CVOL, csa_info::cctl, csa_clearserialfifos(), csa_readmem(), csa_writeio(), csa_writemem(), csa_chinfo::dma, csa_info::rch, csa_info::res, and resp.
Referenced by csa_init(), csachan_trigger(), pcmcsa_resume(), and pcmcsa_suspend().
|
static |
Definition at line 469 of file csapcm.c.
References BA1_SPCR, csa_writemem(), and resp.
Referenced by pcmcsa_suspend().
|
static |
Definition at line 368 of file csapcm.c.
References BA0_SERBSP, BA1_PCTL, BA1_PVOL, csa_clearserialfifos(), csa_readmem(), csa_writeio(), csa_writemem(), csa_chinfo::dma, csa_info::pctl, csa_info::rch, csa_info::res, and resp.
Referenced by csa_init(), csachan_trigger(), pcmcsa_resume(), and pcmcsa_suspend().
|
static |
Definition at line 157 of file csapcm.c.
References BA0_AC97_RESET, csa_active(), csa_writecodec(), data, devinfo, regno, and csa_info::res.
|
static |
Definition at line 621 of file csapcm.c.
References csa_playcaps, csa_reccaps, data, csa_chinfo::dir, and PCMDIR_PLAY.
|
static |
Definition at line 598 of file csapcm.c.
References BA1_CBA, BA1_PBA, csa_chinfo::buffer, csa_readmem(), data, csa_chinfo::dir, csa_chinfo::fmt, csa_chinfo::parent, PCMDIR_PLAY, csa_info::res, resp, and sndbuf_getbufaddr().
|
static |
Definition at line 533 of file csapcm.c.
References b, csa_chinfo::buffer, c, csa_chinfo::channel, CS461x_BUFFSIZE, devinfo, csa_chinfo::dir, dir, csa_chinfo::parent, csa_info::parent_dmat, PCMDIR_PLAY, csa_info::rch, and sndbuf_alloc().
|
static |
Definition at line 566 of file csapcm.c.
References CS461x_BUFFSIZE.
|
static |
Definition at line 548 of file csapcm.c.
References data, csa_chinfo::fmt, and format.
|
static |
Definition at line 557 of file csapcm.c.
References data, csa_chinfo::spd, and speed.
|
static |
Definition at line 572 of file csapcm.c.
References csa_active(), csa_setupchan(), csa_startcapturedma(), csa_startplaydma(), csa_stopcapturedma(), csa_stopplaydma(), data, csa_chinfo::dir, go, csa_chinfo::parent, PCMDIR_PLAY, PCMTRIG_COMMON, and PCMTRIG_START.
DRIVER_MODULE | ( | snd_csapcm | , |
csa | , | ||
pcmcsa_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
MODULE_DEPEND | ( | snd_csapcm | , |
snd_csa | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | snd_csapcm | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_csapcm | , |
1 | |||
) |
|
static |
Definition at line 776 of file csapcm.c.
References AC97_CREATE, ac97_destroy(), AC97_F_EAPD_INV, ac97_getmixerclass(), ac97_setflags(), csa_info::active, BA1_CIE, BA1_PFIE, csa_info::binfo, csa_info::card, csa_bridgeinfo::card, csa_active(), csa_allocres(), csa_init(), csa_intr(), csa_readmem(), csa_releaseres(), csa_writemem(), dev, csa_chinfo::dma, sndcard_func::func, csa_info::ih, csa_card::inv_eapd, mixer_init(), PCIR_BAR, pcm_addchan(), PCM_KLDSTRING, pcm_register(), pcm_setstatus(), PCMDIR_PLAY, PCMDIR_REC, csa_info::rch, csa_info::res, resp, snd_setup_intr(), SND_STATUSLEN, and status.
|
static |
Definition at line 852 of file csapcm.c.
References csa_releaseres(), dev, pcm_getdevinfo(), pcm_unregister(), and r.
|
static |
Definition at line 758 of file csapcm.c.
References dev, sndcard_func::func, and SCF_PCM.
|
static |
Definition at line 988 of file csapcm.c.
References BA0_HICR, BA0_HISR, BA1_CIE, BA1_PFIE, csa_ac97_resume(), csa_active(), csa_readio(), csa_readmem(), csa_setupchan(), csa_startcapturedma(), csa_startdsp(), csa_startplaydma(), csa_stopcapturedma(), csa_stopplaydma(), csa_writeio(), csa_writemem(), dev, HICR_CHGM, HICR_IEV, HISR_INTENA, pcm_getdevinfo(), csa_info::rch, csa_info::res, and resp.
|
static |
Definition at line 943 of file csapcm.c.
References BA0_AC97_POWERDOWN, BA0_CLKCR1, BA1_CIE, BA1_PFIE, CLKCR1_SWCE, csa_ac97_suspend(), csa_active(), csa_readmem(), csa_resetdsp(), csa_stopcapturedma(), csa_stopdsp(), csa_stopplaydma(), csa_writecodec(), csa_writemem(), dev, pcm_getdevinfo(), csa_info::res, and resp.
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
|
static |
Definition at line 112 of file csapcm.c.
Referenced by csachan_getcaps().
|
static |
|
static |
Definition at line 119 of file csapcm.c.
Referenced by csachan_getcaps().
|
static |
|
static |
|
static |
|
static |