FreeBSD kernel sound device code
es137x.c File Reference
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
#include <dev/sound/pci/es137x.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <sys/sysctl.h>
#include "mixer_if.h"
Include dependency graph for es137x.c:

Go to the source code of this file.

Data Structures

struct  es_chinfo
 
struct  es_info
 

Macros

#define MEM_MAP_REG   0x14
 
#define ES1370_PCI_ID   0x50001274
 
#define ES1371_PCI_ID   0x13711274
 
#define ES1371_PCI_ID2   0x13713274
 
#define CT5880_PCI_ID   0x58801274
 
#define CT4730_PCI_ID   0x89381102
 
#define ES1371REV_ES1371_A   0x02
 
#define ES1371REV_ES1371_B   0x09
 
#define ES1371REV_ES1373_8   0x08
 
#define ES1371REV_ES1373_A   0x04
 
#define ES1371REV_ES1373_B   0x06
 
#define ES1371REV_CT5880_A   0x07
 
#define CT5880REV_CT5880_C   0x02
 
#define CT5880REV_CT5880_D   0x03
 
#define CT5880REV_CT5880_E   0x04
 
#define CT4730REV_CT4730_A   0x00
 
#define ES_DEFAULT_BUFSZ   4096
 
#define ES_DAC1   0
 
#define ES_DAC2   1
 
#define ES_ADC   2
 
#define ES_NCHANS   3
 
#define ES_DMA_SEGS_MIN   2
 
#define ES_DMA_SEGS_MAX   256
 
#define ES_BLK_MIN   64
 
#define ES_BLK_ALIGN   (~(ES_BLK_MIN - 1))
 
#define ES1370_DAC1_MINSPEED   5512
 
#define ES1370_DAC1_MAXSPEED   44100
 
#define ES_FIXED_RATE(cfgv)    (((cfgv) & 0xffff0000) >> 16)
 
#define ES_SET_FIXED_RATE(cfgv, nv)    (((cfgv) & ~0xffff0000) | (((nv) & 0xffff) << 16))
 
#define ES_SINGLE_PCM_MIX(cfgv)    (((cfgv) & 0x8000) >> 15)
 
#define ES_SET_SINGLE_PCM_MIX(cfgv, nv)    (((cfgv) & ~0x8000) | (((nv) ? 1 : 0) << 15))
 
#define ES_DAC_FIRST(cfgv)    (((cfgv) & 0x4000) >> 14)
 
#define ES_SET_DAC_FIRST(cfgv, nv)    (((cfgv) & ~0x4000) | (((nv) & 0x1) << 14))
 
#define ES_DAC_SECOND(cfgv)    (((cfgv) & 0x2000) >> 13)
 
#define ES_SET_DAC_SECOND(cfgv, nv)    (((cfgv) & ~0x2000) | (((nv) & 0x1) << 13))
 
#define ES_NUMPLAY(cfgv)    (((cfgv) & 0x1800) >> 11)
 
#define ES_SET_NUMPLAY(cfgv, nv)    (((cfgv) & ~0x1800) | (((nv) & 0x3) << 11))
 
#define ES_NUMREC(cfgv)    (((cfgv) & 0x600) >> 9)
 
#define ES_SET_NUMREC(cfgv, nv)    (((cfgv) & ~0x600) | (((nv) & 0x3) << 9))
 
#define ES_IS_ES1370(cfgv)    (((cfgv) & 0x100) >> 8)
 
#define ES_SET_IS_ES1370(cfgv, nv)    (((cfgv) & ~0x100) | (((nv) ? 1 : 0) << 8))
 
#define ES_GP(cfgv)    ((cfgv) & 0xff)
 
#define ES_SET_GP(cfgv, nv)    (((cfgv) & ~0xff) | ((nv) & 0xff))
 
#define ES_DAC1_ENABLED(cfgv)
 
#define ES_DAC2_ENABLED(cfgv)
 
#define ES_DEFAULT_DAC_CFG   0
 
#define ES_LOCK(sc)   snd_mtxlock((sc)->lock)
 
#define ES_UNLOCK(sc)   snd_mtxunlock((sc)->lock)
 
