]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Allow to enable/disable vmaster build explicitly
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Apr 2017 15:37:34 +0000 (17:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Apr 2017 15:45:27 +0000 (17:45 +0200)
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>
Documentation/sound/hd-audio/notes.rst
sound/pci/hda/hda_generic.c
sound/pci/hda/hda_generic.h

index 9eeb9b468706ccd25ddc67fa457f5884d7d5a34d..f59c3cdbfaf4ccba37f62fca292507ef9b94ea2c 100644 (file)
@@ -494,6 +494,8 @@ add_hp_mic (bool)
 hp_mic_detect (bool)
     enable/disable the hp/mic shared input for a single built-in mic
     case; default true
+vmaster (bool)
+    enable/disable the virtual Master control; default true
 mixer_nid (int)
     specifies the widget NID of the analog-loopback mixer
 
index 443832870a44582d632deb585ee15b503e5982c7..2842c82363c0435f90edfe06793df254c36d43ef 100644 (file)
@@ -196,6 +196,9 @@ static void parse_user_hints(struct hda_codec *codec)
        val = snd_hda_get_bool_hint(codec, "hp_mic_detect");
        if (val >= 0)
                spec->suppress_hp_mic_detect = !val;
+       val = snd_hda_get_bool_hint(codec, "vmaster");
+       if (val >= 0)
+               spec->suppress_vmaster = !val;
 
        if (!snd_hda_get_int_hint(codec, "mixer_nid", &val))
                spec->mixer_nid = val;
@@ -5033,7 +5036,7 @@ int snd_hda_gen_build_controls(struct hda_codec *codec)
        }
 
        /* if we have no master control, let's create it */
-       if (!spec->no_analog &&
+       if (!spec->no_analog && !spec->suppress_vmaster &&
            !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
                err = snd_hda_add_vmaster(codec, "Master Playback Volume",
                                          spec->vmaster_tlv, slave_pfxs,
@@ -5041,7 +5044,7 @@ int snd_hda_gen_build_controls(struct hda_codec *codec)
                if (err < 0)
                        return err;
        }
-       if (!spec->no_analog &&
+       if (!spec->no_analog && !spec->suppress_vmaster &&
            !snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) {
                err = __snd_hda_add_vmaster(codec, "Master Playback Switch",
                                            NULL, slave_pfxs,
index f66fc7e25e07ff10f68f7aa216d00639f3adad3a..61772317de46b4ac49d5890a9fbd822a26bc4938 100644 (file)
@@ -229,6 +229,7 @@ struct hda_gen_spec {
        unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */
        unsigned int power_down_unused:1; /* power down unused widgets */
        unsigned int dac_min_mute:1; /* minimal = mute for DACs */
+       unsigned int suppress_vmaster:1; /* don't create vmaster kctls */
 
        /* other internal flags */
        unsigned int no_analog:1; /* digital I/O only */