FreeBSD kernel sound device code
cmi.c File Reference
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pci/cmireg.h>
#include <dev/sound/isa/sb.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <sys/sysctl.h>
#include <dev/sound/midi/mpu401.h>
#include "mixer_if.h"
#include "mpufoi_if.h"
Include dependency graph for cmi.c:

Go to the source code of this file.

Data Structures

struct  sc_chinfo
 
struct  sc_info
 
struct  sb16props
 

Macros

#define CMI8338A_PCI_ID   0x010013f6
 
#define CMI8338B_PCI_ID   0x010113f6
 
#define CMI8738_PCI_ID   0x011113f6
 
#define CMI8738B_PCI_ID   0x011213f6
 
#define CMI120_USB_ID   0x01030d8c
 
#define CMI_DEFAULT_BUFSZ   16384
 
#define CMI_INTR_PER_BUFFER   2
 
#define CMPCI_REG_DMA0_MAX_SAMPLES   CMPCI_REG_DMA0_BYTES
 
#define CMPCI_REG_DMA0_INTR_SAMPLES   CMPCI_REG_DMA0_SAMPLES
 
#define CMPCI_REG_DMA1_MAX_SAMPLES   CMPCI_REG_DMA1_BYTES
 
#define CMPCI_REG_DMA1_INTR_SAMPLES   CMPCI_REG_DMA1_SAMPLES
 
#define CMPCI_NON_SB16_CONTROL   0xff
 
#define DEB(x)   /* x */
 
#define DEBMIX(x)   /* x */
 
#define NUM_CMI_RATES   (sizeof(cmi_rates)/sizeof(cmi_rates[0]))
 
#define MIXER_GAIN_REG_RTOL(r)   (r - 1)
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static u_int32_t cmi_rd (struct sc_info *sc, int regno, int size)
 
static void cmi_wr (struct sc_info *sc, int regno, u_int32_t data, int size)
 
static void cmi_partial_wr4 (struct sc_info *sc, int reg, int shift, u_int32_t mask, u_int32_t val)
 
static void cmi_clr4 (struct sc_info *sc, int reg, u_int32_t mask)
 
static void cmi_set4 (struct sc_info *sc, int reg, u_int32_t mask)
 
static u_int32_t cmpci_rate_to_regvalue (int rate)
 
static int cmpci_regvalue_to_rate (u_int32_t r)
 
static void cmi_dma_prog (struct sc_info *sc, struct sc_chinfo *ch, u_int32_t base)
 
static void cmi_ch0_start (struct sc_info *sc, struct sc_chinfo *ch)
 
static u_int32_t cmi_ch0_stop (struct sc_info *sc, struct sc_chinfo *ch)
 
static void cmi_ch1_start (struct sc_info *sc, struct sc_chinfo *ch)
 
static u_int32_t cmi_ch1_stop (struct sc_info *sc, struct sc_chinfo *ch)
 
static void cmi_spdif_speed (struct sc_info *sc, int speed)
 
static void * cmichan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
static int cmichan_setformat (kobj_t obj, void *data, u_int32_t format)
 
static u_int32_t cmichan_setspeed (kobj_t obj, void *data, u_int32_t speed)
 
static u_int32_t cmichan_setblocksize (kobj_t obj, void *data, u_int32_t blocksize)
 
static int cmichan_trigger (kobj_t obj, void *data, int go)
 
static u_int32_t cmichan_getptr (kobj_t obj, void *data)
 
static void cmi_intr (void *data)
 
static struct pcmchan_capscmichan_getcaps (kobj_t obj, void *data)
 
 CHANNEL_DECLARE (cmichan)
 
static void cmimix_wr (struct sc_info *sc, u_int8_t port, u_int8_t val)
 
static u_int8_t cmimix_rd (struct sc_info *sc, u_int8_t port)
 
static int cmimix_init (struct snd_mixer *m)
 
static int cmimix_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static u_int32_t cmimix_setrecsrc (struct snd_mixer *m, u_int32_t src)
 
static int cmi_initsys (struct sc_info *sc)
 
 MIXER_DECLARE (cmi_mixer)
 
static unsigned char cmi_mread (struct mpu401 *arg, void *sc, int reg)
 
static void cmi_mwrite (struct mpu401 *arg, void *sc, int reg, unsigned char b)
 