#define ES_LOCK_ASSERT(sc)   snd_mtxassert((sc)->lock)
 
#define es_chan_active(es)
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static void es_intr (void *)
 
static uint32_t es1371_wait_src_ready (struct es_info *)
 
static void es1371_src_write (struct es_info *, unsigned short, unsigned short)
 
static unsigned int es1371_adc_rate (struct es_info *, unsigned int, int)
 
static unsigned int es1371_dac_rate (struct es_info *, unsigned int, int)
 
static int es1371_init (struct es_info *)
 
static int es1370_init (struct es_info *)
 
static int es1370_wrcodec (struct es_info *, unsigned char, unsigned char)
 
static __inline uint32_t es_rd (struct es_info *es, int regno, int size)
 
static __inline void es_wr (struct es_info *es, int regno, uint32_t data, int size)
 
static int es1370_mixinit (struct snd_mixer *m)
 
static int es1370_mixset (struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 
static uint32_t es1370_mixsetrecsrc (struct snd_mixer *m, uint32_t src)
 
 MIXER_DECLARE (es1370_mixer)
 
static void * eschan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
static int eschan_setformat (kobj_t obj, void *data, uint32_t format)
 
static uint32_t eschan1370_setspeed (kobj_t obj, void *data, uint32_t speed)
 
static uint32_t eschan1371_setspeed (kobj_t obj, void *data, uint32_t speed)
 
static int eschan_setfragments (kobj_t obj, void *data, uint32_t blksz, uint32_t blkcnt)
 
static uint32_t eschan_setblocksize (kobj_t obj, void *data, uint32_t blksz)
 
static __inline int es_poll_channel (struct es_chinfo *ch)
 
static void es_poll_callback (void *arg)
 
static int eschan_trigger (kobj_t obj, void *data, int go)
 
static uint32_t eschan_getptr (kobj_t obj, void *data)
 
static struct pcmchan_capseschan_getcaps (kobj_t obj, void *data)
 
 CHANNEL_DECLARE (eschan1370)
 
 CHANNEL_DECLARE (eschan1371)
 
static int es1371_wrcd (kobj_t obj, void *s, int addr, uint32_t data)
 
static int es1371_rdcd (kobj_t obj, void *s, int addr)
 
 AC97_DECLARE (es1371_ac97)
 
static unsigned int es1371_src_read (struct es_info *es, unsigned short reg)
 
static int es_pci_probe (device_t dev)
 
static int sysctl_es137x_spdif_enable (SYSCTL_HANDLER_ARGS)
 
static int sysctl_es137x_latency_timer (SYSCTL_HANDLER_ARGS)
 
static int sysctl_es137x_fixed_rate (SYSCTL_HANDLER_ARGS)
 
static int sysctl_es137x_single_pcm_mixer (SYSCTL_HANDLER_ARGS)
 
static int sysctl_es_polling (SYSCTL_HANDLER_ARGS)
 
static void es_init_sysctls (device_t dev)
 
static int es_pci_attach (device_t dev)
 
static int es_pci_detach (device_t dev)
 
 DRIVER_MODULE (snd_es137x, pci, es_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_es137x, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_es137x, 1)
 

Variables

static uint32_t es_fmt []
 
static struct pcmchan_caps es_caps = {4000, 48000, es_fmt, 0}
 
struct {
   unsigned   volidx:4
 
   unsigned   left:4
 
   unsigned   right:4
 
   unsigned   stereo:1
 
   unsigned   recmask:13
 
   unsigned   avail:1
 
mixtable [SOUND_MIXER_NRDEVICES]
 
static kobj_method_t es1370_mixer_methods []
 
static kobj_method_t eschan1370_methods []
 
static kobj_method_t eschan1371_methods []
 
static kobj_method_t es1371_ac97_methods []
 
static device_method_t es_methods []
 
static driver_t es_driver
 

Macro Definition Documentation

◆ CT4730_PCI_ID

#define CT4730_PCI_ID   0x89381102

Definition at line 102 of file es137x.c.

◆ CT4730REV_CT4730_A

#define CT4730REV_CT4730_A   0x00

Definition at line 117 of file es137x.c.

◆ CT5880_PCI_ID

#define CT5880_PCI_ID   0x58801274

Definition at line 101 of file es137x.c.

◆ CT5880REV_CT5880_C

#define CT5880REV_CT5880_C   0x02

Definition at line 113 of file es137x.c.

◆ CT5880REV_CT5880_D

#define CT5880REV_CT5880_D   0x03

Definition at line 114 of file es137x.c.

◆ CT5880REV_CT5880_E

#define CT5880REV_CT5880_E   0x04

Definition at line 115 of file es137x.c.

◆ ES1370_DAC1_MAXSPEED

#define ES1370_DAC1_MAXSPEED   44100

Definition at line 133 of file es137x.c.

◆ ES1370_DAC1_MINSPEED

#define ES1370_DAC1_MINSPEED   5512

Definition at line 132 of file es137x.c.

◆ ES1370_PCI_ID

#define ES1370_PCI_ID   0x50001274

Definition at line 98 of file es137x.c.

◆ ES1371_PCI_ID

#define ES1371_PCI_ID   0x13711274

Definition at line 99 of file es137x.c.

◆ ES1371_PCI_ID2

#define ES1371_PCI_ID2   0x13713274

Definition at line 100 of file es137x.c.

◆ ES1371REV_CT5880_A

#define ES1371REV_CT5880_A   0x07

Definition at line 111 of file es137x.c.

◆ ES1371REV_ES1371_A

#define ES1371REV_ES1371_A   0x02

Definition at line 104 of file es137x.c.

◆ ES1371REV_ES1371_B

#define ES1371REV_ES1371_B   0x09

Definition at line 105 of file es137x.c.

◆ ES1371REV_ES1373_8

#define ES1371REV_ES1373_8   0x08

Definition at line 107 of file es137x.c.

◆ ES1371REV_ES1373_A

#define ES1371REV_ES1373_A   0x04

Definition at line 108 of file es137x.c.

◆ ES1371REV_ES1373_B

#define ES1371REV_ES1373_B   0x06

Definition at line 109 of file es137x.c.

◆ ES_ADC

#define ES_ADC   2

Definition at line 124 of file es137x.c.

◆ ES_BLK_ALIGN

#define ES_BLK_ALIGN   (~(ES_BLK_MIN - 1))

Definition at line 130 of file es137x.c.

◆ ES_BLK_MIN

#define ES_BLK_MIN   64

Definition at line 129 of file es137x.c.

◆ es_chan_active

#define es_chan_active (   es)
Value:
((es)->ch[ES_DAC1].active + \
(es)->ch[ES_DAC2].active + \
(es)->ch[ES_ADC].active)
#define ES_DAC2
Definition: es137x.c:123
#define ES_ADC
Definition: es137x.c:124
#define ES_DAC1
Definition: es137x.c:122

Definition at line 684 of file es137x.c.

◆ ES_DAC1

#define ES_DAC1   0

Definition at line 122 of file es137x.c.

◆ ES_DAC1_ENABLED

#define ES_DAC1_ENABLED (   cfgv)
Value:
(ES_NUMPLAY(cfgv) > 1 || \
(ES_NUMPLAY(cfgv) == 1 && ES_DAC_FIRST(cfgv) == ES_DAC1))
#define ES_NUMPLAY(cfgv)
Definition: es137x.c:177
#define ES_DAC_FIRST(cfgv)
Definition: es137x.c:169

Definition at line 194 of file es137x.c.

◆ ES_DAC2

#define ES_DAC2   1

Definition at line 123 of file es137x.c.

◆ ES_DAC2_ENABLED

#define ES_DAC2_ENABLED (   cfgv)
Value:
(ES_NUMPLAY(cfgv) > 1 || \
(ES_NUMPLAY(cfgv) == 1 && ES_DAC_FIRST(cfgv) == ES_DAC2))

Definition at line 197 of file es137x.c.

◆ ES_DAC_FIRST

#define ES_DAC_FIRST (   cfgv)     (((cfgv) & 0x4000) >> 14)

Definition at line 169 of file es137x.c.

◆ ES_DAC_SECOND

#define ES_DAC_SECOND (   cfgv)     (((cfgv) & 0x2000) >> 13)

Definition at line 173 of file es137x.c.

◆ ES_DEFAULT_BUFSZ

#define ES_DEFAULT_BUFSZ   4096

Definition at line 119 of file es137x.c.

◆ ES_DEFAULT_DAC_CFG

#define ES_DEFAULT_DAC_CFG   0

Definition at line 209 of file es137x.c.

◆ ES_DMA_SEGS_MAX

#define ES_DMA_SEGS_MAX   256

Definition at line 128 of file es137x.c.

◆ ES_DMA_SEGS_MIN

#define ES_DMA_SEGS_MIN   2

Definition at line 127 of file es137x.c.

◆ ES_FIXED_RATE

#define ES_FIXED_RATE (   cfgv)     (((cfgv) & 0xffff0000) >> 16)

Definition at line 161 of file es137x.c.

◆ ES_GP

#define ES_GP (   cfgv)     ((cfgv) & 0xff)

Definition at line 189 of file es137x.c.

◆ ES_IS_ES1370

#define ES_IS_ES1370 (   cfgv)     (((cfgv) & 0x100) >> 8)

Definition at line 185 of file es137x.c.

◆ ES_LOCK

#define ES_LOCK (   sc)    snd_mtxlock((sc)->lock)

Definition at line 234 of file es137x.c.

◆ ES_LOCK_ASSERT

#define ES_LOCK_ASSERT (   sc)    snd_mtxassert((sc)->lock)

Definition at line 236 of file es137x.c.

◆ ES_NCHANS

#define ES_NCHANS   3

Definition at line 125 of file es137x.c.

◆ ES_NUMPLAY

#define ES_NUMPLAY (   cfgv)     (((cfgv) & 0x1800) >> 11)

Definition at line 177 of file es137x.c.

◆ ES_NUMREC

#define ES_NUMREC (   cfgv)     (((cfgv) & 0x600) >> 9)

Definition at line 181 of file es137x.c.

◆ ES_SET_DAC_FIRST

#define ES_SET_DAC_FIRST (   cfgv,
  nv 
)     (((cfgv) & ~0x4000) | (((nv) & 0x1) << 14))

Definition at line 171 of file es137x.c.

◆ ES_SET_DAC_SECOND

#define ES_SET_DAC_SECOND (   cfgv,
  nv 
)     (((cfgv) & ~0x2000) | (((nv) & 0x1) << 13))

