This document is free; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Table of Contents
Table of Contents
snd_card_create — create and initialize a soundcard structure
int fsfuncsnd_card_create ( | idx, | |
xid, | ||
module, | ||
extra_size, | ||
card_ret) ; |
int idx
;const char * xid
;struct module * module
;int extra_size
;struct snd_card ** card_ret
;idx
card index (address) [0 ... (SNDRV_CARDS-1)]
xid
card identification (ASCII string)
module
top level module for locking
extra_size
allocate this extra size after the main soundcard structure
card_ret
the pointer to store the created card instance
snd_card_disconnect — disconnect all APIs from the file-operations (user space)
int fsfuncsnd_card_disconnect ( | card) ; |
struct snd_card * card
;snd_card_unref — release the reference counter
void fsfuncsnd_card_unref ( | card) ; |
struct snd_card * card
;snd_card_set_id — set card identification name
void fsfuncsnd_card_set_id ( | card, | |
nid) ; |
struct snd_card * card
;const char * nid
;snd_card_register — register the soundcard
int fsfuncsnd_card_register ( | card) ; |
struct snd_card * card
;snd_component_add — add a component string
int fsfuncsnd_component_add ( | card, | |
component) ; |
struct snd_card * card
;const char * component
;snd_card_file_add — add the file to the file list of the card
int fsfuncsnd_card_file_add ( | card, | |
file) ; |
struct snd_card * card
;struct file * file
;snd_card_file_remove — remove the file from the file list
int fsfuncsnd_card_file_remove ( | card, | |
file) ; |
struct snd_card * card
;struct file * file
;snd_device_new — create an ALSA device component
int fsfuncsnd_device_new ( | card, | |
type, | ||
device_data, | ||
ops) ; |
struct snd_card * card
;snd_device_type_t type
;void * device_data
;struct snd_device_ops * ops
;card
the card instance
type
the device type, SNDRV_DEV_XXX
device_data
the data pointer of this device
ops
the operator table
snd_device_free — release the device from the card
int fsfuncsnd_device_free ( | card, | |
device_data) ; |
struct snd_card * card
;void * device_data
;snd_device_register — register the device
int fsfuncsnd_device_register ( | card, | |
device_data) ; |
struct snd_card * card
;void * device_data
;snd_request_card — try to load the card module
void fsfuncsnd_request_card ( | card) ; |
int card
;snd_lookup_minor_data — get user data of a registered device
void * fsfuncsnd_lookup_minor_data ( | minor, | |
type) ; |
unsigned int minor
;int type
;Checks that a minor device with the specified type is registered, and returns its user data pointer.
This function increments the reference counter of the card instance
if an associated instance with the given minor number and type is found.
The caller must call snd_card_unref
appropriately later.
snd_register_device_for_dev — Register the ALSA device file for the card
int fsfuncsnd_register_device_for_dev ( | type, | |
card, | ||
dev, | ||
f_ops, | ||
private_data, | ||
name, | ||
device) ; |
int type
;struct snd_card * card
;int dev
;const struct file_operations * f_ops
;void * private_data
;const char * name
;struct device * device
;type
the device type, SNDRV_DEVICE_TYPE_XXX
card
the card instance
dev
the device index
f_ops
the file operations
private_data
user pointer for f_ops->open
name
the device file name
device
the struct device to link this new device to
copy_to_user_fromio — copy data from mmio-space to user-space
int fsfunccopy_to_user_fromio ( | dst, | |
src, | ||
count) ; |
void __user * dst
;const volatile void __iomem * src
;size_t count
;copy_from_user_toio — copy data from user-space to mmio-space
int fsfunccopy_from_user_toio ( | dst, | |
src, | ||
count) ; |
volatile void __iomem * dst
;const void __user * src
;size_t count
;snd_malloc_pages — allocate pages with the given size
void * fsfuncsnd_malloc_pages ( | size, | |
gfp_flags) ; |
size_t size
;gfp_t gfp_flags
;snd_free_pages — release the pages
void fsfuncsnd_free_pages ( | ptr, | |
size) ; |
void * ptr
;size_t size
;snd_dma_alloc_pages — allocate the buffer area according to the given type
int fsfuncsnd_dma_alloc_pages ( | type, | |
device, | ||
size, | ||
dmab) ; |
int type
;struct device * device
;size_t size
;struct snd_dma_buffer * dmab
;snd_dma_alloc_pages_fallback — allocate the buffer area according to the given type with fallback
int fsfuncsnd_dma_alloc_pages_fallback ( | type, | |
device, | ||
size, | ||
dmab) ; |
int type
;struct device * device
;size_t size
;struct snd_dma_buffer * dmab
;type
the DMA buffer type
device
the device pointer
size
the buffer size to allocate
dmab
buffer allocation record to store the allocated data
snd_dma_free_pages — release the allocated buffer
void fsfuncsnd_dma_free_pages ( | dmab) ; |
struct snd_dma_buffer * dmab
;snd_dma_get_reserved_buf — get the reserved buffer for the given device
size_t fsfuncsnd_dma_get_reserved_buf ( | dmab, | |
id) ; |
struct snd_dma_buffer * dmab
;unsigned int id
;Table of Contents
snd_pcm_new_stream — create a new PCM stream
int fsfuncsnd_pcm_new_stream ( | pcm, | |
stream, | ||
substream_count) ; |
struct snd_pcm * pcm
;int stream
;int substream_count
;pcm
the pcm instance
stream
the stream direction, SNDRV_PCM_STREAM_XXX
substream_count
the number of substreams
snd_pcm_new — create a new PCM instance
int fsfuncsnd_pcm_new ( | card, | |
id, | ||
device, | ||
playback_count, | ||
capture_count, | ||
rpcm) ; |
struct snd_card * card
;const char * id
;int device
;int playback_count
;int capture_count
;struct snd_pcm ** rpcm
;card
the card instance
id
the id string
device
the device index (zero based)
playback_count
the number of substreams for playback
capture_count
the number of substreams for capture
rpcm
the pointer to store the new pcm instance
snd_pcm_new_internal — create a new internal PCM instance
int fsfuncsnd_pcm_new_internal ( | card, | |
id, | ||
device, | ||
playback_count, | ||
capture_count, | ||
rpcm) ; |
struct snd_card * card
;const char * id
;int device
;int playback_count
;int capture_count
;struct snd_pcm ** rpcm
;card
the card instance
id
the id string
device
the device index (zero based - shared with normal PCMs)
playback_count
the number of substreams for playback
capture_count
the number of substreams for capture
rpcm
the pointer to store the new pcm instance
Creates a new internal PCM instance with no userspace device or procfs entries. This is used by ASoC Back End PCMs in order to create a PCM that will only be used internally by kernel drivers. i.e. it cannot be opened by userspace. It provides existing ASoC components drivers with a substream and access to any private data.
The pcm operators have to be set afterwards to the new instance
via snd_pcm_set_ops
.
snd_pcm_set_ops — set the PCM operators
void fsfuncsnd_pcm_set_ops ( | pcm, | |
direction, | ||
ops) ; |
struct snd_pcm * pcm
;int direction
;const struct snd_pcm_ops * ops
;snd_pcm_set_sync — set the PCM sync id
void fsfuncsnd_pcm_set_sync ( | substream) ; |
struct snd_pcm_substream * substream
;snd_interval_refine — refine the interval value of configurator
int fsfuncsnd_interval_refine ( | i, | |
v) ; |
struct snd_interval * i
;const struct snd_interval * v
;snd_interval_ratnum — refine the interval value
int fsfuncsnd_interval_ratnum ( | i, | |
rats_count, | ||
rats, | ||
nump, | ||
denp) ; |
struct snd_interval * i
;unsigned int rats_count
;struct snd_ratnum * rats
;unsigned int * nump
;unsigned int * denp
;snd_interval_list — refine the interval value from the list
int fsfuncsnd_interval_list ( | i, | |
count, | ||
list, | ||
mask) ; |
struct snd_interval * i
;unsigned int count
;const unsigned int * list
;unsigned int mask
;i
the interval value to refine
count
the number of elements in the list
list
the value list
mask
the bit-mask to evaluate
snd_pcm_hw_rule_add — add the hw-constraint rule
int fsfuncsnd_pcm_hw_rule_add ( | runtime, | |
cond, | ||
var, | ||
func, | ||
private, | ||
dep, | ||
...) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;int var
;snd_pcm_hw_rule_func_t func
;void * private
;int dep
; ...
;snd_pcm_hw_constraint_integer — apply an integer constraint to an interval
int fsfuncsnd_pcm_hw_constraint_integer ( | runtime, | |
var) ; |
struct snd_pcm_runtime * runtime
;snd_pcm_hw_param_t var
;snd_pcm_hw_constraint_minmax — apply a min/max range constraint to an interval
int fsfuncsnd_pcm_hw_constraint_minmax ( | runtime, | |
var, | ||
min, | ||
max) ; |
struct snd_pcm_runtime * runtime
;snd_pcm_hw_param_t var
;unsigned int min
;unsigned int max
;snd_pcm_hw_constraint_list — apply a list of constraints to a parameter
int fsfuncsnd_pcm_hw_constraint_list ( | runtime, | |
cond, | ||
var, | ||
l) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;snd_pcm_hw_param_t var
;const struct snd_pcm_hw_constraint_list * l
;snd_pcm_hw_constraint_ratnums — apply ratnums constraint to a parameter
int fsfuncsnd_pcm_hw_constraint_ratnums ( | runtime, | |
cond, | ||
var, | ||
r) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;snd_pcm_hw_param_t var
;struct snd_pcm_hw_constraint_ratnums * r
;snd_pcm_hw_constraint_ratdens — apply ratdens constraint to a parameter
int fsfuncsnd_pcm_hw_constraint_ratdens ( | runtime, | |
cond, | ||
var, | ||
r) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;snd_pcm_hw_param_t var
;struct snd_pcm_hw_constraint_ratdens * r
;snd_pcm_hw_constraint_msbits — add a hw constraint msbits rule
int fsfuncsnd_pcm_hw_constraint_msbits ( | runtime, | |
cond, | ||
width, | ||
msbits) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;unsigned int width
;unsigned int msbits
;snd_pcm_hw_constraint_step — add a hw constraint step rule
int fsfuncsnd_pcm_hw_constraint_step ( | runtime, | |
cond, | ||
var, | ||
step) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;snd_pcm_hw_param_t var
;unsigned long step
;snd_pcm_hw_constraint_pow2 — add a hw constraint power-of-2 rule
int fsfuncsnd_pcm_hw_constraint_pow2 ( | runtime, | |
cond, | ||
var) ; |
struct snd_pcm_runtime * runtime
;unsigned int cond
;snd_pcm_hw_param_t var
;snd_pcm_hw_rule_noresample — add a rule to allow disabling hw resampling
int fsfuncsnd_pcm_hw_rule_noresample ( | runtime, | |
base_rate) ; |
struct snd_pcm_runtime * runtime
;unsigned int base_rate
;snd_pcm_hw_param_value —
return params
field var
value
int fsfuncsnd_pcm_hw_param_value ( | params, | |
var, | ||
dir) ; |
const struct snd_pcm_hw_params * params
;snd_pcm_hw_param_t var
;int * dir
;snd_pcm_hw_param_first — refine config space and return minimum value
int fsfuncsnd_pcm_hw_param_first ( | pcm, | |
params, | ||
var, | ||
dir) ; |
struct snd_pcm_substream * pcm
;struct snd_pcm_hw_params * params
;snd_pcm_hw_param_t var
;int * dir
;pcm
PCM instance
params
the hw_params instance
var
parameter to retrieve
dir
pointer to the direction (-1,0,1) or NULL
snd_pcm_hw_param_last — refine config space and return maximum value
int fsfuncsnd_pcm_hw_param_last ( | pcm, | |
params, | ||
var, | ||
dir) ; |
struct snd_pcm_substream * pcm
;struct snd_pcm_hw_params * params
;snd_pcm_hw_param_t var
;int * dir
;pcm
PCM instance
params
the hw_params instance
var
parameter to retrieve
dir
pointer to the direction (-1,0,1) or NULL
snd_pcm_lib_ioctl — a generic PCM ioctl callback
int fsfuncsnd_pcm_lib_ioctl ( | substream, | |
cmd, | ||
arg) ; |
struct snd_pcm_substream * substream
;unsigned int cmd
;void * arg
;snd_pcm_period_elapsed — update the pcm status for the next period
void fsfuncsnd_pcm_period_elapsed ( | substream) ; |
struct snd_pcm_substream * substream
;snd_pcm_add_chmap_ctls — create channel-mapping control elements
int fsfuncsnd_pcm_add_chmap_ctls ( | pcm, | |
stream, | ||
chmap, | ||
max_channels, | ||
private_value, | ||
info_ret) ; |
struct snd_pcm * pcm
;int stream
;const struct snd_pcm_chmap_elem * chmap
;int max_channels
;unsigned long private_value
;struct snd_pcm_chmap ** info_ret
;snd_pcm_stop — try to stop all running streams in the substream group
int fsfuncsnd_pcm_stop ( | substream, | |
state) ; |
struct snd_pcm_substream * substream
;snd_pcm_state_t state
;snd_pcm_suspend — trigger SUSPEND to all linked streams
int fsfuncsnd_pcm_suspend ( | substream) ; |
struct snd_pcm_substream * substream
;snd_pcm_format_signed — Check the PCM format is signed linear
int fsfuncsnd_pcm_format_signed ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_unsigned — Check the PCM format is unsigned linear
int fsfuncsnd_pcm_format_unsigned ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_linear — Check the PCM format is linear
int fsfuncsnd_pcm_format_linear ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_little_endian — Check the PCM format is little-endian
int fsfuncsnd_pcm_format_little_endian ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_big_endian — Check the PCM format is big-endian
int fsfuncsnd_pcm_format_big_endian ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_width — return the bit-width of the format
int fsfuncsnd_pcm_format_width ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_physical_width — return the physical bit-width of the format
int fsfuncsnd_pcm_format_physical_width ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_size — return the byte size of samples on the given format
ssize_t fsfuncsnd_pcm_format_size ( | format, | |
samples) ; |
snd_pcm_format_t format
;size_t samples
;snd_pcm_format_silence_64 — return the silent data in 8 bytes array
const unsigned char * fsfuncsnd_pcm_format_silence_64 ( | format) ; |
snd_pcm_format_t format
;snd_pcm_format_set_silence — set the silence data on the buffer
int fsfuncsnd_pcm_format_set_silence ( | format, | |
data, | ||
samples) ; |
snd_pcm_format_t format
;void * data
;unsigned int samples
;snd_pcm_limit_hw_rates — determine rate_min/rate_max fields
int fsfuncsnd_pcm_limit_hw_rates ( | runtime) ; |
struct snd_pcm_runtime * runtime
;snd_pcm_rate_to_rate_bit — converts sample rate to SNDRV_PCM_RATE_xxx bit
unsigned int fsfuncsnd_pcm_rate_to_rate_bit ( | rate) ; |
unsigned int rate
;snd_pcm_lib_preallocate_free_for_all — release all pre-allocated buffers on the pcm
int fsfuncsnd_pcm_lib_preallocate_free_for_all ( | pcm) ; |
struct snd_pcm * pcm
;snd_pcm_lib_preallocate_pages — pre-allocation for the given DMA type
int fsfuncsnd_pcm_lib_preallocate_pages ( | substream, | |
type, | ||
data, | ||
size, | ||
max) ; |
struct snd_pcm_substream * substream
;int type
;struct device * data
;size_t size
;size_t max
;substream
the pcm substream instance
type
DMA type (SNDRV_DMA_TYPE_*)
data
DMA type dependent data
size
the requested pre-allocation size in bytes
max
the max. allowed pre-allocation size
Do pre-allocation for the given DMA buffer type.
When substream->dma_buf_id is set, the function tries to look for
the reserved buffer, and the buffer is not freed but reserved at
destruction time. The dma_buf_id must be unique for all systems
(in the same DMA buffer type) e.g. using snd_dma_pci_buf_id
.
snd_pcm_lib_preallocate_pages_for_all — pre-allocation for continuous memory type (all substreams)
int fsfuncsnd_pcm_lib_preallocate_pages_for_all ( | pcm, | |
type, | ||
data, | ||
size, | ||
max) ; |
struct snd_pcm * pcm
;int type
;void * data
;size_t size
;size_t max
;snd_pcm_sgbuf_ops_page — get the page struct at the given offset
struct page * fsfuncsnd_pcm_sgbuf_ops_page ( | substream, | |
offset) ; |
struct snd_pcm_substream * substream
;unsigned long offset
;snd_pcm_lib_malloc_pages — allocate the DMA buffer
int fsfuncsnd_pcm_lib_malloc_pages ( | substream, | |
size) ; |
struct snd_pcm_substream * substream
;size_t size
;substream
the substream to allocate the DMA buffer to
size
the requested buffer size in bytes
snd_pcm_lib_free_pages — release the allocated DMA buffer.
int fsfuncsnd_pcm_lib_free_pages ( | substream) ; |
struct snd_pcm_substream * substream
;snd_pcm_lib_free_vmalloc_buffer — free vmalloc buffer
int fsfuncsnd_pcm_lib_free_vmalloc_buffer ( | substream) ; |
struct snd_pcm_substream * substream
;snd_pcm_lib_get_vmalloc_page — map vmalloc buffer offset to page struct
struct page * fsfuncsnd_pcm_lib_get_vmalloc_page ( | substream, | |
offset) ; |
struct snd_pcm_substream * substream
;unsigned long offset
;Table of Contents
snd_ctl_new1 — create a control instance from the template
struct snd_kcontrol * fsfuncsnd_ctl_new1 ( | ncontrol, | |
private_data) ; |
const struct snd_kcontrol_new * ncontrol
;void * private_data
;snd_ctl_free_one — release the control instance
void fsfuncsnd_ctl_free_one ( | kcontrol) ; |
struct snd_kcontrol * kcontrol
;snd_ctl_add — add the control instance to the card
int fsfuncsnd_ctl_add ( | card, | |
kcontrol) ; |
struct snd_card * card
;struct snd_kcontrol * kcontrol
;snd_ctl_replace — replace the control instance of the card
int fsfuncsnd_ctl_replace ( | card, | |
kcontrol, | ||
add_on_replace) ; |
struct snd_card * card
;struct snd_kcontrol * kcontrol
;bool add_on_replace
;card
the card instance
kcontrol
the control instance to replace
add_on_replace
add the control if not already added
snd_ctl_remove — remove the control from the card and release it
int fsfuncsnd_ctl_remove ( | card, | |
kcontrol) ; |
struct snd_card * card
;struct snd_kcontrol * kcontrol
;snd_ctl_remove_id — remove the control of the given id and release it
int fsfuncsnd_ctl_remove_id ( | card, | |
id) ; |
struct snd_card * card
;struct snd_ctl_elem_id * id
;snd_ctl_activate_id — activate/inactivate the control of the given id
int fsfuncsnd_ctl_activate_id ( | card, | |
id, | ||
active) ; |
struct snd_card * card
;struct snd_ctl_elem_id * id
;int active
;card
the card instance
id
the control id to activate/inactivate
active
non-zero to activate
snd_ctl_rename_id — replace the id of a control on the card
int fsfuncsnd_ctl_rename_id ( | card, | |
src_id, | ||
dst_id) ; |
struct snd_card * card
;struct snd_ctl_elem_id * src_id
;struct snd_ctl_elem_id * dst_id
;snd_ctl_find_numid — find the control instance with the given number-id
struct snd_kcontrol * fsfuncsnd_ctl_find_numid ( | card, | |
numid) ; |
struct snd_card * card
;unsigned int numid
;snd_ctl_find_id — find the control instance with the given id
struct snd_kcontrol * fsfuncsnd_ctl_find_id ( | card, | |
id) ; |
struct snd_card * card
;struct snd_ctl_elem_id * id
;snd_ctl_enum_info — fills the info structure for an enumerated control
int fsfuncsnd_ctl_enum_info ( | info, | |
channels, | ||
items, | ||
names[]) ; |
struct snd_ctl_elem_info * info
;unsigned int channels
;unsigned int items
;const char *const names[]
;info
the structure to be filled
channels
the number of the control's channels; often one
items
the number of control values; also the size of names
names[]
an array containing the names of all control values
snd_ac97_write — write a value on the given register
void fsfuncsnd_ac97_write ( | ac97, | |
reg, | ||
value) ; |
struct snd_ac97 * ac97
;unsigned short reg
;unsigned short value
;snd_ac97_read — read a value from the given register
unsigned short fsfuncsnd_ac97_read ( | ac97, | |
reg) ; |
struct snd_ac97 * ac97
;unsigned short reg
;snd_ac97_write_cache — write a value on the given register and update the cache
void fsfuncsnd_ac97_write_cache ( | ac97, | |
reg, | ||
value) ; |
struct snd_ac97 * ac97
;unsigned short reg
;unsigned short value
;snd_ac97_update — update the value on the given register
int fsfuncsnd_ac97_update ( | ac97, | |
reg, | ||
value) ; |
struct snd_ac97 * ac97
;unsigned short reg
;unsigned short value
;snd_ac97_update_bits — update the bits on the given register
int fsfuncsnd_ac97_update_bits ( | ac97, | |
reg, | ||
mask, | ||
value) ; |
struct snd_ac97 * ac97
;unsigned short reg
;unsigned short mask
;unsigned short value
;snd_ac97_get_short_name — retrieve codec name
const char * fsfuncsnd_ac97_get_short_name ( | ac97) ; |
struct snd_ac97 * ac97
;snd_ac97_bus — create an AC97 bus component
int fsfuncsnd_ac97_bus ( | card, | |
num, | ||
ops, | ||
private_data, | ||
rbus) ; |
struct snd_card * card
;int num
;struct snd_ac97_bus_ops * ops
;void * private_data
;struct snd_ac97_bus ** rbus
;card
the card instance
num
the bus number
ops
the bus callbacks table
private_data
private data pointer for the new instance
rbus
the pointer to store the new AC97 bus instance.
Creates an AC97 bus component. An struct snd_ac97_bus instance is newly allocated and initialized.
The ops table must include valid callbacks (at least read and write). The other callbacks, wait and reset, are not mandatory.
The clock is set to 48000. If another clock is needed, set (*rbus)->clock manually.
The AC97 bus instance is registered as a low-level device, so you don't have to release it manually.
snd_ac97_mixer — create an Codec97 component
int fsfuncsnd_ac97_mixer ( | bus, | |
template, | ||
rac97) ; |
struct snd_ac97_bus * bus
;struct snd_ac97_template * template
;struct snd_ac97 ** rac97
;bus
the AC97 bus which codec is attached to
template
the template of ac97, including index, callbacks and the private data.
rac97
the pointer to store the new ac97 instance.
Creates an Codec97 component. An struct snd_ac97 instance is newly allocated and initialized from the template. The codec is then initialized by the standard procedure.
The template must include the codec number (num) and address (addr), and the private data (private_data).
The ac97 instance is registered as a low-level device, so you don't have to release it manually.
snd_ac97_update_power — update the powerdown register
int fsfuncsnd_ac97_update_power ( | ac97, | |
reg, | ||
powerup) ; |
struct snd_ac97 * ac97
;int reg
;int powerup
;snd_ac97_suspend — General suspend function for AC97 codec
void fsfuncsnd_ac97_suspend ( | ac97) ; |
struct snd_ac97 * ac97
;snd_ac97_resume — General resume function for AC97 codec
void fsfuncsnd_ac97_resume ( | ac97) ; |
struct snd_ac97 * ac97
;snd_ac97_tune_hardware — tune up the hardware
int fsfuncsnd_ac97_tune_hardware ( | ac97, | |
quirk, | ||
override) ; |
struct snd_ac97 * ac97
;struct ac97_quirk * quirk
;const char * override
;ac97
the ac97 instance
quirk
quirk list
override
explicit quirk value (overrides the list if non-NULL)
snd_ac97_set_rate — change the rate of the given input/output.
int fsfuncsnd_ac97_set_rate ( | ac97, | |
reg, | ||
rate) ; |
struct snd_ac97 * ac97
;int reg
;unsigned int rate
;Changes the rate of the given input/output on the codec. If the codec doesn't support VAR, the rate must be 48000 (except for SPDIF).
The valid registers are AC97_PMC_MIC_ADC_RATE, AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE. AC97_PCM_SURR_DAC_RATE and AC97_PCM_LFE_DAC_RATE are accepted if the codec supports them. AC97_SPDIF is accepted as a pseudo register to modify the SPDIF status bits.
snd_ac97_pcm_assign — assign AC97 slots to given PCM streams
int fsfuncsnd_ac97_pcm_assign ( | bus, | |
pcms_count, | ||
pcms) ; |
struct snd_ac97_bus * bus
;unsigned short pcms_count
;const struct ac97_pcm * pcms
;snd_ac97_pcm_open — opens the given AC97 pcm
int fsfuncsnd_ac97_pcm_open ( | pcm, | |
rate, | ||
cfg, | ||
slots) ; |
struct ac97_pcm * pcm
;unsigned int rate
;enum ac97_pcm_cfg cfg
;unsigned short slots
;snd_ac97_pcm_close — closes the given AC97 pcm
int fsfuncsnd_ac97_pcm_close ( | pcm) ; |
struct ac97_pcm * pcm
;snd_ctl_make_virtual_master — Create a virtual master control
struct snd_kcontrol * fsfuncsnd_ctl_make_virtual_master ( | name, | |
tlv) ; |
char * name
;const unsigned int * tlv
;name
name string of the control element to create
tlv
optional TLV int array for dB information
Creates a virtual master control with the given name string.
After creating a vmaster element, you can add the slave controls
via snd_ctl_add_slave
or snd_ctl_add_slave_uncached
.
The optional argument tlv
can be used to specify the TLV information
for dB scale of the master control. It should be a single element
with #SNDRV_CTL_TLVT_DB_SCALE, #SNDRV_CTL_TLV_DB_MINMAX or
#SNDRV_CTL_TLVT_DB_MINMAX_MUTE type, and should be the max 0dB.
snd_ctl_add_vmaster_hook — Add a hook to a vmaster control
int fsfuncsnd_ctl_add_vmaster_hook ( | kcontrol, | |
hook, | ||
private_data) ; |
struct snd_kcontrol * kcontrol
;void (*hook)
(
void *private_data, int)
;void * private_data
;kcontrol
vmaster kctl element
hook
the hook function
private_data
the private_data pointer to be saved
snd_ctl_sync_vmaster — Sync the vmaster slaves and hook
void fsfuncsnd_ctl_sync_vmaster ( | kcontrol, | |
hook_only) ; |
struct snd_kcontrol * kcontrol
;bool hook_only
;snd_ctl_add_slave — Add a virtual slave control
int fsfuncsnd_ctl_add_slave ( | master, | |
slave) ; |
struct snd_kcontrol * master
;struct snd_kcontrol * slave
;
Add a virtual slave control to the given master element created via
snd_ctl_create_virtual_master
beforehand.
All slaves must be the same type (returning the same information via info callback). The function doesn't check it, so it's your responsibility.
Also, some additional limitations: at most two channels, logarithmic volume control (dB level) thus no linear volume, master can only attenuate the volume without gain
snd_ctl_add_slave_uncached — Add a virtual slave control
int fsfuncsnd_ctl_add_slave_uncached ( | master, | |
slave) ; |
struct snd_kcontrol * master
;struct snd_kcontrol * slave
;
Add a virtual slave control to the given master.
Unlike snd_ctl_add_slave
, the element added via this function
is supposed to have volatile values, and get callback is called
at each time quried from the master.
When the control peeks the hardware values directly and the value can be changed by other means than the put callback of the element, this function should be used to keep the value always up-to-date.
Table of Contents
snd_rawmidi_receive — receive the input data from the device
int fsfuncsnd_rawmidi_receive ( | substream, | |
buffer, | ||
count) ; |
struct snd_rawmidi_substream * substream
;const unsigned char * buffer
;int count
;snd_rawmidi_transmit_empty — check whether the output buffer is empty
int fsfuncsnd_rawmidi_transmit_empty ( | substream) ; |
struct snd_rawmidi_substream * substream
;snd_rawmidi_transmit_peek — copy data from the internal buffer
int fsfuncsnd_rawmidi_transmit_peek ( | substream, | |
buffer, | ||
count) ; |
struct snd_rawmidi_substream * substream
;unsigned char * buffer
;int count
;snd_rawmidi_transmit_ack — acknowledge the transmission
int fsfuncsnd_rawmidi_transmit_ack ( | substream, | |
count) ; |
struct snd_rawmidi_substream * substream
;int count
;snd_rawmidi_transmit — copy from the buffer to the device
int fsfuncsnd_rawmidi_transmit ( | substream, | |
buffer, | ||
count) ; |
struct snd_rawmidi_substream * substream
;unsigned char * buffer
;int count
;snd_rawmidi_new — create a rawmidi instance
int fsfuncsnd_rawmidi_new ( | card, | |
id, | ||
device, | ||
output_count, | ||
input_count, | ||
rrawmidi) ; |
struct snd_card * card
;char * id
;int device
;int output_count
;int input_count
;struct snd_rawmidi ** rrawmidi
;card
the card instance
id
the id string
device
the device index
output_count
the number of output streams
input_count
the number of input streams
rrawmidi
the pointer to store the new rawmidi instance
snd_mpu401_uart_interrupt — generic MPU401-UART interrupt handler
irqreturn_t fsfuncsnd_mpu401_uart_interrupt ( | irq, | |
dev_id) ; |
int irq
;void * dev_id
;snd_mpu401_uart_interrupt_tx — generic MPU401-UART transmit irq handler
irqreturn_t fsfuncsnd_mpu401_uart_interrupt_tx ( | irq, | |
dev_id) ; |
int irq
;void * dev_id
;snd_mpu401_uart_new — create an MPU401-UART instance
int fsfuncsnd_mpu401_uart_new ( | card, | |
device, | ||
hardware, | ||
port, | ||
info_flags, | ||
irq, | ||
rrawmidi) ; |
struct snd_card * card
;int device
;unsigned short hardware
;unsigned long port
;unsigned int info_flags
;int irq
;struct snd_rawmidi ** rrawmidi
;card
the card instance
device
the device index, zero-based
hardware
the hardware type, MPU401_HW_XXXX
port
the base address of MPU401 port
info_flags
bitflags MPU401_INFO_XXX
irq
the ISA irq number, -1 if not to be allocated
rrawmidi
the pointer to store the new rawmidi instance
Table of Contents
snd_iprintf — printf on the procfs buffer
int fsfuncsnd_iprintf ( | buffer, | |
fmt, | ||
...) ; |
struct snd_info_buffer * buffer
;const char * fmt
; ...
;snd_info_get_line — read one line from the procfs buffer
int fsfuncsnd_info_get_line ( | buffer, | |
line, | ||
len) ; |
struct snd_info_buffer * buffer
;char * line
;int len
;snd_info_get_str — parse a string token
const char * fsfuncsnd_info_get_str ( | dest, | |
src, | ||
len) ; |
char * dest
;const char * src
;int len
;snd_info_create_module_entry — create an info entry for the given module
struct snd_info_entry * fsfuncsnd_info_create_module_entry ( | module, | |
name, | ||
parent) ; |
struct module * module
;const char * name
;struct snd_info_entry * parent
;snd_info_create_card_entry — create an info entry for the given card
struct snd_info_entry * fsfuncsnd_info_create_card_entry ( | card, | |
name, | ||
parent) ; |
struct snd_card * card
;const char * name
;struct snd_info_entry * parent
;snd_card_proc_new — create an info entry for the given card
int fsfuncsnd_card_proc_new ( | card, | |
name, | ||
entryp) ; |
struct snd_card * card
;const char * name
;struct snd_info_entry ** entryp
;
Creates a new info entry and assigns it to the given card.
Unlike snd_info_create_card_entry
, this function registers the
info entry as an ALSA device component, so that it can be
unregistered/released without explicit call.
Also, you don't have to register this entry via snd_info_register
,
since this will be registered by snd_card_register
automatically.
The parent is assumed as card->proc_root.
For releasing this entry, use snd_device_free
instead of
snd_info_free_entry
.
Table of Contents
snd_hwdep_new — create a new hwdep instance
int fsfuncsnd_hwdep_new ( | card, | |
id, | ||
device, | ||
rhwdep) ; |
struct snd_card * card
;char * id
;int device
;struct snd_hwdep ** rhwdep
;card
the card instance
id
the id string
device
the device index (zero-based)
rhwdep
the pointer to store the new hwdep instance
snd_jack_new — Create a new jack
int fsfuncsnd_jack_new ( | card, | |
id, | ||
type, | ||
jjack) ; |
struct snd_card * card
;const char * id
;int type
;struct snd_jack ** jjack
;snd_jack_set_parent — Set the parent device for a jack
void fsfuncsnd_jack_set_parent ( | jack, | |
parent) ; |
struct snd_jack * jack
;struct device * parent
;snd_jack_set_key — Set a key mapping on a jack
int fsfuncsnd_jack_set_key ( | jack, | |
type, | ||
keytype) ; |
struct snd_jack * jack
;enum snd_jack_types type
;int keytype
;jack
The jack to configure
type
Jack report type for this key
keytype
Input layer key type to be reported
Map a SND_JACK_BTN_ button type to an input layer key, allowing reporting of keys on accessories via the jack abstraction. If no mapping is provided but keys are enabled in the jack type then BTN_n numeric buttons will be reported.
If jacks are not reporting via the input API this call will have no effect.
Note that this is intended to be use by simple devices with small numbers of keys that can be reported. It is also possible to access the input device directly - devices with complex input capabilities on accessories should consider doing this rather than using this abstraction.
This function may only be called prior to registration of the jack.
snd_dma_program — program an ISA DMA transfer
void fsfuncsnd_dma_program ( | dma, | |
addr, | ||
size, | ||
mode) ; |
unsigned long dma
;unsigned long addr
;unsigned int size
;unsigned short mode
;snd_register_device — Register the ALSA device file for the card
int fsfuncsnd_register_device ( | type, | |
card, | ||
dev, | ||
f_ops, | ||
private_data, | ||
name) ; |
int type
;struct snd_card * card
;int dev
;const struct file_operations * f_ops
;void * private_data
;const char * name
;type
the device type, SNDRV_DEVICE_TYPE_XXX
card
the card instance
dev
the device index
f_ops
the file operations
private_data
user pointer for f_ops->open
name
the device file name