summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-03-12 12:25:03 +0100
committerTakashi Iwai <tiwai@suse.de>2012-03-12 14:52:28 +0100
commit29e5853d618282d8277ce8a8304f7424eb60deb5 (patch)
treee6f2990534e3656f9bbdc1a13cb3fc3cf41934c9 /sound/pci/hda/hda_codec.c
parent2ad787e9aae8bfac14fa96748c0f2b034577be6a (diff)
ALSA: hda - Return the created kcontrol in __snd_hda_add_vmaster()
It'll be used for adding hooks in later patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 0c0ac0e1d50..b79ee344465 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2399,6 +2399,7 @@ static int init_slave_unmute(void *data, struct snd_kcontrol *slave)
* @slaves: slave control names (optional)
* @suffix: suffix string to each slave name (optional)
* @init_slave_vol: initialize slaves to unmute/0dB
+ * @ctl_ret: store the vmaster kcontrol in return
*
* Create a virtual master control with the given name. The TLV data
* must be either NULL or a valid data.
@@ -2411,11 +2412,15 @@ static int init_slave_unmute(void *data, struct snd_kcontrol *slave)
*/
int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,
unsigned int *tlv, const char * const *slaves,
- const char *suffix, bool init_slave_vol)
+ const char *suffix, bool init_slave_vol,
+ struct snd_kcontrol **ctl_ret)
{
struct snd_kcontrol *kctl;
int err;
+ if (ctl_ret)
+ *ctl_ret = NULL;
+
err = map_slaves(codec, slaves, suffix, check_slave_present, NULL);
if (err != 1) {
snd_printdd("No slave found for %s\n", name);
@@ -2439,6 +2444,8 @@ int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,
map_slaves(codec, slaves, suffix,
tlv ? init_slave_0dB : init_slave_unmute, kctl);
+ if (ctl_ret)
+ *ctl_ret = kctl;
return 0;
}
EXPORT_SYMBOL_HDA(__snd_hda_add_vmaster);