Skip to content

Commit a01ef05

Browse files
Raymond Yautiwai
authored andcommitted
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: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 4dffbe0 commit a01ef05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sound/pci/hda/patch_analog.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,11 @@ static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
506506
hda_nid_t hp)
507507
{
508508
struct ad198x_spec *spec = codec->spec;
509-
snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE,
509+
if (snd_hda_query_pin_caps(codec, front) & AC_PINCAP_EAPD)
510+
snd_hda_codec_write(codec, front, 0, AC_VERB_SET_EAPD_BTLENABLE,
510511
!spec->inv_eapd ? 0x00 : 0x02);
511-
snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE,
512+
if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD)
513+
snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE,
512514
!spec->inv_eapd ? 0x00 : 0x02);
513515
}
514516

0 commit comments

Comments
 (0)