FreeBSD kernel sound device code
emu10kx-pcm.c File Reference
#include <sys/param.h>
#include <sys/types.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <sys/systm.h>
#include <sys/sbuf.h>
#include <sys/queue.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <dev/sound/chip.h>
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
#include "mixer_if.h"
#include <dev/sound/pci/emuxkireg.h>
#include <dev/sound/pci/emu10kx.h>
Include dependency graph for emu10kx-pcm.c:

Go to the source code of this file.

Data Structures

struct  emu_pcm_pchinfo
 
struct  emu_pcm_rchinfo
 
struct  emu_pcm_info
 
struct  emu_dspmix_props_k1
 
struct  emu_dspmix_props_k2
 

Macros

#define MAX_CHANNELS   4
 
#define AC97LEFT(x)   ((x & 0x7F00)>>8)
 
#define AC97RIGHT(x)   (x & 0x007F)
 
#define AC97MUTE(x)   ((x & 0x8000)>>15)
 
#define BIT4_TO100(x)   (100-(x)*100/(0x0f))
 
#define BIT6_TO100(x)   (100-(x)*100/(0x3f))
 
#define BIT4_TO255(x)   (255-(x)*255/(0x0f))
 
#define BIT6_TO255(x)   (255-(x)*255/(0x3f))
 
#define V100_TOBIT6(x)   (0x3f*(100-x)/100)
 
#define V100_TOBIT4(x)   (0x0f*(100-x)/100)
 
#define AC97ENCODE(x_muted, x_left, x_right)   (((x_muted & 1)<<15) | ((x_left & 0x3f)<<8) | (x_right & 0x3f))
 

Functions

static uint32_t emu_pcm_intr (void *pcm, uint32_t stat)
 
static int emu_dspmixer_init (struct snd_mixer *m)
 
static int emu_dspmixer_uninit (struct snd_mixer *m)
 
static int emu_dspmixer_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static u_int32_t emu_dspmixer_setrecsrc (struct snd_mixer *m, u_int32_t src)
 
 MIXER_DECLARE (emudspmixer)
 
static int emu_efxmixer_init (struct snd_mixer *m)
 
