aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorLibin Yang <libin.yang@linux.intel.com>2016-03-04 01:33:43 -0500
committerTakashi Iwai <tiwai@suse.de>2016-03-04 02:40:24 -0500
commit790b415c98de62602810b0eedce26f0f9d6ddd78 (patch)
tree31eae524fe8e36df55b07c844a4c2e21b0d312b3 /sound/pci/hda/patch_hdmi.c
parentec75a940b1037e877efd9a5a9e94eab1e464f73b (diff)
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 <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r--sound/pci/hda/patch_hdmi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 6858e88c7326..bcbc4ee10130 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2477,18 +2477,6 @@ static int patch_generic_hdmi(struct hda_codec *codec)
2477 is_broxton(codec)) 2477 is_broxton(codec))
2478 codec->core.link_power_control = 1; 2478 codec->core.link_power_control = 1;
2479 2479
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
2492 if (hdmi_parse_codec(codec) < 0) { 2480 if (hdmi_parse_codec(codec) < 0) {
2493 if (spec->i915_bound) 2481 if (spec->i915_bound)
2494 snd_hdac_i915_exit(&codec->bus->core); 2482 snd_hdac_i915_exit(&codec->bus->core);
@@ -2510,6 +2498,18 @@ static int patch_generic_hdmi(struct hda_codec *codec)
2510 2498
2511 init_channel_allocations(); 2499 init_channel_allocations();
2512 2500
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
2513 return 0; 2513 return 0;
2514} 2514}
2515 2515