Skip to content

Commit

Permalink
ALSA: hda - Fix inconsistent pin states after resume
Browse files Browse the repository at this point in the history
The commit [26a6cb6: ALSA: hda - Implement a poll loop for jacks as a
module parameter] introduced the polling jack detection code, but it
also moved the call of snd_hda_jack_set_dirty_all() in the resume path
after resume/init ops call.  This caused a regression when the jack
state has been changed during power-down (e.g. in the power save
mode).  Since the driver doesn't probe the new jack state but keeps
using the cached value due to no dirty flag, the pin state remains
also as if the jack is still plugged.

The fix is simply moving snd_hda_jack_set_dirty_all() to the original
position.

Reported-by: Manolo Díaz <diaz.manolo@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jan 23, 2013
1 parent 42c364a commit 31614bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3654,6 +3654,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
hda_set_power_state(codec, AC_PWRST_D0);
restore_shutup_pins(codec);
hda_exec_init_verbs(codec);
snd_hda_jack_set_dirty_all(codec);
if (codec->patch_ops.resume)
codec->patch_ops.resume(codec);
else {
Expand All @@ -3665,10 +3666,8 @@ static void hda_call_codec_resume(struct hda_codec *codec)

if (codec->jackpoll_interval)
hda_jackpoll_work(&codec->jackpoll_work.work);
else {
snd_hda_jack_set_dirty_all(codec);
else
snd_hda_jack_report_sync(codec);
}

codec->in_pm = 0;
snd_hda_power_down(codec); /* flag down before returning */
Expand Down

0 comments on commit 31614bb

Please sign in to comment.