static int emu_efxmixer_set (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static u_int32_t emu_efxmixer_setrecsrc (struct snd_mixer *m __unused, u_int32_t src __unused)
 
 MIXER_DECLARE (emuefxmixer)
 
static int emu_ac97_read_emulation (struct emu_pcm_info *sc, int regno)
 
static void emu_ac97_write_emulation (struct emu_pcm_info *sc, int regno, uint32_t data)
 
static int emu_erdcd (kobj_t obj __unused, void *devinfo, int regno)
 
static int emu_ewrcd (kobj_t obj __unused, void *devinfo, int regno, uint32_t data)
 
 AC97_DECLARE (emu_eac97)
 
static int emu_rdcd (kobj_t obj __unused, void *devinfo, int regno)
 
static int emu_wrcd (kobj_t obj __unused, void *devinfo, int regno, uint32_t data)
 
 AC97_DECLARE (emu_ac97)
 
static int emu_k1_recval (int speed)
 
static int emu_k2_recval (int speed)
 
static void * emupchan_init (kobj_t obj __unused, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir __unused)
 
static int emupchan_free (kobj_t obj __unused, void *c_devinfo)
 
static int emupchan_setformat (kobj_t obj __unused, void *c_devinfo, uint32_t format)
 
static uint32_t emupchan_setspeed (kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 
static uint32_t emupchan_setblocksize (kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
 
static int emupchan_trigger (kobj_t obj __unused, void *c_devinfo, int go)
 
static uint32_t emupchan_getptr (kobj_t obj __unused, void *c_devinfo)
 
static struct pcmchan_capsemupchan_getcaps (kobj_t obj __unused, void *c_devinfo __unused)
 
 CHANNEL_DECLARE (emupchan)
 
static void * emurchan_init (kobj_t obj __unused, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir __unused)
 
static int emurchan_free (kobj_t obj __unused, void *c_devinfo)
 
static int emurchan_setformat (kobj_t obj __unused, void *c_devinfo, uint32_t format)
 
static uint32_t emurchan_setspeed (kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 
static uint32_t emurchan_setblocksize (kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
 
static int emurchan_trigger (kobj_t obj __unused, void *c_devinfo, int go)
 
static uint32_t emurchan_getptr (kobj_t obj __unused, void *c_devinfo)
 
static struct pcmchan_capsemurchan_getcaps (kobj_t obj __unused, void *c_devinfo __unused)
 
 CHANNEL_DECLARE (emurchan)
 
static void * emufxrchan_init (kobj_t obj __unused, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir __unused)
 
static int emufxrchan_setformat (kobj_t obj __unused, void *c_devinfo __unused, uint32_t format)
 
static uint32_t emufxrchan_setspeed (kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 
static uint32_t emufxrchan_setblocksize (kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
 
static int emufxrchan_trigger (kobj_t obj __unused, void *c_devinfo, int go)
 
static uint32_t emufxrchan_getptr (kobj_t obj __unused, void *c_devinfo)
 
static struct pcmchan_capsemufxrchan_getcaps (kobj_t obj __unused, void *c_devinfo)
 
static int emufxrchan_getrates (kobj_t obj __unused, void *c_devinfo, int **rates)
 
 CHANNEL_DECLARE (emufxrchan)
 
static int emu_pcm_init (struct emu_pcm_info *sc)
 
static int emu_pcm_uninit (struct emu_pcm_info *sc __unused)
 
static int emu_pcm_probe (device_t dev)
 
static int emu_pcm_attach (device_t dev)
 
static int emu_pcm_detach (device_t dev)
 
 DRIVER_MODULE (snd_emu10kx_pcm, emu10kx, emu_pcm_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_emu10kx_pcm, snd_emu10kx, SND_EMU10KX_MINVER, SND_EMU10KX_PREFVER, SND_EMU10KX_MAXVER)
 
 MODULE_DEPEND (snd_emu10kx_pcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_emu10kx_pcm, SND_EMU10KX_PREFVER)
 

Variables

static uint32_t emu_rfmt_adc []
 
static struct pcmchan_caps emu_reccaps_adc
 
static uint32_t emu_rfmt_efx []
 
static struct pcmchan_caps emu_reccaps_efx_live
 
static struct pcmchan_caps emu_reccaps_efx_audigy
 
static int emu_rates_live []
 
static int emu_rates_audigy []
 
static uint32_t emu_pfmt []
 
static uint32_t emu_pfmt_mono []
 
static struct pcmchan_caps emu_playcaps = {4000, 48000, emu_pfmt, 0}
 
static struct pcmchan_caps emu_playcaps_mono = {4000, 48000, emu_pfmt_mono, 0}
 
static int emu10k1_adcspeed [8] = {48000, 44100, 32000, 24000, 22050, 16000, 11025, 8000}
 
static int emu10k2_adcspeed [9] = {48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000}
 
static const struct emu_dspmix_props_k1 dspmix_k1 [SOUND_MIXER_NRDEVICES]
 
static const struct emu_dspmix_props_k2 dspmix_k2 [SOUND_MIXER_NRDEVICES]
 
static kobj_method_t emudspmixer_methods []
 
static kobj_method_t emuefxmixer_methods []
 
static kobj_method_t emu_eac97_methods []
 
static kobj_method_t emu_ac97_methods []
 
static kobj_method_t emupchan_methods []
 
static kobj_method_t emurchan_methods []
 
static kobj_method_t emufxrchan_methods []
 
static device_method_t emu_pcm_methods []
 
static driver_t emu_pcm_driver
 

Macro Definition Documentation

◆ AC97ENCODE

#define AC97ENCODE (   x_muted,
  x_left,
  x_right 
)    (((x_muted & 1)<<15) | ((x_left & 0x3f)<<8) | (x_right & 0x3f))

Definition at line 529 of file emu10kx-pcm.c.

◆ AC97LEFT

#define AC97LEFT (   x)    ((x & 0x7F00)>>8)

Definition at line 520 of file emu10kx-pcm.c.

◆ AC97MUTE

#define AC97MUTE (   x)    ((x & 0x8000)>>15)

Definition at line 522 of file emu10kx-pcm.c.

◆ AC97RIGHT

#define AC97RIGHT (   x)    (x & 0x007F)

Definition at line 521 of file emu10kx-pcm.c.

◆ BIT4_TO100

#define BIT4_TO100 (   x)    (100-(x)*100/(0x0f))

Definition at line 523 of file emu10kx-pcm.c.

◆ BIT4_TO255

#define BIT4_TO255 (   x)    (255-(x)*255/(0x0f))

Definition at line 525 of file emu10kx-pcm.c.

◆ BIT6_TO100

#define BIT6_TO100 (   x)    (100-(x)*100/(0x3f))

Definition at line 524 of file emu10kx-pcm.c.

◆ BIT6_TO255

#define BIT6_TO255 (   x)    (255-(x)*255/(0x3f))

Definition at line 526 of file emu10kx-pcm.c.

◆ MAX_CHANNELS

#define MAX_CHANNELS   4

Definition at line 89 of file emu10kx-pcm.c.

◆ V100_TOBIT4

#define V100_TOBIT4 (   x)    (0x0f*(100-x)/100)

Definition at line 528 of file emu10kx-pcm.c.

◆ V100_TOBIT6

#define V100_TOBIT6 (   x)    (0x3f*(100-x)/100)

Definition at line 527 of file emu10kx-pcm.c.

Function Documentation

◆ AC97_DECLARE() [1/2]

AC97_DECLARE ( emu_ac97  )

◆ AC97_DECLARE() [2/2]

AC97_DECLARE ( emu_eac97  )

◆ CHANNEL_DECLARE() [1/3]

CHANNEL_DECLARE ( emufxrchan  )

◆ CHANNEL_DECLARE() [2/3]

CHANNEL_DECLARE ( emupchan  )

◆ CHANNEL_DECLARE() [3/3]

CHANNEL_DECLARE ( emurchan  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( snd_emu10kx_pcm  ,
emu10kx  ,
emu_pcm_driver  ,
pcm_devclass  ,
,
 
)

◆ emu_ac97_read_emulation()

static int emu_ac97_read_emulation ( struct emu_pcm_info sc,
int  regno 
)
static

Definition at line 532 of file emu10kx-pcm.c.

References AC97_MIX_MASTER, AC97_MIX_PCM, AC97_MIX_RGAIN, AC97_REG_RECSEL, emu_pcm_info::ac97_state, emu_pcm_info::card, EMU_AC97ADDR, EMU_AC97DATA, emu_rd(), emu_wr(), and regno.

Referenced by emu_erdcd().

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

◆ emu_ac97_write_emulation()

static void emu_ac97_write_emulation ( struct emu_pcm_info sc,
int  regno,
uint32_t  data 
)
static

◆ emu_dspmixer_init()

◆ emu_dspmixer_set()

◆ emu_dspmixer_setrecsrc()

◆ emu_dspmixer_uninit()

static int emu_dspmixer_uninit ( struct snd_mixer m)
static

Definition at line 258 of file emu10kx-pcm.c.

References m, mix_getdevinfo(), mixer_delete(), and emu_pcm_info::sm.

Here is the call graph for this function:

◆ emu_efxmixer_init()

static int emu_efxmixer_init ( struct snd_mixer m)
static

Definition at line 481 of file emu10kx-pcm.c.

References m, mix_setdevs(), and mix_setrecdevs().

Here is the call graph for this function:

◆ emu_efxmixer_set()

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

Definition at line 489 of file emu10kx-pcm.c.

References left, and right.

◆ emu_efxmixer_setrecsrc()

static u_int32_t emu_efxmixer_setrecsrc ( struct snd_mixer *m  __unused,
u_int32_t src  __unused 
)
static

Definition at line 496 of file emu10kx-pcm.c.

◆ emu_erdcd()

static int emu_erdcd ( kobj_t obj  __unused,
void *  devinfo,
int  regno 
)
static

Definition at line 632 of file emu10kx-pcm.c.

References devinfo, emu_ac97_read_emulation(), and regno.

Here is the call graph for this function:

◆ emu_ewrcd()

static int emu_ewrcd ( kobj_t obj  __unused,
void *  devinfo,
int  regno,
uint32_t  data 
)
static

Definition at line 640 of file emu10kx-pcm.c.

References data, devinfo, emu_ac97_write_emulation(), and regno.

Here is the call graph for this function:

◆ emu_k1_recval()

static int emu_k1_recval ( int  speed)
static

Definition at line 687 of file emu10kx-pcm.c.

References emu10k1_adcspeed, speed, and val.

Referenced by emurchan_setspeed(), and emurchan_trigger().

Here is the caller graph for this function:

◆ emu_k2_recval()

static int emu_k2_recval ( int  speed)
static

Definition at line 698 of file emu10kx-pcm.c.

References emu10k2_adcspeed, speed, and val.

Referenced by emurchan_setspeed(), and emurchan_trigger().

Here is the caller graph for this function:

◆ emu_pcm_attach()

◆ emu_pcm_detach()

static int emu_pcm_detach ( device_t  dev)
static

Definition at line 1497 of file emu10kx-pcm.c.

References dev, emu_pcm_uninit(), free, emu_pcm_info::lock, pcm_getdevinfo(), pcm_unregister(), r, and snd_mtxfree().

Here is the call graph for this function:

◆ emu_pcm_init()

static int emu_pcm_init ( struct emu_pcm_info sc)
static

Definition at line 1286 of file emu10kx-pcm.c.

References emu_pcm_info::bufsz, emu_pcm_info::dev, EMU_MAX_BUFSZ, EMU_REC_BUFSZ, EMUPAGESIZE, and pcm_getbuffersize().

Referenced by emu_pcm_attach().

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

◆ emu_pcm_intr()

◆ emu_pcm_probe()

static int emu_pcm_probe ( device_t  dev)
static

◆ emu_pcm_uninit()

static int emu_pcm_uninit ( struct emu_pcm_info *sc  __unused)
static

Definition at line 1293 of file emu10kx-pcm.c.

Referenced by emu_pcm_detach().

Here is the caller graph for this function:

◆ emu_rdcd()

static int emu_rdcd ( kobj_t obj  __unused,
void *  devinfo,
int  regno 
)
static

Definition at line 657 of file emu10kx-pcm.c.

References emu_pcm_info::card, devinfo, EMU_AC97ADDR, EMU_AC97DATA, emu_rd(), emu_wr(), and regno.

Here is the call graph for this function:

◆ emu_wrcd()

static int emu_wrcd ( kobj_t obj  __unused,
void *  devinfo,
int  regno,
uint32_t  data 
)
static

Definition at line 669 of file emu10kx-pcm.c.

References emu_pcm_info::card, data, devinfo, EMU_AC97ADDR, EMU_AC97DATA, emu_wr(), and regno.

Here is the call graph for this function:

◆ emufxrchan_getcaps()

static struct pcmchan_caps * emufxrchan_getcaps ( kobj_t obj  __unused,
void *  c_devinfo 
)
static

◆ emufxrchan_getptr()

static uint32_t emufxrchan_getptr ( kobj_t obj  __unused,
void *  c_devinfo 
)
static

Definition at line 1179 of file emu10kx-pcm.c.

References emu_pcm_info::card, emu_rdptr(), emu_pcm_rchinfo::idxreg, emu_pcm_rchinfo::pcm, and r.

Here is the call graph for this function:

◆ emufxrchan_getrates()

static int emufxrchan_getrates ( kobj_t obj  __unused,
void *  c_devinfo,
int **  rates 
)
static

◆ emufxrchan_init()

◆ emufxrchan_setblocksize()

static uint32_t emufxrchan_setblocksize ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  blocksize 
)
static

◆ emufxrchan_setformat()

static int emufxrchan_setformat ( kobj_t obj  __unused,
void *c_devinfo  __unused,
uint32_t  format 
)
static

Definition at line 1072 of file emu10kx-pcm.c.

References format, and SND_FORMAT.

◆ emufxrchan_setspeed()

static uint32_t emufxrchan_setspeed ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  speed 
)
static

Definition at line 1079 of file emu10kx-pcm.c.

References emu_pcm_rchinfo::spd.

◆ emufxrchan_trigger()

◆ emupchan_free()

static int emupchan_free ( kobj_t obj  __unused,
void *  c_devinfo 
)
static

Definition at line 739 of file emu10kx-pcm.c.

References emu_pcm_info::card, emu_timer_clear(), emu_vfree(), emu_pcm_pchinfo::master, emu_pcm_pchinfo::pcm, emu_pcm_pchinfo::slave, and emu_pcm_pchinfo::timer.

Here is the call graph for this function:

◆ emupchan_getcaps()

static struct pcmchan_caps * emupchan_getcaps ( kobj_t obj  __unused,
void *c_devinfo  __unused 
)
static

◆ emupchan_getptr()

static uint32_t emupchan_getptr ( kobj_t obj  __unused,
void *  c_devinfo 
)
static

Definition at line 812 of file emu10kx-pcm.c.

References emu_pcm_info::card, emu_vpos(), emu_pcm_pchinfo::master, emu_pcm_pchinfo::pcm, and r.

Here is the call graph for this function:

◆ emupchan_init()

◆ emupchan_setblocksize()

static uint32_t emupchan_setblocksize ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  blocksize 
)
static

◆ emupchan_setformat()

static int emupchan_setformat ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  format 
)
static

Definition at line 752 of file emu10kx-pcm.c.

References emu_pcm_pchinfo::fmt, and format.

◆ emupchan_setspeed()

static uint32_t emupchan_setspeed ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  speed 
)
static

Definition at line 761 of file emu10kx-pcm.c.

References emu_pcm_pchinfo::spd, and speed.

◆ emupchan_trigger()

◆ emurchan_free()

static int emurchan_free ( kobj_t obj  __unused,
void *  c_devinfo 
)
static

Definition at line 891 of file emu10kx-pcm.c.

References emu_pcm_info::card, emu_timer_clear(), emu_pcm_rchinfo::pcm, and emu_pcm_rchinfo::timer.

Here is the call graph for this function:

◆ emurchan_getcaps()

static struct pcmchan_caps * emurchan_getcaps ( kobj_t obj  __unused,
void *c_devinfo  __unused 
)
static

Definition at line 1021 of file emu10kx-pcm.c.

References emu_reccaps_adc.

◆ emurchan_getptr()

static uint32_t emurchan_getptr ( kobj_t obj  __unused,
void *  c_devinfo 
)
static

Definition at line 1009 of file emu10kx-pcm.c.

References emu_pcm_info::card, emu_rdptr(), emu_pcm_rchinfo::idxreg, emu_pcm_rchinfo::pcm, and r.

Here is the call graph for this function:

◆ emurchan_init()

◆ emurchan_setblocksize()

static uint32_t emurchan_setblocksize ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  blocksize 
)
static

◆ emurchan_setformat()

static int emurchan_setformat ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  format 
)
static

