FreeBSD kernel sound device code
envy24ht.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/envy24ht.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include "mixer_if.h"
Include dependency graph for envy24ht.c:

Go to the source code of this file.

Data Structures

struct  envy24ht_sample
 
struct  sc_chinfo
 
struct  codec_entry
 
struct  cfg_info
 
struct  sc_info
 
struct  envy24ht_emldma
 
struct  envy24ht_spi_codec
 

Macros

#define ENVY24HT_PLAY_CHNUM   8
 
#define ENVY24HT_REC_CHNUM   2
 
#define ENVY24HT_PLAY_BUFUNIT   (4 /* byte/sample */ * 8 /* channel */)
 
#define ENVY24HT_REC_BUFUNIT   (4 /* byte/sample */ * 2 /* channel */)
 
#define ENVY24HT_SAMPLE_NUM   4096
 
#define ENVY24HT_TIMEOUT   1000
 
#define ENVY24HT_DEFAULT_FORMAT   SND_FORMAT(AFMT_S16_LE, 2, 0)
 
#define ENVY24HT_NAMELEN   32
 

Typedefs

typedef struct envy24ht_sample sample32_t
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static MALLOC_DEFINE (M_ENVY24HT, "envy24ht", "envy24ht audio")
 
static void envy24ht_p8u (struct sc_chinfo *)
 
static void envy24ht_p16sl (struct sc_chinfo *)
 
static void envy24ht_p32sl (struct sc_chinfo *)
 
static void envy24ht_r16sl (struct sc_chinfo *)
 
static void envy24ht_r32sl (struct sc_chinfo *)
 
static void * envy24htchan_init (kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int)
 
static int envy24htchan_setformat (kobj_t, void *, u_int32_t)
 
static u_int32_t envy24htchan_setspeed (kobj_t, void *, u_int32_t)
 
static u_int32_t envy24htchan_setblocksize (kobj_t, void *, u_int32_t)
 
static int envy24htchan_trigger (kobj_t, void *, int)
 
static u_int32_t envy24htchan_getptr (kobj_t, void *)
 
static struct pcmchan_capsenvy24htchan_getcaps (kobj_t, void *)
 
static int envy24htmixer_init (struct snd_mixer *)
 
static int envy24htmixer_reinit (struct snd_mixer *)
 
static int envy24htmixer_uninit (struct snd_mixer *)
 
static int envy24htmixer_set (struct snd_mixer *, unsigned, unsigned, unsigned)
 
static u_int32_t envy24htmixer_setrecsrc (struct snd_mixer *, u_int32_t)
 
static void * envy24ht_spi_create (device_t, void *, int, int)
 
static void envy24ht_spi_destroy (void *)
 
static void envy24ht_spi_init (void *)
 
static void envy24ht_spi_reinit (void *)
 
static void envy24ht_spi_setvolume (void *, int, unsigned int, unsigned int)
 
static u_int32_t envy24ht_rdcs (struct sc_info *sc, int regno, int size)
 
static void envy24ht_wrcs (struct sc_info *sc, int regno, u_int32_t data, int size)
 
static u_int32_t envy24ht_rdmt (struct sc_info *sc, int regno, int size)
 
static void envy24ht_wrmt (struct sc_info *sc, int regno, u_int32_t data, int size)
 
static int envy24ht_rdi2c (struct sc_info *sc, u_int32_t dev, u_int32_t addr)
 
static int envy24ht_wri2c (struct sc_info *sc, u_int32_t dev, u_int32_t addr, u_int32_t data)
 
static int envy24ht_rdrom (struct sc_info *sc, u_int32_t addr)
 
static struct cfg_infoenvy24ht_rom2cfg (struct sc_info *sc)
 
static void envy24ht_cfgfree (struct cfg_info *cfg)
 
static u_int32_t envy24ht_gpiord (struct sc_info *sc)
 
static void envy24ht_gpiowr (struct sc_info *sc, u_int32_t data)
 
