Skip to content

Commit 790b415

Browse files
libinyangtiwai
authored andcommitted
ALSA: hda - hdmi defer to register acomp eld notifier
Defer to register acomp eld notifier until hdmi audio driver is fully ready. After registering eld notifier, gfx driver can use this callback function to notify audio driver the monitor connection event. However this action may happen when audio driver is adding the pins or doing other initialization. This is not always safe, however. For example, using per_pin->lock before the lock is initialized. Let's register the eld notifier after the initialization is done. Signed-off-by: Libin Yang <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent ec75a94 commit 790b415

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,18 +2477,6 @@ static int patch_generic_hdmi(struct hda_codec *codec)
24772477
is_broxton(codec))
24782478
codec->core.link_power_control = 1;
24792479

2480-
if (codec_has_acomp(codec)) {
2481-
codec->depop_delay = 0;
2482-
spec->i915_audio_ops.audio_ptr = codec;
2483-
/* intel_audio_codec_enable() or intel_audio_codec_disable()
2484-
* will call pin_eld_notify with using audio_ptr pointer
2485-
* We need make sure audio_ptr is really setup
2486-
*/
2487-
wmb();
2488-
spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify;
2489-
snd_hdac_i915_register_notifier(&spec->i915_audio_ops);
2490-
}
2491-
24922480
if (hdmi_parse_codec(codec) < 0) {
24932481
if (spec->i915_bound)
24942482
snd_hdac_i915_exit(&codec->bus->core);
@@ -2510,6 +2498,18 @@ static int patch_generic_hdmi(struct hda_codec *codec)
25102498

25112499
init_channel_allocations();
25122500

2501+
if (codec_has_acomp(codec)) {
2502+
codec->depop_delay = 0;
2503+
spec->i915_audio_ops.audio_ptr = codec;
2504+
/* intel_audio_codec_enable() or intel_audio_codec_disable()
2505+
* will call pin_eld_notify with using audio_ptr pointer
2506+
* We need make sure audio_ptr is really setup
2507+
*/
2508+
wmb();
2509+
spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify;
2510+
snd_hdac_i915_register_notifier(&spec->i915_audio_ops);
2511+
}
2512+
25132513
return 0;
25142514
}
25152515

0 commit comments

Comments
 (0)