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

Go to the source code of this file.

Data Structures

struct  envy24_sample
 
struct  sc_chinfo
 
struct  codec_entry
 
struct  cfg_info
 
struct  sc_info
 
struct  envy24_emldma
 
struct  envy24_delta_ak4524_codec
 

Macros

#define ENVY24_PLAY_CHNUM   10
 
#define ENVY24_REC_CHNUM   12
 
#define ENVY24_PLAY_BUFUNIT   (4 /* byte/sample */ * 10 /* channel */)
 
#define ENVY24_REC_BUFUNIT   (4 /* byte/sample */ * 12 /* channel */)
 
#define ENVY24_SAMPLE_NUM   4096
 
#define ENVY24_TIMEOUT   1000
 
#define ENVY24_DEFAULT_FORMAT   SND_FORMAT(AFMT_S16_LE, 2, 0)
 
#define ENVY24_NAMELEN   32
 
#define SDA_GPIO   0x10
 
#define SCL_GPIO   0x20
 

Typedefs

typedef struct envy24_sample sample32_t
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static MALLOC_DEFINE (M_ENVY24, "envy24", "envy24 audio")
 
static void envy24_p8u (struct sc_chinfo *)
 
static void envy24_p16sl (struct sc_chinfo *)
 
static void envy24_p32sl (struct sc_chinfo *)
 
static void envy24_r16sl (struct sc_chinfo *)
 
static void envy24_r32sl (struct sc_chinfo *)
 
static void * envy24chan_init (kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int)
 
static int envy24chan_setformat (kobj_t, void *, u_int32_t)
 
static u_int32_t envy24chan_setspeed (kobj_t, void *, u_int32_t)
 
static u_int32_t envy24chan_setblocksize (kobj_t, void *, u_int32_t)
 
static int envy24chan_trigger (kobj_t, void *, int)
 
static u_int32_t envy24chan_getptr (kobj_t, void *)
 
static struct pcmchan_capsenvy24chan_getcaps (kobj_t, void *)
 
static int envy24mixer_init (struct snd_mixer *)
 
static int envy24mixer_reinit (struct snd_mixer *)
 
static int envy24mixer_uninit (struct snd_mixer *)
 
static int envy24mixer_set (struct snd_mixer *, unsigned, unsigned, unsigned)
 
static u_int32_t envy24mixer_setrecsrc (struct snd_mixer *, u_int32_t)
 
static void * envy24_delta_ak4524_create (device_t, void *, int, int)
 
static void envy24_delta_ak4524_destroy (void *)
 
static void envy24_delta_ak4524_init (void *)
 
static void envy24_delta_ak4524_reinit (void *)
 
static void envy24_delta_ak4524_setvolume (void *, int, unsigned int, unsigned int)
 
static u_int32_t envy24_rdcs (struct sc_info *sc, int regno, int size)
 
static void envy24_wrcs (struct sc_info *sc, int regno, u_int32_t data, int size)
 
static u_int32_t envy24_rdmt (struct sc_info *sc, int regno, int size)
 
static void envy24_wrmt (struct sc_info *sc, int regno, u_int32_t data, int size)
 
static u_int32_t envy24_rdci (struct sc_info *sc, int regno)
 
static void envy24_wrci (struct sc_info *sc, int regno, u_int32_t data)
 
static int envy24_rdi2c (struct sc_info *sc, u_int32_t dev, u_int32_t addr)
 
static int envy24_rdrom (struct sc_info *sc, u_int32_t addr)
 
static struct cfg_infoenvy24_rom2cfg (struct sc_info *sc)
 
static void envy24_cfgfree (struct cfg_info *cfg)
 
static int envy24_slavecd (struct sc_info *sc)
 
static u_int32_t envy24_gpiord (struct sc_info *sc)
 
static void envy24_gpiowr (struct sc_info *sc, u_int32_t data)
 
static void envy24_gpiosetmask (struct sc_info *sc, u_int32_t mask)
 
static void envy24_gpiosetdir (struct sc_info *sc, u_int32_t dir)
 
static void envy24_gpio_i2c_ctl (void *codec, unsigned int scl, unsigned int sda)
 
static void i2c_wrbit (void *codec, void(*ctrl)(void *, unsigned int, unsigned int), int bit)
 
static void i2c_start (void *codec, void(*ctrl)(void *, unsigned int, unsigned int))
 
static void i2c_stop (void *codec, void(*ctrl)(void *, unsigned int, unsigned int))
 
static void i2c_ack (void *codec, void(*ctrl)(void *, unsigned int, unsigned int))
 
