Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257692
b: refs/heads/master
c: 370bafb
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jun 20, 2011
1 parent ba35265 commit 5262a27
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a918ffeaadd6a2269b9c6575478c102382c7702
refs/heads/master: 370bafbdae3d78c9081ebe3028a3ff5f0e91357b
42 changes: 42 additions & 0 deletions trunk/sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,31 @@ static const struct hda_pcm_stream via_pcm_digital_capture = {
.channels_max = 2,
};

/*
* slave controls for virtual master
*/
static const char * const via_slave_vols[] = {
"Front Playback Volume",
"Surround Playback Volume",
"Center Playback Volume",
"LFE Playback Volume",
"Side Playback Volume",
"Headphone Playback Volume",
"Speaker Playback Volume",
NULL,
};

static const char * const via_slave_sws[] = {
"Front Playback Switch",
"Surround Playback Switch",
"Center Playback Switch",
"LFE Playback Switch",
"Side Playback Switch",
"Headphone Playback Switch",
"Speaker Playback Switch",
NULL,
};

static int via_build_controls(struct hda_codec *codec)
{
struct via_spec *spec = codec->spec;
Expand Down Expand Up @@ -1343,6 +1368,23 @@ static int via_build_controls(struct hda_codec *codec)
return err;
}

/* if we have no master control, let's create it */
if (!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
unsigned int vmaster_tlv[4];
snd_hda_set_vmaster_tlv(codec, spec->multiout.dac_nids[0],
HDA_OUTPUT, vmaster_tlv);
err = snd_hda_add_vmaster(codec, "Master Playback Volume",
vmaster_tlv, via_slave_vols);
if (err < 0)
return err;
}
if (!snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) {
err = snd_hda_add_vmaster(codec, "Master Playback Switch",
NULL, via_slave_sws);
if (err < 0)
return err;
}

/* assign Capture Source enums to NID */
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) {
Expand Down

0 comments on commit 5262a27

Please sign in to comment.