Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a01ef051 authored by Raymond Yau's avatar Raymond Yau Committed by Takashi Iwai
Browse files

ALSA: hda - Check pin support EAPD in ad198x_power_eapd_write



Check whether the pin supports EAPD in ad198x_power_eapd_write.

Signed-off-by: default avatarRaymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4dffbe03
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -506,8 +506,10 @@ static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
				hda_nid_t hp)
				hda_nid_t hp)
{
{
	struct ad198x_spec *spec = codec->spec;
	struct ad198x_spec *spec = codec->spec;
	if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD)
		snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE,
		snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE,
			    !spec->inv_eapd ? 0x00 : 0x02);
			    !spec->inv_eapd ? 0x00 : 0x02);
	if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD)
		snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE,
		snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE,
			    !spec->inv_eapd ? 0x00 : 0x02);
			    !spec->inv_eapd ? 0x00 : 0x02);
}
}