| From f2f4dc1df42fae72f3f3e2585ca20c54c5b9ea81 Mon Sep 17 00:00:00 2001 |
| From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> |
| Date: Tue, 6 Aug 2019 15:19:58 -0700 |
| Subject: [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 |
| init |
| |
| commit cc352735d49c9c25fd711795bee35d3d001ddffa upstream. |
| |
| On some platforms, sound card registration fails when a HDMI |
| monitor is not connected. This is caused by a recent commit |
| that switched the order in which the HDA controller and the |
| i915 are initialized. Initializing the i915 before initializing |
| the HDA controller fixes the problem. |
| |
| Fixes: be1b577d01787c ("ASoC: SOF: Intel: hda: fix the hda init chip" |
| Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> |
| Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> |
| Reviewed-by: Takashi Iwai <tiwai@suse.de> |
| Link: https://lore.kernel.org/r/20190806221958.19180-1-ranjani.sridharan@linux.intel.com |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c |
| index 5c6cf188668e..35c9055ea439 100644 |
| --- a/sound/soc/sof/intel/hda.c |
| +++ b/sound/soc/sof/intel/hda.c |
| @@ -301,10 +301,23 @@ static int hda_init_caps(struct snd_sof_dev *sdev) |
| if (bus->ppcap) |
| dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n"); |
| |
| +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) |
| + /* init i915 and HDMI codecs */ |
| + ret = hda_codec_i915_init(sdev); |
| + if (ret < 0) { |
| + dev_err(sdev->dev, "error: init i915 and HDMI codec failed\n"); |
| + return ret; |
| + } |
| +#endif |
| + |
| + /* Init HDA controller after i915 init */ |
| ret = hda_dsp_ctrl_init_chip(sdev, true); |
| if (ret < 0) { |
| dev_err(bus->dev, "error: init chip failed with ret: %d\n", |
| ret); |
| +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) |
| + hda_codec_i915_exit(sdev); |
| +#endif |
| return ret; |
| } |
| |
| @@ -312,13 +325,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev) |
| if (bus->mlcap) |
| snd_hdac_ext_bus_get_ml_capabilities(bus); |
| |
| - /* init i915 and HDMI codecs */ |
| - ret = hda_codec_i915_init(sdev); |
| - if (ret < 0) { |
| - dev_err(sdev->dev, "error: no HDMI audio devices found\n"); |
| - return ret; |
| - } |
| - |
| /* codec detection */ |
| if (!bus->codec_mask) { |
| dev_info(bus->dev, "no hda codecs found!\n"); |
| -- |
| 2.27.0 |
| |