Definition at line 175 of file es137x.c.

◆ ES_SET_FIXED_RATE

#define ES_SET_FIXED_RATE (   cfgv,
  nv 
)     (((cfgv) & ~0xffff0000) | (((nv) & 0xffff) << 16))

Definition at line 163 of file es137x.c.

◆ ES_SET_GP

#define ES_SET_GP (   cfgv,
  nv 
)     (((cfgv) & ~0xff) | ((nv) & 0xff))

Definition at line 191 of file es137x.c.

◆ ES_SET_IS_ES1370

#define ES_SET_IS_ES1370 (   cfgv,
  nv 
)     (((cfgv) & ~0x100) | (((nv) ? 1 : 0) << 8))

Definition at line 187 of file es137x.c.

◆ ES_SET_NUMPLAY

#define ES_SET_NUMPLAY (   cfgv,
  nv 
)     (((cfgv) & ~0x1800) | (((nv) & 0x3) << 11))

Definition at line 179 of file es137x.c.

◆ ES_SET_NUMREC

#define ES_SET_NUMREC (   cfgv,
  nv 
)     (((cfgv) & ~0x600) | (((nv) & 0x3) << 9))

Definition at line 183 of file es137x.c.

◆ ES_SET_SINGLE_PCM_MIX

#define ES_SET_SINGLE_PCM_MIX (   cfgv,
  nv 
)     (((cfgv) & ~0x8000) | (((nv) ? 1 : 0) << 15))

