FreeBSD kernel sound device code
|
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <machine/resource.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <dev/sound/pcm/sound.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>
#include <dev/sound/pci/cs461x_dsp.h>
Go to the source code of this file.
Data Structures | |
struct | csa_softc |
struct | card_type |
Macros | |
#define | CS4610_PCI_ID 0x60011013 |
#define | CS4614_PCI_ID 0x60031013 |
#define | CS4615_PCI_ID 0x60041013 |
Typedefs | |
typedef struct csa_softc * | sc_p |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static int | csa_probe (device_t dev) |
static int | csa_attach (device_t dev) |
static struct resource * | csa_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 | csa_release_resource (device_t bus, device_t child, int type, int rid, struct resource *r) |
static int | csa_setup_intr (device_t bus, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep) |
static int | csa_teardown_intr (device_t bus, device_t child, struct resource *irq, void *cookie) |
static int | csa_initialize (sc_p scp) |
static int | csa_downloadimage (csa_res *resp) |
static int | csa_transferimage (csa_res *resp, u_int32_t *src, u_long dest, u_long len) |
static void | amp_none (void) |
static void | amp_voyetra (void) |
static int | clkrun_hack (int run) |
static struct card_type * | csa_findcard (device_t dev) |
struct csa_card * | csa_findsubcard (device_t dev) |
static int | csa_detach (device_t dev) |
static int | csa_resume (device_t dev) |
static void | csa_intr (void *arg) |
void | csa_clearserialfifos (csa_res *resp) |
void | csa_resetdsp (csa_res *resp) |
int | csa_readcodec (csa_res *resp, u_long offset, u_int32_t *data) |
int | csa_writecodec (csa_res *resp, u_long offset, u_int32_t data) |
u_int32_t | csa_readio (csa_res *resp, u_long offset) |
void | csa_writeio (csa_res *resp, u_long offset, u_int32_t data) |
u_int32_t | csa_readmem (csa_res *resp, u_long offset) |
void | csa_writemem (csa_res *resp, u_long offset, u_int32_t data) |
DRIVER_MODULE (snd_csa, pci, csa_driver, csa_devclass, 0, 0) | |
MODULE_DEPEND (snd_csa, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_csa, 1) | |
Variables | |
static driver_intr_t | csa_intr |
static devclass_t | csa_devclass |
static struct csa_card | cards_4610 [] |
static struct csa_card | cards_4614 [] |
static struct csa_card | cards_4615 [] |
static struct csa_card | nocard = {0, 0, "unknown", NULL, NULL, NULL, 0} |
static struct card_type | cards [] |
static device_method_t | csa_methods [] |
static driver_t | csa_driver |
|
static |
|
static |
Definition at line 245 of file csa.c.
References BA0_HICR, BA0_HISR, csa_downloadimage(), csa_findsubcard(), csa_initialize(), csa_intr, csa_readio(), csa_resetdsp(), csa_writeio(), gusc_softc::dev, dev, error, sndcard_func::func, HICR_CHGM, HICR_IEV, HISR_INTENA, PCIR_BAR, resp, SCF_MIDI, SCF_PCM, and snd_setup_intr().
void csa_clearserialfifos | ( | csa_res * | resp | ) |
Definition at line 773 of file csa.c.
References BA0_CLKCR1, BA0_SERBAD, BA0_SERBCM, BA0_SERBST, BA0_SERBWP, CLKCR1_SWCE, csa_readio(), csa_writeio(), resp, SERBCM_WRC, and SERBST_WBSY.
Referenced by csa_initialize(), csa_stopcapturedma(), and csa_stopplaydma().
|
static |
|
static |
Definition at line 854 of file csa.c.
References cs461x_firmware_struct::BA1Array, cs461x_firmware, csa_transferimage(), INKY_MEMORY_COUNT, cs461x_firmware_struct::MemoryStat, offset, resp, cs461x_firmware_struct::ulDestAddr, and cs461x_firmware_struct::ulSourceSize.
Referenced by csa_attach(), and csa_resume().
|
static |
Definition at line 196 of file csa.c.
References cards, dev, and devid.
Referenced by csa_findsubcard(), and csa_probe().
struct csa_card * csa_findsubcard | ( | device_t | dev | ) |
Definition at line 210 of file csa.c.
References card_type::cards, csa_findcard(), dev, nocard, csa_card::subdevice, and csa_card::subvendor.
Referenced by csa_attach().
|
static |
Definition at line 574 of file csa.c.
References ACCTL_ESYN, ACCTL_RSTN, ACCTL_VFRM, ACISV_ISV3, ACISV_ISV4, ACOSV_SLV3, ACOSV_SLV4, ACSTS_CRDY, BA0_AC97_POWERDOWN, BA0_ACCTL, BA0_ACISV, BA0_ACOSV, BA0_ACSTS, BA0_CLKCR1, BA0_CLKCR2, BA0_HICR, BA0_PLLCC, BA0_PLLM, BA0_SERACC, BA0_SERBSP, BA0_SERC1, BA0_SERC2, BA0_SERMC1, CLKCR1_PLLP, CLKCR1_SWCE, CLKCR2_PDIVS_8, csa_clearserialfifos(), csa_readio(), csa_writeio(), HICR_CHGM, HICR_IEV, PLLCC_CDR_73_104_MHZ, PLLCC_LPF_1050_2780_KHZ, resp, SERACC_CODEC_TYPE_1_03, SERACC_CODEC_TYPE_2_0, SERACC_HSP, SERC1_SO1EN, SERC1_SO1F_AC97, SERC2_SI1F_AC97, SERMC1_MSPE, and SERMC1_PTC_AC97.
Referenced by csa_attach(), and csa_resume().
|
static |
|
static |
Definition at line 232 of file csa.c.
References csa_findcard(), dev, and card_type::name.
int csa_readcodec | ( | csa_res * | resp, |
u_long | offset, | ||
u_int32_t * | data | ||
) |
Definition at line 900 of file csa.c.
References ACCTL_CRW, ACCTL_DCV, ACCTL_ESYN, ACCTL_RSTN, ACCTL_VFRM, ACSTS_VSTS, BA0_AC97_RESET, BA0_ACCAD, BA0_ACCDA, BA0_ACCTL, BA0_ACSDA, BA0_ACSTS, csa_readio(), csa_writeio(), data, offset, and resp.
Referenced by csa_ac97_suspend(), csa_rdcd(), and csa_readio().
u_int32_t csa_readio | ( | csa_res * | resp, |
u_long | offset | ||
) |
Definition at line 1047 of file csa.c.
References BA0_AC97_RESET, csa_readcodec(), offset, and resp.
Referenced by csa_attach(), csa_clearserialfifos(), csa_init(), csa_initialize(), csa_intr(), csa_readcodec(), csa_setup_intr(), csa_writecodec(), and pcmcsa_resume().
u_int32_t csa_readmem | ( | csa_res * | resp, |
u_long | offset | ||
) |
Definition at line 1070 of file csa.c.
Referenced by csa_setupchan(), csa_startcapturedma(), csa_startdsp(), csa_startplaydma(), csa_stopcapturedma(), csa_stopplaydma(), csachan_getptr(), pcmcsa_attach(), pcmcsa_resume(), and pcmcsa_suspend().
|
static |
void csa_resetdsp | ( | csa_res * | resp | ) |
Definition at line 824 of file csa.c.
References BA1_DREG, BA1_FRMT, BA1_SPCR, BA1_TWPR, csa_writemem(), DREG_REGID_TRAP_SELECT, resp, SPCR_DRQEN, and SPCR_RSTSP.
Referenced by csa_attach(), csa_resume(), and pcmcsa_suspend().
|
static |
Definition at line 379 of file csa.c.
References csa_downloadimage(), csa_initialize(), csa_resetdsp(), dev, and resp.
|
static |
Definition at line 453 of file csa.c.
References BA0_HICR, BA0_HISR, bus, child, csa_readio(), csa_writeio(), sndcard_func::func, HICR_CHGM, HICR_IEV, HISR_INTENA, intr, irq, resp, SCF_MIDI, and SCF_PCM.
|
static |
|
static |
Definition at line 876 of file csa.c.
References csa_writemem(), len, resp, and src.
Referenced by csa_downloadimage().
int csa_writecodec | ( | csa_res * | resp, |
u_long | offset, | ||
u_int32_t | data | ||
) |
Definition at line 994 of file csa.c.
References ACCTL_DCV, ACCTL_ESYN, ACCTL_RSTN, ACCTL_VFRM, BA0_AC97_RESET, BA0_ACCAD, BA0_ACCDA, BA0_ACCTL, csa_readio(), csa_writeio(), data, offset, and resp.
Referenced by csa_ac97_resume(), csa_ac97_suspend(), csa_wrcd(), csa_writeio(), and pcmcsa_suspend().
void csa_writeio | ( | csa_res * | resp, |
u_long | offset, | ||
u_int32_t | data | ||
) |
Definition at line 1061 of file csa.c.
References BA0_AC97_RESET, csa_writecodec(), data, offset, and resp.
Referenced by csa_attach(), csa_clearserialfifos(), csa_init(), csa_initialize(), csa_intr(), csa_readcodec(), csa_setup_intr(), csa_stopcapturedma(), csa_stopplaydma(), csa_writecodec(), and pcmcsa_resume().
void csa_writemem | ( | csa_res * | resp, |
u_long | offset, | ||
u_int32_t | data | ||
) |
Definition at line 1076 of file csa.c.
References data, offset, and resp.
Referenced by csa_resetdsp(), csa_setcapturesamplerate(), csa_setplaysamplerate(), csa_setupchan(), csa_startcapturedma(), csa_startdsp(), csa_startplaydma(), csa_stopcapturedma(), csa_stopdsp(), csa_stopplaydma(), csa_transferimage(), pcmcsa_attach(), pcmcsa_resume(), and pcmcsa_suspend().
DRIVER_MODULE | ( | snd_csa | , |
pci | , | ||
csa_driver | , | ||
csa_devclass | , | ||
0 | , | ||
0 | |||
) |
MODULE_DEPEND | ( | snd_csa | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_csa | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 188 of file csa.c.
Referenced by csa_findcard(), and opti_detect().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 96 of file csa.c.
Referenced by csa_attach().
|
static |
|
static |
Definition at line 180 of file csa.c.
Referenced by csa_findsubcard().