FreeBSD kernel sound device code
|
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
#include <dev/sound/pci/ich.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
Go to the source code of this file.
Data Structures | |
struct | ich_type |
struct | ich_desc |
struct | sc_chinfo |
struct | sc_info |
Macros | |
#define | ICH_TIMEOUT 1000 /* semaphore timeout polling count */ |
#define | ICH_DTBL_LENGTH 32 |
#define | ICH_DEFAULT_BUFSZ 16384 |
#define | ICH_MAX_BUFSZ 65536 |
#define | ICH_MIN_BUFSZ 4096 |
#define | ICH_DEFAULT_BLKCNT 2 |
#define | ICH_MAX_BLKCNT 32 |
#define | ICH_MIN_BLKCNT 2 |
#define | ICH_MIN_BLKSZ 64 |
#define | INTEL_VENDORID 0x8086 |
#define | SIS_VENDORID 0x1039 |
#define | NVIDIA_VENDORID 0x10de |
#define | AMD_VENDORID 0x1022 |
#define | INTEL_82440MX 0x7195 |
#define | INTEL_82801AA 0x2415 |
#define | INTEL_82801AB 0x2425 |
#define | INTEL_82801BA 0x2445 |
#define | INTEL_82801CA 0x2485 |
#define | INTEL_82801DB 0x24c5 /* ICH4 needs special handling */ |
#define | INTEL_82801EB 0x24d5 /* ICH5 needs to be treated as ICH4 */ |
#define | INTEL_6300ESB 0x25a6 /* 6300ESB needs to be treated as ICH4 */ |
#define | INTEL_82801FB 0x266e /* ICH6 needs to be treated as ICH4 */ |
#define | INTEL_82801GB 0x27de /* ICH7 needs to be treated as ICH4 */ |
#define | SIS_7012 0x7012 /* SiS 7012 needs special handling */ |
#define | NVIDIA_NFORCE 0x01b1 |
#define | NVIDIA_NFORCE2 0x006a |
#define | NVIDIA_NFORCE2_400 0x008a |
#define | NVIDIA_NFORCE3 0x00da |
#define | NVIDIA_NFORCE3_250 0x00ea |
#define | NVIDIA_NFORCE4 0x0059 |
#define | NVIDIA_NFORCE_410_MCP 0x026b |
#define | NVIDIA_NFORCE4_MCP 0x003a |
#define | AMD_768 0x7445 |
#define | AMD_8111 0x746d |
#define | ICH_LOCK(sc) snd_mtxlock((sc)->ich_lock) |
#define | ICH_UNLOCK(sc) snd_mtxunlock((sc)->ich_lock) |
#define | ICH_LOCK_ASSERT(sc) snd_mtxassert((sc)->ich_lock) |
#define | ICH_DEBUG(...) |
#define | ICH_CALIBRATE_DONE (1 << 0) |
#define | ICH_IGNORE_PCR (1 << 1) |
#define | ICH_IGNORE_RESET (1 << 2) |
#define | ICH_FIXED_RATE (1 << 3) |
#define | ICH_DMA_NOCACHE (1 << 4) |
#define | ICH_HIGH_LATENCY (1 << 5) |
#define | PROBE_LOW 0x01 |
Functions | |
SND_DECLARE_FILE ("$FreeBSD$") | |
static __inline uint32_t | ich_rd (struct sc_info *sc, int regno, int size) |
static __inline void | ich_wr (struct sc_info *sc, int regno, uint32_t data, int size) |
static int | ich_waitcd (void *devinfo) |
static int | ich_rdcd (kobj_t obj, void *devinfo, int regno) |
static int | ich_wrcd (kobj_t obj, void *devinfo, int regno, uint32_t data) |
AC97_DECLARE (ich_ac97) | |
static void | ich_filldtbl (struct sc_chinfo *ch) |
static int | ich_resetchan (struct sc_info *sc, int num) |
static void * | ichchan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) |
static int | ichchan_setformat (kobj_t obj, void *data, uint32_t format) |
static uint32_t | ichchan_setspeed (kobj_t obj, void *data, uint32_t speed) |
static uint32_t | ichchan_setblocksize (kobj_t obj, void *data, uint32_t blocksize) |
static int | ichchan_trigger (kobj_t obj, void *data, int go) |
static uint32_t | ichchan_getptr (kobj_t obj, void *data) |
static struct pcmchan_caps * | ichchan_getcaps (kobj_t obj, void *data) |
CHANNEL_DECLARE (ichchan) | |
static void | ich_intr (void *p) |
static int | ich_initsys (struct sc_info *sc) |
static void | ich_setstatus (struct sc_info *sc) |
static void | ich_calibrate (void *arg) |
static void | ich_setmap (void *arg, bus_dma_segment_t *segs, int nseg, int error) |
static int | ich_init (struct sc_info *sc) |
static int | ich_pci_probe (device_t dev) |
static int | ich_pci_attach (device_t dev) |
static int | ich_pci_detach (device_t dev) |
static void | ich_pci_codec_reset (struct sc_info *sc) |
static int | ich_pci_suspend (device_t dev) |
static int | ich_pci_resume (device_t dev) |
DRIVER_MODULE (snd_ich, pci, ich_driver, pcm_devclass, 0, 0) | |
MODULE_DEPEND (snd_ich, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER) | |
MODULE_VERSION (snd_ich, 1) | |
Variables | |
static const struct ich_type | ich_devs [] |
static uint32_t | ich_fmt [] |
static struct pcmchan_caps | ich_vrcaps = {8000, 48000, ich_fmt, 0} |
static struct pcmchan_caps | ich_caps = {48000, 48000, ich_fmt, 0} |
static kobj_method_t | ich_ac97_methods [] |
static kobj_method_t | ichchan_methods [] |
static device_method_t | ich_methods [] |
static driver_t | ich_driver |
#define ICH_LOCK | ( | sc | ) | snd_mtxlock((sc)->ich_lock) |
#define ICH_LOCK_ASSERT | ( | sc | ) | snd_mtxassert((sc)->ich_lock) |
#define ICH_UNLOCK | ( | sc | ) | snd_mtxunlock((sc)->ich_lock) |
#define INTEL_6300ESB 0x25a6 /* 6300ESB needs to be treated as ICH4 */ |
#define INTEL_82801EB 0x24d5 /* ICH5 needs to be treated as ICH4 */ |
#define INTEL_82801FB 0x266e /* ICH6 needs to be treated as ICH4 */ |
#define INTEL_82801GB 0x27de /* ICH7 needs to be treated as ICH4 */ |
AC97_DECLARE | ( | ich_ac97 | ) |
CHANNEL_DECLARE | ( | ichchan | ) |
DRIVER_MODULE | ( | snd_ich | , |
pci | , | ||
ich_driver | , | ||
pcm_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
Definition at line 708 of file ich.c.
References sc_info::ac97rate, sc_chinfo::blkcnt, sc_chinfo::blksz, sc_chinfo::buffer, sc_info::ch, sc_chinfo::desc_addr, sc_info::dev, sc_info::flags, ICH_CALIBRATE_DONE, ICH_LOCK, ich_rd(), ICH_REG_PI_BASE, ICH_REG_X_BDBAR, ICH_REG_X_CIV, ICH_REG_X_CR, ich_setstatus(), ICH_UNLOCK, ich_wr(), ICH_X_CR_RPBM, ICH_X_CR_RR, ichchan_setblocksize(), sc_info::intrhook, sc_chinfo::regbase, and sndbuf_getmaxsize().
Referenced by ich_pci_attach().
|
static |
Definition at line 300 of file ich.c.
References base, sc_chinfo::blkcnt, sc_chinfo::blksz, sc_chinfo::buffer, ich_desc::buffer, sc_info::ch, sc_info::dev, sc_chinfo::dtbl, ICH_BDC_IOC, ICH_DTBL_LENGTH, ich_desc::length, sc_chinfo::parent, sc_info::sample_size, sndbuf_getblkcnt(), sndbuf_getblksz(), sndbuf_getbufaddr(), sndbuf_getmaxsize(), and sndbuf_resize().
Referenced by ichchan_setblocksize().
|
static |
Definition at line 828 of file ich.c.
References sc_info::dev, sc_info::devid, sc_info::flags, sc_info::hasmic, ICH_GLOB_CTL_COLD, ICH_GLOB_CTL_PRES, ICH_GLOB_STA_PCR, ICH_IGNORE_PCR, ich_rd(), ICH_REG_GLOB_CNT, ICH_REG_GLOB_STA, ich_resetchan(), ich_wr(), INTEL_6300ESB, INTEL_82801DB, INTEL_82801EB, INTEL_82801FB, INTEL_82801GB, INTEL_VENDORID, and sc_info::vendor.
Referenced by ich_pci_attach(), and ich_pci_resume().
|
static |
Definition at line 671 of file ich.c.
References sc_info::ac97rate, and sc_info::dev.
Referenced by ich_pci_attach().
|
static |
Definition at line 600 of file ich.c.
References sc_chinfo::blkcnt, sc_info::ch, sc_chinfo::channel, chn_intr(), sc_chinfo::civ, sc_info::dev, sc_info::flags, ICH_CALIBRATE_DONE, ICH_DEBUG, ICH_DTBL_LENGTH, ICH_GLOB_STA_IMASK, ICH_GLOB_STA_PRES, ICH_GLOB_STA_SRES, ICH_LOCK, ich_rd(), ICH_REG_GLOB_STA, ICH_REG_X_LVI, ICH_REG_X_PICB, ICH_REG_X_SR, ICH_UNLOCK, ich_wr(), ICH_X_SR_BCIS, ICH_X_SR_FIFOE, ICH_X_SR_LVBCI, sc_chinfo::imask, sc_chinfo::regbase, sc_chinfo::run, and sc_info::swap_reg.
Referenced by ich_pci_attach().
|
static |
Definition at line 883 of file ich.c.
References AC97_CAP_MICCHANNEL, AC97_CREATE, ac97_destroy(), AC97_EXTCAP_VRA, AC97_EXTCAP_VRM, AC97_F_EAPD_INV, ac97_getcaps(), ac97_getextcaps(), ac97_getflags(), ac97_getmixerclass(), ac97_setextmode(), ac97_setflags(), sc_info::blkcnt, sc_info::bufsz, sc_info::chan_dmat, sc_info::codec, sc_info::dev, dev, devid, sc_info::devid, sc_info::dmat, sc_info::dtbl, sc_info::dtbl_size, sc_info::dtmap, sc_info::flags, free, sc_info::hasmic, sc_info::hasvra, sc_info::hasvrm, ich_calibrate(), ICH_CALIBRATE_DONE, ICH_DEFAULT_BLKCNT, ICH_DEFAULT_BUFSZ, ICH_DMA_NOCACHE, ICH_DTBL_LENGTH, ICH_FIXED_RATE, ICH_HIGH_LATENCY, ich_init(), ich_initsys(), ich_intr(), ICH_LEGACY_ENABLE, sc_info::ich_lock, ICH_MAX_BLKCNT, ICH_MAX_BUFSZ, ICH_MIN_BLKCNT, ICH_MIN_BLKSZ, ICH_MIN_BUFSZ, ich_setmap(), ich_setstatus(), sc_info::ih, INTEL_6300ESB, INTEL_82440MX, INTEL_82801DB, INTEL_82801EB, INTEL_82801FB, INTEL_82801GB, INTEL_VENDORID, sc_info::intrhook, sc_info::irq, sc_info::irqid, mixer_init(), sc_info::nabmbar, sc_info::nabmbarh, sc_info::nabmbarid, sc_info::nabmbart, sc_info::nambar, sc_info::nambarh, sc_info::nambarid, sc_info::nambart, PCIR_ICH_LEGACY, PCIR_MBBAR, PCIR_MMBAR, PCIR_NABMBAR, PCIR_NAMBAR, pcm_addchan(), pcm_getbuffersize(), pcm_register(), PCMDIR_PLAY, PCMDIR_REC, sc_info::regtype, sc_info::sample_size, SIS_7012, SIS_VENDORID, snd_mtxcreate(), snd_mtxfree(), snd_setup_intr(), sc_info::swap_reg, vendor, and sc_info::vendor.
|
static |
Definition at line 1147 of file ich.c.
References ICH_GLOB_CTL_COLD, ICH_GLOB_CTL_SHUT, ICH_GLOB_CTL_WARM, ICH_GLOB_STA_PCR, ich_rd(), ICH_REG_GLOB_CNT, ICH_REG_GLOB_STA, and ich_wr().
Referenced by ich_pci_resume().
|
static |
Definition at line 1123 of file ich.c.
References sc_info::chan_dmat, dev, sc_info::dmat, sc_info::dtbl, sc_info::dtmap, free, sc_info::ich_lock, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::nabmbar, sc_info::nabmbarid, sc_info::nambar, sc_info::nambarid, pcm_getdevinfo(), pcm_unregister(), r, sc_info::regtype, and snd_mtxfree().
|
static |
|
static |
Definition at line 1189 of file ich.c.
References ac97_setextmode(), sc_chinfo::blksz, sc_info::ch, sc_info::codec, dev, sc_info::hasvra, sc_info::hasvrm, ich_init(), ICH_LOCK, ich_pci_codec_reset(), ICH_UNLOCK, ichchan_setblocksize(), ichchan_setspeed(), ichchan_trigger(), mixer_reinit(), pcm_getdevinfo(), PCMTRIG_START, sc_chinfo::run_save, and sc_chinfo::spd.
|
static |
Definition at line 1169 of file ich.c.
References sc_info::ch, dev, ICH_LOCK, ICH_UNLOCK, ichchan_trigger(), pcm_getdevinfo(), PCMTRIG_ABORT, sc_chinfo::run, and sc_chinfo::run_save.
|
static |
Definition at line 216 of file ich.c.
References sc_info::nabmbarh, sc_info::nabmbart, regno, and size.
Referenced by ich_calibrate(), ich_init(), ich_intr(), ich_pci_codec_reset(), ich_resetchan(), ich_waitcd(), and ichchan_getptr().
|
static |
Definition at line 267 of file ich.c.
References devinfo, ich_waitcd(), sc_info::nambarh, sc_info::nambart, and regno.
|
static |
Definition at line 324 of file ich.c.
References sc_info::dev, sc_info::flags, ICH_IGNORE_RESET, ich_rd(), ICH_REG_MC_BASE, ICH_REG_PI_BASE, ICH_REG_PO_BASE, ICH_REG_X_CR, ICH_TIMEOUT, ich_wr(), ICH_X_CR_RR, NVIDIA_VENDORID, and sc_info::vendor.
Referenced by ich_init(), and ichchan_trigger().
|
static |
Definition at line 820 of file ich.c.
References sc_info::desc_addr.
Referenced by ich_pci_attach().
|
static |
Definition at line 686 of file ich.c.
References sc_info::bufsz, sc_info::dev, sc_info::flags, ICH_DMA_NOCACHE, sc_info::irq, sc_info::nabmbar, sc_info::nambar, PCM_KLDSTRING, pcm_setstatus(), SND_STATUSLEN, and status.
Referenced by ich_calibrate(), and ich_pci_attach().
|
static |
Definition at line 248 of file ich.c.
References data, sc_info::dev, devinfo, sc_info::flags, ICH_IGNORE_PCR, ich_rd(), ICH_REG_ACC_SEMA, and ICH_TIMEOUT.
Referenced by ich_rdcd(), and ich_wrcd().
|
static |
Definition at line 231 of file ich.c.
References data, sc_info::nabmbarh, sc_info::nabmbart, regno, and size.
Referenced by ich_calibrate(), ich_init(), ich_intr(), ich_pci_codec_reset(), ich_resetchan(), ichchan_init(), ichchan_setblocksize(), and ichchan_trigger().
|
static |
Definition at line 278 of file ich.c.
References data, devinfo, ich_waitcd(), sc_info::nambarh, sc_info::nambart, and regno.
|
static |
Definition at line 568 of file ich.c.
References data, sc_info::dev, ICH_CALIBRATE_DONE, ich_caps, ICH_DEBUG, ich_vrcaps, sc_chinfo::parent, and sc_chinfo::spdreg.
|
static |
Definition at line 545 of file ich.c.
References sc_chinfo::blkcnt, sc_chinfo::blksz, sc_info::ch, sc_chinfo::civ, data, sc_info::dev, sc_info::flags, ICH_CALIBRATE_DONE, ICH_DEBUG, ICH_LOCK, ich_rd(), ICH_REG_X_CIV, ICH_UNLOCK, sc_chinfo::parent, and sc_chinfo::regbase.
|
static |
Definition at line 370 of file ich.c.
References AC97_REGEXT_FDACRATE, AC97_REGEXT_LADCRATE, AC97_REGEXT_MADCRATE, b, sc_chinfo::blkcnt, sc_info::blkcnt, sc_chinfo::blksz, sc_chinfo::buffer, sc_info::bufsz, c, sc_info::ch, sc_info::chan_dmat, sc_chinfo::channel, sc_info::chnum, sc_chinfo::desc_addr, sc_info::desc_addr, devinfo, dir, sc_chinfo::dtbl, sc_info::dtbl, sc_info::flags, sc_info::hasvra, sc_info::hasvrm, ICH_DMA_NOCACHE, ICH_DTBL_LENGTH, ICH_FIXED_RATE, ICH_GLOB_STA_MINT, ICH_GLOB_STA_PIINT, ICH_GLOB_STA_POINT, ICH_LOCK, ICH_REG_MC_BASE, ICH_REG_PI_BASE, ICH_REG_PO_BASE, ICH_REG_X_BDBAR, ICH_UNLOCK, ich_wr(), sc_chinfo::imask, sc_chinfo::num, sc_chinfo::parent, PCMDIR_PLAY, PCMDIR_REC, sc_chinfo::regbase, sc_chinfo::run, sndbuf_alloc(), and sc_chinfo::spdreg.
|
static |
Definition at line 483 of file ich.c.
References sc_chinfo::blkcnt, sc_chinfo::blksz, blocksize, sc_chinfo::buffer, sc_info::ch, data, sc_info::dev, sc_info::flags, ICH_CALIBRATE_DONE, ICH_DEBUG, ich_filldtbl(), ICH_HIGH_LATENCY, ICH_LOCK, ICH_MIN_BLKSZ, ICH_REG_X_LVI, ICH_UNLOCK, ich_wr(), sc_chinfo::parent, sc_chinfo::regbase, and sndbuf_getmaxsize().
Referenced by ich_calibrate(), and ich_pci_resume().
|
static |
Definition at line 433 of file ich.c.
References sc_info::ch, data, sc_info::dev, sc_info::flags, ICH_CALIBRATE_DONE, ICH_DEBUG, and sc_chinfo::parent.
|
static |
Definition at line 449 of file ich.c.
References ac97_setrate(), sc_info::ac97rate, sc_info::ch, sc_info::codec, data, sc_info::dev, sc_info::flags, ICH_CALIBRATE_DONE, ICH_DEBUG, ICH_LOCK, ICH_UNLOCK, sc_chinfo::parent, r, sc_chinfo::spd, sc_chinfo::spdreg, and speed.
Referenced by ich_pci_resume().
|
static |
Definition at line 511 of file ich.c.
References sc_info::ch, data, sc_chinfo::desc_addr, sc_info::dev, sc_info::flags, go, ICH_CALIBRATE_DONE, ICH_DEBUG, ICH_LOCK, ICH_REG_X_BDBAR, ICH_REG_X_CR, ich_resetchan(), ICH_UNLOCK, ich_wr(), ICH_X_CR_IOCE, ICH_X_CR_LVBIE, ICH_X_CR_RPBM, sc_chinfo::num, sc_chinfo::parent, PCMTRIG_ABORT, PCMTRIG_START, PCMTRIG_STOP, sc_chinfo::regbase, and sc_chinfo::run.
Referenced by ich_pci_resume(), and ich_pci_suspend().
MODULE_DEPEND | ( | snd_ich | , |
sound | , | ||
SOUND_MINVER | , | ||
SOUND_PREFVER | , | ||
SOUND_MAXVER | |||
) |
MODULE_VERSION | ( | snd_ich | , |
1 | |||
) |
SND_DECLARE_FILE | ( | "$FreeBSD$" | ) |
|
static |
|
static |
Definition at line 211 of file ich.c.
Referenced by ichchan_getcaps().
|
static |
Referenced by ich_pci_probe().
|
static |
|
static |
|
static |
|
static |
Definition at line 210 of file ich.c.
Referenced by ichchan_getcaps().
|
static |