static int cmi_muninit (struct mpu401 *arg, void *cookie)
 
static DEFINE_CLASS (cmi_mpu, cmi_mpu_methods, 0)
 
static void cmi_midiattach (struct sc_info *sc)
 
static void cmi_power (struct sc_info *sc, int state)
 
static int cmi_init (struct sc_info *sc)
 
static void cmi_uninit (struct sc_info *sc)
 
static int cmi_probe (device_t dev)
 
static int cmi_attach (device_t dev)
 
static int cmi_detach (device_t dev)
 
static int cmi_suspend (device_t dev)
 
static int cmi_resume (device_t dev)
 
 DRIVER_MODULE (snd_cmi, pci, cmi_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_cmi, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_DEPEND (snd_cmi, midi, 1, 1, 1)
 
 MODULE_VERSION (snd_cmi, 1)
 

Variables

static u_int32_t cmi_fmt []
 
static struct pcmchan_caps cmi_caps = {5512, 48000, cmi_fmt, 0}
 
static int cmi_rates []
 
static kobj_method_t cmichan_methods []
 
struct sb16props cmt [SOUND_MIXER_NRDEVICES]
 
static kobj_method_t cmi_mixer_methods []
 
static kobj_method_t cmi_mpu_methods []
 
static device_method_t cmi_methods []
 
static driver_t cmi_driver
 

Macro Definition Documentation

◆ CMI120_USB_ID

#define CMI120_USB_ID   0x01030d8c

Definition at line 71 of file cmi.c.

◆ CMI8338A_PCI_ID

#define CMI8338A_PCI_ID   0x010013f6

Definition at line 67 of file cmi.c.

◆ CMI8338B_PCI_ID

#define CMI8338B_PCI_ID   0x010113f6

Definition at line 68 of file cmi.c.

◆ CMI8738_PCI_ID

#define CMI8738_PCI_ID   0x011113f6

Definition at line 69 of file cmi.c.

◆ CMI8738B_PCI_ID

#define CMI8738B_PCI_ID   0x011213f6

Definition at line 70 of file cmi.c.

◆ CMI_DEFAULT_BUFSZ

#define CMI_DEFAULT_BUFSZ   16384

Definition at line 74 of file cmi.c.

◆ CMI_INTR_PER_BUFFER

#define CMI_INTR_PER_BUFFER   2

Definition at line 77 of file cmi.c.

◆ CMPCI_NON_SB16_CONTROL

#define CMPCI_NON_SB16_CONTROL   0xff

Definition at line 86 of file cmi.c.

◆ CMPCI_REG_DMA0_INTR_SAMPLES

#define CMPCI_REG_DMA0_INTR_SAMPLES   CMPCI_REG_DMA0_SAMPLES

Definition at line 81 of file cmi.c.

◆ CMPCI_REG_DMA0_MAX_SAMPLES

#define CMPCI_REG_DMA0_MAX_SAMPLES   CMPCI_REG_DMA0_BYTES

Definition at line 80 of file cmi.c.

◆ CMPCI_REG_DMA1_INTR_SAMPLES

#define CMPCI_REG_DMA1_INTR_SAMPLES   CMPCI_REG_DMA1_SAMPLES

Definition at line 83 of file cmi.c.

◆ CMPCI_REG_DMA1_MAX_SAMPLES

#define CMPCI_REG_DMA1_MAX_SAMPLES   CMPCI_REG_DMA1_BYTES

Definition at line 82 of file cmi.c.

◆ DEB

#define DEB (   x)    /* x */

Definition at line 91 of file cmi.c.

◆ DEBMIX

#define DEBMIX (   x)    /* x */

Definition at line 95 of file cmi.c.

◆ MIXER_GAIN_REG_RTOL

#define MIXER_GAIN_REG_RTOL (   r)    (r - 1)

Definition at line 648 of file cmi.c.

◆ NUM_CMI_RATES

#define NUM_CMI_RATES   (sizeof(cmi_rates)/sizeof(cmi_rates[0]))

Definition at line 219 of file cmi.c.

Function Documentation

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( cmichan  )

◆ cmi_attach()

◆ cmi_ch0_start()

static void cmi_ch0_start ( struct sc_info sc,
struct sc_chinfo ch 
)
static

Definition at line 273 of file cmi.c.

References cmi_dma_prog(), cmi_set4(), CMPCI_REG_CH0_ENABLE, CMPCI_REG_CH0_INTR_ENABLE, CMPCI_REG_DMA0_BASE, CMPCI_REG_FUNC_0, CMPCI_REG_INTR_CTRL, and sc_chinfo::dma_active.

Referenced by cmi_resume(), and cmichan_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_ch0_stop()

static u_int32_t cmi_ch0_stop ( struct sc_info sc,
struct sc_chinfo ch 
)
static

Definition at line 285 of file cmi.c.

References cmi_clr4(), cmi_set4(), CMPCI_REG_CH0_ENABLE, CMPCI_REG_CH0_INTR_ENABLE, CMPCI_REG_CH0_RESET, CMPCI_REG_FUNC_0, CMPCI_REG_INTR_CTRL, sc_chinfo::dma_active, and r.

Referenced by cmi_suspend(), and cmichan_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_ch1_start()

static void cmi_ch1_start ( struct sc_info sc,
struct sc_chinfo ch 
)
static

Definition at line 298 of file cmi.c.

References cmi_dma_prog(), cmi_set4(), CMPCI_REG_CH1_ENABLE, CMPCI_REG_CH1_INTR_ENABLE, CMPCI_REG_DMA1_BASE, CMPCI_REG_FUNC_0, CMPCI_REG_INTR_CTRL, DEB, and sc_chinfo::dma_active.

Referenced by cmi_resume(), and cmichan_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_ch1_stop()

static u_int32_t cmi_ch1_stop ( struct sc_info sc,
struct sc_chinfo ch 
)
static

Definition at line 310 of file cmi.c.

References cmi_clr4(), cmi_set4(), CMPCI_REG_CH1_ENABLE, CMPCI_REG_CH1_INTR_ENABLE, CMPCI_REG_CH1_RESET, CMPCI_REG_FUNC_0, CMPCI_REG_INTR_CTRL, sc_chinfo::dma_active, and r.

Referenced by cmi_suspend(), and cmichan_trigger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_clr4()

static void cmi_clr4 ( struct sc_info sc,
int  reg,
u_int32_t  mask 
)
static

Definition at line 195 of file cmi.c.

References cmi_rd(), cmi_wr(), r, and reg.

Referenced by cmi_ch0_stop(), cmi_ch1_stop(), cmi_init(), cmi_intr(), cmi_midiattach(), cmi_power(), and cmi_uninit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_detach()

static int cmi_detach ( device_t  dev)
static

◆ cmi_dma_prog()

static void cmi_dma_prog ( struct sc_info sc,
struct sc_chinfo ch,
u_int32_t  base 
)
static

Definition at line 256 of file cmi.c.

References base, sc_chinfo::bps, sc_chinfo::buffer, CMI_INTR_PER_BUFFER, cmi_wr(), sc_chinfo::phys_buf, sndbuf_getbufaddr(), and sndbuf_getsize().

Referenced by cmi_ch0_start(), cmi_ch1_start(), and cmichan_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_init()

static int cmi_init ( struct sc_info sc)
static

◆ cmi_initsys()

static int cmi_initsys ( struct sc_info sc)
static

Definition at line 752 of file cmi.c.

References sc_info::dev, and sc_info::spdif_enabled.

Referenced by cmi_attach().

Here is the caller graph for this function:

◆ cmi_intr()

static void cmi_intr ( void *  data)
static

◆ cmi_midiattach()

static void cmi_midiattach ( struct sc_info sc)
static

Definition at line 822 of file cmi.c.

References cmi_clr4(), cmi_intr(), cmi_set4(), CMPCI_REG_FUNC_1, CMPCI_REG_LEGACY_CTRL, CMPCI_REG_UART_ENABLE, CMPCI_REG_VMPUSEL_MASK, CMPCI_REG_VMPUSEL_SHIFT, sc_info::mpu, mpu401_init(), and sc_info::mpu_intr.

Referenced by cmi_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_mread()

static unsigned char cmi_mread ( struct mpu401 arg,
void *  sc,
int  reg 
)
static

Definition at line 782 of file cmi.c.

References reg.

◆ cmi_muninit()

static int cmi_muninit ( struct mpu401 arg,
void *  cookie 
)
static

Definition at line 800 of file cmi.c.

References sc_info::lock, sc_info::mpu, sc_info::mpu_intr, snd_mtxlock, and snd_mtxunlock.

◆ cmi_mwrite()

static void cmi_mwrite ( struct mpu401 arg,
void *  sc,
int  reg,
unsigned char  b 
)
static

Definition at line 793 of file cmi.c.

References b, and reg.

◆ cmi_partial_wr4()

static void cmi_partial_wr4 ( struct sc_info sc,
int  reg,
int  shift,
u_int32_t  mask,
u_int32_t  val 
)
static

Definition at line 183 of file cmi.c.

References cmi_rd(), cmi_wr(), mask, r, reg, and val.

Referenced by cmi_spdif_speed(), cmichan_setformat(), and cmichan_setspeed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_power()

static void cmi_power ( struct sc_info sc,
int  state 
)
static

Definition at line 848 of file cmi.c.

References cmi_clr4(), cmi_set4(), CMPCI_REG_MISC, CMPCI_REG_POWER_DOWN, and state.

Referenced by cmi_attach(), cmi_detach(), cmi_resume(), and cmi_suspend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_probe()

static int cmi_probe ( device_t  dev)
static

Definition at line 908 of file cmi.c.

References CMI120_USB_ID, CMI8338A_PCI_ID, CMI8338B_PCI_ID, CMI8738_PCI_ID, CMI8738B_PCI_ID, and dev.

◆ cmi_rd()

static u_int32_t cmi_rd ( struct sc_info sc,
int  regno,
int  size 
)
static

Definition at line 151 of file cmi.c.

References DEB, regno, sc_info::sh, size, and sc_info::st.

Referenced by cmi_clr4(), cmi_intr(), cmi_partial_wr4(), cmi_set4(), cmichan_getptr(), cmichan_setspeed(), cmimix_rd(), and cmimix_set().

Here is the caller graph for this function:

◆ cmi_resume()

static int cmi_resume ( device_t  dev)
static

◆ cmi_set4()

static void cmi_set4 ( struct sc_info sc,
int  reg,
u_int32_t  mask 
)
static

Definition at line 205 of file cmi.c.

References cmi_rd(), cmi_wr(), mask, r, and reg.

Referenced by cmi_ch0_start(), cmi_ch0_stop(), cmi_ch1_start(), cmi_ch1_stop(), cmi_init(), cmi_intr(), cmi_midiattach(), and cmi_power().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_spdif_speed()

static void cmi_spdif_speed ( struct sc_info sc,
int  speed 
)
static

Definition at line 323 of file cmi.c.

References cmi_partial_wr4(), CMPCI_REG_FUNC_1, CMPCI_REG_LEGACY_CTRL, CMPCI_REG_MISC, CMPCI_REG_SPDIF0_ENABLE, CMPCI_REG_SPDIF_48K, CMPCI_REG_W_SPDIF_48L, CMPCI_REG_XSPDIF_ENABLE, and speed.

Referenced by cmichan_setspeed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_suspend()

static int cmi_suspend ( device_t  dev)
static

Definition at line 1048 of file cmi.c.

References cmi_ch0_stop(), cmi_ch1_stop(), cmi_power(), dev, sc_chinfo::dma_was_active, sc_info::lock, sc_info::pch, pcm_getdevinfo(), sc_info::rch, snd_mtxlock, and snd_mtxunlock.

Here is the call graph for this function:

◆ cmi_uninit()

static void cmi_uninit ( struct sc_info sc)
static

Definition at line 890 of file cmi.c.

References cmi_clr4(), CMPCI_REG_CH0_ENABLE, CMPCI_REG_CH0_INTR_ENABLE, CMPCI_REG_CH1_ENABLE, CMPCI_REG_CH1_INTR_ENABLE, CMPCI_REG_FUNC_0, CMPCI_REG_FUNC_1, CMPCI_REG_INTR_CTRL, CMPCI_REG_TDMA_INTR_ENABLE, CMPCI_REG_UART_ENABLE, sc_info::mpu, and sc_info::mpu_intr.

Referenced by cmi_detach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmi_wr()

static void cmi_wr ( struct sc_info sc,
int  regno,
u_int32_t  data,
int  size 
)
static

Definition at line 167 of file cmi.c.

References data, regno, sc_info::sh, size, and sc_info::st.

Referenced by cmi_clr4(), cmi_dma_prog(), cmi_partial_wr4(), cmi_set4(), cmimix_rd(), cmimix_set(), and cmimix_wr().

Here is the caller graph for this function:

◆ cmichan_getcaps()

static struct pcmchan_caps * cmichan_getcaps ( kobj_t  obj,
void *  data 
)
static

Definition at line 582 of file cmi.c.

References cmi_caps.

◆ cmichan_getptr()

static u_int32_t cmichan_getptr ( kobj_t  obj,
void *  data 
)
static

◆ cmichan_init()

static void * cmichan_init ( kobj_t  obj,
void *  devinfo,
struct snd_dbuf b,
struct pcm_channel c,
int  dir 
)
static

◆ cmichan_setblocksize()

static u_int32_t cmichan_setblocksize ( kobj_t  obj,
void *  data,
u_int32_t  blocksize 
)
static

Definition at line 466 of file cmi.c.

References blocksize, sc_chinfo::buffer, sc_info::bufsz, sc_info::ch, CMI_INTR_PER_BUFFER, data, sc_chinfo::parent, and sndbuf_resize().

Here is the call graph for this function:

◆ cmichan_setformat()

static int cmichan_setformat ( kobj_t  obj,
void *  data,
u_int32_t  format 
)
static

◆ cmichan_setspeed()

static u_int32_t cmichan_setspeed ( kobj_t  obj,
void *  data,
u_int32_t  speed 
)
static

◆ cmichan_trigger()

static int cmichan_trigger ( kobj_t  obj,
void *  data,
int  go 
)
static

◆ cmimix_init()

static int cmimix_init ( struct snd_mixer m)
static

◆ cmimix_rd()

static u_int8_t cmimix_rd ( struct sc_info sc,
u_int8_t  port 
)
static

Definition at line 610 of file cmi.c.

References cmi_rd(), cmi_wr(), CMPCI_REG_SBADDR, and CMPCI_REG_SBDATA.

Referenced by cmimix_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmimix_set()

static int cmimix_set ( struct snd_mixer m,
unsigned  dev,
unsigned  left,
unsigned  right 
)
static

◆ cmimix_setrecsrc()

static u_int32_t cmimix_setrecsrc ( struct snd_mixer m,
u_int32_t  src 
)
static

Definition at line 723 of file cmi.c.

References cmimix_wr(), CMPCI_SB16_MIXER_ADCMIX_L, CMPCI_SB16_MIXER_ADCMIX_R, CMPCI_SB16_MIXER_SRC_R_TO_L, cmt, DEBMIX, sb16props::iselect, m, mix_getdevinfo(), src, and stereo.

Here is the call graph for this function:

◆ cmimix_wr()

static void cmimix_wr ( struct sc_info sc,
u_int8_t  port,
u_int8_t  val 
)
static

Definition at line 603 of file cmi.c.

References cmi_wr(), CMPCI_REG_SBADDR, CMPCI_REG_SBDATA, and val.

Referenced by cmimix_init(), cmimix_set(), and cmimix_setrecsrc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmpci_rate_to_regvalue()

static u_int32_t cmpci_rate_to_regvalue ( int  rate)
static

Definition at line 225 of file cmi.c.

References cmi_rates, DEB, NUM_CMI_RATES, r, and rate.

Referenced by cmichan_setspeed().

Here is the caller graph for this function:

◆ cmpci_regvalue_to_rate()

static int cmpci_regvalue_to_rate ( u_int32_t  r)
static

Definition at line 242 of file cmi.c.

References cmi_rates, DEB, and r.

Referenced by cmichan_setspeed().

Here is the caller graph for this function:

◆ DEFINE_CLASS()

static DEFINE_CLASS ( cmi_mpu  ,
cmi_mpu_methods  ,
 
)
static

◆ DRIVER_MODULE()

DRIVER_MODULE ( snd_cmi  ,
pci  ,
cmi_driver  ,
pcm_devclass  ,
,
 
)

◆ MIXER_DECLARE()

MIXER_DECLARE ( cmi_mixer  )

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( snd_cmi  ,
midi  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

MODULE_DEPEND ( snd_cmi  ,
sound  ,
SOUND_MINVER  ,
SOUND_PREFVER  ,
SOUND_MAXVER   
)

◆ MODULE_VERSION()

MODULE_VERSION ( snd_cmi  ,
 
)

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

Variable Documentation

◆ cmi_caps

struct pcmchan_caps cmi_caps = {5512, 48000, cmi_fmt, 0}
static

Definition at line 145 of file cmi.c.

Referenced by cmichan_getcaps().

◆ cmi_driver

driver_t cmi_driver
static
Initial value:
= {
"pcm",
}
static device_method_t cmi_methods[]
Definition: cmi.c:1094
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 1103 of file cmi.c.

◆ cmi_fmt

u_int32_t cmi_fmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_U8, 1, 0),
SND_FORMAT(AFMT_U8, 2, 0),
SND_FORMAT(AFMT_S16_LE, 1, 0),
SND_FORMAT(AFMT_S16_LE, 2, 0),
0
}
#define SND_FORMAT(f, c, e)
Definition: sound.h:238