Definition at line 901 of file emu10kx-pcm.c.

References emu_pcm_rchinfo::fmt, and format.

◆ emurchan_setspeed()

static uint32_t emurchan_setspeed ( kobj_t obj  __unused,
void *  c_devinfo,
uint32_t  speed 
)
static

Definition at line 910 of file emu10kx-pcm.c.

References emu10k1_adcspeed, emu10k2_adcspeed, emu_k1_recval(), emu_k2_recval(), emu_pcm_info::is_emu10k1, emu_pcm_rchinfo::pcm, emu_pcm_rchinfo::spd, and speed.

Here is the call graph for this function:

◆ emurchan_trigger()

◆ MIXER_DECLARE() [1/2]

MIXER_DECLARE ( emudspmixer  )

◆ MIXER_DECLARE() [2/2]

MIXER_DECLARE ( emuefxmixer  )

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( snd_emu10kx_pcm  ,
snd_emu10kx  ,
SND_EMU10KX_MINVER  ,
SND_EMU10KX_PREFVER  ,
SND_EMU10KX_MAXVER   
)

◆ MODULE_DEPEND() [2/2]

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

◆ MODULE_VERSION()

MODULE_VERSION ( snd_emu10kx_pcm  ,
SND_EMU10KX_PREFVER   
)

Variable Documentation

◆ dspmix_k1

const struct emu_dspmix_props_k1 dspmix_k1[SOUND_MIXER_NRDEVICES]
static
Initial value:
= {
[SOUND_MIXER_DIGITAL1] = {1, 1, 1},
[SOUND_MIXER_DIGITAL2] = {1, 1, 3},
[SOUND_MIXER_LINE2] = {1, 1, 4},
[SOUND_MIXER_DIGITAL3] = {1, 1, 5},
[SOUND_MIXER_LINE3] = {1, 1, 6},
}

Referenced by emu_dspmixer_init(), and emu_dspmixer_setrecsrc().

◆ dspmix_k2

const struct emu_dspmix_props_k2 dspmix_k2[SOUND_MIXER_NRDEVICES]
static
Initial value:
= {
[SOUND_MIXER_VOLUME] = {1, 0, (-1)},
[SOUND_MIXER_PCM] = {1, 0, (-1)},
[SOUND_MIXER_DIGITAL1] = {1, 1, 1},
[SOUND_MIXER_DIGITAL2] = {1, 1, 2},
[SOUND_MIXER_LINE2] = {1, 1, 4},
[SOUND_MIXER_DIGITAL3] = {1, 1, 5},
[SOUND_MIXER_LINE3] = {1, 1, 6},
}

