Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
control.h File Reference
#include <sound/asound.h>

Go to the source code of this file.

Data Structures

struct  snd_kcontrol_new
 
struct  snd_kcontrol_volatile
 
struct  snd_kcontrol
 
struct  snd_kctl_event
 
struct  snd_ctl_file
 

Macros

#define snd_kcontrol_chip(kcontrol)   ((kcontrol)->private_data)
 
#define snd_kcontrol(n)   list_entry(n, struct snd_kcontrol, list)
 
#define snd_kctl_event(n)   list_entry(n, struct snd_kctl_event, list)
 
#define snd_ctl_file(n)   list_entry(n, struct snd_ctl_file, list)
 
#define snd_ctl_register_ioctl_compat(fcn)
 
#define snd_ctl_unregister_ioctl_compat(fcn)
 
#define SND_CTL_SLAVE_NEED_UPDATE   (1 << 0)
 

Typedefs

typedef intsnd_kcontrol_info_t )(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
typedef intsnd_kcontrol_get_t )(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
typedef intsnd_kcontrol_put_t )(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
 
typedef intsnd_kcontrol_tlv_rw_t )(struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv)
 
typedef int(* snd_kctl_ioctl_func_t )(struct snd_card *card, struct snd_ctl_file *control, unsigned int cmd, unsigned long arg)
 

Functions

void snd_ctl_notify (struct snd_card *card, unsigned int mask, struct snd_ctl_elem_id *id)
 
struct snd_kcontrolsnd_ctl_new1 (const struct snd_kcontrol_new *kcontrolnew, void *private_data)
 
void snd_ctl_free_one (struct snd_kcontrol *kcontrol)
 
int snd_ctl_add (struct snd_card *card, struct snd_kcontrol *kcontrol)
 
int snd_ctl_remove (struct snd_card *card, struct snd_kcontrol *kcontrol)
 
int snd_ctl_replace (struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace)
 
int snd_ctl_remove_id (struct snd_card *card, struct snd_ctl_elem_id *id)
 
int snd_ctl_rename_id (struct snd_card *card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id)
 
int snd_ctl_activate_id (struct snd_card *card, struct snd_ctl_elem_id *id, int active)
 
struct snd_kcontrolsnd_ctl_find_numid (struct snd_card *card, unsigned int numid)
 
struct snd_kcontrolsnd_ctl_find_id (struct snd_card *card, struct snd_ctl_elem_id *id)
 
int snd_ctl_create (struct snd_card *card)
 
int snd_ctl_register_ioctl (snd_kctl_ioctl_func_t fcn)
 
int snd_ctl_unregister_ioctl (snd_kctl_ioctl_func_t fcn)
 
int snd_ctl_boolean_mono_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
int snd_ctl_boolean_stereo_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
int snd_ctl_enum_info (struct snd_ctl_elem_info *info, unsigned int channels, unsigned int items, const char *const names[])
 
struct snd_kcontrolsnd_ctl_make_virtual_master (char *name, const unsigned int *tlv)
 
int _snd_ctl_add_slave (struct snd_kcontrol *master, struct snd_kcontrol *slave, unsigned int flags)
 
int snd_ctl_add_vmaster_hook (struct snd_kcontrol *kctl, void(*hook)(void *private_data, int), void *private_data)
 
void snd_ctl_sync_vmaster_hook (struct snd_kcontrol *kctl)
 
struct snd_kcontrolsnd_kctl_jack_new (const char *name, int idx, void *private_data)
 
void snd_kctl_jack_report (struct snd_card *card, struct snd_kcontrol *kctl, bool status)
 

Macro Definition Documentation

#define snd_ctl_file (   n)    list_entry(n, struct snd_ctl_file, list)

Definition at line 104 of file control.h.

#define snd_ctl_register_ioctl_compat (   fcn)

Definition at line 132 of file control.h.

#define SND_CTL_SLAVE_NEED_UPDATE   (1 << 0)

Definition at line 183 of file control.h.

