Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293119
b: refs/heads/master
c: 29e5853
h: refs/heads/master
i:
  293117: a0f53e7
  293115: 5a696da
  293111: 42bd967
  293103: cd24658
  293087: 84ea5f5
  293055: dada607
  292991: 916ef95
  292863: 44970fd
v: v3
  • Loading branch information
Takashi Iwai committed Mar 12, 2012
1 parent 01d9e1d commit 1474199
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ad787e9aae8bfac14fa96748c0f2b034577be6a
refs/heads/master: 29e5853d618282d8277ce8a8304f7424eb60deb5
9 changes: 8 additions & 1 deletion trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand All @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1474199

Please sign in to comment.