Referenced by emu_dspmixer_init(), and emu_dspmixer_setrecsrc().

◆ emu10k1_adcspeed

int emu10k1_adcspeed[8] = {48000, 44100, 32000, 24000, 22050, 16000, 11025, 8000}
static

Definition at line 165 of file emu10kx-pcm.c.

Referenced by emu_k1_recval(), and emurchan_setspeed().

◆ emu10k2_adcspeed

int emu10k2_adcspeed[9] = {48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000}
static

Definition at line 167 of file emu10kx-pcm.c.

Referenced by emu_k2_recval(), and emurchan_setspeed().

◆ emu_ac97_methods

kobj_method_t emu_ac97_methods[]
static
Initial value:
= {
KOBJMETHOD(ac97_read, emu_rdcd),
KOBJMETHOD(ac97_write, emu_wrcd),
}
static int emu_rdcd(kobj_t obj __unused, void *devinfo, int regno)
Definition: emu10kx-pcm.c:657
static int emu_wrcd(kobj_t obj __unused, void *devinfo, int regno, uint32_t data)
Definition: emu10kx-pcm.c:669
#define KOBJMETHOD_END
Definition: midi.c:76

Definition at line 679 of file emu10kx-pcm.c.

◆ emu_eac97_methods

kobj_method_t emu_eac97_methods[]
static
Initial value:
= {
KOBJMETHOD(ac97_read, emu_erdcd),
KOBJMETHOD(ac97_write, emu_ewrcd),
}
static int emu_ewrcd(kobj_t obj __unused, void *devinfo, int regno, uint32_t data)
Definition: emu10kx-pcm.c:640
static int emu_erdcd(kobj_t obj __unused, void *devinfo, int regno)
Definition: emu10kx-pcm.c:632

