FreeBSD kernel sound device code
spicds.c File Reference
Include dependency graph for spicds.c:

Go to the source code of this file.

Data Structures

struct  spicds_info
 

Macros

#define SPICDS_NAMELEN   16
 

Functions

static MALLOC_DEFINE (M_SPICDS, "spicds", "SPI codec")
 
static void spicds_wrbit (struct spicds_info *codec, int bit)
 
static void spicds_wrcd (struct spicds_info *codec, int reg, u_int16_t val)
 
struct spicds_infospicds_create (device_t dev, void *devinfo, int num, spicds_ctrl ctrl)
 
void spicds_destroy (struct spicds_info *codec)
 
void spicds_settype (struct spicds_info *codec, unsigned int type)
 
void spicds_setcif (struct spicds_info *codec, unsigned int cif)
 
void spicds_setformat (struct spicds_info *codec, unsigned int format)
 
void spicds_setdvc (struct spicds_info *codec, unsigned int dvc)
 
void spicds_init (struct spicds_info *codec)
 
void spicds_reinit (struct spicds_info *codec)
 
void spicds_set (struct spicds_info *codec, int dir, unsigned int left, unsigned int right)
 
 MODULE_DEPEND (snd_spicds, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (snd_spicds, 1)
 

Macro Definition Documentation

◆ SPICDS_NAMELEN

#define SPICDS_NAMELEN   16

Definition at line 42 of file spicds.c.

Function Documentation

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_SPICDS  ,
"spicds"  ,
"SPI codec"   
)
static

◆ MODULE_DEPEND()

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

◆ MODULE_VERSION()

MODULE_VERSION ( snd_spicds  ,
 
)

◆ spicds_create()

struct spicds_info * spicds_create ( device_t  dev,
void *  devinfo,
int  num,
spicds_ctrl  ctrl 
)

◆ spicds_destroy()

void spicds_destroy ( struct spicds_info codec)

Definition at line 168 of file spicds.c.

References free, spicds_info::lock, and snd_mtxfree().

Referenced by envy24_delta_ak4524_destroy(), and envy24ht_spi_destroy().

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

◆ spicds_init()

◆ spicds_reinit()

void spicds_reinit ( struct spicds_info codec)

Definition at line 253 of file spicds.c.

References AK4524_DVC, AK4524_FORMAT, AK4524_RESET, AK452X_RESET_RSAD, AK452X_RESET_RSDA, spicds_info::dvc, spicds_info::format, spicds_info::lock, snd_mtxlock, snd_mtxunlock, SPICDS_TYPE_WM8770, spicds_wrcd(), and spicds_info::type.

Referenced by envy24_delta_ak4524_reinit(), and envy24ht_spi_reinit().

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

◆ spicds_set()

◆ spicds_setcif()

void spicds_setcif ( struct spicds_info codec,
unsigned int  cif 
)

Definition at line 183 of file spicds.c.

References spicds_info::cif, spicds_info::lock, snd_mtxlock, and snd_mtxunlock.

Referenced by envy24_delta_ak4524_init(), and envy24ht_spi_init().

Here is the caller graph for this function:

◆ spicds_setdvc()

void spicds_setdvc ( struct spicds_info codec,
unsigned int  dvc 
)

Definition at line 199 of file spicds.c.

References spicds_info::dvc, spicds_info::lock, snd_mtxlock, and snd_mtxunlock.

Referenced by envy24_delta_ak4524_init(), and envy24ht_spi_init().

Here is the caller graph for this function:

◆ spicds_setformat()

void spicds_setformat ( struct spicds_info codec,
unsigned int  format 
)

Definition at line 191 of file spicds.c.

References format, spicds_info::format, spicds_info::lock, snd_mtxlock, and snd_mtxunlock.

Referenced by envy24_delta_ak4524_init(), and envy24ht_spi_init().

Here is the caller graph for this function:

◆ spicds_settype()

void spicds_settype ( struct spicds_info codec,
unsigned int  type 
)

Definition at line 175 of file spicds.c.

References spicds_info::lock, snd_mtxlock, snd_mtxunlock, spicds_info::type, and type.

Referenced by envy24_delta_ak4524_init(), and envy24ht_spi_init().

Here is the caller graph for this function:

◆ spicds_wrbit()

static void spicds_wrbit ( struct spicds_info codec,
int  bit 
)
static

Definition at line 58 of file spicds.c.

References spicds_info::cif, spicds_info::ctrl, and spicds_info::devinfo.

Referenced by spicds_wrcd().

Here is the caller graph for this function:

◆ spicds_wrcd()

static void spicds_wrcd ( struct spicds_info codec,
int  reg,
u_int16_t  val 
)
static

Definition at line 78 of file spicds.c.

References spicds_info::cif, spicds_info::ctrl, spicds_info::dev, spicds_info::devinfo, mask, reg, SPICDS_TYPE_AK4381, SPICDS_TYPE_AK4396, SPICDS_TYPE_WM8770, spicds_wrbit(), spicds_info::type, and val.

Referenced by spicds_init(), spicds_reinit(), and spicds_set().

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