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

Go to the source code of this file.

Macros

#define autoload_device(minor)   NULL
 

Functions

 EXPORT_SYMBOL (snd_major)
 
 MODULE_AUTHOR ("Jaroslav Kysela <[email protected]>")
 
 MODULE_DESCRIPTION ("Advanced Linux Sound Architecture driver for soundcards.")
 
 MODULE_LICENSE ("GPL")
 
 module_param (major, int, 0444)
 
 MODULE_PARM_DESC (major,"Major # for sound driver.")
 
 module_param (cards_limit, int, 0444)
 
 MODULE_PARM_DESC (cards_limit,"Count of auto-loadable soundcards.")
 
 MODULE_ALIAS_CHARDEV_MAJOR (CONFIG_SND_MAJOR)
 
 EXPORT_SYMBOL (snd_ecards_limit)
 
voidsnd_lookup_minor_data (unsigned int minor, int type)
 
 EXPORT_SYMBOL (snd_lookup_minor_data)
 
: the device file name

snd_register_device_for_dev - Register the ALSA device file for the card : the device type, SNDRV_DEVICE_TYPE_XXX : the card instance : the device index : the file operations : user pointer for f_ops->open()

: the &struct device to link this new device to

Registers an ALSA device file for the given card. The operators have to be set in reg parameter.

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

int snd_register_device_for_dev (int type, struct snd_card *card, int dev, const struct file_operations *f_ops, void *private_data, const char *name, struct device *device)
 
 EXPORT_SYMBOL (snd_register_device_for_dev)
 
int snd_unregister_device (int type, struct snd_card *card, int dev)
 
 EXPORT_SYMBOL (snd_unregister_device)
 
int snd_add_device_sysfs_file (int type, struct snd_card *card, int dev, struct device_attribute *attr)
 
 EXPORT_SYMBOL (snd_add_device_sysfs_file)
 
 subsys_initcall (alsa_sound_init)
 
 module_exit (alsa_sound_exit)
 

Variables

int snd_major
 
int snd_ecards_limit
 

Macro Definition Documentation

#define autoload_device (   minor)    NULL

Definition at line 146 of file sound.c.

Function Documentation

EXPORT_SYMBOL ( snd_major  )
EXPORT_SYMBOL ( snd_ecards_limit  )
EXPORT_SYMBOL ( snd_lookup_minor_data  )
EXPORT_SYMBOL ( snd_register_device_for_dev  )
EXPORT_SYMBOL ( snd_unregister_device  )
EXPORT_SYMBOL ( snd_add_device_sysfs_file  )
MODULE_ALIAS_CHARDEV_MAJOR ( CONFIG_SND_MAJOR  )
MODULE_AUTHOR ( "Jaroslav Kysela <[email protected]>"  )
MODULE_DESCRIPTION ( "Advanced Linux Sound Architecture driver for soundcards."  )
module_exit ( alsa_sound_exit  )
MODULE_LICENSE ( "GPL"  )
module_param ( major  ,
int  ,
0444   
)
module_param ( cards_limit  ,
int  ,
0444   
)
MODULE_PARM_DESC ( major  ,
"Major # for sound driver."   
)
MODULE_PARM_DESC ( cards_limit  ,
"Count of auto-loadable soundcards."   
)
int snd_add_device_sysfs_file ( int  type,
struct snd_card card,
int  dev,
struct device_attribute attr 
)

Definition at line 365 of file sound.c.

void* snd_lookup_minor_data ( unsigned int  minor,
int  type 
)

snd_lookup_minor_data - get user data of a registered device : the minor number : device type (SNDRV_DEVICE_TYPE_XXX)

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.

Definition at line 106 of file sound.c.

int snd_register_device_for_dev ( int  type,
struct snd_card card,
int  dev,
const struct file_operations f_ops,
void private_data,
const char name,
struct device device 
)

Definition at line 266 of file sound.c.

int snd_unregister_device ( int  type,
struct snd_card card,
int  dev 
)

snd_unregister_device - unregister the device on the given card : the device type, SNDRV_DEVICE_TYPE_XXX : the card instance : the device index

Unregisters the device file already registered via snd_register_device().

Returns zero if sucecessful, or a negative error code on failure

Definition at line 344 of file sound.c.

subsys_initcall ( alsa_sound_init  )

Variable Documentation

int snd_ecards_limit

Definition at line 54 of file sound.c.

int snd_major

Definition at line 36 of file sound.c.