static void i2c_wr (void *codec, void(*ctrl)(void *, unsigned int, unsigned int), u_int32_t dev, int reg, u_int8_t val)
 
static void envy24_delta_ak4524_ctl (void *codec, unsigned int cs, unsigned int cclk, unsigned int cdti)
 
static u_int32_t envy24_setspeed (struct sc_info *sc, u_int32_t speed)
 
static void envy24_setvolume (struct sc_info *sc, unsigned ch)
 
static void envy24_mutevolume (struct sc_info *sc, unsigned ch)
 
static u_int32_t envy24_gethwptr (struct sc_info *sc, int dir)
 
static void envy24_updintr (struct sc_info *sc, int dir)
 
static int envy24_checkintr (struct sc_info *sc, int dir)
 
static void envy24_start (struct sc_info *sc, int dir)
 
static void envy24_stop (struct sc_info *sc, int dir)
 
static int envy24_route (struct sc_info *sc, int dac, int class, int adc, int rev)
 
static int envy24chan_free (kobj_t obj, void *data)
 
 CHANNEL_DECLARE (envy24chan)
 
 MIXER_DECLARE (envy24mixer)
 
static void envy24_intr (void *p)
 
static int envy24_pci_probe (device_t dev)
 
static void envy24_dmapsetmap (void *arg, bus_dma_segment_t *segs, int nseg, int error)
 
static void envy24_dmarsetmap (void *arg, bus_dma_segment_t *segs, int nseg, int error)
 
static void envy24_dmafree (struct sc_info *sc)
 
static int envy24_dmainit (struct sc_info *sc)
 
static void envy24_putcfg (struct sc_info *sc)
 
static int envy24_init (struct sc_info *sc)
 
static int envy24_alloc_resource (struct sc_info *sc)
 
static int envy24_pci_attach (device_t dev)
 