Definition at line 137 of file cmi.c.

◆ cmi_methods

device_method_t cmi_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, cmi_probe),
DEVMETHOD(device_attach, cmi_attach),
DEVMETHOD(device_detach, cmi_detach),
DEVMETHOD(device_resume, cmi_resume),
DEVMETHOD(device_suspend, cmi_suspend),
{ 0, 0 }
}
static int cmi_probe(device_t dev)
Definition: cmi.c:908
static int cmi_suspend(device_t dev)
Definition: cmi.c:1048
static int cmi_resume(device_t dev)
Definition: cmi.c:1061
static int cmi_attach(device_t dev)
Definition: cmi.c:932
static int cmi_detach(device_t dev)
Definition: cmi.c:1020

Definition at line 1094 of file cmi.c.

◆ cmi_mixer_methods

kobj_method_t cmi_mixer_methods[]
static
Initial value:
= {
KOBJMETHOD(mixer_init, cmimix_init),
KOBJMETHOD(mixer_set, cmimix_set),
}
static int cmimix_init(struct snd_mixer *m)
Definition: cmi.c:651
static u_int32_t cmimix_setrecsrc(struct snd_mixer *m, u_int32_t src)
Definition: cmi.c:723
static int cmimix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: cmi.c:675
#define KOBJMETHOD_END
Definition: midi.c:76
static int mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
Definition: mixer.c:373
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
Definition: mixer.c:725
static int mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
Definition: mixer.c:247

