FreeBSD kernel sound device code
uaudio_pcm.c File Reference
#include <dev/sound/pcm/sound.h>
#include <dev/sound/chip.h>
#include <dev/sound/usb/uaudio.h>
#include "mixer_if.h"
Include dependency graph for uaudio_pcm.c:

Go to the source code of this file.

Functions

static void * ua_chan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
static int ua_chan_free (kobj_t obj, void *data)
 
static int ua_chan_setformat (kobj_t obj, void *data, uint32_t format)
 
static uint32_t ua_chan_setspeed (kobj_t obj, void *data, uint32_t speed)
 
static uint32_t ua_chan_setblocksize (kobj_t obj, void *data, uint32_t blocksize)
 
static int ua_chan_setfragments (kobj_t obj, void *data, uint32_t blocksize, uint32_t blockcount)
 
static int ua_chan_trigger (kobj_t obj, void *data, int go)
 
static uint32_t ua_chan_getptr (kobj_t obj, void *data)
 
static struct pcmchan_capsua_chan_getcaps (kobj_t obj, void *data)
 
static struct pcmchan_matrixua_chan_getmatrix (kobj_t obj, void *data, uint32_t format)
 
 CHANNEL_DECLARE (ua_chan)
 
static int ua_mixer_init (struct snd_mixer *m)
 
static int ua_mixer_set (struct snd_mixer *m, unsigned type, unsigned left, unsigned right)
 
static uint32_t ua_mixer_setrecsrc (struct snd_mixer *m, uint32_t src)
 
static int ua_mixer_uninit (struct snd_mixer *m)
 
 MIXER_DECLARE (ua_mixer)
 
static int ua_probe (device_t dev)
 
static int ua_attach (device_t dev)
 