static void envy24ht_gpiosetmask (struct sc_info *sc, u_int32_t mask)
 
static void envy24ht_gpiosetdir (struct sc_info *sc, u_int32_t dir)
 
static void envy24ht_spi_ctl (void *codec, unsigned int cs, unsigned int cclk, unsigned int cdti)
 
static u_int32_t envy24ht_setspeed (struct sc_info *sc, u_int32_t speed)
 
static void envy24ht_setvolume (struct sc_info *sc, unsigned ch)
 
static void envy24ht_mutevolume (struct sc_info *sc, unsigned ch)
 
static u_int32_t envy24ht_gethwptr (struct sc_info *sc, int dir)
 
static void envy24ht_updintr (struct sc_info *sc, int dir)
 
static int envy24ht_checkintr (struct sc_info *sc, int dir)
 
static void envy24ht_start (struct sc_info *sc, int dir)
 
static void envy24ht_stop (struct sc_info *sc, int dir)
 
static int envy24htchan_free (kobj_t obj, void *data)
 
 CHANNEL_DECLARE (envy24htchan)
 
 MIXER_DECLARE (envy24htmixer)
 
static void envy24ht_intr (void *p)
 
static int envy24ht_pci_probe (device_t dev)
 
static void envy24ht_dmapsetmap (void *arg, bus_dma_segment_t *segs, int nseg, int error)
 
static void envy24ht_dmarsetmap (void *arg, bus_dma_segment_t *segs, int nseg, int error)
 
static void envy24ht_dmafree (struct sc_info *sc)
 
static int envy24ht_dmainit (struct sc_info *sc)
 
static void envy24ht_putcfg (struct sc_info *sc)
 
static int envy24ht_init (struct sc_info *sc)
 
static int envy24ht_alloc_resource (struct sc_info *sc)
 
static int envy24ht_pci_attach (device_t dev)
 