Definition at line 769 of file cmi.c.

◆ cmi_mpu_methods

kobj_method_t cmi_mpu_methods[]
static
Initial value:
= {
KOBJMETHOD(mpufoi_read, cmi_mread),
KOBJMETHOD(mpufoi_write, cmi_mwrite),
KOBJMETHOD(mpufoi_uninit, cmi_muninit),
}
static unsigned char cmi_mread(struct mpu401 *arg, void *sc, int reg)
Definition: cmi.c:782
static int cmi_muninit(struct mpu401 *arg, void *cookie)
Definition: cmi.c:800
static void cmi_mwrite(struct mpu401 *arg, void *sc, int reg, unsigned char b)
Definition: cmi.c:793

Definition at line 812 of file cmi.c.

◆ cmi_rates

int cmi_rates[]
static
Initial value:
= {5512, 8000, 11025, 16000,
22050, 32000, 44100, 48000}

Definition at line 217 of file cmi.c.

Referenced by cmpci_rate_to_regvalue(), and cmpci_regvalue_to_rate().

◆ cmichan_methods

kobj_method_t cmichan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, cmichan_init),
KOBJMETHOD(channel_setformat, cmichan_setformat),
KOBJMETHOD(channel_setspeed, cmichan_setspeed),
KOBJMETHOD(channel_setblocksize, cmichan_setblocksize),
KOBJMETHOD(channel_trigger, cmichan_trigger),
KOBJMETHOD(channel_getptr, cmichan_getptr),
KOBJMETHOD(channel_getcaps, cmichan_getcaps),
}
static u_int32_t cmichan_setspeed(kobj_t obj, void *data, u_int32_t speed)
Definition: cmi.c:420
static u_int32_t cmichan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
Definition: cmi.c:466
static int cmichan_trigger(kobj_t obj, void *data, int go)
Definition: cmi.c:481
static u_int32_t cmichan_getptr(kobj_t obj, void *data)
Definition: cmi.c:516
static void * cmichan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
Definition: cmi.c:347
static struct pcmchan_caps * cmichan_getcaps(kobj_t obj, void *data)
Definition: cmi.c:582
static int cmichan_setformat(kobj_t obj, void *data, u_int32_t format)
Definition: cmi.c:378

