Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a535414 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Call snd_hda_jack_report_sync() generically in hda_codec.c



Instead of calling the jack sync in the init callback of each codec,
call it generically at initialization and resume.  By calling it at
the last of resume sequence, a possible race between the jack sync and
the unsol event enablement in the current code will be closed, too.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f9933487
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3618,6 +3618,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
		snd_hda_codec_resume_amp(codec);
		snd_hda_codec_resume_cache(codec);
	}
	snd_hda_jack_report_sync(codec);
	snd_hda_power_down(codec); /* flag down before returning */
}
#endif /* CONFIG_PM */
@@ -3663,6 +3664,7 @@ int snd_hda_codec_build_controls(struct hda_codec *codec)
		err = codec->patch_ops.build_controls(codec);
	if (err < 0)
		return err;
	snd_hda_jack_report_sync(codec); /* call at the last init point */
	return 0;
}

+0 −2
Original line number Diff line number Diff line
@@ -1193,7 +1193,6 @@ static int cs_init(struct hda_codec *codec)
	init_output(codec);
	init_input(codec);
	init_digital(codec);
	snd_hda_jack_report_sync(codec);

	return 0;
}
@@ -1643,7 +1642,6 @@ static int cs421x_init(struct hda_codec *codec)
	init_output(codec);
	init_input(codec);
	init_cs421x_digital(codec);
	snd_hda_jack_report_sync(codec);

	return 0;
}
+0 −1
Original line number Diff line number Diff line
@@ -4061,7 +4061,6 @@ static int cx_auto_init(struct hda_codec *codec)
	cx_auto_init_output(codec);
	cx_auto_init_input(codec);
	cx_auto_init_digital(codec);
	snd_hda_jack_report_sync(codec);
	snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
	return 0;
}
+0 −2
Original line number Diff line number Diff line
@@ -1311,7 +1311,6 @@ static int generic_hdmi_init(struct hda_codec *codec)
		hdmi_init_pin(codec, pin_nid);
		snd_hda_jack_detect_enable(codec, pin_nid, pin_nid);
	}
	snd_hda_jack_report_sync(codec);
	return 0;
}

@@ -1428,7 +1427,6 @@ static int simple_playback_init(struct hda_codec *codec)
		snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE,
				    AMP_OUT_UNMUTE);
	snd_hda_jack_detect_enable(codec, pin, pin);
	snd_hda_jack_report_sync(codec);
	return 0;
}

+0 −2
Original line number Diff line number Diff line
@@ -2053,8 +2053,6 @@ static int alc_init(struct hda_codec *codec)

	alc_apply_fixup(codec, ALC_FIXUP_ACT_INIT);

	snd_hda_jack_report_sync(codec);

	hda_call_check_power_status(codec, 0x01);
	return 0;
}
Loading