Definition at line 167 of file es137x.c.

◆ ES_SINGLE_PCM_MIX

#define ES_SINGLE_PCM_MIX (   cfgv)     (((cfgv) & 0x8000) >> 15)

Definition at line 165 of file es137x.c.

◆ ES_UNLOCK

#define ES_UNLOCK (   sc)    snd_mtxunlock((sc)->lock)

Definition at line 235 of file es137x.c.

◆ MEM_MAP_REG

#define MEM_MAP_REG   0x14

Definition at line 95 of file es137x.c.

Function Documentation

◆ AC97_DECLARE()

AC97_DECLARE ( es1371_ac97  )

◆ CHANNEL_DECLARE() [1/2]

CHANNEL_DECLARE ( eschan1370  )

◆ CHANNEL_DECLARE() [2/2]

CHANNEL_DECLARE ( eschan1371  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( snd_es137x  ,
pci  ,
es_driver  ,
pcm_devclass  ,
,
 
)

◆ es1370_init()

◆ es1370_mixinit()

static int es1370_mixinit ( struct snd_mixer m)
static

Definition at line 314 of file es137x.c.

References avail, ES_SINGLE_PCM_MIX, es_info::escfg, m, mix_getdevinfo(), mix_setdevs(), mix_setrecdevs(), mixtable, and recmask.

Here is the call graph for this function:

◆ es1370_mixset()

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

Definition at line 348 of file es137x.c.

References avail, dev, es1370_wrcodec(), ES_DAC1_ENABLED, ES_LOCK, ES_SINGLE_PCM_MIX, ES_UNLOCK, es_info::escfg, left, m, mix_getdevinfo(), mixtable, r, right, and stereo.

Here is the call graph for this function:

◆ es1370_mixsetrecsrc()

static uint32_t es1370_mixsetrecsrc ( struct snd_mixer m,
uint32_t  src 
)
static

◆ es1370_wrcodec()

static int es1370_wrcodec ( struct es_info es,
unsigned char  i,
unsigned char  data 
)
static

Definition at line 421 of file es137x.c.

References CODEC_INDEX_SHIFT, data, es_info::dev, ES1370_REG_CODEC, ES1370_REG_STATUS, ES_LOCK_ASSERT, es_rd(), es_wr(), and STAT_CSTAT.

Referenced by es1370_init(), es1370_mixset(), and es1370_mixsetrecsrc().

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

◆ es1371_adc_rate()

static unsigned int es1371_adc_rate ( struct es_info es,
unsigned int  rate,
int  set 
)
static

Definition at line 1227 of file es137x.c.

References es1371_src_read(), es1371_src_write(), ES_LOCK_ASSERT, ES_SMPREG_ADC, ES_SMPREG_INT_REGS, ES_SMPREG_TRUNC_N, ES_SMPREG_VFREQ_FRAC, ES_SMPREG_VOL_ADC, n, rate, and set.

Referenced by es1371_init(), and eschan1371_setspeed().

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

◆ es1371_dac_rate()

static unsigned int es1371_dac_rate ( struct es_info es,
unsigned int  rate,
int  set 
)
static

Definition at line 1267 of file es137x.c.

References ES1371_DIS_P1, ES1371_DIS_P2, ES1371_DIS_R1, ES1371_DIS_SRC, ES1371_REG_SMPRATE, es1371_src_read(), es1371_src_write(), es1371_wait_src_ready(), ES_DAC1, ES_LOCK_ASSERT, ES_SMPREG_DAC1, ES_SMPREG_DAC2, ES_SMPREG_INT_REGS, ES_SMPREG_VFREQ_FRAC, es_wr(), r, rate, and set.

Referenced by es1371_init(), and eschan1371_setspeed().

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

◆ es1371_init()

◆ es1371_rdcd()

static int es1371_rdcd ( kobj_t  obj,
void *  s,
int  addr 
)
static

◆ es1371_src_read()

static unsigned int es1371_src_read ( struct es_info es,
unsigned short  reg 
)
static

Definition at line 1204 of file es137x.c.

References ES1371_DIS_P1, ES1371_DIS_P2, ES1371_DIS_R1, ES1371_DIS_SRC, ES1371_REG_SMPRATE, ES1371_SRC_RAM_ADDRO, ES1371_SRC_RAM_DATAI, es1371_wait_src_ready(), es_wr(), r, and reg.

Referenced by es1371_adc_rate(), and es1371_dac_rate().

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

◆ es1371_src_write()

static void es1371_src_write ( struct es_info es,
unsigned short  reg,
unsigned short  data 
)
static

Definition at line 1216 of file es137x.c.

References data, ES1371_DIS_P1, ES1371_DIS_P2, ES1371_DIS_R1, ES1371_DIS_SRC, ES1371_REG_SMPRATE, ES1371_SRC_RAM_ADDRO, ES1371_SRC_RAM_DATAO, ES1371_SRC_RAM_WE, es1371_wait_src_ready(), es_wr(), r, and reg.

Referenced by es1371_adc_rate(), es1371_dac_rate(), and es1371_init().

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

◆ es1371_wait_src_ready()

static uint32_t es1371_wait_src_ready ( struct es_info es)
static

Definition at line 1296 of file es137x.c.

References es_info::dev, ES1371_REG_SMPRATE, ES1371_SRC_RAM_BUSY, es_rd(), and r.

Referenced by es1371_dac_rate(), es1371_init(), es1371_rdcd(), es1371_src_read(), es1371_src_write(), and es1371_wrcd().

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

◆ es1371_wrcd()

static int es1371_wrcd ( kobj_t  obj,
void *  s,
int  addr,
uint32_t  data 
)
static

◆ es_init_sysctls()

◆ es_intr()

static void es_intr ( void *  p)
static

Definition at line 921 of file es137x.c.

References es_info::ch, es_chinfo::channel, chn_intr(), ES1370_REG_SERIAL_CONTROL, ES1370_REG_STATUS, ES_ADC, ES_DAC1, ES_DAC2, ES_LOCK, es_rd(), ES_UNLOCK, es_wr(), es_info::polling, es_info::sctrl, STAT_ADC, STAT_DAC1, STAT_DAC2, and STAT_INTR.

Referenced by es_pci_attach().

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

◆ es_pci_attach()

◆ es_pci_detach()

static int es_pci_detach ( device_t  dev)
static

◆ es_pci_probe()

◆ es_poll_callback()

static void es_poll_callback ( void *  arg)
static

Definition at line 724 of file es137x.c.

References es_info::ch, es_chinfo::channel, chn_intr(), es_chan_active, ES_LOCK, ES_NCHANS, es_poll_callback(), es_poll_channel(), ES_UNLOCK, es_info::poll_timer, es_info::polling, and trigger.

Referenced by es_poll_callback(), and eschan_trigger().

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

◆ es_poll_channel()

static __inline int es_poll_channel ( struct es_chinfo ch)
static

◆ es_rd()

static __inline uint32_t es_rd ( struct es_info es,
int  regno,
int  size 
)
static

Definition at line 279 of file es137x.c.

References regno, es_info::sh, size, and es_info::st.

Referenced by es1370_wrcodec(), es1371_rdcd(), es1371_wait_src_ready(), es1371_wrcd(), es_intr(), es_poll_channel(), eschan_getptr(), and sysctl_es137x_spdif_enable().

Here is the caller graph for this function:

◆ es_wr()

static __inline void es_wr ( struct es_info es,
int  regno,
uint32_t  data,
int  size 
)
static

◆ eschan1370_setspeed()

static uint32_t eschan1370_setspeed ( kobj_t  obj,
void *  data,
uint32_t  speed 
)
static

◆ eschan1371_setspeed()

static uint32_t eschan1371_setspeed ( kobj_t  obj,
void *  data,
uint32_t  speed 
)
static

Definition at line 615 of file es137x.c.

References es_info::ch, data, es_chinfo::dir, es1371_adc_rate(), es1371_dac_rate(), ES_LOCK, ES_UNLOCK, es_chinfo::index, es_chinfo::parent, PCMDIR_PLAY, and speed.

Here is the call graph for this function:

◆ eschan_getcaps()

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

Definition at line 885 of file es137x.c.

References es_chinfo::caps, and data.

◆ eschan_getptr()

static uint32_t eschan_getptr ( kobj_t  obj,
void *  data 
)
static

◆ eschan_init()

◆ eschan_setblocksize()

static uint32_t eschan_setblocksize ( kobj_t  obj,
void *  data,
uint32_t  blksz 
)
static

Definition at line 674 of file es137x.c.

References es_info::blkcnt, es_chinfo::blksz, blksz, es_info::ch, data, eschan_setfragments(), and es_chinfo::parent.

Here is the call graph for this function:

◆ eschan_setformat()

static int eschan_setformat ( kobj_t  obj,
void *  data,
uint32_t  format 
)
static

◆ eschan_setfragments()

static int eschan_setfragments ( kobj_t  obj,
void *  data,
uint32_t  blksz,
uint32_t  blkcnt 
)
static

◆ eschan_trigger()

◆ MIXER_DECLARE()

MIXER_DECLARE ( es1370_mixer  )

◆ MODULE_DEPEND()

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

◆ MODULE_VERSION()

MODULE_VERSION ( snd_es137x  ,
 
)

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

◆ sysctl_es137x_fixed_rate()

static int sysctl_es137x_fixed_rate ( SYSCTL_HANDLER_ARGS  )
static

◆ sysctl_es137x_latency_timer()

static int sysctl_es137x_latency_timer ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 1435 of file es137x.c.

References dev, ES_LOCK, ES_UNLOCK, PCIR_LATTIMER, pcm_getdevinfo(), req, and val.

Referenced by es_init_sysctls().

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

◆ sysctl_es137x_single_pcm_mixer()

static int sysctl_es137x_single_pcm_mixer ( SYSCTL_HANDLER_ARGS  )
static

◆ sysctl_es137x_spdif_enable()

static int sysctl_es137x_spdif_enable ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 1397 of file es137x.c.

References es_info::ctrl, dev, ENABLE_SPDIF, ES1370_REG_CONTROL, ES1370_REG_STATUS, ES_LOCK, es_rd(), ES_UNLOCK, es_wr(), pcm_getdevinfo(), r, RECEN_B, req, and SPDIFEN_B.

Referenced by es_init_sysctls().

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

◆ sysctl_es_polling()

static int sysctl_es_polling ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 1595 of file es137x.c.

References dev, es_chan_active, ES_LOCK, ES_UNLOCK, pcm_getdevinfo(), es_info::polling, req, and val.

Referenced by es_init_sysctls().

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

Variable Documentation

◆ avail

unsigned avail

Definition at line 264 of file es137x.c.

Referenced by es1370_mixinit(), and es1370_mixset().

◆ es1370_mixer_methods

kobj_method_t es1370_mixer_methods[]
static
Initial value:
= {
KOBJMETHOD(mixer_init, es1370_mixinit),
KOBJMETHOD(mixer_set, es1370_mixset),
}
static int es1370_mixinit(struct snd_mixer *m)
Definition: es137x.c:314
static int es1370_mixset(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: es137x.c:348
static uint32_t es1370_mixsetrecsrc(struct snd_mixer *m, uint32_t src)
Definition: es137x.c:384
#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 410 of file es137x.c.

◆ es1371_ac97_methods

kobj_method_t es1371_ac97_methods[]
static
Initial value:
= {
KOBJMETHOD(ac97_read, es1371_rdcd),
KOBJMETHOD(ac97_write, es1371_wrcd),
}
static int es1371_rdcd(kobj_t obj, void *s, int addr)
Definition: es137x.c:1150
static int es1371_wrcd(kobj_t obj, void *s, int addr, uint32_t data)
Definition: es137x.c:1112

Definition at line 1194 of file es137x.c.

◆ es_caps

struct pcmchan_caps es_caps = {4000, 48000, es_fmt, 0}
static

Definition at line 256 of file es137x.c.

Referenced by es1370_init(), eschan_init(), and sysctl_es137x_fixed_rate().

◆ es_driver

driver_t es_driver
static
Initial value:
= {
"pcm",
}
static device_method_t es_methods[]
Definition: es137x.c:1930
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 1938 of file es137x.c.

◆ es_fmt

uint32_t es_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 249 of file es137x.c.

◆ es_methods

device_method_t es_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, es_pci_probe),
DEVMETHOD(device_attach, es_pci_attach),
DEVMETHOD(device_detach, es_pci_detach),
{ 0, 0 }
}
static int es_pci_attach(device_t dev)
Definition: es137x.c:1707
static int es_pci_probe(device_t dev)
Definition: es137x.c:1318
static int es_pci_detach(device_t dev)
Definition: es137x.c:1901