#define snd_ctl_unregister_ioctl_compat (   fcn)

Definition at line 133 of file control.h.

#define snd_kcontrol (   n)    list_entry(n, struct snd_kcontrol, list)

Definition at line 79 of file control.h.

#define snd_kcontrol_chip (   kcontrol)    ((kcontrol)->private_data)

Definition at line 27 of file control.h.

Definition at line 87 of file control.h.

Typedef Documentation

typedef int( snd_kcontrol_get_t)(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)

Definition at line 31 of file control.h.

typedef int( snd_kcontrol_info_t)(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)

Definition at line 30 of file control.h.

typedef int( snd_kcontrol_put_t)(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)

Definition at line 32 of file control.h.

typedef int( snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol, int op_flag,unsigned int size, unsigned int __user *tlv)

Definition at line 33 of file control.h.

typedef int(* snd_kctl_ioctl_func_t)(struct snd_card *card, struct snd_ctl_file *control, unsigned int cmd, unsigned long arg)

Definition at line 106 of file control.h.

Function Documentation

int _snd_ctl_add_slave ( struct snd_kcontrol master,
struct snd_kcontrol slave,
unsigned int  flags 
)

Definition at line 250 of file vmaster.c.

int snd_ctl_activate_id ( struct snd_card card,
struct snd_ctl_elem_id id,
int  active 
)

snd_ctl_activate_id - activate/inactivate the control of the given id : the card instance : the control id to activate/inactivate : non-zero to activate

Finds the control instance with the given id, and activate or inactivate the control together with notification, if changed.

Returns 0 if unchanged, 1 if changed, or a negative error code on failure.

Definition at line 546 of file control.c.

int snd_ctl_add ( struct snd_card card,
struct snd_kcontrol kcontrol 
)

snd_ctl_add - add the control instance to the card : the card instance : the control instance to add

Adds the control instance created via snd_ctl_new() or snd_ctl_new1() to the given card. Assigns also an unique numid used for fast search.

Returns zero if successful, or a negative error code on failure.

It frees automatically the control which cannot be added.

Definition at line 329 of file control.c.

int snd_ctl_add_vmaster_hook ( struct snd_kcontrol kcontrol,
void(*)(void *private_data, int hook,
void private_data 
)

snd_ctl_add_vmaster_hook - Add a hook to a vmaster control : vmaster kctl element : the hook function : the private_data pointer to be saved

Adds the given hook to the vmaster control element so that it's called at each time when the value is changed.

Definition at line 427 of file vmaster.c.

int snd_ctl_boolean_mono_info ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_info uinfo 
)

Definition at line 1679 of file control.c.

int snd_ctl_boolean_stereo_info ( struct snd_kcontrol kcontrol,
struct snd_ctl_elem_info uinfo 
)

Definition at line 1691 of file control.c.

int snd_ctl_create ( struct snd_card card)

Definition at line 1663 of file control.c.

int snd_ctl_enum_info ( struct snd_ctl_elem_info info,
unsigned int  channels,
unsigned int  items,
const char *const  names[] 
)

snd_ctl_enum_info - fills the info structure for an enumerated control : the structure to be filled : the number of the control's channels; often one : the number of control values; also the size of : an array containing the names of all control values

Sets all required fields in to their appropriate values. If the control's accessibility is not the default (readable and writable), the caller has to fill ->access.

Definition at line 1714 of file control.c.

struct snd_kcontrol* snd_ctl_find_id ( struct snd_card card,
struct snd_ctl_elem_id id 
)
read

snd_ctl_find_id - find the control instance with the given id : the card instance : the id to search

Finds the control instance with the given id from the card.

Returns the pointer of the instance if found, or NULL if not.

The caller must down card->controls_rwsem before calling this function (if the race condition can happen).

Definition at line 651 of file control.c.

struct snd_kcontrol* snd_ctl_find_numid ( struct snd_card card,
unsigned int  numid 
)
read