static int envy24_pci_detach (device_t dev)
 
 DRIVER_MODULE (snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_envy24, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_DEPEND (snd_envy24, snd_spicds, 1, 1, 1)
 
 MODULE_VERSION (snd_envy24, 1)
 

Variables

static unsigned envy24_chanmap [ENVY24_CHAN_NUM]
 
static int envy24_mixmap []
 
static u_int32_t envy24_speed []
 
static struct codec_entry delta_codec
 
static struct cfg_info cfg_table []
 
static u_int32_t envy24_recfmt []
 
static struct pcmchan_caps envy24_reccaps = {8000, 96000, envy24_recfmt, 0}
 
static u_int32_t envy24_playfmt []
 
static struct pcmchan_caps envy24_playcaps = {8000, 96000, envy24_playfmt, 0}
 
static struct envy24_emldma envy24_pemltab []
 
static struct envy24_emldma envy24_remltab []
 
struct {
   u_int32_t   speed
 
   u_int32_t   code
 
envy24_speedtab []
 
static kobj_method_t envy24chan_methods []
 
static kobj_method_t envy24mixer_methods []
 
static device_method_t envy24_methods []
 
static driver_t envy24_driver
 

Macro Definition Documentation

◆ ENVY24_DEFAULT_FORMAT

#define ENVY24_DEFAULT_FORMAT   SND_FORMAT(AFMT_S16_LE, 2, 0)

Definition at line 60 of file envy24.c.

◆ ENVY24_NAMELEN

#define ENVY24_NAMELEN   32

Definition at line 62 of file envy24.c.

◆ ENVY24_PLAY_BUFUNIT

#define ENVY24_PLAY_BUFUNIT   (4 /* byte/sample */ * 10 /* channel */)

Definition at line 54 of file envy24.c.

◆ ENVY24_PLAY_CHNUM

#define ENVY24_PLAY_CHNUM   10

Definition at line 52 of file envy24.c.

◆ ENVY24_REC_BUFUNIT

#define ENVY24_REC_BUFUNIT   (4 /* byte/sample */ * 12 /* channel */)

Definition at line 55 of file envy24.c.

◆ ENVY24_REC_CHNUM

#define ENVY24_REC_CHNUM   12

Definition at line 53 of file envy24.c.

◆ ENVY24_SAMPLE_NUM

#define ENVY24_SAMPLE_NUM   4096

Definition at line 56 of file envy24.c.

◆ ENVY24_TIMEOUT

#define ENVY24_TIMEOUT   1000

Definition at line 58 of file envy24.c.

◆ SCL_GPIO

#define SCL_GPIO   0x20

Definition at line 65 of file envy24.c.

◆ SDA_GPIO

#define SDA_GPIO   0x10

Definition at line 64 of file envy24.c.

Typedef Documentation

◆ sample32_t

typedef struct envy24_sample sample32_t

Definition at line 71 of file envy24.c.

Function Documentation

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( envy24chan  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( snd_envy24  ,
pci  ,
envy24_driver  ,
pcm_devclass  ,
,
 
)

◆ envy24_alloc_resource()

◆ envy24_cfgfree()

static void envy24_cfgfree ( struct cfg_info cfg)
static

Definition at line 628 of file envy24.c.

References cfg_info::free, and free.

Referenced by envy24_pci_attach(), and envy24_pci_detach().

Here is the caller graph for this function:

◆ envy24_checkintr()

static int envy24_checkintr ( struct sc_info sc,
int  dir 
)
static

Definition at line 1273 of file envy24.c.

References sc_info::dev, dir, ENVY24_MT_INT, ENVY24_MT_INT_PMASK, ENVY24_MT_INT_PSTAT, ENVY24_MT_INT_RMASK, ENVY24_MT_INT_RSTAT, envy24_rdmt(), envy24_wrmt(), intr, mask, and PCMDIR_PLAY.

Referenced by envy24_intr().

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

◆ envy24_delta_ak4524_create()

static void * envy24_delta_ak4524_create ( device_t  dev,
void *  info,
int  dir,
int  num 
)
static

◆ envy24_delta_ak4524_ctl()

static void envy24_delta_ak4524_ctl ( void *  codec,
unsigned int  cs,
unsigned int  cclk,
unsigned int  cdti 
)
static

Definition at line 913 of file envy24.c.

References envy24_delta_ak4524_codec::cclk, envy24_delta_ak4524_codec::cdti, envy24_delta_ak4524_codec::cs, data, sc_info::dev, envy24_gpiord(), envy24_gpiowr(), and envy24_delta_ak4524_codec::parent.

Referenced by envy24_delta_ak4524_create().

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

◆ envy24_delta_ak4524_destroy()

static void envy24_delta_ak4524_destroy ( void *  codec)
static

◆ envy24_delta_ak4524_init()

◆ envy24_delta_ak4524_reinit()

static void envy24_delta_ak4524_reinit ( void *  codec)
static

Definition at line 1040 of file envy24.c.

References sc_info::dev, envy24_delta_ak4524_codec::info, envy24_delta_ak4524_codec::parent, and spicds_reinit().

Here is the call graph for this function:

◆ envy24_delta_ak4524_setvolume()

static void envy24_delta_ak4524_setvolume ( void *  codec,
int  dir,
unsigned int  left,
unsigned int  right 
)
static

Definition at line 1053 of file envy24.c.

References sc_info::dev, dir, envy24_delta_ak4524_codec::info, left, envy24_delta_ak4524_codec::parent, right, and spicds_set().

Here is the call graph for this function:

◆ envy24_dmafree()

static void envy24_dmafree ( struct sc_info sc)
static

Definition at line 2204 of file envy24.c.

References sc_info::dev, sc_info::dmat, sc_info::paddr, sc_info::pbuf, sc_info::pmap, sc_info::raddr, sc_info::rbuf, and sc_info::rmap.

Referenced by envy24_dmainit(), envy24_pci_attach(), and envy24_pci_detach().

Here is the caller graph for this function:

◆ envy24_dmainit()

◆ envy24_dmapsetmap()

static void envy24_dmapsetmap ( void *  arg,
bus_dma_segment_t *  segs,
int  nseg,
int  error 
)
static

Definition at line 2170 of file envy24.c.

References sc_info::dev, sc_info::paddr, and sc_info::pmap.

Referenced by envy24_dmainit().

Here is the caller graph for this function:

◆ envy24_dmarsetmap()

static void envy24_dmarsetmap ( void *  arg,
bus_dma_segment_t *  segs,
int  nseg,
int  error 
)
static

Definition at line 2187 of file envy24.c.

References sc_info::dev, sc_info::raddr, and sc_info::rmap.

Referenced by envy24_dmainit().

Here is the caller graph for this function:

◆ envy24_gethwptr()

static u_int32_t envy24_gethwptr ( struct sc_info sc,
int  dir 
)
static

Definition at line 1173 of file envy24.c.

References sc_info::dev, dir, ENVY24_MT_PCNT, ENVY24_MT_RCNT, ENVY24_PLAY_BUFUNIT, envy24_rdmt(), ENVY24_REC_BUFUNIT, PCMDIR_PLAY, sc_info::psize, regno, and sc_info::rsize.

Referenced by envy24chan_getptr(), and envy24chan_trigger().

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

◆ envy24_gpio_i2c_ctl()

static void envy24_gpio_i2c_ctl ( void *  codec,
unsigned int  scl,
unsigned int  sda 
)
static

Definition at line 809 of file envy24.c.

References data, sc_info::dev, envy24_gpiord(), envy24_gpiowr(), envy24_delta_ak4524_codec::parent, SCL_GPIO, and SDA_GPIO.

Referenced by envy24_delta_ak4524_init().

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

◆ envy24_gpiord()

static u_int32_t envy24_gpiord ( struct sc_info sc)
static

Definition at line 750 of file envy24.c.

References ENVY24_CCI_GPIODAT, and envy24_rdci().

Referenced by envy24_delta_ak4524_ctl(), and envy24_gpio_i2c_ctl().

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

◆ envy24_gpiosetdir()

static void envy24_gpiosetdir ( struct sc_info sc,
u_int32_t  dir 
)
static

Definition at line 790 of file envy24.c.

References dir, ENVY24_CCI_GPIOCTL, and envy24_wrci().

Referenced by envy24_delta_ak4524_init(), and envy24_init().

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

◆ envy24_gpiosetmask()

static void envy24_gpiosetmask ( struct sc_info sc,
u_int32_t  mask 
)
static

Definition at line 775 of file envy24.c.

References ENVY24_CCI_GPIOMASK, envy24_wrci(), and mask.

Referenced by envy24_delta_ak4524_init(), and envy24_init().

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

◆ envy24_gpiowr()

static void envy24_gpiowr ( struct sc_info sc,
u_int32_t  data 
)
static

Definition at line 756 of file envy24.c.

References data, sc_info::dev, ENVY24_CCI_GPIODAT, and envy24_wrci().

Referenced by envy24_delta_ak4524_ctl(), envy24_gpio_i2c_ctl(), and envy24_init().

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

◆ envy24_init()

◆ envy24_intr()

◆ envy24_mutevolume()

static void envy24_mutevolume ( struct sc_info sc,
unsigned  ch 
)
static

Definition at line 1158 of file envy24.c.

References sc_info::dev, ENVY24_MT_VOLIDX, ENVY24_MT_VOLUME, ENVY24_VOL_MUTE, and envy24_wrmt().

Referenced by envy24chan_trigger().

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

◆ envy24_p16sl()

static void envy24_p16sl ( struct sc_chinfo ch)
static

◆ envy24_p32sl()

static void envy24_p32sl ( struct sc_chinfo ch)
static

◆ envy24_p8u()

static void envy24_p8u ( struct sc_chinfo ch)
static

◆ envy24_pci_attach()

◆ envy24_pci_detach()

◆ envy24_pci_probe()

static int envy24_pci_probe ( device_t  dev)
static

Definition at line 2137 of file envy24.c.

References cfg_table, dev, name, PCID_ENVY24, PCIV_ENVY24, cfg_info::subdevice, and cfg_info::subvendor.

◆ envy24_putcfg()

◆ envy24_r16sl()

static void envy24_r16sl ( struct sc_chinfo ch)
static

◆ envy24_r32sl()

static void envy24_r32sl ( struct sc_chinfo ch)
static

◆ envy24_rdci()

static u_int32_t envy24_rdci ( struct sc_info sc,
int  regno 
)
static

Definition at line 468 of file envy24.c.

References ENVY24_CCS_DATA, ENVY24_CCS_INDEX, envy24_rdcs(), envy24_wrcs(), and regno.

Referenced by envy24_gpiord().

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

◆ envy24_rdcs()

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

Definition at line 406 of file envy24.c.

References sc_info::csh, sc_info::cst, regno, and size.

Referenced by envy24_init(), envy24_rdci(), envy24_rdi2c(), and envy24_rdrom().

Here is the caller graph for this function:

◆ envy24_rdi2c()

static int envy24_rdi2c ( struct sc_info sc,
u_int32_t  dev,
u_int32_t  addr 
)
static

Definition at line 486 of file envy24.c.

References addr, data, sc_info::dev, dev, ENVY24_CCS_I2CADDR, ENVY24_CCS_I2CDATA, ENVY24_CCS_I2CDEV, ENVY24_CCS_I2CDEV_ADDR, ENVY24_CCS_I2CDEV_RD, ENVY24_CCS_I2CSTAT, ENVY24_CCS_I2CSTAT_BSY, envy24_rdcs(), ENVY24_TIMEOUT, and envy24_wrcs().

Referenced by envy24_rdrom().

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

◆ envy24_rdmt()

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

Definition at line 437 of file envy24.c.

References sc_info::mth, sc_info::mtt, regno, and size.

Referenced by envy24_checkintr(), envy24_dmainit(), envy24_gethwptr(), envy24_intr(), envy24_route(), envy24_setspeed(), envy24_slavecd(), envy24_start(), envy24_stop(), and envy24_updintr().

Here is the caller graph for this function:

◆ envy24_rdrom()

static int envy24_rdrom ( struct sc_info sc,
u_int32_t  addr 
)
static

Definition at line 561 of file envy24.c.

References addr, data, sc_info::dev, ENVY24_CCS_I2CDEV_ROM, ENVY24_CCS_I2CSTAT, ENVY24_CCS_I2CSTAT_ROM, envy24_rdcs(), and envy24_rdi2c().

Referenced by envy24_rom2cfg().

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

◆ envy24_rom2cfg()

◆ envy24_route()

static int envy24_route ( struct sc_info sc,
int  dac,
int  class,
int  adc,
int  rev 
)
static

Definition at line 1343 of file envy24.c.

References class, sc_info::dev, ENVY24_MT_PSDOUT, ENVY24_MT_RECORD, ENVY24_MT_SPDOUT, envy24_rdmt(), ENVY24_ROUTE_CLASS_MIX, ENVY24_ROUTE_DAC_1, ENVY24_ROUTE_DAC_SPDIF, ENVY24_ROUTE_LEFT, ENVY24_ROUTE_RIGHT, envy24_wrmt(), left, mask, reg, and right.

Referenced by envy24_init().

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

◆ envy24_setspeed()

static u_int32_t envy24_setspeed ( struct sc_info sc,
u_int32_t  speed 
)
static

Definition at line 1098 of file envy24.c.

References code, sc_info::dev, ENVY24_MT_RATE, ENVY24_MT_RATE_MASK, ENVY24_MT_RATE_SPDIF, envy24_rdmt(), envy24_slavecd(), envy24_speedtab, envy24_wrmt(), and speed.

Referenced by envy24chan_trigger().

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

◆ envy24_setvolume()

static void envy24_setvolume ( struct sc_info sc,
unsigned  ch 
)
static

Definition at line 1139 of file envy24.c.

References sc_info::cfg, sc_info::dev, ENVY24_MT_VOLIDX, ENVY24_MT_VOLUME, envy24_wrmt(), sc_info::left, sc_info::right, cfg_info::subdevice, and cfg_info::subvendor.

Referenced by envy24chan_trigger(), and envy24mixer_set().

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

◆ envy24_slavecd()

static int envy24_slavecd ( struct sc_info sc)
static

Definition at line 666 of file envy24.c.

References data, sc_info::dev, ENVY24_MT_AC97CMD, ENVY24_MT_AC97CMD_CLD, ENVY24_MT_AC97CMD_RDY, ENVY24_MT_AC97CMD_WRM, envy24_rdmt(), ENVY24_TIMEOUT, and envy24_wrmt().

Referenced by envy24_setspeed().

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

◆ envy24_start()

static void envy24_start ( struct sc_info sc,
int  dir 
)
static

Definition at line 1300 of file envy24.c.

References sc_info::dev, dir, ENVY24_MT_PADDR, ENVY24_MT_PCNT, ENVY24_MT_PCTL, ENVY24_MT_PCTL_PSTART, ENVY24_MT_PCTL_RSTART, envy24_rdmt(), envy24_wrmt(), and PCMDIR_PLAY.

Referenced by envy24chan_trigger().

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

◆ envy24_stop()

static void envy24_stop ( struct sc_info sc,
int  dir 
)
static

Definition at line 1324 of file envy24.c.

References sc_info::dev, dir, ENVY24_MT_PCTL, envy24_rdmt(), envy24_wrmt(), and PCMDIR_PLAY.

Referenced by envy24chan_trigger().

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

◆ envy24_updintr()

static void envy24_updintr ( struct sc_info sc,
int  dir 
)
static

Definition at line 1203 of file envy24.c.

References sc_info::blk, sc_info::dev, dir, ENVY24_MT_INT, ENVY24_MT_PCNT, ENVY24_MT_PTERM, ENVY24_MT_RCNT, ENVY24_MT_RTERM, envy24_rdmt(), envy24_wrmt(), intr, mask, PCMDIR_PLAY, sc_info::psize, sc_info::rsize, and size.

Referenced by envy24_intr(), and envy24chan_trigger().

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

◆ envy24_wrci()

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

Definition at line 475 of file envy24.c.

References data, ENVY24_CCS_DATA, ENVY24_CCS_INDEX, envy24_wrcs(), and regno.

Referenced by envy24_gpiosetdir(), envy24_gpiosetmask(), and envy24_gpiowr().

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

◆ envy24_wrcs()

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

Definition at line 421 of file envy24.c.

References sc_info::csh, sc_info::cst, data, regno, and size.

Referenced by envy24_init(), envy24_rdci(), envy24_rdi2c(), and envy24_wrci().

Here is the caller graph for this function:

◆ envy24_wrmt()

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

◆ envy24chan_free()

static int envy24chan_free ( kobj_t  obj,
void *  data 
)
static

◆ envy24chan_getcaps()

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

◆ envy24chan_getptr()

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

Definition at line 1882 of file envy24.c.

References sc_info::ch, data, sc_info::dev, sc_chinfo::dir, envy24_gethwptr(), sc_info::lock, sc_chinfo::parent, snd_mtxlock, snd_mtxunlock, and sc_chinfo::unit.

Here is the call graph for this function:

◆ envy24chan_init()

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

◆ envy24chan_setblocksize()

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

◆ envy24chan_setformat()

◆ envy24chan_setspeed()

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

Definition at line 1702 of file envy24.c.

References data, sc_info::dev, envy24_speed, sc_chinfo::parent, prev, sc_chinfo::speed, speed, and val.

◆ envy24chan_trigger()

◆ envy24mixer_init()

static int envy24mixer_init ( struct snd_mixer m)
static

◆ envy24mixer_reinit()

static int envy24mixer_reinit ( struct snd_mixer m)
static

Definition at line 1971 of file envy24.c.

References sc_info::dev, m, and mix_getdevinfo().

Here is the call graph for this function:

◆ envy24mixer_set()

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

◆ envy24mixer_setrecsrc()

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

Definition at line 2041 of file envy24.c.

References sc_info::ch, sc_info::dev, ENVY24_CHAN_PLAY_SPDIF, envy24_mixmap, m, mix_getdevinfo(), sc_info::src, and src.

Here is the call graph for this function:

◆ envy24mixer_uninit()

static int envy24mixer_uninit ( struct snd_mixer m)
static

Definition at line 1985 of file envy24.c.

References sc_info::dev, m, and mix_getdevinfo().

Here is the call graph for this function:

◆ i2c_ack()

static void i2c_ack ( void *  codec,
void(*)(void *, unsigned int, unsigned int)  ctrl 
)
static

Definition at line 870 of file envy24.c.

References ctrl, and I2C_DELAY.

Referenced by i2c_wr().

Here is the caller graph for this function:

◆ i2c_start()

static void i2c_start ( void *  codec,
void(*)(void *, unsigned int, unsigned int)  ctrl 
)
static

Definition at line 844 of file envy24.c.

References ctrl, and I2C_DELAY.

Referenced by i2c_wr().

Here is the caller graph for this function:

◆ i2c_stop()

static void i2c_stop ( void *  codec,
void(*)(void *, unsigned int, unsigned int)  ctrl 
)
static

Definition at line 857 of file envy24.c.

References ctrl, and I2C_DELAY.

Referenced by i2c_wr().

Here is the caller graph for this function:

◆ i2c_wr()

static void i2c_wr ( void *  codec,
void(*)(void *, unsigned int, unsigned int)  ctrl,
u_int32_t  dev,
int  reg,
u_int8_t  val 
)
static

Definition at line 884 of file envy24.c.

References ctrl, dev, i2c_ack(), i2c_start(), i2c_stop(), i2c_wrbit(), mask, reg, and val.

Referenced by envy24_delta_ak4524_init().

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

◆ i2c_wrbit()

static void i2c_wrbit ( void *  codec,
void(*)(void *, unsigned int, unsigned int)  ctrl,
int  bit 
)
static

Definition at line 825 of file envy24.c.

References ctrl, and I2C_DELAY.

Referenced by i2c_wr().

Here is the caller graph for this function:

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_ENVY24  ,
"envy24"  ,
"envy24 audio"   
)
static

◆ MIXER_DECLARE()

MIXER_DECLARE ( envy24mixer  )

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( snd_envy24  ,
snd_spicds  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

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

◆ MODULE_VERSION()

MODULE_VERSION ( snd_envy24  ,
 
)

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

Variable Documentation

◆ cfg_table

struct cfg_info cfg_table[]
static

Definition at line 283 of file envy24.c.

Referenced by envy24_init(), envy24_pci_probe(), and envy24_rom2cfg().

◆ code

u_int32_t code

Definition at line 1079 of file envy24.c.

Referenced by envy24_setspeed().

◆ delta_codec

struct codec_entry delta_codec
static
Initial value:
= {
NULL,
}
static void envy24_delta_ak4524_setvolume(void *, int, unsigned int, unsigned int)
Definition: envy24.c:1053
static void envy24_delta_ak4524_reinit(void *)
Definition: envy24.c:1040
static void envy24_delta_ak4524_init(void *)
Definition: envy24.c:985
static void * envy24_delta_ak4524_create(device_t, void *, int, int)
Definition: envy24.c:931
static void envy24_delta_ak4524_destroy(void *)
Definition: envy24.c:963

Definition at line 274 of file envy24.c.

◆ envy24_chanmap

unsigned envy24_chanmap[ENVY24_CHAN_NUM]
static
Initial value:
= {
}
#define ENVY24_CHAN_PLAY_DAC2
Definition: envy24.h:377
#define ENVY24_CHAN_PLAY_DAC4
Definition: envy24.h:379
#define ENVY24_CHAN_REC_ADC1
Definition: envy24.h:381
#define ENVY24_CHAN_PLAY_DAC1
Definition: envy24.h:376
#define ENVY24_CHAN_REC_ADC2
Definition: envy24.h:382
#define ENVY24_CHAN_REC_ADC3
Definition: envy24.h:383
#define ENVY24_CHAN_PLAY_SPDIF
Definition: envy24.h:380
#define ENVY24_CHAN_REC_SPDIF
Definition: envy24.h:385
#define ENVY24_CHAN_REC_ADC4
Definition: envy24.h:384
#define ENVY24_CHAN_REC_MIX
Definition: envy24.h:386
#define ENVY24_CHAN_PLAY_DAC3
Definition: envy24.h:378

Definition at line 224 of file envy24.c.

Referenced by envy24chan_init(), and envy24mixer_set().

◆ envy24_driver

driver_t envy24_driver
static
Initial value:
= {
"pcm",
}
static device_method_t envy24_methods[]
Definition: envy24.c:2685
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 2693 of file envy24.c.

◆ envy24_methods

device_method_t envy24_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, envy24_pci_probe),
DEVMETHOD(device_attach, envy24_pci_attach),
DEVMETHOD(device_detach, envy24_pci_detach),
{ 0, 0 }
}
static int envy24_pci_detach(device_t dev)
Definition: envy24.c:2649
static int envy24_pci_attach(device_t dev)
Definition: envy24.c:2549
static int envy24_pci_probe(device_t dev)
Definition: envy24.c:2137

Definition at line 2685 of file envy24.c.

◆ envy24_mixmap

int envy24_mixmap[]
static
Initial value:
= {
-1,
-1,
-1,
-1,
0,
-1,
7,
-1,
-1,
-1,
1,
-1,
-1,
-1,
8,
9,
10,
6,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
}

Definition at line 239 of file envy24.c.

Referenced by envy24mixer_set(), and envy24mixer_setrecsrc().

◆ envy24_pemltab

struct envy24_emldma envy24_pemltab[]
static
Initial value:
= {
{SND_FORMAT(AFMT_U8, 2, 0), envy24_p8u, 2},
{SND_FORMAT(AFMT_S16_LE, 2, 0), envy24_p16sl, 4},
{SND_FORMAT(AFMT_S32_LE, 2, 0), envy24_p32sl, 8},
{0, NULL, 0}
}
static void envy24_p16sl(struct sc_chinfo *)
Definition: envy24.c:1435
static void envy24_p32sl(struct sc_chinfo *)
Definition: envy24.c:1405
static void envy24_p8u(struct sc_chinfo *)
Definition: envy24.c:1480
#define SND_FORMAT(f, c, e)
Definition: sound.h:238

Definition at line 389 of file envy24.c.

Referenced by envy24chan_setformat().

◆ envy24_playcaps

struct pcmchan_caps envy24_playcaps = {8000, 96000, envy24_playfmt, 0}
static

Definition at line 381 of file envy24.c.

Referenced by envy24chan_getcaps().

◆ envy24_playfmt

u_int32_t envy24_playfmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_U8, 2, 0),
SND_FORMAT(AFMT_S16_LE, 2, 0),
SND_FORMAT(AFMT_S32_LE, 2, 0),
0
}

