From 14741992298c2dedc59c825119346d9cbf14809a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 12 Mar 2012 12:25:03 +0100 Subject: [PATCH] --- yaml --- r: 293119 b: refs/heads/master c: 29e5853d618282d8277ce8a8304f7424eb60deb5 h: refs/heads/master i: 293117: a0f53e7737056a0d256f43309676102dd4e7373e 293115: 5a696dabfd6609ae52fac6d6a92b843d0252aa1a 293111: 42bd9670bece524df256f0c70ca63ba4d24a0be2 293103: cd24658c8a7b0eaeca4fd294d19635b04ae526d8 293087: 84ea5f53abbfdc1fcd12386cdb4d07692957ad6b 293055: dada6077f8ceb3cbf3a05ccf37dc57a730fa590e 292991: 916ef954cfedc5b7acf4286d9747ef8c6158ee6a 292863: 44970fd2b3baeece76e8c59e7f007b958ccb32f3 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.c | 9 ++++++++- trunk/sound/pci/hda/hda_local.h | 7 ++++--- trunk/sound/pci/hda/patch_analog.c | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index d4544f6d129b..c1984e71747e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2ad787e9aae8bfac14fa96748c0f2b034577be6a +refs/heads/master: 29e5853d618282d8277ce8a8304f7424eb60deb5 diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index 0c0ac0e1d504..b79ee3444654 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/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); diff --git a/trunk/sound/pci/hda/hda_local.h b/trunk/sound/pci/hda/hda_local.h index caa64686267b..c3ee4ede4482 100644 --- a/trunk/sound/pci/hda/hda_local.h +++ b/trunk/sound/pci/hda/hda_local.h @@ -140,10 +140,11 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, const char *name); 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); + unsigned int *tlv, const char * const *slaves, + const char *suffix, bool init_slave_vol, + struct snd_kcontrol **ctl_ret); #define snd_hda_add_vmaster(codec, name, tlv, slaves, suffix) \ - __snd_hda_add_vmaster(codec, name, tlv, slaves, suffix, true) + __snd_hda_add_vmaster(codec, name, tlv, slaves, suffix, true, NULL) int snd_hda_codec_reset(struct hda_codec *codec); /* amp value bits */ diff --git a/trunk/sound/pci/hda/patch_analog.c b/trunk/sound/pci/hda/patch_analog.c index fa97a0c5ced0..7143393927da 100644 --- a/trunk/sound/pci/hda/patch_analog.c +++ b/trunk/sound/pci/hda/patch_analog.c @@ -229,7 +229,7 @@ static int ad198x_build_controls(struct hda_codec *codec) (spec->slave_vols ? spec->slave_vols : ad_slave_pfxs), "Playback Volume", - !spec->avoid_init_slave_vol); + !spec->avoid_init_slave_vol, NULL); if (err < 0) return err; }