Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
control.c File Reference
#include <linux/threads.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/time.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
#include <sound/control.h>

Go to the source code of this file.

Data Structures

struct  snd_kctl_ioctl
 
struct  user_element
 

Macros

#define MAX_USER_CONTROLS   32
 
#define MAX_CONTROL_COUNT   1028
 
#define snd_ctl_ioctl_compat   NULL
 

Functions

void snd_ctl_notify (struct snd_card *card, unsigned int mask, struct snd_ctl_elem_id *id)
 
 EXPORT_SYMBOL (snd_ctl_notify)
 
struct snd_kcontrolsnd_ctl_new1 (const struct snd_kcontrol_new *ncontrol, void *private_data)
 
 EXPORT_SYMBOL (snd_ctl_new1)
 
void snd_ctl_free_one (struct snd_kcontrol *kcontrol)
 
 EXPORT_SYMBOL (snd_ctl_free_one)
 
int snd_ctl_add (struct snd_card *card, struct snd_kcontrol *kcontrol)
 
 EXPORT_SYMBOL (snd_ctl_add)
 
int snd_ctl_replace (struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace)
 
 EXPORT_SYMBOL (snd_ctl_replace)
 
int snd_ctl_remove (struct snd_card *card, struct snd_kcontrol *kcontrol)
 
 EXPORT_SYMBOL (snd_ctl_remove)
 
int snd_ctl_remove_id (struct snd_card *card, struct snd_ctl_elem_id *id)
 
 EXPORT_SYMBOL (snd_ctl_remove_id)
 
int snd_ctl_activate_id (struct snd_card *card, struct snd_ctl_elem_id *id, int active)
 
 EXPORT_SYMBOL_GPL (snd_ctl_activate_id)
 
int snd_ctl_rename_id (struct snd_card *card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id)
 
 EXPORT_SYMBOL (snd_ctl_rename_id)
 
struct snd_kcontrolsnd_ctl_find_numid (struct snd_card *card, unsigned int numid)
 
 EXPORT_SYMBOL (snd_ctl_find_numid)
 
struct snd_kcontrolsnd_ctl_find_id (struct snd_card *card, struct snd_ctl_elem_id *id)
 
 EXPORT_SYMBOL (snd_ctl_find_id)
 
int snd_ctl_register_ioctl (snd_kctl_ioctl_func_t fcn)
 
 EXPORT_SYMBOL (snd_ctl_register_ioctl)
 
int snd_ctl_unregister_ioctl (snd_kctl_ioctl_func_t fcn)
 
 EXPORT_SYMBOL (snd_ctl_unregister_ioctl)
 
int snd_ctl_create (struct snd_card *card)
 
int snd_ctl_boolean_mono_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
 EXPORT_SYMBOL (snd_ctl_boolean_mono_info)
 
int snd_ctl_boolean_stereo_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
 
 EXPORT_SYMBOL (snd_ctl_boolean_stereo_info)
 
int snd_ctl_enum_info (struct snd_ctl_elem_info *info, unsigned int channels, unsigned int items, const char *const names[])
 
 EXPORT_SYMBOL (snd_ctl_enum_info)
 

Macro Definition Documentation

#define MAX_CONTROL_COUNT   1028

Definition at line 35 of file control.c.

#define MAX_USER_CONTROLS   32

Definition at line 34 of file control.c.

#define snd_ctl_ioctl_compat   NULL

Definition at line 1573 of file control.c.

Function Documentation

EXPORT_SYMBOL ( snd_ctl_notify  )
EXPORT_SYMBOL ( snd_ctl_new1  )
EXPORT_SYMBOL ( snd_ctl_free_one  )
EXPORT_SYMBOL ( snd_ctl_add  )
EXPORT_SYMBOL ( snd_ctl_replace  )
EXPORT_SYMBOL ( snd_ctl_remove  )
EXPORT_SYMBOL ( snd_ctl_remove_id  )
EXPORT_SYMBOL ( snd_ctl_rename_id  )
EXPORT_SYMBOL ( snd_ctl_find_numid  )
EXPORT_SYMBOL ( snd_ctl_find_id  )
EXPORT_SYMBOL ( snd_ctl_register_ioctl  )
EXPORT_SYMBOL ( snd_ctl_unregister_ioctl  )
EXPORT_SYMBOL ( snd_ctl_boolean_mono_info  )
EXPORT_SYMBOL ( snd_ctl_boolean_stereo_info  )
EXPORT_SYMBOL ( snd_ctl_enum_info  )
EXPORT_SYMBOL_GPL ( snd_ctl_activate_id  )
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_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_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.

int snd_ctl_unregister_ioctl ( snd_kctl_ioctl_func_t  fcn)

Definition at line 1543 of file control.c.