Definition at line 587 of file cmi.c.

◆ cmt

struct sb16props cmt[SOUND_MIXER_NRDEVICES]
Initial value:
= {
[SOUND_MIXER_SYNTH] = {CMPCI_SB16_MIXER_FM_R, 1, 1, 5,
[SOUND_MIXER_CD] = {CMPCI_SB16_MIXER_CDDA_R, 1, 1, 5,
[SOUND_MIXER_LINE] = {CMPCI_SB16_MIXER_LINE_R, 1, 1, 5,
[SOUND_MIXER_MIC] = {CMPCI_SB16_MIXER_MIC, 0, 1, 5,
[SOUND_MIXER_SPEAKER] = {CMPCI_SB16_MIXER_SPEAKER, 0, 0, 2, 0, 0},
[SOUND_MIXER_PCM] = {CMPCI_SB16_MIXER_VOICE_R, 1, 0, 5, 0, 0},
[SOUND_MIXER_VOLUME] = {CMPCI_SB16_MIXER_MASTER_R, 1, 0, 5, 0, 0},
[SOUND_MIXER_IGAIN] = {CMPCI_SB16_MIXER_INGAIN_R, 1, 0, 2, 0, 0},
[SOUND_MIXER_OGAIN] = {CMPCI_SB16_MIXER_OUTGAIN_R, 1, 0, 2, 0, 0},
[SOUND_MIXER_BASS] = {CMPCI_SB16_MIXER_BASS_R, 1, 0, 4, 0, 0},
[SOUND_MIXER_TREBLE] = {CMPCI_SB16_MIXER_TREBLE_R, 1, 0, 4, 0, 0},
[SOUND_MIXER_MONITOR] = {CMPCI_NON_SB16_CONTROL, 0, 1, 4, 0},
}
#define CMPCI_NON_SB16_CONTROL
Definition: cmi.c:86
#define CMPCI_SB16_SW_MIC
Definition: cmireg.h:141
#define CMPCI_SB16_SW_LINE
Definition: cmireg.h:147
#define CMPCI_SB16_MIXER_TREBLE_R
Definition: cmireg.h:165
#define CMPCI_SB16_MIXER_CDDA_R
Definition: cmireg.h:135
#define CMPCI_SB16_MIXER_MASTER_R
Definition: cmireg.h:129
#define CMPCI_SB16_MIXER_BASS_R
Definition: cmireg.h:167
#define CMPCI_SB16_SW_FM
Definition: cmireg.h:150
#define CMPCI_SB16_MIXER_OUTGAIN_R
Definition: cmireg.h:162
#define CMPCI_SB16_MIXER_VOICE_R
Definition: cmireg.h:131
#define CMPCI_SB16_MIXER_LINE_R
Definition: cmireg.h:137
#define CMPCI_SB16_MIXER_INGAIN_R
Definition: cmireg.h:160
#define CMPCI_SB16_MIXER_FM_R
Definition: cmireg.h:133
#define CMPCI_SB16_MIXER_FM_SRC_R
Definition: cmireg.h:153
#define CMPCI_SB16_MIXER_MIC_SRC
Definition: cmireg.h:156
#define CMPCI_SB16_MIXER_SPEAKER
Definition: cmireg.h:139
#define CMPCI_SB16_MIXER_MIC
Definition: cmireg.h:138
#define CMPCI_SB16_SW_CD
Definition: cmireg.h:144
#define CMPCI_SB16_MIXER_CD_SRC_R
Definition: cmireg.h:155
#define CMPCI_SB16_MIXER_LINE_SRC_R
Definition: cmireg.h:154

Referenced by cmimix_init(), cmimix_set(), and cmimix_setrecsrc().