snd_ctl_find_numid - find the control instance with the given number-id : the card instance : the number-id to search

Finds the control instance with the given number-id from the card.

Returns the pointer of the instance if found, or NULL if not.

The caller must down card->controls_rwsem before calling this function (if the race condition can happen).

Definition at line 624 of file control.c.

void snd_ctl_free_one ( struct snd_kcontrol kcontrol)

snd_ctl_free_one - release the control instance : the control instance

Releases the control instance created via snd_ctl_new() or snd_ctl_new1(). Don't call this after the control was added to the card.

Definition at line 276 of file control.c.

struct snd_kcontrol* snd_ctl_make_virtual_master ( char name,
const unsigned int tlv 
)
read

Definition at line 376 of file vmaster.c.

struct snd_kcontrol* snd_ctl_new1 ( const struct snd_kcontrol_new ncontrol,
void private_data 
)
read

snd_ctl_new1 - create a control instance from the template : the initialization record : the private data to set

Allocates a new struct snd_kcontrol instance and initialize from the given template. When the access field of ncontrol is 0, it's assumed as READWRITE access. When the count field is 0, it's assumes as one.

Returns the pointer of the newly generated instance, or NULL on failure.

Definition at line 229 of file control.c.

void snd_ctl_notify ( struct snd_card card,
unsigned int  mask,
struct snd_ctl_elem_id id 
)

Definition at line 144 of file control.c.

int snd_ctl_register_ioctl ( snd_kctl_ioctl_func_t  fcn)

Definition at line 1503 of file control.c.

int snd_ctl_remove ( struct snd_card card,
struct snd_kcontrol kcontrol 
)

snd_ctl_remove - remove the control from the card and release it : the card instance : the control instance to remove

Removes the control from the card and then releases the instance. You don't need to call snd_ctl_free_one(). You must be in the write lock - down_write(&card->controls_rwsem).

Returns 0 if successful, or a negative error code on failure.

Definition at line 448 of file control.c.

int snd_ctl_remove_id ( struct snd_card card,
struct snd_ctl_elem_id id 
)

snd_ctl_remove_id - remove the control of the given id and release it : the card instance : the control id to remove

Finds the control instance with the given id, removes it from the card list and releases it.

Returns 0 if successful, or a negative error code on failure.

Definition at line 476 of file control.c.

int snd_ctl_rename_id ( struct snd_card card,
struct snd_ctl_elem_id src_id,
struct snd_ctl_elem_id dst_id 
)

snd_ctl_rename_id - replace the id of a control on the card : the card instance : the old id : the new id

Finds the control with the old id from the card, and replaces the id with the new one.

Returns zero if successful, or a negative error code on failure.

Definition at line 592 of file control.c.

int snd_ctl_replace ( struct snd_card card,
struct snd_kcontrol kcontrol,
bool  add_on_replace 
)

snd_ctl_replace - replace the control instance of the card : the card instance : the control instance to replace : add the control if not already added

Replaces the given control. If the given control does not exist and the add_on_replace flag is set, the control is added. If the control exists, it is destroyed first.

Returns zero if successful, or a negative error code on failure.

It frees automatically the control which cannot be added or replaced.

Definition at line 387 of file control.c.

void snd_ctl_sync_vmaster_hook ( struct snd_kcontrol kcontrol)

snd_ctl_sync_vmaster_hook - Sync the vmaster hook : vmaster kctl element

Call the hook function to synchronize with the current value of the given vmaster element. NOP when NULL is passed to or the hook doesn't exist.

Definition at line 446 of file vmaster.c.

int snd_ctl_unregister_ioctl ( snd_kctl_ioctl_func_t  fcn)

Definition at line 1543 of file control.c.

struct snd_kcontrol* snd_kctl_jack_new ( const char name,
int  idx,
void private_data 
)
read

Definition at line 35 of file ctljack.c.

void snd_kctl_jack_report ( struct snd_card card,
struct snd_kcontrol kctl,
bool  status 
)

Definition at line 48 of file ctljack.c.