Definition at line 648 of file emu10kx-pcm.c.

◆ emu_pcm_driver

driver_t emu_pcm_driver
static
Initial value:
= {
"pcm",
NULL,
0,
NULL
}
static device_method_t emu_pcm_methods[]
Definition: emu10kx-pcm.c:1517
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 1525 of file emu10kx-pcm.c.

◆ emu_pcm_methods

device_method_t emu_pcm_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, emu_pcm_probe),
DEVMETHOD(device_attach, emu_pcm_attach),
DEVMETHOD(device_detach, emu_pcm_detach),
DEVMETHOD_END
}
static int emu_pcm_attach(device_t dev)
Definition: emu10kx-pcm.c:1339
static int emu_pcm_detach(device_t dev)
Definition: emu10kx-pcm.c:1497
static int emu_pcm_probe(device_t dev)
Definition: emu10kx-pcm.c:1299

Definition at line 1517 of file emu10kx-pcm.c.

◆ emu_pfmt

uint32_t emu_pfmt[]
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 149 of file emu10kx-pcm.c.

◆ emu_pfmt_mono

uint32_t emu_pfmt_mono[]
static
Initial value:
= {
SND_FORMAT(AFMT_U8, 1, 0),
SND_FORMAT(AFMT_S16_LE, 1, 0),
0
}

Definition at line 156 of file emu10kx-pcm.c.

◆ emu_playcaps

struct pcmchan_caps emu_playcaps = {4000, 48000, emu_pfmt, 0}
static

Definition at line 162 of file emu10kx-pcm.c.

Referenced by emupchan_getcaps().