Definition at line 1930 of file es137x.c.

◆ eschan1370_methods

kobj_method_t eschan1370_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, eschan_init),
KOBJMETHOD(channel_setformat, eschan_setformat),
KOBJMETHOD(channel_setspeed, eschan1370_setspeed),
KOBJMETHOD(channel_setblocksize, eschan_setblocksize),
KOBJMETHOD(channel_setfragments, eschan_setfragments),
KOBJMETHOD(channel_trigger, eschan_trigger),
KOBJMETHOD(channel_getptr, eschan_getptr),
KOBJMETHOD(channel_getcaps, eschan_getcaps),
}
static void * eschan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
Definition: es137x.c:444
static uint32_t eschan1370_setspeed(kobj_t obj, void *data, uint32_t speed)
Definition: es137x.c:570
static uint32_t eschan_setblocksize(kobj_t obj, void *data, uint32_t blksz)
Definition: es137x.c:674
static uint32_t eschan_getptr(kobj_t obj, void *data)
Definition: es137x.c:855
static struct pcmchan_caps * eschan_getcaps(kobj_t obj, void *data)
Definition: es137x.c:885
static int eschan_trigger(kobj_t obj, void *data, int go)
Definition: es137x.c:757
static int eschan_setfragments(kobj_t obj, void *data, uint32_t blksz, uint32_t blkcnt)
Definition: es137x.c:635
static int eschan_setformat(kobj_t obj, void *data, uint32_t format)
Definition: es137x.c:536