Definition at line 374 of file envy24.c.

Referenced by envy24_init().

◆ envy24_reccaps

struct pcmchan_caps envy24_reccaps = {8000, 96000, envy24_recfmt, 0}
static

Definition at line 372 of file envy24.c.

Referenced by envy24chan_getcaps().

◆ envy24_recfmt

u_int32_t envy24_recfmt[]
static
Initial value:
= {
SND_FORMAT(AFMT_S16_LE, 2, 0),
SND_FORMAT(AFMT_S32_LE, 2, 0),
0
}

Definition at line 367 of file envy24.c.

Referenced by envy24_init().

◆ envy24_remltab

struct envy24_emldma envy24_remltab[]
static
Initial value:
= {
{SND_FORMAT(AFMT_S16_LE, 2, 0), envy24_r16sl, 4},
{SND_FORMAT(AFMT_S32_LE, 2, 0), envy24_r32sl, 8},
{0, NULL, 0}
}
static void envy24_r16sl(struct sc_chinfo *)
Definition: envy24.c:1540
static void envy24_r32sl(struct sc_chinfo *)
Definition: envy24.c:1510

Definition at line 396 of file envy24.c.

Referenced by envy24chan_setformat().

◆ envy24_speed

u_int32_t envy24_speed[]
static
Initial value:
= {
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000,
12000, 11025, 9600, 8000, 0
}

