Commit 729d55ba authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Disable tigger at pin-sensing on AD codecs

Analog Device codecs seem to have problems with the triggering of
pin-sensing although their pincaps give the trigger requirements.
Some reported that constant CPU load on HP laptops with AD codecs.

For avoiding this regression, add a flag to codec struct to notify
explicitly that the codec doesn't suppot the trigger at pin-sensing.
Tested-by: default avatarMaciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ef18bede
...@@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); ...@@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps);
*/ */
u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
{ {
u32 pincap = snd_hda_query_pin_caps(codec, nid); u32 pincap;
if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
if (!codec->no_trigger_sense) {
pincap = snd_hda_query_pin_caps(codec, nid);
if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
}
return snd_hda_codec_read(codec, nid, 0, return snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_PIN_SENSE, 0); AC_VERB_GET_PIN_SENSE, 0);
} }
......
...@@ -817,6 +817,7 @@ struct hda_codec { ...@@ -817,6 +817,7 @@ struct hda_codec {
unsigned int pin_amp_workaround:1; /* pin out-amp takes index unsigned int pin_amp_workaround:1; /* pin out-amp takes index
* (e.g. Conexant codecs) * (e.g. Conexant codecs)
*/ */
unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
unsigned int power_on :1; /* current (global) power-state */ unsigned int power_on :1; /* current (global) power-state */
unsigned int power_transition :1; /* power-state in transition */ unsigned int power_transition :1; /* power-state in transition */
......
...@@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec) ...@@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec)
*/ */
spec->multiout.no_share_stream = 1; spec->multiout.no_share_stream = 1;
codec->no_trigger_sense = 1;
return 0; return 0;
} }
...@@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec) ...@@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec)
codec->patch_ops = ad198x_patch_ops; codec->patch_ops = ad198x_patch_ops;
codec->no_trigger_sense = 1;
return 0; return 0;
} }
...@@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec) ...@@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec)
codec->patch_ops.unsol_event = ad1981_hp_unsol_event; codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
break; break;
} }
codec->no_trigger_sense = 1;
return 0; return 0;
} }
...@@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec) ...@@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec)
#endif #endif
spec->vmaster_nid = 0x04; spec->vmaster_nid = 0x04;
codec->no_trigger_sense = 1;
return 0; return 0;
} }
...@@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec) ...@@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec)
codec->patch_ops = ad198x_patch_ops; codec->patch_ops = ad198x_patch_ops;
codec->no_trigger_sense = 1;
return 0; return 0;
} }
...@@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec) ...@@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec)
break; break;
} }
codec->no_trigger_sense = 1;
return 0; return 0;
} }
...@@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec) ...@@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec)
spec->mixers[2] = ad1882_6stack_mixers; spec->mixers[2] = ad1882_6stack_mixers;
break; break;
} }
codec->no_trigger_sense = 1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment