linux/sound/core/sound.c
<<
> > p/spa pspa class="lxr_search"> > ="+search" method="post" onsubmit="return do_search(this);"> > > > Search > p/spa > ="ajax+*" method="post" onsubmit="return false;"> pinput typ"v4hidden" nam"v4ajax_lookup" idv4ajax_lookup" lue="v4"> >
pdiv idv4file_contents"
o o1p/a>pspa
 class="comment">/*p/spa
  o o2p/a>pspa
 class="comment"> *  Advanced Linux Sound Architecturep/spa
  o o3p/a>pspa
 class="comment"> *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>p/spa
  o o4p/a>pspa
 class="comment"> *p/spa
  o o5p/a>pspa
 class="comment"> *p/spa
  o o6p/a>pspa
 class="comment"> *   This program is free software; you ca
 redistribute it and/or modifyp/spa
  o o7p/a>pspa
 class="comment"> *   it under the terms of the GNU General Public License as published byp/spa
  o o8p/a>pspa
 class="comment"> *   the Free Software Foundaon>
; either versn va2 of the License, orp/spa
  o o9p/a>pspa
 class="comment"> *   (at your tion>
) any later versn v.p/spa
  o pspa
 class="comment"> *p/spa
  o 11p/a>pspa
 class="comment"> *   This program is distributed in the hope that it will be useful,p/spa
  o 12p/a>pspa
 class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty ofp/spa
  o 13p/a>pspa
 class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See thep/spa
  o 14p/a>pspa
 class="comment"> *   GNU General Public License for more details.p/spa
  o 15p/a>pspa
 class="comment"> *p/spa
  o 16p/a>pspa
 class="comment"> *   You should have received a copy of the GNU General Public Licensep/spa
  o 17p/a>pspa
 class="comment"> *   along with this program; if not, write to the Free Softwarep/spa
  o 18p/a>pspa
 class="comment"> *   Foundaon>
, Inc., 59 Temple Place, Suite 330, Bost>
, MA  02111-1307 USAp/spa
  o 19p/a>pspa
 class="comment"> *p/spa
  o 2/opa>pspa
 class="comment"> */p/spa
  o 21p/a> o 22p/a>#include <linux/init.hp/a>> o 23p/a>#include <linux/slab.hp/a>> o 24p/a>#include <linux/time.hp/a>> o 25p/a>#include <linux/device.hp/a>> o 26p/a>#include <linux/module.hp/a>> o 27p/a>#include <sound/core.hp/a>> o 28p/a>#include <sound/minors.hp/a>> o 29p/a>#include <sound/info.hp/a>> o 30p/a>#include <sound/control.hp/a>> o 31p/a>#include <sound/initval.hp/a>> o 32p/a>#include <linux/kmod.hp/a>> o 33p/a>#include <linux/mutex.hp/a>> o 34p/a> o 35p/a>static intopa href="+code=major" class="sref">majorp/a> =opa href="+code=CONFIG_SND_MAJOR" class="sref">CONFIG_SND_MAJORp/a>; o 36p/a>intopa href="+code=snd_major" class="sref">snd_majorp/a>; o 37p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_major" class="sref">snd_majorp/a>); o 38p/a> o 39p/a>static intopa href="+code=cards_limit" class="sref">cards_limitp/a> =o1; o 40p/a> o 41p/a>pa href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHORp/a>(pspa
 class="string">"Jaroslav Kysela <perex@perex.cz>"p/spa
 ); o 42p/a>pa href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTIONp/a>(pspa
 class="string">"Advanced Linux Sound Architecture driver for soundcards."p/spa
 ); o 43p/a>pa href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSEp/a>(pspa
 class="string">"GPL"p/spa
 ); o 44p/a>pa href="+code=module_param" class="sref">module_paramp/a>(pa href="+code=major" class="sref">majorp/a>, int, 0444); o 45p/a>pa href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESCp/a>(pa href="+code=major" class="sref">majorp/a>, pspa
 class="string">"Major # for sound driver."p/spa
 ); o 46p/a>pa href="+code=module_param" class="sref">module_paramp/a>(pa href="+code=cards_limit" class="sref">cards_limitp/a>, int, 0444); o 47p/a>pa href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESCp/a>(pa href="+code=cards_limit" class="sref">cards_limitp/a>, pspa
 class="string">"Count of auto-loadable soundcards."p/spa
 ); o 48p/a>pa href="+code=MODULE_ALIAS_CHARDEV_MAJOR" class="sref">MODULE_ALIAS_CHARDEV_MAJORp/a>(pa href="+code=CONFIG_SND_MAJOR" class="sref">CONFIG_SND_MAJORp/a>); o 49p/a> o 5/opa>pspa
 class="comment">/* this one holds the actual max. card number currently available.p/spa
  o 51p/a>pspa
 class="comment"> * as default, it's identical with cards_limit tion>
.  when morep/spa
  o 52p/a>pspa
 class="comment"> * modules are loaded manually, this limit number increases, too.p/spa
  o 53p/a>pspa
 class="comment"> */p/spa
  o 54p/a>intopa href="+code=snd_ecards_limit" class="sref">snd_ecards_limitp/a>; o 55p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_ecards_limit" class="sref">snd_ecards_limitp/a>); o 56p/a> o 57p/a>static structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=SNDRV_OS_MINORS" class="sref">SNDRV_OS_MINORSp/a>]; o 58p/a>static pa href="+code=DEFINE_MUTEX" class="sref">DEFINE_MUTEXp/a>(pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o 59p/a> o 60p/a>#ifdefopa href="+code=CONFIG_MODULES" class="sref">CONFIG_MODULESp/a> o 61p/a> o 62p/a>pspa
 class="comment">/**p/spa
  o 63p/a>pspa
 class="comment"> * snd_request_card - try to load the card modulep/spa
  o 64p/a>pspa
 class="comment"> * @card: the card numberp/spa
  o 65p/a>pspa
 class="comment"> *p/spa
  o 66p/a>pspa
 class="comment"> * Tries to load the module "snd-card-X" for the given card numberp/spa
  o 67p/a>pspa
 class="comment"> * via request_module.  Returns immediately if already loaded.p/spa
  o 68p/a>pspa
 class="comment"> */p/spa
  o 69p/a>voidopa href="+code=snd_request_card" class="sref">snd_request_cardp/a>(intopa href="+code=card" class="sref">cardp/a>) o 70p/a>{ o 71p/a>        if (pa href="+code=snd_card_locked" class="sref">snd_card_lockedp/a>(pa href="+code=card" class="sref">cardp/a>)) o 72p/a>                return; o 73p/a>        if (pa href="+code=card" class="sref">cardp/a> < 0 ||opa href="+code=card" class="sref">cardp/a> >=opa href="+code=cards_limit" class="sref">cards_limitp/a>) o 74p/a>                return; o 75p/a>        pa href="+code=request_module" class="sref">request_modulep/a>(pspa
 class="string">"snd-card-%i"p/spa
 ,opa href="+code=card" class="sref">cardp/a>); o 76p/a>} o 77p/a> o 78p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_request_card" class="sref">snd_request_cardp/a>); o 79p/a> o 80p/a>static voidopa href="+code=snd_request_other" class="sref">snd_request_otherp/a>(intopa href="+code=minor" class="sref">minorp/a>) o 81p/a>{ o 82p/a>        char *pa href="+code=str" class="sref">strp/a>; o 83p/a> o 84p/a>        switch (pa href="+code=minor" class="sref">minorp/a>) { o 85p/a>        caseopa href="+code=SNDRV_MINOR_SEQUENCER" class="sref">SNDRV_MINOR_SEQUENCERp/a>:     pa href="+code=str" class="sref">strp/a> =opspa
 class="string">"snd-seq"p/spa
 ;        break; o 86p/a>        caseopa href="+code=SNDRV_MINOR_TIMER" class="sref">SNDRV_MINOR_TIMERp/a>:         pa href="+code=str" class="sref">strp/a> =opspa
 class="string">"snd-timer"p/spa
 ;      break; o 87p/a>        default:                        return; o 88p/a>        } o 89p/a>        pa href="+code=request_module" class="sref">request_modulep/a>(pa href="+code=str" class="sref">strp/a>); o 90p/a>} o 91p/a> o 92p/a>#endif  pspa
 class="comment">/* modular kernel */p/spa
  o 93p/a> o 94p/a>pspa
 class="comment">/**p/spa
  o 95p/a>pspa
 class="comment"> * snd_lookup_minor_data - get user data of a registered devicep/spa
  o 96p/a>pspa
 class="comment"> * @minor: the minor numberp/spa
  o 97p/a>pspa
 class="comment"> * @typ": device typ" (SNDRV_DEVICE_TYPE_XXX)p/spa
  o 98p/a>pspa
 class="comment"> *p/spa
  o 99p/a>pspa
 class="comment"> * Checks that a minor device with the specified typ" is registered, and returnsp/spa
  o100p/a>pspa
 class="comment"> * its user data pointer.p/spa
  o101p/a>pspa
 class="comment"> *p/spa
  o102p/a>pspa
 class="comment"> * This funcon>
 increments the reference counter of the card instancep/spa
  o103p/a>pspa
 class="comment"> * if an associated instance with the given minor number and typ" is found.p/spa
  o104p/a>pspa
 class="comment"> * The caller must call snd_card_unref() appropriately later.p/spa
  o105p/a>pspa
 class="comment"> */p/spa
  o106p/a>voido*pa href="+code=snd_lookup_minor_data" class="sref">snd_lookup_minor_datap/a>(unsigned intopa href="+code=minor" class="sref">minorp/a>, intopa href="+code=typ"" class="sref">typ"p/a>) o107p/a>{ o108p/a>        structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=mreg" class="sref">mregp/a>; o109p/a>        voido*pa href="+code=private_data" class="sref">private_datap/a>; o110p/a> o111p/a>        if (pa href="+code=minor" class="sref">minorp/a> >=opa href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZEp/a>(pa href="+code=snd_minors" class="sref">snd_minorsp/a>)) o112p/a>                returnopa href="+code=NULL" class="sref">NULLp/a>; o113p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o114p/a>        pa href="+code=mreg" class="sref">mregp/a> =opa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]; o115p/a>        if (pa href="+code=mreg" class="sref">mregp/a> && pa href="+code=mreg" class="sref">mregp/a>->pa href="+code=typ"" class="sref">typ"p/a> ==opa href="+code=typ"" class="sref">typ"p/a>) { o116p/a>                pa href="+code=private_data" class="sref">private_datap/a> =opa href="+code=mreg" class="sref">mregp/a>->pa href="+code=private_data" class="sref">private_datap/a>; o117p/a>                if (pa href="+code=private_data" class="sref">private_datap/a> && pa href="+code=mreg" class="sref">mregp/a>->pa href="+code=card_ptr" class="sref">card_ptrp/a>) o118p/a>                        pa href="+code=atomic_inc" class="sref">atomic_incp/a>(&pa href="+code=mreg" class="sref">mregp/a>->pa href="+code=card_ptr" class="sref">card_ptrp/a>->pa href="+code=refcount" class="sref">refcountp/a>); o119p/a>        } else o12/opa>                pa href="+code=private_data" class="sref">private_datap/a> =opa href="+code=NULL" class="sref">NULLp/a>; o121p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o122p/a>        returnopa href="+code=private_data" class="sref">private_datap/a>; o123p/a>} o124p/a> o125p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_lookup_minor_data" class="sref">snd_lookup_minor_datap/a>); o126p/a> o127p/a>#ifdefopa href="+code=CONFIG_MODULES" class="sref">CONFIG_MODULESp/a> o128p/a>static structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=autoload_device" class="sref">autoload_devicep/a>(unsigned intopa href="+code=minor" class="sref">minorp/a>) o129p/a>{ o13/opa>        intopa href="+code=dev" class="sref">devp/a>; o131p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); pspa
 class="comment">/* release lock temporarily */p/spa
  o132p/a>        pa href="+code=dev" class="sref">devp/a> =opa href="+code=SNDRV_MINOR_DEVICE" class="sref">SNDRV_MINOR_DEVICEp/a>(pa href="+code=minor" class="sref">minorp/a>); o133p/a>        if (pa href="+code=dev" class="sref">devp/a> ==opa href="+code=SNDRV_MINOR_CONTROL" class="sref">SNDRV_MINOR_CONTROLp/a>) { o134p/a>                pspa
 class="comment">/* /dev/aloadC? */p/spa
  o135p/a>                intopa href="+code=card" class="sref">cardp/a> =opa href="+code=SNDRV_MINOR_CARD" class="sref">SNDRV_MINOR_CARDp/a>(pa href="+code=minor" class="sref">minorp/a>); o136p/a>                if (pa href="+code=snd_cards" class="sref">snd_cardsp/a>[pa href="+code=card" class="sref">cardp/a>] ==opa href="+code=NULL" class="sref">NULLp/a>) o137p/a>                        pa href="+code=snd_request_card" class="sref">snd_request_cardp/a>(pa href="+code=card" class="sref">cardp/a>); o138p/a>        } else if (pa href="+code=dev" class="sref">devp/a> ==opa href="+code=SNDRV_MINOR_GLOBAL" class="sref">SNDRV_MINOR_GLOBALp/a>) { o139p/a>                pspa
 class="comment">/* /dev/aloadSEQ */p/spa
  o14/opa>                pa href="+code=snd_request_other" class="sref">snd_request_otherp/a>(pa href="+code=minor" class="sref">minorp/a>); o141p/a>        } o142p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); pspa
 class="comment">/* reacuire lock */p/spa
  o143p/a>        returnopa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]; o144p/a>} o145p/a>#else pspa
 class="comment">/* !CONFIG_MODULES */p/spa
  o146p/a>#define pa href="+code=autoload_device" class="sref">autoload_devicep/a>(pa href="+code=minor" class="sref">minorp/a>)  pa href="+code=NULL" class="sref">NULLp/a> o147p/a>#endif pspa
 class="comment">/* CONFIG_MODULES */p/spa
  o148p/a> o149p/a>static intopa href="+code=snd_open" class="sref">snd_openp/a>(structopa href="+code=inode" class="sref">inodep/a> *pa href="+code=inode" class="sref">inodep/a>, structopa href="+code=file" class="sref">filep/a> *pa href="+code=file" class="sref">filep/a>) o150p/a>{ o151p/a>        unsigned intopa href="+code=minor" class="sref">minorp/a> =opa href="+code=iminor" class="sref">iminorp/a>(pa href="+code=inode" class="sref">inodep/a>); o152p/a>        structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=mptr" class="sref">mptrp/a> =opa href="+code=NULL" class="sref">NULLp/a>; o153p/a>        const structopa href="+code=file_operaon>
s" class="sref">file_operaon>
sp/a> *pa href="+code=old_fops" class="sref">old_fopsp/a>; o154p/a>        intopa href="+code=err" class="sref">errp/a> =o0; o155p/a> o156p/a>        if (pa href="+code=minor" class="sref">minorp/a> >=opa href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZEp/a>(pa href="+code=snd_minors" class="sref">snd_minorsp/a>)) o157p/a>                returno-pa href="+code=ENODEV" class="sref">ENODEVp/a>; o158p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o159p/a>        pa href="+code=mptr" class="sref">mptrp/a> =opa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]; o160p/a>        if (pa href="+code=mptr" class="sref">mptrp/a> ==opa href="+code=NULL" class="sref">NULLp/a>) { o161p/a>                pa href="+code=mptr" class="sref">mptrp/a> =opa href="+code=autoload_device" class="sref">autoload_devicep/a>(pa href="+code=minor" class="sref">minorp/a>); o162p/a>                if (!pa href="+code=mptr" class="sref">mptrp/a>) { o163p/a>                        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o164p/a>                        returno-pa href="+code=ENODEV" class="sref">ENODEVp/a>; o165p/a>                } o166p/a>        } o167p/a>        pa href="+code=old_fops" class="sref">old_fopsp/a> =opa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a>; o168p/a>        pa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a> =opa href="+code=fops_get" class="sref">fops_getp/a>(pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=f_ops" class="sref">f_opsp/a>); o169p/a>        if (pa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a> ==opa href="+code=NULL" class="sref">NULLp/a>) { o17/opa>                pa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a> =opa href="+code=old_fops" class="sref">old_fopsp/a>; o171p/a>                pa href="+code=err" class="sref">errp/a> =o-pa href="+code=ENODEV" class="sref">ENODEVp/a>; o172p/a>        } o173p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o174p/a>        if (pa href="+code=err" class="sref">errp/a> < 0) o175p/a>                returnopa href="+code=err" class="sref">errp/a>; o176p/a> o177p/a>        if (pa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a>->pa href="+code=open" class="sref">openp/a>) { o178p/a>                pa href="+code=err" class="sref">errp/a> =opa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a>->pa href="+code=open" class="sref">openp/a>(pa href="+code=inode" class="sref">inodep/a>,opa href="+code=file" class="sref">filep/a>); o179p/a>                if (pa href="+code=err" class="sref">errp/a>) { o18/opa>                        pa href="+code=fops_put" class="sref">fops_putp/a>(pa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a>); o181p/a>                        pa href="+code=file" class="sref">filep/a>->pa href="+code=f_op" class="sref">f_opp/a> =opa href="+code=fops_get" class="sref">fops_getp/a>(pa href="+code=old_fops" class="sref">old_fopsp/a>); o182p/a>                } o183p/a>        } o184p/a>        pa href="+code=fops_put" class="sref">fops_putp/a>(pa href="+code=old_fops" class="sref">old_fopsp/a>); o185p/a>        returnopa href="+code=err" class="sref">errp/a>; o186p/a>} o187p/a> o188p/a>static const structopa href="+code=file_operaon>
s" class="sref">file_operaon>
sp/a> pa href="+code=snd_fops" class="sref">snd_fopsp/a> = o189p/a>{ o19/opa>        .pa href="+code=owner" class="sref">ownerp/a> =o       pa href="+code=THIS_MODULE" class="sref">THIS_MODULEp/a>, o191opa>        .pa href="+code=open" class="sref">openp/a> =o       opa href="+code=snd_open" class="sref">snd_openp/a>, o192opa>        .pa href="+code=llseek" class="sref">llseekp/a> =o      pa href="+code=noop_llseek" class="sref">noop_llseekp/a>, o193p/a>}; o194p/a> o195p/a>#ifdefopa href="+code=CONFIG_SND_DYNAMIC_MINORS" class="sref">CONFIG_SND_DYNAMIC_MINORSp/a> o196p/a>static intopa href="+code=snd_find_free_minor" class="sref">snd_find_free_minorp/a>(intopa href="+code=typ"" class="sref">typ"p/a>) o197p/a>{ o198p/a>        intopa href="+code=minor" class="sref">minorp/a>; o199p/a> o20/opa>        pspa
 class="comment">/* static minors for module auto loading */p/spa
  o201p/a>        if (pa href="+code=typ"" class="sref">typ"p/a> ==opa href="+code=SNDRV_DEVICE_TYPE_SEQUENCER" class="sref">SNDRV_DEVICE_TYPE_SEQUENCERp/a>) o202p/a>                returnopa href="+code=SNDRV_MINOR_SEQUENCER" class="sref">SNDRV_MINOR_SEQUENCERp/a>; o203p/a>        if (pa href="+code=typ"" class="sref">typ"p/a> ==opa href="+code=SNDRV_DEVICE_TYPE_TIMER" class="sref">SNDRV_DEVICE_TYPE_TIMERp/a>) o204p/a>                returnopa href="+code=SNDRV_MINOR_TIMER" class="sref">SNDRV_MINOR_TIMERp/a>; o205p/a> o206p/a>        for (pa href="+code=minor" class="sref">minorp/a> =o0;opa href="+code=minor" class="sref">minorp/a> < pa href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZEp/a>(pa href="+code=snd_minors" class="sref">snd_minorsp/a>); ++pa href="+code=minor" class="sref">minorp/a>) { o207p/a>                pspa
 class="comment">/* skip static minors still used for module auto loading */p/spa
  o208p/a>                if (pa href="+code=SNDRV_MINOR_DEVICE" class="sref">SNDRV_MINOR_DEVICEp/a>(pa href="+code=minor" class="sref">minorp/a>) ==opa href="+code=SNDRV_MINOR_CONTROL" class="sref">SNDRV_MINOR_CONTROLp/a>) o209p/a>                        continue; o21/opa>                if (pa href="+code=minor" class="sref">minorp/a> ==opa href="+code=SNDRV_MINOR_SEQUENCER" class="sref">SNDRV_MINOR_SEQUENCERp/a> || o211p/a>                    pa href="+code=minor" class="sref">minorp/a> ==opa href="+code=SNDRV_MINOR_TIMER" class="sref">SNDRV_MINOR_TIMERp/a>) o212p/a>                        continue; o213p/a>                if (!pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]) o214p/a>                        returnopa href="+code=minor" class="sref">minorp/a>; o215p/a>        } o216p/a>        returno-pa href="+code=EBUSY" class="sref">EBUSYp/a>; o217p/a>} o218p/a>#else o219p/a>static intopa href="+code=snd_kernel_minor" class="sref">snd_kernel_minorp/a>(intopa href="+code=typ"" class="sref">typ"p/a>, structopa href="+code=snd_card" class="sref">snd_cardp/a> *pa href="+code=card" class="sref">cardp/a>, intopa href="+code=dev" class="sref">devp/a>) o220p/a>{ o221p/a>        intopa href="+code=minor" class="sref">minorp/a>; o222p/a> o223p/a>        switch (pa href="+code=typ"" class="sref">typ"p/a>) { o224p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_SEQUENCER" class="sref">SNDRV_DEVICE_TYPE_SEQUENCERp/a>: o225p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_TIMER" class="sref">SNDRV_DEVICE_TYPE_TIMERp/a>: o226p/a>                pa href="+code=minor" class="sref">minorp/a> =opa href="+code=typ"" class="sref">typ"p/a>; o227p/a>                break; o228p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_CONTROL" class="sref">SNDRV_DEVICE_TYPE_CONTROLp/a>: o229p/a>                if (pa href="+code=snd_BUG_ON" class="sref">snd_BUG_ONp/a>(!pa href="+code=card" class="sref">cardp/a>)) o23/opa>                        returno-pa href="+code=EINVAL" class="sref">EINVALp/a>; o231p/a>                pa href="+code=minor" class="sref">minorp/a> =opa href="+code=SNDRV_MINOR" class="sref">SNDRV_MINORp/a>(pa href="+code=card" class="sref">cardp/a>->pa href="+code=number" class="sref">numberp/a>,opa href="+code=typ"" class="sref">typ"p/a>); o232p/a>                break; o233p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_HWDEP" class="sref">SNDRV_DEVICE_TYPE_HWDEPp/a>: o234p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_RAWMIDI" class="sref">SNDRV_DEVICE_TYPE_RAWMIDIp/a>: o235p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_PCM_PLAYBACK" class="sref">SNDRV_DEVICE_TYPE_PCM_PLAYBACKp/a>: o236p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_PCM_CAPTURE" class="sref">SNDRV_DEVICE_TYPE_PCM_CAPTUREp/a>: o237p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_COMPRESS" class="sref">SNDRV_DEVICE_TYPE_COMPRESSp/a>: o238p/a>                if (pa href="+code=snd_BUG_ON" class="sref">snd_BUG_ONp/a>(!pa href="+code=card" class="sref">cardp/a>)) o239p/a>                        returno-pa href="+code=EINVAL" class="sref">EINVALp/a>; o24/opa>                pa href="+code=minor" class="sref">minorp/a> =opa href="+code=SNDRV_MINOR" class="sref">SNDRV_MINORp/a>(pa href="+code=card" class="sref">cardp/a>->pa href="+code=number" class="sref">numberp/a>,opa href="+code=typ"" class="sref">typ"p/a> +opa href="+code=dev" class="sref">devp/a>); o241p/a>                break; o242p/a>        default: o243p/a>                returno-pa href="+code=EINVAL" class="sref">EINVALp/a>; o244p/a>        } o245p/a>        if (pa href="+code=snd_BUG_ON" class="sref">snd_BUG_ONp/a>(pa href="+code=minor" class="sref">minorp/a> < 0 ||opa href="+code=minor" class="sref">minorp/a> >=opa href="+code=SNDRV_OS_MINORS" class="sref">SNDRV_OS_MINORSp/a>)) o246p/a>                returno-pa href="+code=EINVAL" class="sref">EINVALp/a>; o247p/a>        returnopa href="+code=minor" class="sref">minorp/a>; o248p/a>} o249p/a>#endif o250p/a> o251p/a>pspa
 class="comment">/**p/spa
  o252p/a>pspa
 class="comment"> * snd_register_device_for_dev - Register the ALSA device file for the cardp/spa
  o253p/a>pspa
 class="comment"> * @typ": the device typ", SNDRV_DEVICE_TYPE_XXXp/spa
  o254p/a>pspa
 class="comment"> * @card: the card instancep/spa
  o255p/a>pspa
 class="comment"> * @dev: the device indexp/spa
  o256p/a>pspa
 class="comment"> * @f_ops: the file operaon>
sp/spa
  o257p/a>pspa
 class="comment"> * @private_data: user pointer for f_ops->open()p/spa
  o258p/a>pspa
 class="comment"> * @nam": the device file nam"p/spa
  o259p/a>pspa
 class="comment"> * @device: the &structodevice to link this newodevice top/spa
  o260p/a>pspa
 class="comment"> *p/spa
  o261p/a>pspa
 class="comment"> * Registers an ALSA device file for the given card.p/spa
  o262p/a>pspa
 class="comment"> * The operaoors have to be set in reg param"ter.p/spa
  o263p/a>pspa
 class="comment"> *p/spa
  o264p/a>pspa
 class="comment"> * Returns zero if successful, or a negaonve error code on failure.p/spa
  o265p/a>pspa
 class="comment"> */p/spa
  o266p/a>intopa href="+code=snd_register_device_for_dev" class="sref">snd_register_device_for_devp/a>(intopa href="+code=typ"" class="sref">typ"p/a>, structopa href="+code=snd_card" class="sref">snd_cardp/a> *pa href="+code=card" class="sref">cardp/a>, intopa href="+code=dev" class="sref">devp/a>, o267p/a>                                const structopa href="+code=file_operaon>
s" class="sref">file_operaon>
sp/a> *pa href="+code=f_ops" class="sref">f_opsp/a>, o268p/a>                                voido*pa href="+code=private_data" class="sref">private_datap/a>, o269p/a>                                const char *pa href="+code=nam"" class="sref">nam"p/a>, structopa href="+code=device" class="sref">devicep/a> *pa href="+code=device" class="sref">devicep/a>) o270p/a>{ o271p/a>        intopa href="+code=minor" class="sref">minorp/a>; o272p/a>        structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=preg" class="sref">pregp/a>; o273p/a> o274p/a>        if (pa href="+code=snd_BUG_ON" class="sref">snd_BUG_ONp/a>(!pa href="+code=nam"" class="sref">nam"p/a>)) o275p/a>                returno-pa href="+code=EINVAL" class="sref">EINVALp/a>; o276p/a>        pa href="+code=preg" class="sref">pregp/a> =opa href="+code=kmalloc" class="sref">kmallocp/a>(sizeof *pa href="+code=preg" class="sref">pregp/a>,opa href="+code=GFP_KERNEL" class="sref">GFP_KERNELp/a>); o277p/a>        if (pa href="+code=preg" class="sref">pregp/a> ==opa href="+code=NULL" class="sref">NULLp/a>) o278p/a>                returno-pa href="+code=ENOMEM" class="sref">ENOMEMp/a>; o279p/a>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=typ"" class="sref">typ"p/a> =opa href="+code=typ"" class="sref">typ"p/a>; o28/opa>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=card" class="sref">cardp/a> =opa href="+code=card" class="sref">cardp/a> ?opa href="+code=card" class="sref">cardp/a>->pa href="+code=number" class="sref">numberp/a> : -1; o281p/a>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=device" class="sref">devicep/a> =opa href="+code=dev" class="sref">devp/a>; o282p/a>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=f_ops" class="sref">f_opsp/a> =opa href="+code=f_ops" class="sref">f_opsp/a>; o283p/a>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=private_data" class="sref">private_datap/a> =opa href="+code=private_data" class="sref">private_datap/a>; o284p/a>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=card_ptr" class="sref">card_ptrp/a> =opa href="+code=card" class="sref">cardp/a>; o285p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o286p/a>#ifdefopa href="+code=CONFIG_SND_DYNAMIC_MINORS" class="sref">CONFIG_SND_DYNAMIC_MINORSp/a> o287p/a>        pa href="+code=minor" class="sref">minorp/a> =opa href="+code=snd_find_free_minor" class="sref">snd_find_free_minorp/a>(pa href="+code=typ"" class="sref">typ"p/a>); o288p/a>#else o289p/a>        pa href="+code=minor" class="sref">minorp/a> =opa href="+code=snd_kernel_minor" class="sref">snd_kernel_minorp/a>(pa href="+code=typ"" class="sref">typ"p/a>, pa href="+code=card" class="sref">cardp/a>, pa href="+code=dev" class="sref">devp/a>); o290p/a>        if (pa href="+code=minor" class="sref">minorp/a> >=o0 && pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]) o291p/a>                pa href="+code=minor" class="sref">minorp/a> =o-pa href="+code=EBUSY" class="sref">EBUSYp/a>; o292opa>#endif o293p/a>        if (pa href="+code=minor" class="sref">minorp/a> < 0) { o294p/a>                pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o295p/a>                pa href="+code=kfree" class="sref">kfreep/a>(pa href="+code=preg" class="sref">pregp/a>); o296p/a>                returnopa href="+code=minor" class="sref">minorp/a>; o297p/a>        } o298p/a>        pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>] =opa href="+code=preg" class="sref">pregp/a>; o299p/a>        pa href="+code=preg" class="sref">pregp/a>->pa href="+code=dev" class="sref">devp/a> =opa href="+code=device_create" class="sref">device_createp/a>(pa href="+code=sound_class" class="sref">sound_classp/a>, pa href="+code=device" class="sref">devicep/a>, pa href="+code=MKDEV" class="sref">MKDEVp/a>(pa href="+code=major" class="sref">majorp/a>, pa href="+code=minor" class="sref">minorp/a>), o30/opa>                                  pa href="+code=private_data" class="sref">private_datap/a>, pspa
 class="string">"%s"p/spa
 , pa href="+code=nam"" class="sref">nam"p/a>); o301p/a>        if (pa href="+code=IS_ERR" class="sref">IS_ERRp/a>(pa href="+code=preg" class="sref">pregp/a>->pa href="+code=dev" class="sref">devp/a>)) { o302p/a>                pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>] =opa href="+code=NULL" class="sref">NULLp/a>; o303p/a>                pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o304p/a>                pa href="+code=minor" class="sref">minorp/a> =opa href="+code=PTR_ERR" class="sref">PTR_ERRp/a>(pa href="+code=preg" class="sref">pregp/a>->pa href="+code=dev" class="sref">devp/a>); o305p/a>                pa href="+code=kfree" class="sref">kfreep/a>(pa href="+code=preg" class="sref">pregp/a>); o306p/a>                returnopa href="+code=minor" class="sref">minorp/a>; o307p/a>        } o308p/a> o309p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o31/opa>        returno0; o311p/a>} o312p/a> o313p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_register_device_for_dev" class="sref">snd_register_device_for_devp/a>); o314p/a> o315p/a>pspa
 class="comment">/* find the matching minor recordp/spa
  o316p/a>pspa
 class="comment"> * returnothe index of snd_minor, or -1 if not foundp/spa
  o317p/a>pspa
 class="comment"> */p/spa
  o318p/a>static intopa href="+code=find_snd_minor" class="sref">find_snd_minorp/a>(intopa href="+code=typ"" class="sref">typ"p/a>, structopa href="+code=snd_card" class="sref">snd_cardp/a> *pa href="+code=card" class="sref">cardp/a>, intopa href="+code=dev" class="sref">devp/a>) o319p/a>{ o320p/a>        intopa href="+code=cardnum" class="sref">cardnump/a>, pa href="+code=minor" class="sref">minorp/a>; o321p/a>        structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=mptr" class="sref">mptrp/a>; o322p/a> o323p/a>        pa href="+code=cardnum" class="sref">cardnump/a> =opa href="+code=card" class="sref">cardp/a> ?opa href="+code=card" class="sref">cardp/a>->pa href="+code=number" class="sref">numberp/a> : -1; o324p/a>        for (pa href="+code=minor" class="sref">minorp/a> =o0;opa href="+code=minor" class="sref">minorp/a> < pa href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZEp/a>(pa href="+code=snd_minors" class="sref">snd_minorsp/a>); ++pa href="+code=minor" class="sref">minorp/a>) o325p/a>                if ((pa href="+code=mptr" class="sref">mptrp/a> = pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]) !=opa href="+code=NULL" class="sref">NULLp/a> && o326p/a>                    pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=typ"" class="sref">typ"p/a> ==opa href="+code=typ"" class="sref">typ"p/a> && o327p/a>                    pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=card" class="sref">cardp/a> ==opa href="+code=cardnum" class="sref">cardnump/a> && o328p/a>                    pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=device" class="sref">devicep/a> ==opa href="+code=dev" class="sref">devp/a>) o329p/a>                        returnopa href="+code=minor" class="sref">minorp/a>; o33/opa>        returno-1; o331p/a>} o332p/a> o333p/a>pspa
 class="comment">/**p/spa
  o334p/a>pspa
 class="comment"> * snd_unregister_device - unregister the device on the given cardp/spa
  o335p/a>pspa
 class="comment"> * @typ": the device typ", SNDRV_DEVICE_TYPE_XXXp/spa
  o336p/a>pspa
 class="comment"> * @card: the card instancep/spa
  o337p/a>pspa
 class="comment"> * @dev: the device indexp/spa
  o338p/a>pspa
 class="comment"> *p/spa
  o339p/a>pspa
 class="comment"> * Unregisters the device file already registered viap/spa
  o340p/a>pspa
 class="comment"> * snd_register_device().p/spa
  o341p/a>pspa
 class="comment"> *p/spa
  o342p/a>pspa
 class="comment"> * Returns zero if sucecessful, or a negaonve error code on failurep/spa
  o343p/a>pspa
 class="comment"> */p/spa
  o344p/a>intopa href="+code=snd_unregister_device" class="sref">snd_unregister_devicep/a>(intopa href="+code=typ"" class="sref">typ"p/a>, structopa href="+code=snd_card" class="sref">snd_cardp/a> *pa href="+code=card" class="sref">cardp/a>, intopa href="+code=dev" class="sref">devp/a>) o345p/a>{ o346p/a>        intopa href="+code=minor" class="sref">minorp/a>; o347p/a> o348p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o349p/a>        pa href="+code=minor" class="sref">minorp/a> =opa href="+code=find_snd_minor" class="sref">find_snd_minorp/a>(pa href="+code=typ"" class="sref">typ"p/a>, pa href="+code=card" class="sref">cardp/a>, pa href="+code=dev" class="sref">devp/a>); o350p/a>        if (pa href="+code=minor" class="sref">minorp/a> < 0) { o351p/a>                pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o352p/a>                returno-pa href="+code=EINVAL" class="sref">EINVALp/a>; o353p/a>        } o354p/a> o355p/a>        pa href="+code=device_destroy" class="sref">device_destroyp/a>(pa href="+code=sound_class" class="sref">sound_classp/a>, pa href="+code=MKDEV" class="sref">MKDEVp/a>(pa href="+code=major" class="sref">majorp/a>, pa href="+code=minor" class="sref">minorp/a>)); o356p/a> o357p/a>        pa href="+code=kfree" class="sref">kfreep/a>(pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]); o358p/a>        pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>] =opa href="+code=NULL" class="sref">NULLp/a>; o359p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o36/opa>        returno0; o361p/a>} o362p/a> o363p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_unregister_device" class="sref">snd_unregister_devicep/a>); o364p/a> o365p/a>intopa href="+code=snd_add_device_sysfs_file" class="sref">snd_add_device_sysfs_filep/a>(intopa href="+code=typ"" class="sref">typ"p/a>, structopa href="+code=snd_card" class="sref">snd_cardp/a> *pa href="+code=card" class="sref">cardp/a>, intopa href="+code=dev" class="sref">devp/a>, o366p/a>                              structopa href="+code=device_attribute" class="sref">device_attributep/a> *pa href="+code=attr" class="sref">attrp/a>) o367p/a>{ o368p/a>        intopa href="+code=minor" class="sref">minorp/a>, pa href="+code=ret" class="sref">retp/a> =o-pa href="+code=EINVAL" class="sref">EINVALp/a>; o369p/a>        structopa href="+code=device" class="sref">devicep/a> *pa href="+code=d" class="sref">dp/a>; o370p/a> o371p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o372p/a>        pa href="+code=minor" class="sref">minorp/a> =opa href="+code=find_snd_minor" class="sref">find_snd_minorp/a>(pa href="+code=typ"" class="sref">typ"p/a>, pa href="+code=card" class="sref">cardp/a>, pa href="+code=dev" class="sref">devp/a>); o373p/a>        if (pa href="+code=minor" class="sref">minorp/a> >=o0 && (pa href="+code=d" class="sref">dp/a> = pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>]->pa href="+code=dev" class="sref">devp/a>) !=opa href="+code=NULL" class="sref">NULLp/a>) o374p/a>                pa href="+code=ret" class="sref">retp/a> =opa href="+code=device_create_file" class="sref">device_create_filep/a>(pa href="+code=d" class="sref">dp/a>, pa href="+code=attr" class="sref">attrp/a>); o375p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o376p/a>        returnopa href="+code=ret" class="sref">retp/a>; o377p/a> o378p/a>} o379p/a> o38/opa>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=snd_add_device_sysfs_file" class="sref">snd_add_device_sysfs_filep/a>); o381p/a> o382p/a>#ifdefopa href="+code=CONFIG_PROC_FS" class="sref">CONFIG_PROC_FSp/a> o383p/a>pspa
 class="comment">/*p/spa
  o384p/a>pspa
 class="comment"> *  INFO PARTp/spa
  o385p/a>pspa
 class="comment"> */p/spa
  o386p/a> o387p/a>static structopa href="+code=snd_info_entry" class="sref">snd_info_entryp/a> *pa href="+code=snd_minor_info_entry" class="sref">snd_minor_info_entryp/a>; o388p/a> o389p/a>static const char *pa href="+code=snd_device_typ"_nam"" class="sref">snd_device_typ"_nam"p/a>(intopa href="+code=typ"" class="sref">typ"p/a>) o390p/a>{ o391p/a>        switch (pa href="+code=typ"" class="sref">typ"p/a>) { o392p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_CONTROL" class="sref">SNDRV_DEVICE_TYPE_CONTROLp/a>: o393p/a>                returnopspa
 class="string">"control"p/spa
 ; o394p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_HWDEP" class="sref">SNDRV_DEVICE_TYPE_HWDEPp/a>: o395p/a>                returnopspa
 class="string">"hardware dependent"p/spa
 ; o396p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_RAWMIDI" class="sref">SNDRV_DEVICE_TYPE_RAWMIDIp/a>: o397p/a>                returnopspa
 class="string">"raw midi"p/spa
 ; o398p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_PCM_PLAYBACK" class="sref">SNDRV_DEVICE_TYPE_PCM_PLAYBACKp/a>: o399p/a>                returnopspa
 class="string">"digital audio playback"p/spa
 ; o40/opa>        caseopa href="+code=SNDRV_DEVICE_TYPE_PCM_CAPTURE" class="sref">SNDRV_DEVICE_TYPE_PCM_CAPTUREp/a>: o401p/a>                returnopspa
 class="string">"digital audio capture"p/spa
 ; o402p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_SEQUENCER" class="sref">SNDRV_DEVICE_TYPE_SEQUENCERp/a>: o403p/a>                returnopspa
 class="string">"sequencer"p/spa
 ; o404p/a>        caseopa href="+code=SNDRV_DEVICE_TYPE_TIMER" class="sref">SNDRV_DEVICE_TYPE_TIMERp/a>: o405p/a>                returnopspa
 class="string">"timer"p/spa
 ; o406p/a>        default: o407p/a>                returnopspa
 class="string">"?"p/spa
 ; o408p/a>        } o409p/a>} o410p/a> o411p/a>static voidopa href="+code=snd_minor_info_read" class="sref">snd_minor_info_readp/a>(structopa href="+code=snd_info_entry" class="sref">snd_info_entryp/a> *pa href="+code=entry" class="sref">entryp/a>, structopa href="+code=snd_info_buffer" class="sref">snd_info_bufferp/a> *pa href="+code=buffer" class="sref">bufferp/a>) o412p/a>{ o413p/a>        intopa href="+code=minor" class="sref">minorp/a>; o414p/a>        structopa href="+code=snd_minor" class="sref">snd_minorp/a> *pa href="+code=mptr" class="sref">mptrp/a>; o415p/a> o416p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o417p/a>        for (pa href="+code=minor" class="sref">minorp/a> =o0;opa href="+code=minor" class="sref">minorp/a> < pa href="+code=SNDRV_OS_MINORS" class="sref">SNDRV_OS_MINORSp/a>; ++pa href="+code=minor" class="sref">minorp/a>) { o418p/a>                if (!(pa href="+code=mptr" class="sref">mptrp/a> = pa href="+code=snd_minors" class="sref">snd_minorsp/a>[pa href="+code=minor" class="sref">minorp/a>])) o419p/a>                        continue; o42/opa>                if (pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=card" class="sref">cardp/a> >=o0) { o421p/a>                        if (pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=device" class="sref">devicep/a> >=o0) o422p/a>                                pa href="+code=snd_iprintf" class="sref">snd_iprintfp/a>(pa href="+code=buffer" class="sref">bufferp/a>, pspa
 class="string">"%3i: [%2i-%2i]: %s\n"p/spa
 , o423p/a>                                            pa href="+code=minor" class="sref">minorp/a>, pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=card" class="sref">cardp/a>, pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=device" class="sref">devicep/a>, o424p/a>                                            pa href="+code=snd_device_typ"_nam"" class="sref">snd_device_typ"_nam"p/a>(pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=typ"" class="sref">typ"p/a>)); o425p/a>                        else o426p/a>                                pa href="+code=snd_iprintf" class="sref">snd_iprintfp/a>(pa href="+code=buffer" class="sref">bufferp/a>, pspa
 class="string">"%3i: [%2i]   : %s\n"p/spa
 , o427p/a>                                            pa href="+code=minor" class="sref">minorp/a>, pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=card" class="sref">cardp/a>, o428p/a>                                            pa href="+code=snd_device_typ"_nam"" class="sref">snd_device_typ"_nam"p/a>(pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=typ"" class="sref">typ"p/a>)); o429p/a>                } else o43/opa>                        pa href="+code=snd_iprintf" class="sref">snd_iprintfp/a>(pa href="+code=buffer" class="sref">bufferp/a>, pspa
 class="string">"%3i:        : %s\n"p/spa
 , pa href="+code=minor" class="sref">minorp/a>, o431p/a>                                    pa href="+code=snd_device_typ"_nam"" class="sref">snd_device_typ"_nam"p/a>(pa href="+code=mptr" class="sref">mptrp/a>->pa href="+code=typ"" class="sref">typ"p/a>)); o432p/a>        } o433p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=sound_mutex" class="sref">sound_mutexp/a>); o434p/a>} o435p/a> o436p/a>intopa href="+code=__init" class="sref">__initp/a> pa href="+code=snd_minor_info_init" class="sref">snd_minor_info_initp/a>(void) o437p/a>{ o438p/a>        structopa href="+code=snd_info_entry" class="sref">snd_info_entryp/a> *pa href="+code=entry" class="sref">entryp/a>; o439p/a> o44/opa>        pa href="+code=entry" class="sref">entryp/a> = pa href="+code=snd_info_create_module_entry" class="sref">snd_info_create_module_entryp/a>(pa href="+code=THIS_MODULE" class="sref">THIS_MODULEp/a>, pspa
 class="string">"devices"p/spa
 , pa href="+code=NULL" class="sref">NULLp/a>); o441p/a>        if (pa href="+code=entry" class="sref">entryp/a>) { o442p/a>                pa href="+code=entry" class="sref">entryp/a>->pa href="+code=c" class="sref">cp/a>.pa href="+code=text" class="sref">textp/a>.pa href="+code=read" class="sref">readp/a> = pa href="+code=snd_minor_info_read" class="sref">snd_minor_info_readp/a>; o443p/a>                if (pa href="+code=snd_info_register" class="sref">snd_info_registerp/a>(pa href="+code=entry" class="sref">entryp/a>) < 0) { ound.c#L438" idvo href="+code=_minors" class="sre
g2s="line" nam"v4L4o_buffer" classe="+code=snd_minor_info_read" claslass="linv" class="sref">devp/a>)4o44/opa>     >[pa href="+code=minor" class="sref">minorp/a>] =opa href=4class="li4e" nam"v4L345">o345p/a>{4minorp/a>;4o347p/a>4snd_info_entryp/a> *pa href="440">o44/opa>     =snd_info_entry" class="sref">snd_info_entryp/a> *pa href="+cex" class4"sref">sound_mutexp/a>);4devp/a>);4minorp/a> < 0) {4sound_mutexp/a>);4o436p/a>intopa href="+codon                    a href="+codon href="+code=snd_minor_info_init" class="se=EINVAL"4class="sref">EINVALp/a>;4o353p/a>        }4ound.c#L438" idvo href="+code=_minors" class="sre
g2s="=snd_info_entry" class="sref">snd_info_entryp/a> *pa href="e="+code=snd_minor_info_read" cla class="l4ne" nam"v4L354">o354p/a>4minorp/a>));4o356p/a>4o382p/a>idv4L385" class="line" nam"v4L385">o385p4e=minor" 4lass="sref">minorp/a>]);4NULLp/a>;4o3834ex" class4"sref">sound_mutexp/a>);4o384p/a>pspa
 c4"v4L360">436/opa>        returno0;4o385p4class="li4e" nam"v4L361">o361p/a>}4o362p/a>4o436p/a>ialsa_">mute idv4L436" class="lalsa_">mute idvhref="+code=snd_minor_info_init" class="s"sref">sn4_unregister_devicep/a>);4o364p/a>4, pa href="+code=nfo_ea>, ef="440">o44/opa>     /a>, pa href="+code=MKDEV" clL360" idv4L360" class="line" na4="+code=d4v" class="sref">devp/a>,4o44/opa>     ptr"s_lim=__init" class="sptr"s_lim=_ef="L360" idv4L360" class="line" na4=de=minor4" class="sref">attrp/a>)4(pchrpa href="+code=minBOLp/a>(pchrpa ef="+code=snd_device_a>, pa href="+code=MKDEV" classyp/a>(pa href="+code=THIS_alsa class="sref">T      pa href="+code=ef"f;pa href="+code=f_=ef"f;pa classegisterp/a>(pa href="+code=entry"class="li4e" nam"v4L367">o367p/a>{4(pa href="+code=THIS_unable to9p/a>pspa367a>pspMKDEVine" namd" clas="sred">bufferp/a>, pspa
 class="stringa>, pa href="+code=MKDEV" cle="+code=snd_minor_info_read" clae=EINVAL"4class="sref">EINVALp/a>;4minorp/Opa href="+code=p/Oef="L360" idv4L360" class="line" na4href="+co4e=d" class="sref">dp/a>;4o370p/a>4entryp/mode=caK nd.c#L344" idv4L344" class="line" nam"v4L344nd.c#L436" idv4L43>minorp/a>));4o4Oef="L360" idv4L360" classoundp/a>,2/core/solassoundp/a>,2/core/solassoundp/a.M"sref">EINVALp/ap/a.M4]->pa href="+code=4ev" c4ass="sref">dev" class="line" na4href="+co4e=d" sn4_unregreate_filep/a>(pa href="4code=4" class="sref">dp/a>, pa href0p/a>4   ck" class="sref">mutex_u4lockp4a>(&am#ifnsound.c#L381" idv4L" class="sref">entryp pa href="r46="sound/core/sound.c#L399" iatr"s_lim=v4L376" class="line" nam4v4L3747nd/core/sound.c#L356" idv4L34e" nam"v4L367">o367p4p"line" nam"v=ef"     aef="+code=AdvTYPEd Linux Sc#L3 Architecf="s Dr"+cr Ir47ialized.(pa href="+codenhr46="sound/core/sound.c#L399" iade=ef"f;pass="sref">retp/a>; minorp/a> =o-pa href="+code=EBUSY"4="line" n4m"v4L377">o377p/a> sound="line" n4m"v4L378">o378p/a>} EXPORT4SYMBOLp/a>(pa href="+cod4=snd_4dd_device_sysfs_file" class="sref">s4d_add_dev4ce_sysfs_filep/a>); sound_mutexp/a>);4o436p/a>ialsa_">mute i382" clas4="line" nam"v4L382">o3824/a>#i48e=snd_minor_info_init" class="se=EINVa href="s4und/core/sound.c#L383" i4v4L3848isterp/a>(pa href="+code=entry"ine" nf="+coard" classeadp/a>; dp/a>, pa href0p/a>4   nd/core/sound.c#L385" id44L38548360" idv4L360" class="line" ound/core/sound.c#L370" idcode=card" class="/sound.c#L370" idcode=card" cla="+co4L33="sref">entryp/mode=caK nd.c#L344" idv4L344" class="line" nam"v4L344nd.c#L436" idv4L43>minorpa
 class=4comment"> */p/spa
  snd_info_entryp/a> *pa4href=4+code=snd_minor_info_entry" class="s4ef">snd_m4nor_info_entryp/a>; minorpsnd_devic4_typ"_nam"" class="sref"4snd_d49nd/core/sound.c#L379>o44/opa3814ex" class4"sre>o44/opa381d.c#L370" idcode=carnd/core/souL3814ex" class4"sredv4L436" clL381"linm"v4L344nd.c#L436" idv4L43>minorps">EXPORT4s="sref">typ"p/a>) tyfooasse>
The original LXR softPp/a>bylass=4L344nd.chttp:/4L43rceforge.net/projecfs/lxse>LXR 4p/auss=ef">sndthis experia>psal +crsion>byl4L344nd.cmailto:lxs@linux.no">lxs@linux.no     
ty4ubfooasse> lxs.linux.no kindly holasd>byl4L344nd.chttp:/4www.redpill-linpro.no">Redpill Linpro ASf">sndprovidcr of Linux d.c#ult namaL3 oper/so.c# sertry" siYPE 1995.