static int envy24ht_pci_detach (device_t dev)
 
 DRIVER_MODULE (snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (snd_envy24ht, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_DEPEND (snd_envy24ht, snd_spicds, 1, 1, 1)
 
 MODULE_VERSION (snd_envy24ht, 1)
 

Variables

static unsigned envy24ht_chanmap [ENVY24HT_CHAN_NUM]
 
static int envy24ht_mixmap []
 
static u_int32_t envy24ht_speed []
 
static struct codec_entry spi_codec
 
static struct cfg_info cfg_table []
 
static u_int32_t envy24ht_recfmt []
 
static struct pcmchan_caps envy24ht_reccaps = {8000, 96000, envy24ht_recfmt, 0}
 
static u_int32_t envy24ht_playfmt []
 
static struct pcmchan_caps envy24ht_playcaps = {8000, 192000, envy24ht_playfmt, 0}
 
static struct envy24ht_emldma envy24ht_pemltab []
 
static struct envy24ht_emldma envy24ht_remltab []
 
struct {
   u_int32_t   speed
 
   u_int32_t   code
 
envy24ht_speedtab []
 
static kobj_method_t envy24htchan_methods []
 
static kobj_method_t envy24htmixer_methods []
 
static device_method_t envy24ht_methods []
 
static driver_t envy24ht_driver
 

Macro Definition Documentation

◆ ENVY24HT_DEFAULT_FORMAT

#define ENVY24HT_DEFAULT_FORMAT   SND_FORMAT(AFMT_S16_LE, 2, 0)

Definition at line 72 of file envy24ht.c.

◆ ENVY24HT_NAMELEN

#define ENVY24HT_NAMELEN   32

Definition at line 74 of file envy24ht.c.

◆ ENVY24HT_PLAY_BUFUNIT

#define ENVY24HT_PLAY_BUFUNIT   (4 /* byte/sample */ * 8 /* channel */)

Definition at line 66 of file envy24ht.c.

◆ ENVY24HT_PLAY_CHNUM

#define ENVY24HT_PLAY_CHNUM   8

Definition at line 64 of file envy24ht.c.

◆ ENVY24HT_REC_BUFUNIT

#define ENVY24HT_REC_BUFUNIT   (4 /* byte/sample */ * 2 /* channel */)

Definition at line 67 of file envy24ht.c.

◆ ENVY24HT_REC_CHNUM

#define ENVY24HT_REC_CHNUM   2

Definition at line 65 of file envy24ht.c.

◆ ENVY24HT_SAMPLE_NUM

#define ENVY24HT_SAMPLE_NUM   4096

Definition at line 68 of file envy24ht.c.

◆ ENVY24HT_TIMEOUT

#define ENVY24HT_TIMEOUT   1000

Definition at line 70 of file envy24ht.c.

Typedef Documentation

◆ sample32_t

typedef struct envy24ht_sample sample32_t

Definition at line 80 of file envy24ht.c.

Function Documentation

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( envy24htchan  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( snd_envy24ht  ,
pci  ,
envy24ht_driver  ,
pcm_devclass  ,
,
 
)

◆ envy24ht_alloc_resource()

static int envy24ht_alloc_resource ( struct sc_info sc)
static

Definition at line 2400 of file envy24ht.c.

References BUS_SPACE_MAXSIZE_ENVY24, sc_info::cs, sc_info::csh, sc_info::csid, sc_info::cst, sc_info::dev, sc_info::dmat, envy24ht_intr(), ENVY24HT_PCIR_MT, sc_info::ih, sc_info::irq, sc_info::irqid, sc_info::mt, sc_info::mth, sc_info::mtid, sc_info::mtt, PCIR_CCS, PCIR_MT, and snd_setup_intr().

Referenced by envy24ht_pci_attach().

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

◆ envy24ht_cfgfree()

static void envy24ht_cfgfree ( struct cfg_info cfg)
static

Definition at line 709 of file envy24ht.c.

References cfg_info::free, and free.

Referenced by envy24ht_pci_attach(), and envy24ht_pci_detach().

Here is the caller graph for this function:

◆ envy24ht_checkintr()

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

Definition at line 1227 of file envy24ht.c.

References sc_info::dev, dir, ENVY24HT_MT_INT_MASK, ENVY24HT_MT_INT_PMASK, ENVY24HT_MT_INT_PSTAT, ENVY24HT_MT_INT_RMASK, ENVY24HT_MT_INT_RSTAT, ENVY24HT_MT_INT_STAT, envy24ht_rdmt(), envy24ht_wrmt(), intr, mask, and PCMDIR_PLAY.

Referenced by envy24ht_intr().

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

◆ envy24ht_dmafree()

static void envy24ht_dmafree ( struct sc_info sc)
static

Definition at line 2120 of file envy24ht.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 envy24ht_dmainit(), envy24ht_pci_attach(), and envy24ht_pci_detach().

Here is the caller graph for this function:

◆ envy24ht_dmainit()

static int envy24ht_dmainit ( struct sc_info sc)
static

◆ envy24ht_dmapsetmap()

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

Definition at line 2084 of file envy24ht.c.

References sc_info::dev, ENVY24HT_MT_PADDR, ENVY24HT_MT_PCNT, envy24ht_wrmt(), and sc_info::paddr.

Referenced by envy24ht_dmainit().

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

◆ envy24ht_dmarsetmap()

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

Definition at line 2102 of file envy24ht.c.

References sc_info::dev, ENVY24HT_MT_RADDR, ENVY24HT_MT_RCNT, envy24ht_wrmt(), and sc_info::raddr.

Referenced by envy24ht_dmainit().

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

◆ envy24ht_gethwptr()

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

Definition at line 1127 of file envy24ht.c.

References sc_info::dev, dir, ENVY24HT_MT_PCNT, ENVY24HT_MT_RCNT, ENVY24HT_PLAY_BUFUNIT, envy24ht_rdmt(), ENVY24HT_REC_BUFUNIT, PCMDIR_PLAY, sc_info::psize, regno, and sc_info::rsize.

Referenced by envy24htchan_getptr(), and envy24htchan_trigger().

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

◆ envy24ht_gpiord()

static u_int32_t envy24ht_gpiord ( struct sc_info sc)
static

Definition at line 829 of file envy24ht.c.

References sc_info::cfg, ENVY24HT_CCS_GPIO_HDATA, ENVY24HT_CCS_GPIO_LDATA, envy24ht_rdcs(), cfg_info::subdevice, and cfg_info::subvendor.

Referenced by envy24ht_spi_ctl().

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

◆ envy24ht_gpiosetdir()

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

Definition at line 876 of file envy24ht.c.

References sc_info::cfg, dir, ENVY24HT_CCS_GPIO_CTLDIR, envy24ht_wrcs(), cfg_info::subdevice, and cfg_info::subvendor.

Referenced by envy24ht_init().

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

◆ envy24ht_gpiosetmask()

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

Definition at line 859 of file envy24ht.c.

References sc_info::cfg, ENVY24HT_CCS_GPIO_HMASK, ENVY24HT_CCS_GPIO_LMASK, envy24ht_wrcs(), mask, and cfg_info::subdevice.

Referenced by envy24ht_init().

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

◆ envy24ht_gpiowr()

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

Definition at line 838 of file envy24ht.c.

References sc_info::cfg, data, sc_info::dev, ENVY24HT_CCS_GPIO_HDATA, ENVY24HT_CCS_GPIO_LDATA, envy24ht_wrcs(), and cfg_info::subdevice.

Referenced by envy24ht_init(), and envy24ht_spi_ctl().

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

◆ envy24ht_init()

◆ envy24ht_intr()

◆ envy24ht_mutevolume()

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

Definition at line 1112 of file envy24ht.c.

References sc_info::dev, ENVY24HT_VOL_MUTE, and envy24ht_wrmt().

Referenced by envy24htchan_trigger().

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

◆ envy24ht_p16sl()

static void envy24ht_p16sl ( struct sc_chinfo ch)
static

◆ envy24ht_p32sl()

static void envy24ht_p32sl ( struct sc_chinfo ch)
static

◆ envy24ht_p8u()

static void envy24ht_p8u ( struct sc_chinfo ch)
static

◆ envy24ht_pci_attach()

◆ envy24ht_pci_detach()

◆ envy24ht_pci_probe()

static int envy24ht_pci_probe ( device_t  dev)
static

◆ envy24ht_putcfg()

◆ envy24ht_r16sl()

static void envy24ht_r16sl ( struct sc_chinfo ch)
static

◆ envy24ht_r32sl()

static void envy24ht_r32sl ( struct sc_chinfo ch)
static

◆ envy24ht_rdcs()

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

Definition at line 459 of file envy24ht.c.

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

Referenced by envy24ht_gpiord(), envy24ht_init(), envy24ht_rdi2c(), envy24ht_rdrom(), and envy24ht_wri2c().

Here is the caller graph for this function:

◆ envy24ht_rdi2c()

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

Definition at line 525 of file envy24ht.c.

References addr, data, sc_info::dev, dev, ENVY24HT_CCS_I2CADDR, ENVY24HT_CCS_I2CDATA, ENVY24HT_CCS_I2CDEV, ENVY24HT_CCS_I2CDEV_ADDR, ENVY24HT_CCS_I2CDEV_RD, ENVY24HT_CCS_I2CSTAT, ENVY24HT_CCS_I2CSTAT_BSY, envy24ht_rdcs(), ENVY24HT_TIMEOUT, and envy24ht_wrcs().

Referenced by envy24ht_rdrom().

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

◆ envy24ht_rdmt()

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

Definition at line 490 of file envy24ht.c.

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

Referenced by envy24ht_checkintr(), envy24ht_gethwptr(), envy24ht_intr(), envy24ht_setspeed(), envy24ht_start(), envy24ht_stop(), and envy24ht_updintr().

Here is the caller graph for this function:

◆ envy24ht_rdrom()

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

Definition at line 598 of file envy24ht.c.

References addr, data, sc_info::dev, ENVY24HT_CCS_I2CDEV_ROM, ENVY24HT_CCS_I2CSTAT, ENVY24HT_CCS_I2CSTAT_ROM, envy24ht_rdcs(), and envy24ht_rdi2c().

Referenced by envy24ht_rom2cfg().

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

◆ envy24ht_rom2cfg()

◆ envy24ht_setspeed()

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

◆ envy24ht_setvolume()

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

Definition at line 1100 of file envy24ht.c.

References sc_info::dev, envy24ht_wrmt(), sc_info::left, and sc_info::right.

Referenced by envy24htchan_trigger(), and envy24htmixer_set().

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

◆ envy24ht_spi_create()

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

◆ envy24ht_spi_ctl()

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

Definition at line 898 of file envy24ht.c.

References envy24ht_spi_codec::cclk, envy24ht_spi_codec::cdti, envy24ht_spi_codec::cs, data, sc_info::dev, envy24ht_gpiord(), envy24ht_gpiowr(), and envy24ht_spi_codec::parent.

Referenced by envy24ht_spi_create().

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

◆ envy24ht_spi_destroy()

static void envy24ht_spi_destroy ( void *  codec)
static

◆ envy24ht_spi_init()

◆ envy24ht_spi_reinit()

static void envy24ht_spi_reinit ( void *  codec)
static

Definition at line 996 of file envy24ht.c.

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

Here is the call graph for this function:

◆ envy24ht_spi_setvolume()

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

Definition at line 1009 of file envy24ht.c.

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

Here is the call graph for this function:

◆ envy24ht_start()

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

Definition at line 1260 of file envy24ht.c.

References sc_info::dev, dir, ENVY24HT_MT_PADDR, ENVY24HT_MT_PCNT, ENVY24HT_MT_PCTL, ENVY24HT_MT_PCTL_PSTART, ENVY24HT_MT_PCTL_RSTART, envy24ht_rdmt(), envy24ht_wrmt(), and PCMDIR_PLAY.

Referenced by envy24htchan_trigger().

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

◆ envy24ht_stop()

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

Definition at line 1284 of file envy24ht.c.

References sc_info::dev, dir, ENVY24HT_MT_PCTL, envy24ht_rdmt(), envy24ht_wrmt(), and PCMDIR_PLAY.

Referenced by envy24htchan_trigger().

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

◆ envy24ht_updintr()

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

Definition at line 1157 of file envy24ht.c.

References sc_info::blk, sc_info::dev, dir, ENVY24HT_MT_INT_MASK, ENVY24HT_MT_PCNT, ENVY24HT_MT_PTERM, ENVY24HT_MT_RCNT, ENVY24HT_MT_RTERM, envy24ht_rdmt(), envy24ht_wrmt(), intr, mask, PCMDIR_PLAY, sc_info::psize, sc_info::rsize, and size.

Referenced by envy24ht_intr(), and envy24htchan_trigger().

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

◆ envy24ht_wrcs()

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

Definition at line 474 of file envy24ht.c.

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

Referenced by envy24ht_gpiosetdir(), envy24ht_gpiosetmask(), envy24ht_gpiowr(), envy24ht_init(), envy24ht_rdi2c(), and envy24ht_wri2c().

Here is the caller graph for this function:

◆ envy24ht_wri2c()

static int envy24ht_wri2c ( struct sc_info sc,
u_int32_t  dev,
u_int32_t  addr,
u_int32_t  data 
)
static

Definition at line 563 of file envy24ht.c.

References addr, data, sc_info::dev, dev, ENVY24HT_CCS_I2CADDR, ENVY24HT_CCS_I2CDATA, ENVY24HT_CCS_I2CDEV, ENVY24HT_CCS_I2CDEV_ADDR, ENVY24HT_CCS_I2CDEV_WR, ENVY24HT_CCS_I2CSTAT, ENVY24HT_CCS_I2CSTAT_BSY, envy24ht_rdcs(), ENVY24HT_TIMEOUT, and envy24ht_wrcs().

Referenced by envy24ht_init().

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

◆ envy24ht_wrmt()

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

◆ envy24htchan_free()

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

◆ envy24htchan_getcaps()

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

◆ envy24htchan_getptr()

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

Definition at line 1791 of file envy24ht.c.

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

Here is the call graph for this function:

◆ envy24htchan_init()

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

◆ envy24htchan_setblocksize()

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

◆ envy24htchan_setformat()

◆ envy24htchan_setspeed()

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

Definition at line 1613 of file envy24ht.c.

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

◆ envy24htchan_trigger()

◆ envy24htmixer_init()

static int envy24htmixer_init ( struct snd_mixer m)
static

◆ envy24htmixer_reinit()

static int envy24htmixer_reinit ( struct snd_mixer m)
static

Definition at line 1885 of file envy24ht.c.

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

Here is the call graph for this function:

◆ envy24htmixer_set()

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

◆ envy24htmixer_setrecsrc()

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

Definition at line 1955 of file envy24ht.c.

References sc_info::ch, sc_info::dev, ENVY24HT_CHAN_PLAY_SPDIF, envy24ht_mixmap, m, mix_getdevinfo(), sc_info::src, and src.

Here is the call graph for this function:

◆ envy24htmixer_uninit()

static int envy24htmixer_uninit ( struct snd_mixer m)
static

Definition at line 1899 of file envy24ht.c.

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

Here is the call graph for this function:

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_ENVY24HT  ,
"envy24ht"  ,
"envy24ht audio"   
)
static

◆ MIXER_DECLARE()

MIXER_DECLARE ( envy24htmixer  )

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( snd_envy24ht  ,
snd_spicds  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

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

◆ MODULE_VERSION()

MODULE_VERSION ( snd_envy24ht  ,
 
)

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

Variable Documentation

◆ cfg_table

struct cfg_info cfg_table[]
static

Definition at line 282 of file envy24ht.c.

Referenced by envy24ht_init(), envy24ht_pci_probe(), and envy24ht_rom2cfg().

◆ code

u_int32_t code

Definition at line 1027 of file envy24ht.c.

Referenced by envy24ht_setspeed().

◆ envy24ht_chanmap

unsigned envy24ht_chanmap[ENVY24HT_CHAN_NUM]
static
Initial value:
= {
}
#define ENVY24HT_CHAN_REC_MIX
Definition: envy24ht.h:170
#define ENVY24HT_CHAN_REC_ADC3
Definition: envy24ht.h:167
#define ENVY24HT_CHAN_REC_ADC1
Definition: envy24ht.h:165
#define ENVY24HT_CHAN_PLAY_SPDIF
Definition: envy24ht.h:164
#define ENVY24HT_CHAN_PLAY_DAC4
Definition: envy24ht.h:163
#define ENVY24HT_CHAN_REC_SPDIF
Definition: envy24ht.h:169
#define ENVY24HT_CHAN_PLAY_DAC1
Definition: envy24ht.h:160
#define ENVY24HT_CHAN_PLAY_DAC3
Definition: envy24ht.h:162
#define ENVY24HT_CHAN_REC_ADC2
Definition: envy24ht.h:166
#define ENVY24HT_CHAN_PLAY_DAC2
Definition: envy24ht.h:161
#define ENVY24HT_CHAN_REC_ADC4
Definition: envy24ht.h:168

Definition at line 223 of file envy24ht.c.

Referenced by envy24htchan_init(), and envy24htmixer_set().

◆ envy24ht_driver

driver_t envy24ht_driver
static
Initial value:
= {
"pcm",
}
static device_method_t envy24ht_methods[]
Definition: envy24ht.c:2581
#define PCM_SOFTC_SIZE
Definition: sound.h:96

Definition at line 2589 of file envy24ht.c.

◆ envy24ht_methods

device_method_t envy24ht_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, envy24ht_pci_probe),
DEVMETHOD(device_attach, envy24ht_pci_attach),
DEVMETHOD(device_detach, envy24ht_pci_detach),
{ 0, 0 }
}
static int envy24ht_pci_probe(device_t dev)
Definition: envy24ht.c:2051
static int envy24ht_pci_attach(device_t dev)
Definition: envy24ht.c:2453
static int envy24ht_pci_detach(device_t dev)
Definition: envy24ht.c:2547

Definition at line 2581 of file envy24ht.c.

◆ envy24ht_mixmap

int envy24ht_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 238 of file envy24ht.c.

Referenced by envy24htmixer_set(), and envy24htmixer_setrecsrc().

◆ envy24ht_pemltab

struct envy24ht_emldma envy24ht_pemltab[]
static
Initial value:
= {
{SND_FORMAT(AFMT_U8, 2, 0), envy24ht_p8u, 2},
{SND_FORMAT(AFMT_S16_LE, 2, 0), envy24ht_p16sl, 4},
{SND_FORMAT(AFMT_S32_LE, 2, 0), envy24ht_p32sl, 8},
{0, NULL, 0}
}
static void envy24ht_p32sl(struct sc_chinfo *)
Definition: envy24ht.c:1314
static void envy24ht_p8u(struct sc_chinfo *)
Definition: envy24ht.c:1389
static void envy24ht_p16sl(struct sc_chinfo *)
Definition: envy24ht.c:1344
#define SND_FORMAT(f, c, e)
Definition: sound.h:238

Definition at line 442 of file envy24ht.c.

Referenced by envy24htchan_setformat().

◆ envy24ht_playcaps

struct pcmchan_caps envy24ht_playcaps = {8000, 192000, envy24ht_playfmt, 0}
static

Definition at line 434 of file envy24ht.c.

Referenced by envy24htchan_getcaps().

◆ envy24ht_playfmt

u_int32_t envy24ht_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 427 of file envy24ht.c.

Referenced by envy24ht_init().

◆ envy24ht_reccaps

struct pcmchan_caps envy24ht_reccaps = {8000, 96000, envy24ht_recfmt, 0}
static

Definition at line 425 of file envy24ht.c.

Referenced by envy24htchan_getcaps().

◆ envy24ht_recfmt

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

Definition at line 420 of file envy24ht.c.

Referenced by envy24ht_init().

◆ envy24ht_remltab

struct envy24ht_emldma envy24ht_remltab[]
static
Initial value:
= {
{SND_FORMAT(AFMT_S16_LE, 2, 0), envy24ht_r16sl, 4},
{SND_FORMAT(AFMT_S32_LE, 2, 0), envy24ht_r32sl, 8},
{0, NULL, 0}
}
static void envy24ht_r16sl(struct sc_chinfo *)
Definition: envy24ht.c:1449
static void envy24ht_r32sl(struct sc_chinfo *)
Definition: envy24ht.c:1419

Definition at line 449 of file envy24ht.c.

Referenced by envy24htchan_setformat().

◆ envy24ht_speed

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

Definition at line 267 of file envy24ht.c.

Referenced by envy24htchan_setspeed().

◆ 

struct { ... } envy24ht_speedtab[]
Initial value:
= {
{0, 0x10}
}
#define ENVY24HT_MT_RATE_96000
Definition: envy24ht.h:111
#define ENVY24HT_MT_RATE_48000
Definition: envy24ht.h:104
#define ENVY24HT_MT_RATE_24000
Definition: envy24ht.h:105
#define ENVY24HT_MT_RATE_64000
Definition: envy24ht.h:113
#define ENVY24HT_MT_RATE_12000
Definition: envy24ht.h:106
#define ENVY24HT_MT_RATE_9600
Definition: envy24ht.h:107
#define ENVY24HT_MT_RATE_11025
Definition: envy24ht.h:116
#define ENVY24HT_MT_RATE_176400
Definition: envy24ht.h:118
#define ENVY24HT_MT_RATE_16000
Definition: envy24ht.h:109
#define ENVY24HT_MT_RATE_8000
Definition: envy24ht.h:110
#define ENVY24HT_MT_RATE_32000
Definition: envy24ht.h:108
#define ENVY24HT_MT_RATE_192000
Definition: envy24ht.h:112
#define ENVY24HT_MT_RATE_88200
Definition: envy24ht.h:117
#define ENVY24HT_MT_RATE_22050
Definition: envy24ht.h:115
#define ENVY24HT_MT_RATE_44100
Definition: envy24ht.h:114

Referenced by envy24ht_setspeed().

◆ envy24htchan_methods

kobj_method_t envy24htchan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, envy24htchan_init),
KOBJMETHOD(channel_free, envy24htchan_free),
KOBJMETHOD(channel_setformat, envy24htchan_setformat),
KOBJMETHOD(channel_setspeed, envy24htchan_setspeed),
KOBJMETHOD(channel_setblocksize, envy24htchan_setblocksize),
KOBJMETHOD(channel_trigger, envy24htchan_trigger),
KOBJMETHOD(channel_getptr, envy24htchan_getptr),
KOBJMETHOD(channel_getcaps, envy24htchan_getcaps),
}
static u_int32_t envy24htchan_setblocksize(kobj_t, void *, u_int32_t)
Definition: envy24ht.c:1638
static void * envy24htchan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int)
Definition: envy24ht.c:1482
static int envy24htchan_setformat(kobj_t, void *, u_int32_t)
Definition: envy24ht.c:1547
static u_int32_t envy24htchan_getptr(kobj_t, void *)
Definition: envy24ht.c:1791
static struct pcmchan_caps * envy24htchan_getcaps(kobj_t, void *)
Definition: envy24ht.c:1813
static int envy24htchan_free(kobj_t obj, void *data)
Definition: envy24ht.c:1528
static u_int32_t envy24htchan_setspeed(kobj_t, void *, u_int32_t)
Definition: envy24ht.c:1613
static int envy24htchan_trigger(kobj_t, void *, int)
Definition: envy24ht.c:1681
#define KOBJMETHOD_END
Definition: midi.c:76

Definition at line 1840 of file envy24ht.c.

◆ envy24htmixer_methods

kobj_method_t envy24htmixer_methods[]
static
Initial value:
= {
}
static int envy24htmixer_uninit(struct snd_mixer *)
Definition: envy24ht.c:1899
static int envy24htmixer_init(struct snd_mixer *)
Definition: envy24ht.c:1858
static int envy24htmixer_reinit(struct snd_mixer *)
Definition: envy24ht.c:1885
static int envy24htmixer_set(struct snd_mixer *, unsigned, unsigned, unsigned)
Definition: envy24ht.c:1913
static u_int32_t envy24htmixer_setrecsrc(struct snd_mixer *, u_int32_t)
Definition: envy24ht.c:1955
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 1968 of file envy24ht.c.

◆ speed

u_int32_t speed

Definition at line 1026 of file envy24ht.c.

Referenced by envy24ht_setspeed(), and envy24htchan_setspeed().

◆ spi_codec

struct codec_entry spi_codec
static
Initial value:
= {
NULL,
}
static void envy24ht_spi_reinit(void *)
Definition: envy24ht.c:996
static void * envy24ht_spi_create(device_t, void *, int, int)
Definition: envy24ht.c:916
static void envy24ht_spi_setvolume(void *, int, unsigned int, unsigned int)
Definition: envy24ht.c:1009
static void envy24ht_spi_init(void *)
Definition: envy24ht.c:970
static void envy24ht_spi_destroy(void *)
Definition: envy24ht.c:948

Definition at line 273 of file envy24ht.c.