diff options
| author | Takashi Iwai <tiwai@suse.de> | 2017-04-10 11:37:34 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2017-04-10 11:45:27 -0400 |
| commit | 7480316c265c9fcdbf73b1b8dec061b893b7e987 (patch) | |
| tree | 69b0bdc29afba6b441eaa9fa1656e6ceead36a35 | |
| parent | 9f3dadb156692e15933a4a97ef659f65151be4a1 (diff) | |
ALSA: hda - Allow to enable/disable vmaster build explicitly
Another preliminary patch for the dual-codec support: since the
support of vmaster over multiple codecs is difficult, simply disable
it by a new flag to hda_codec struct. A new user hint is added as
well for consistency.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | Documentation/sound/hd-audio/notes.rst | 2 | ||||
| -rw-r--r-- | sound/pci/hda/hda_generic.c | 7 | ||||
| -rw-r--r-- | sound/pci/hda/hda_generic.h | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/Documentation/sound/hd-audio/notes.rst b/Documentation/sound/hd-audio/notes.rst index 9eeb9b468706..f59c3cdbfaf4 100644 --- a/Documentation/sound/hd-audio/notes.rst +++ b/Documentation/sound/hd-audio/notes.rst | |||
| @@ -494,6 +494,8 @@ add_hp_mic (bool) | |||
| 494 | hp_mic_detect (bool) | 494 | hp_mic_detect (bool) |
| 495 | enable/disable the hp/mic shared input for a single built-in mic | 495 | enable/disable the hp/mic shared input for a single built-in mic |
| 496 | case; default true | 496 | case; default true |
| 497 | vmaster (bool) | ||
| 498 | enable/disable the virtual Master control; default true | ||
| 497 | mixer_nid (int) | 499 | mixer_nid (int) |
| 498 | specifies the widget NID of the analog-loopback mixer | 500 | specifies the widget NID of the analog-loopback mixer |
| 499 | 501 | ||
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 443832870a44..2842c82363c0 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
| @@ -196,6 +196,9 @@ static void parse_user_hints(struct hda_codec *codec) | |||
| 196 | val = snd_hda_get_bool_hint(codec, "hp_mic_detect"); | 196 | val = snd_hda_get_bool_hint(codec, "hp_mic_detect"); |
| 197 | if (val >= 0) | 197 | if (val >= 0) |
| 198 | spec->suppress_hp_mic_detect = !val; | 198 | spec->suppress_hp_mic_detect = !val; |
| 199 | val = snd_hda_get_bool_hint(codec, "vmaster"); | ||
| 200 | if (val >= 0) | ||
| 201 | spec->suppress_vmaster = !val; | ||
| 199 | 202 | ||
| 200 | if (!snd_hda_get_int_hint(codec, "mixer_nid", &val)) | 203 | if (!snd_hda_get_int_hint(codec, "mixer_nid", &val)) |
| 201 | spec->mixer_nid = val; | 204 | spec->mixer_nid = val; |
| @@ -5033,7 +5036,7 @@ int snd_hda_gen_build_controls(struct hda_codec *codec) | |||
| 5033 | } | 5036 | } |
| 5034 | 5037 | ||
| 5035 | /* if we have no master control, let's create it */ | 5038 | /* if we have no master control, let's create it */ |
| 5036 | if (!spec->no_analog && | 5039 | if (!spec->no_analog && !spec->suppress_vmaster && |
| 5037 | !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) { | 5040 | !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) { |
| 5038 | err = snd_hda_add_vmaster(codec, "Master Playback Volume", | 5041 | err = snd_hda_add_vmaster(codec, "Master Playback Volume", |
| 5039 | spec->vmaster_tlv, slave_pfxs, | 5042 | spec->vmaster_tlv, slave_pfxs, |
| @@ -5041,7 +5044,7 @@ int snd_hda_gen_build_controls(struct hda_codec *codec) | |||
| 5041 | if (err < 0) | 5044 | if (err < 0) |
| 5042 | return err; | 5045 | return err; |
| 5043 | } | 5046 | } |
| 5044 | if (!spec->no_analog && | 5047 | if (!spec->no_analog && !spec->suppress_vmaster && |
| 5045 | !snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) { | 5048 | !snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) { |
| 5046 | err = __snd_hda_add_vmaster(codec, "Master Playback Switch", | 5049 | err = __snd_hda_add_vmaster(codec, "Master Playback Switch", |
| 5047 | NULL, slave_pfxs, | 5050 | NULL, slave_pfxs, |
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index f66fc7e25e07..61772317de46 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h | |||
| @@ -229,6 +229,7 @@ struct hda_gen_spec { | |||
| 229 | unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ | 229 | unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ |
| 230 | unsigned int power_down_unused:1; /* power down unused widgets */ | 230 | unsigned int power_down_unused:1; /* power down unused widgets */ |
| 231 | unsigned int dac_min_mute:1; /* minimal = mute for DACs */ | 231 | unsigned int dac_min_mute:1; /* minimal = mute for DACs */ |
| 232 | unsigned int suppress_vmaster:1; /* don't create vmaster kctls */ | ||
| 232 | 233 | ||
| 233 | /* other internal flags */ | 234 | /* other internal flags */ |
| 234 | unsigned int no_analog:1; /* digital I/O only */ | 235 | unsigned int no_analog:1; /* digital I/O only */ |