◆ emu_playcaps_mono

struct pcmchan_caps emu_playcaps_mono = {4000, 48000, emu_pfmt_mono, 0}
static

Definition at line 163 of file emu10kx-pcm.c.

Referenced by emupchan_getcaps().

◆ emu_rates_audigy

int emu_rates_audigy[]
static
Initial value:
= {
48000*64
}

Definition at line 145 of file emu10kx-pcm.c.

Referenced by emufxrchan_getrates().

◆ emu_rates_live

int emu_rates_live[]
static
Initial value:
= {
48000*32
}

Definition at line 141 of file emu10kx-pcm.c.

Referenced by emufxrchan_getrates().

◆ emu_reccaps_adc

struct pcmchan_caps emu_reccaps_adc
static
Initial value:
= {
8000, 48000, emu_rfmt_adc, 0
}
static uint32_t emu_rfmt_adc[]
Definition: emu10kx-pcm.c:119

Definition at line 124 of file emu10kx-pcm.c.

Referenced by emurchan_getcaps().

◆ emu_reccaps_efx_audigy

struct pcmchan_caps emu_reccaps_efx_audigy
static
Initial value:
= {
48000*64, 48000*64, emu_rfmt_efx, 0
}
static uint32_t emu_rfmt_efx[]
Definition: emu10kx-pcm.c:128

Definition at line 137 of file emu10kx-pcm.c.

Referenced by emufxrchan_getcaps().

◆ emu_reccaps_efx_live

struct pcmchan_caps emu_reccaps_efx_live
static
Initial value:
= {
48000*32, 48000*32, emu_rfmt_efx, 0
}

Definition at line 133 of file emu10kx-pcm.c.

Referenced by emufxrchan_getcaps().

◆ emu_rfmt_adc

uint32_t emu_rfmt_adc[]
static
Initial value:
= {
SND_FORMAT(AFMT_S16_LE, 1, 0),
SND_FORMAT(AFMT_S16_LE, 2, 0),
0
}

Definition at line 119 of file emu10kx-pcm.c.

◆ emu_rfmt_efx

uint32_t emu_rfmt_efx[]
static
Initial value:
= {
SND_FORMAT(AFMT_S16_LE, 1, 0),
0
}

Definition at line 128 of file emu10kx-pcm.c.

◆ emudspmixer_methods

kobj_method_t emudspmixer_methods[]
static
Initial value:
= {
}
static int emu_dspmixer_uninit(struct snd_mixer *m)
Definition: emu10kx-pcm.c:258
static u_int32_t emu_dspmixer_setrecsrc(struct snd_mixer *m, u_int32_t src)
Definition: emu10kx-pcm.c:395
static int emu_dspmixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: emu10kx-pcm.c:275
static int emu_dspmixer_init(struct snd_mixer *m)
Definition: emu10kx-pcm.c:204
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
int mixer_uninit(device_t dev)
Definition: mixer.c:805

Definition at line 471 of file emu10kx-pcm.c.

◆ emuefxmixer_methods

kobj_method_t emuefxmixer_methods[]
static
Initial value:
= {
}
static int emu_efxmixer_init(struct snd_mixer *m)
Definition: emu10kx-pcm.c:481
static u_int32_t emu_efxmixer_setrecsrc(struct snd_mixer *m __unused, u_int32_t src __unused)
Definition: emu10kx-pcm.c:496
static int emu_efxmixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: emu10kx-pcm.c:489

Definition at line 501 of file emu10kx-pcm.c.

◆ emufxrchan_methods

