]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - A new flag to enforce prefix to each pin
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Apr 2017 15:12:33 +0000 (17:12 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Apr 2017 15:44:39 +0000 (17:44 +0200)
This is a preliminary patch for a smooth multi-codec support, and it
introduces a new flag, force_pin_prefix, to struct hda_codec.
This flag is used to force to add the pin location prefix to each
input pin.  For example, when there is only one microphone pin,
usually the auto-parser assigns the string "Mic".  With this flag on,
it'll be like "Front Mic".  Also, the creation of "Master" or "PCM"
playback volume for a single pin is suppressed, too.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195305
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_auto_parser.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_generic.c

index a03cf68d0bcd6ce350b658e96de7dc9b9561dd1a..d3ea73171a3d22a2e41554e7df8d1fedc72a9751 100644 (file)
@@ -580,6 +580,7 @@ const char *hda_get_autocfg_input_label(struct hda_codec *codec,
                has_multiple_pins = 1;
        if (has_multiple_pins && type == AUTO_PIN_MIC)
                has_multiple_pins &= check_mic_location_need(codec, cfg, input);
+       has_multiple_pins |= codec->force_pin_prefix;
        return hda_get_input_pin_label(codec, &cfg->inputs[input],
                                       cfg->inputs[input].pin,
                                       has_multiple_pins);
index f17f25245e52acdee1a57f3ae5ab7b84fd97a37b..d6fb2d5d01a70ef21eb533f1b86cb9c9c8f2be84 100644 (file)
@@ -256,6 +256,7 @@ struct hda_codec {
        unsigned int dump_coef:1; /* dump processing coefs in codec proc file */
        unsigned int power_save_node:1; /* advanced PM for each widget */
        unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */
+       unsigned int force_pin_prefix:1; /* Add location prefix */
 #ifdef CONFIG_PM
        unsigned long power_on_acct;
        unsigned long power_off_acct;
index e7c8f4f076d5f3297946b088bc31cf7ecc0d66ad..443832870a44582d632deb585ee15b503e5982c7 100644 (file)
@@ -1125,6 +1125,7 @@ static const char *get_line_out_pfx(struct hda_codec *codec, int ch,
 
        *index = 0;
        if (cfg->line_outs == 1 && !spec->multi_ios &&
+           !codec->force_pin_prefix &&
            !cfg->hp_outs && !cfg->speaker_outs)
                return spec->vmaster_mute.hook ? "PCM" : "Master";
 
@@ -1132,6 +1133,7 @@ static const char *get_line_out_pfx(struct hda_codec *codec, int ch,
         * use it master (or "PCM" if a vmaster hook is present)
         */
        if (spec->multiout.num_dacs == 1 && !spec->mixer_nid &&
+           !codec->force_pin_prefix &&
            !spec->multiout.hp_out_nid[0] && !spec->multiout.extra_out_nid[0])
                return spec->vmaster_mute.hook ? "PCM" : "Master";