ALSA: hda - Add EAPD control to generic parser

Enable EAPD in output path initializations automatically unless the
new flag spec->own_eapd_ctl is set.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 2d19b91..31c5677 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -3333,6 +3333,7 @@
 static void set_output_and_unmute(struct hda_codec *codec, hda_nid_t pin,
 				  int pin_type, hda_nid_t dac)
 {
+	struct hda_gen_spec *spec = codec->spec;
 	struct nid_path *path;
 
 	snd_hda_set_pin_ctl_cache(codec, pin, pin_type);
@@ -3342,6 +3343,11 @@
 	if (path->active)
 		return;
 	snd_hda_activate_path(codec, path, true, true);
+
+	if (!spec->own_eapd_ctl &&
+	    (snd_hda_query_pin_caps(codec, pin) & AC_PINCAP_EAPD))
+		snd_hda_codec_update_cache(codec, pin, 0,
+					   AC_VERB_SET_EAPD_BTLENABLE, 0x02);
 }
 
 /* initialize primary output paths */