kobj_method_t emufxrchan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, emufxrchan_init),
KOBJMETHOD(channel_setformat, emufxrchan_setformat),
KOBJMETHOD(channel_setspeed, emufxrchan_setspeed),
KOBJMETHOD(channel_setblocksize, emufxrchan_setblocksize),
KOBJMETHOD(channel_trigger, emufxrchan_trigger),
KOBJMETHOD(channel_getptr, emufxrchan_getptr),
KOBJMETHOD(channel_getcaps, emufxrchan_getcaps),
KOBJMETHOD(channel_getrates, emufxrchan_getrates),
}
static uint32_t emufxrchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
Definition: emu10kx-pcm.c:1079
static struct pcmchan_caps * emufxrchan_getcaps(kobj_t obj __unused, void *c_devinfo)
Definition: emu10kx-pcm.c:1191
static void * emufxrchan_init(kobj_t obj __unused, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir __unused)
Definition: emu10kx-pcm.c:1040
static int emufxrchan_trigger(kobj_t obj __unused, void *c_devinfo, int go)
Definition: emu10kx-pcm.c:1105
static uint32_t emufxrchan_setblocksize(kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
Definition: emu10kx-pcm.c:1088
static uint32_t emufxrchan_getptr(kobj_t obj __unused, void *c_devinfo)
Definition: emu10kx-pcm.c:1179
static int emufxrchan_setformat(kobj_t obj __unused, void *c_devinfo __unused, uint32_t format)
Definition: emu10kx-pcm.c:1072
static int emufxrchan_getrates(kobj_t obj __unused, void *c_devinfo, int **rates)
Definition: emu10kx-pcm.c:1203

Definition at line 1216 of file emu10kx-pcm.c.

◆ emupchan_methods

kobj_method_t emupchan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, emupchan_init),
KOBJMETHOD(channel_free, emupchan_free),
KOBJMETHOD(channel_setformat, emupchan_setformat),
KOBJMETHOD(channel_setspeed, emupchan_setspeed),
KOBJMETHOD(channel_setblocksize, emupchan_setblocksize),
KOBJMETHOD(channel_trigger, emupchan_trigger),
KOBJMETHOD(channel_getptr, emupchan_getptr),
KOBJMETHOD(channel_getcaps, emupchan_getcaps),
}
static int emupchan_trigger(kobj_t obj __unused, void *c_devinfo, int go)
Definition: emu10kx-pcm.c:785
static uint32_t emupchan_getptr(kobj_t obj __unused, void *c_devinfo)
Definition: emu10kx-pcm.c:812
static int emupchan_setformat(kobj_t obj __unused, void *c_devinfo, uint32_t format)
Definition: emu10kx-pcm.c:752
static struct pcmchan_caps * emupchan_getcaps(kobj_t obj __unused, void *c_devinfo __unused)
Definition: emu10kx-pcm.c:824
static uint32_t emupchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
Definition: emu10kx-pcm.c:761
static void * emupchan_init(kobj_t obj __unused, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir __unused)
Definition: emu10kx-pcm.c:709
static int emupchan_free(kobj_t obj __unused, void *c_devinfo)
Definition: emu10kx-pcm.c:739
static uint32_t emupchan_setblocksize(kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
Definition: emu10kx-pcm.c:770

Definition at line 846 of file emu10kx-pcm.c.

◆ emurchan_methods

kobj_method_t emurchan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, emurchan_init),
KOBJMETHOD(channel_free, emurchan_free),
KOBJMETHOD(channel_setformat, emurchan_setformat),
KOBJMETHOD(channel_setspeed, emurchan_setspeed),
KOBJMETHOD(channel_setblocksize, emurchan_setblocksize),
KOBJMETHOD(channel_trigger, emurchan_trigger),
KOBJMETHOD(channel_getptr, emurchan_getptr),
KOBJMETHOD(channel_getcaps, emurchan_getcaps),
}
static struct pcmchan_caps * emurchan_getcaps(kobj_t obj __unused, void *c_devinfo __unused)
Definition: emu10kx-pcm.c:1021
static uint32_t emurchan_getptr(kobj_t obj __unused, void *c_devinfo)
Definition: emu10kx-pcm.c:1009
static int emurchan_setformat(kobj_t obj __unused, void *c_devinfo, uint32_t format)
Definition: emu10kx-pcm.c:901
static uint32_t emurchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
Definition: emu10kx-pcm.c:910
static int emurchan_free(kobj_t obj __unused, void *c_devinfo)
Definition: emu10kx-pcm.c:891
static uint32_t emurchan_setblocksize(kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
Definition: emu10kx-pcm.c:924
static void * emurchan_init(kobj_t obj __unused, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir __unused)
Definition: emu10kx-pcm.c:860
static int emurchan_trigger(kobj_t obj __unused, void *c_devinfo, int go)
Definition: emu10kx-pcm.c:945

Definition at line 1026 of file emu10kx-pcm.c.