diff options
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index e968cc9cbf31..b03efbc17132 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -870,6 +870,34 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, hinfo->formats = per_cvt->formats; hinfo->maxbps = per_cvt->maxbps; +#ifdef CONFIG_SND_HDA_PLATFORM_NVIDIA_TEGRA + if ((codec->preset->id == 0x10de0020) && + (!eld->eld_valid || !eld->sad_count)) { + int err = 0; + unsigned long timeout; + + if (!eld->eld_valid) { + err = tegra_hdmi_setup_hda_presence(); + if (err < 0) { + snd_printk(KERN_WARNING + "HDMI: No HDMI device connected\n"); + return -ENODEV; + } + } + + timeout = jiffies + msecs_to_jiffies(5000); + for (;;) { + if (eld->eld_valid && eld->sad_count) + break; + + if (time_after(jiffies, timeout)) + break; + + mdelay(10); + } + } +#endif + /* Restrict capabilities by ELD if this isn't disabled */ if (!static_hdmi_pcm && eld->eld_valid) { snd_hdmi_eld_update_pcm_info(eld, hinfo); @@ -1062,8 +1090,8 @@ static int hdmi_parse_codec(struct hda_codec *codec) * HDA link is powered off at hot plug or hw initialization time. */ #ifdef CONFIG_SND_HDA_POWER_SAVE - if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) & - AC_PWRST_EPSS)) + if ((!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) & + AC_PWRST_EPSS)) && (codec->preset->id != 0x10de0020)) codec->bus->power_keep_link_on = 1; #endif |