Definition at line 892 of file es137x.c.

◆ eschan1371_methods

kobj_method_t eschan1371_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, eschan_init),
KOBJMETHOD(channel_setformat, eschan_setformat),
KOBJMETHOD(channel_setspeed, eschan1371_setspeed),
KOBJMETHOD(channel_setblocksize, eschan_setblocksize),
KOBJMETHOD(channel_setfragments, eschan_setfragments),
KOBJMETHOD(channel_trigger, eschan_trigger),
KOBJMETHOD(channel_getptr, eschan_getptr),
KOBJMETHOD(channel_getcaps, eschan_getcaps),
}
static uint32_t eschan1371_setspeed(kobj_t obj, void *data, uint32_t speed)
Definition: es137x.c:615

Definition at line 905 of file es137x.c.

◆ left

◆ 

const struct { ... } mixtable[SOUND_MIXER_NRDEVICES]
Initial value:
= {
[SOUND_MIXER_VOLUME] = { 0, 0x0, 0x1, 1, 0x1f7f, 1 },
[SOUND_MIXER_PCM] = { 1, 0x2, 0x3, 1, 0x0400, 1 },
[SOUND_MIXER_SYNTH] = { 2, 0x4, 0x5, 1, 0x0060, 1 },
[SOUND_MIXER_CD] = { 3, 0x6, 0x7, 1, 0x0006, 1 },
[SOUND_MIXER_LINE] = { 4, 0x8, 0x9, 1, 0x0018, 1 },
[SOUND_MIXER_LINE1] = { 5, 0xa, 0xb, 1, 0x1800, 1 },
[SOUND_MIXER_LINE2] = { 6, 0xc, 0x0, 0, 0x0100, 1 },
[SOUND_MIXER_LINE3] = { 7, 0xd, 0x0, 0, 0x0200, 1 },
[SOUND_MIXER_MIC] = { 8, 0xe, 0x0, 0, 0x0001, 1 },
[SOUND_MIXER_OGAIN] = { 9, 0xf, 0x0, 0, 0x0000, 1 }
}

Referenced by es1370_mixinit(), es1370_mixset(), and es1370_mixsetrecsrc().

◆ recmask

unsigned recmask

Definition at line 263 of file es137x.c.

Referenced by emu_dspmixer_setrecsrc(), es1370_mixinit(), and hdaa_audio_ctl_ossmixer_init().

◆ right

◆ stereo

unsigned stereo

◆ volidx

unsigned volidx

Definition at line 259 of file es137x.c.