]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Fix jack detection at resume with VT codecs
authorTakashi Iwai <tiwai@suse.de>
Sun, 31 May 2015 07:27:29 +0000 (09:27 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 31 May 2015 07:27:29 +0000 (09:27 +0200)
VT202x codecs seem requiring some delay after the resume D0 power
transition for making the jack detection working again.  Without the
delay soon after D0, the jack is always detected as unplugged.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98921
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_via.c

index 31a95cca015d4d1c34a1facff2e226b6821a5203..bab6c04932aa050ff63f054bf172acf288f5ee5e 100644 (file)
@@ -449,6 +449,15 @@ static int via_suspend(struct hda_codec *codec)
 
        return 0;
 }
+
+static int via_resume(struct hda_codec *codec)
+{
+       /* some delay here to make jack detection working (bko#98921) */
+       msleep(10);
+       codec->patch_ops.init(codec);
+       regcache_sync(codec->core.regmap);
+       return 0;
+}
 #endif
 
 #ifdef CONFIG_PM
@@ -475,6 +484,7 @@ static const struct hda_codec_ops via_patch_ops = {
        .stream_pm = snd_hda_gen_stream_pm,
 #ifdef CONFIG_PM
        .suspend = via_suspend,
+       .resume = via_resume,
        .check_power_status = via_check_power_status,
 #endif
 };