static int ua_detach (device_t dev)
 
 DRIVER_MODULE (ua_pcm, uaudio, ua_pcm_driver, pcm_devclass, 0, 0)
 
 MODULE_DEPEND (ua_pcm, uaudio, 1, 1, 1)
 
 MODULE_DEPEND (ua_pcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_VERSION (ua_pcm, 1)
 

Variables

static kobj_method_t ua_chan_methods []
 
static kobj_method_t ua_mixer_methods []
 
static device_method_t ua_pcm_methods []
 
static driver_t ua_pcm_driver
 

Function Documentation

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( ua_chan  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( ua_pcm  ,
uaudio  ,
ua_pcm_driver  ,
pcm_devclass  ,
,
 
)

◆ MIXER_DECLARE()

MIXER_DECLARE ( ua_mixer  )

◆ MODULE_DEPEND() [1/2]

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

◆ MODULE_DEPEND() [2/2]

MODULE_DEPEND ( ua_pcm  ,
uaudio  ,
,
,
 
)

◆ MODULE_VERSION()

MODULE_VERSION ( ua_pcm  ,
 
)

◆ ua_attach()

static int ua_attach ( device_t  dev)
static

Definition at line 211 of file uaudio_pcm.c.

References dev, and uaudio_attach_sub().

Here is the call graph for this function:

◆ ua_chan_free()

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

Definition at line 49 of file uaudio_pcm.c.

References data, and uaudio_chan_free().

Here is the call graph for this function:

◆ ua_chan_getcaps()

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

Definition at line 102 of file uaudio_pcm.c.

References data, and uaudio_chan_getcaps().

Here is the call graph for this function:

◆ ua_chan_getmatrix()

static struct pcmchan_matrix * ua_chan_getmatrix ( kobj_t  obj,
void *  data,
uint32_t  format 
)
static

Definition at line 108 of file uaudio_pcm.c.

References data, format, and uaudio_chan_getmatrix().

Here is the call graph for this function:

◆ ua_chan_getptr()

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

Definition at line 96 of file uaudio_pcm.c.

References data, and uaudio_chan_getptr().

Here is the call graph for this function:

◆ ua_chan_init()

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

Definition at line 43 of file uaudio_pcm.c.

References b, c, devinfo, dir, and uaudio_chan_init().

Here is the call graph for this function:

◆ ua_chan_setblocksize()

static uint32_t ua_chan_setblocksize ( kobj_t  obj,
void *  data,
uint32_t  blocksize 
)
static

Definition at line 71 of file uaudio_pcm.c.

References blocksize, data, and uaudio_chan_set_param_blocksize().

Here is the call graph for this function:

◆ ua_chan_setformat()

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

Definition at line 55 of file uaudio_pcm.c.

References data, format, and uaudio_chan_set_param_format().

Here is the call graph for this function:

◆ ua_chan_setfragments()

static int ua_chan_setfragments ( kobj_t  obj,
void *  data,
uint32_t  blocksize,
uint32_t  blockcount 
)
static

Definition at line 77 of file uaudio_pcm.c.

References blockcount, blocksize, data, and uaudio_chan_set_param_fragments().

Here is the call graph for this function:

◆ ua_chan_setspeed()

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

Definition at line 65 of file uaudio_pcm.c.

References data, speed, and uaudio_chan_set_param_speed().

Here is the call graph for this function:

◆ ua_chan_trigger()

static int ua_chan_trigger ( kobj_t  obj,
void *  data,
int  go 
)
static

Definition at line 83 of file uaudio_pcm.c.

References data, go, PCMTRIG_COMMON, PCMTRIG_START, uaudio_chan_start(), and uaudio_chan_stop().

Here is the call graph for this function:

◆ ua_detach()

static int ua_detach ( device_t  dev)
static

Definition at line 217 of file uaudio_pcm.c.

References dev, and uaudio_detach_sub().

Here is the call graph for this function:

◆ ua_mixer_init()

static int ua_mixer_init ( struct snd_mixer m)
static

Definition at line 131 of file uaudio_pcm.c.

References m, mix_getdevinfo(), and uaudio_mixer_init_sub().

Here is the call graph for this function:

◆ ua_mixer_set()

static int ua_mixer_set ( struct snd_mixer m,
unsigned  type,
unsigned  left,
unsigned  right 
)
static

Definition at line 137 of file uaudio_pcm.c.

References left, m, mix_getdevinfo(), mixer_get_lock(), right, type, and uaudio_mixer_set().

Here is the call graph for this function:

◆ ua_mixer_setrecsrc()

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

Definition at line 156 of file uaudio_pcm.c.

References m, mix_getdevinfo(), mixer_get_lock(), src, and uaudio_mixer_setrecsrc().

Here is the call graph for this function:

◆ ua_mixer_uninit()

static int ua_mixer_uninit ( struct snd_mixer m)
static

Definition at line 176 of file uaudio_pcm.c.

References m, mix_getdevinfo(), and uaudio_mixer_uninit_sub().

Here is the call graph for this function:

◆ ua_probe()

static int ua_probe ( device_t  dev)
static

Definition at line 193 of file uaudio_pcm.c.

References dev, sndcard_func::func, and SCF_PCM.

Variable Documentation

◆ ua_chan_methods

kobj_method_t ua_chan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, ua_chan_init),
KOBJMETHOD(channel_free, ua_chan_free),
KOBJMETHOD(channel_setformat, ua_chan_setformat),
KOBJMETHOD(channel_setspeed, ua_chan_setspeed),
KOBJMETHOD(channel_setblocksize, ua_chan_setblocksize),
KOBJMETHOD(channel_setfragments, ua_chan_setfragments),
KOBJMETHOD(channel_trigger, ua_chan_trigger),
KOBJMETHOD(channel_getptr, ua_chan_getptr),
KOBJMETHOD(channel_getcaps, ua_chan_getcaps),
KOBJMETHOD(channel_getmatrix, ua_chan_getmatrix),
}
#define KOBJMETHOD_END
Definition: midi.c:76
static uint32_t ua_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksize)
Definition: uaudio_pcm.c:71
static uint32_t ua_chan_getptr(kobj_t obj, void *data)
Definition: uaudio_pcm.c:96
static int ua_chan_setformat(kobj_t obj, void *data, uint32_t format)
Definition: uaudio_pcm.c:55
static struct pcmchan_caps * ua_chan_getcaps(kobj_t obj, void *data)
Definition: uaudio_pcm.c:102
static uint32_t ua_chan_setspeed(kobj_t obj, void *data, uint32_t speed)
Definition: uaudio_pcm.c:65
static void * ua_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
Definition: uaudio_pcm.c:43
static int ua_chan_free(kobj_t obj, void *data)
Definition: uaudio_pcm.c:49
static int ua_chan_setfragments(kobj_t obj, void *data, uint32_t blocksize, uint32_t blockcount)
Definition: uaudio_pcm.c:77
static struct pcmchan_matrix * ua_chan_getmatrix(kobj_t obj, void *data, uint32_t format)
Definition: uaudio_pcm.c:108
static int ua_chan_trigger(kobj_t obj, void *data, int go)
Definition: uaudio_pcm.c:83

Definition at line 113 of file uaudio_pcm.c.

◆ ua_mixer_methods

kobj_method_t ua_mixer_methods[]
static
Initial value:
= {
KOBJMETHOD(mixer_init, ua_mixer_init),
KOBJMETHOD(mixer_set, ua_mixer_set),
}
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
static int ua_mixer_uninit(struct snd_mixer *m)
Definition: uaudio_pcm.c:176
static int ua_mixer_init(struct snd_mixer *m)
Definition: uaudio_pcm.c:131
static uint32_t ua_mixer_setrecsrc(struct snd_mixer *m, uint32_t src)
Definition: uaudio_pcm.c:156
static int ua_mixer_set(struct snd_mixer *m, unsigned type, unsigned left, unsigned right)
Definition: uaudio_pcm.c:137

Definition at line 181 of file uaudio_pcm.c.

◆ ua_pcm_driver

driver_t ua_pcm_driver
static
Initial value:
= {
"pcm",
}
#define PCM_SOFTC_SIZE
Definition: sound.h:96
static device_method_t ua_pcm_methods[]
Definition: uaudio_pcm.c:224

Definition at line 233 of file uaudio_pcm.c.

◆ ua_pcm_methods

device_method_t ua_pcm_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, ua_probe),
DEVMETHOD(device_attach, ua_attach),
DEVMETHOD(device_detach, ua_detach),
DEVMETHOD_END
}
static int ua_probe(device_t dev)
Definition: uaudio_pcm.c:193
static int ua_detach(device_t dev)
Definition: uaudio_pcm.c:217
static int ua_attach(device_t dev)
Definition: uaudio_pcm.c:211

Definition at line 224 of file uaudio_pcm.c.