alc_fill_eapd_coef(codec);
 }
 
+#define is_s3_resume(codec) \
+       ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
 #define is_s4_resume(codec) \
        ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
 
        switch (new_headset_mode) {
        case ALC_HEADSET_MODE_UNPLUGGED:
                alc_headset_mode_unplugged(codec);
+               spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
+               spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
                spec->gen.hp_jack_present = false;
                break;
        case ALC_HEADSET_MODE_HEADSET:
 static void alc_update_headset_jack_cb(struct hda_codec *codec,
                                       struct hda_jack_callback *jack)
 {
-       struct alc_spec *spec = codec->spec;
-       spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
        snd_hda_gen_hp_automute(codec, jack);
 }
 
                alc_probe_headset_mode(codec);
                break;
        case HDA_FIXUP_ACT_INIT:
-               spec->current_headset_mode = 0;
+               if (is_s3_resume(codec) || is_s4_resume(codec)) {
+                       spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
+                       spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
+               }
                alc_update_headset_mode(codec);
                break;
        }