Definition at line 268 of file envy24.c.

Referenced by envy24chan_setspeed().

◆ 

struct { ... } envy24_speedtab[]
Initial value:
= {
{0, 0x10}
}
#define ENVY24_MT_RATE_44100
Definition: envy24.h:312
#define ENVY24_MT_RATE_88200
Definition: envy24.h:315
#define ENVY24_MT_RATE_16000
Definition: envy24.h:308
#define ENVY24_MT_RATE_9600
Definition: envy24.h:306
#define ENVY24_MT_RATE_11025
Definition: envy24.h:314
#define ENVY24_MT_RATE_48000
Definition: envy24.h:303
#define ENVY24_MT_RATE_22050
Definition: envy24.h:313
#define ENVY24_MT_RATE_8000
Definition: envy24.h:309
#define ENVY24_MT_RATE_96000
Definition: envy24.h:310
#define ENVY24_MT_RATE_32000
Definition: envy24.h:307
#define ENVY24_MT_RATE_12000
Definition: envy24.h:305
#define ENVY24_MT_RATE_64000
Definition: envy24.h:311
#define ENVY24_MT_RATE_24000
Definition: envy24.h:304

Referenced by envy24_setspeed().

◆ envy24chan_methods

kobj_method_t envy24chan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, envy24chan_init),
KOBJMETHOD(channel_free, envy24chan_free),
KOBJMETHOD(channel_setformat, envy24chan_setformat),
KOBJMETHOD(channel_setspeed, envy24chan_setspeed),
KOBJMETHOD(channel_setblocksize, envy24chan_setblocksize),
KOBJMETHOD(channel_trigger, envy24chan_trigger),
KOBJMETHOD(channel_getptr, envy24chan_getptr),
KOBJMETHOD(channel_getcaps, envy24chan_getcaps),
}
static int envy24chan_trigger(kobj_t, void *, int)
Definition: envy24.c:1770
static u_int32_t envy24chan_setblocksize(kobj_t, void *, u_int32_t)
Definition: envy24.c:1727
static struct pcmchan_caps * envy24chan_getcaps(kobj_t, void *)
Definition: envy24.c:1904
static int envy24chan_free(kobj_t obj, void *data)
Definition: envy24.c:1617
static void * envy24chan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int)
Definition: envy24.c:1573
static u_int32_t envy24chan_getptr(kobj_t, void *)
Definition: envy24.c:1882
static u_int32_t envy24chan_setspeed(kobj_t, void *, u_int32_t)
Definition: envy24.c:1702
static int envy24chan_setformat(kobj_t, void *, u_int32_t)
Definition: envy24.c:1636
#define KOBJMETHOD_END
Definition: midi.c:76

Definition at line 1931 of file envy24.c.

◆ envy24mixer_methods

kobj_method_t envy24mixer_methods[]
static
Initial value:
= {
KOBJMETHOD(mixer_set, envy24mixer_set),
}
static int envy24mixer_reinit(struct snd_mixer *)
Definition: envy24.c:1971
static int envy24mixer_uninit(struct snd_mixer *)
Definition: envy24.c:1985
static int envy24mixer_init(struct snd_mixer *)
Definition: envy24.c:1949
static int envy24mixer_set(struct snd_mixer *, unsigned, unsigned, unsigned)
Definition: envy24.c:1999
static u_int32_t envy24mixer_setrecsrc(struct snd_mixer *, u_int32_t)
Definition: envy24.c:2041
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
int mixer_reinit(device_t dev)
Definition: mixer.c:860

Definition at line 2054 of file envy24.c.

◆ speed

u_int32_t speed

Definition at line 1078 of file envy24.c.

Referenced by envy24_setspeed(), and envy24chan_setspeed().