From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init Date: Wed, 07 Aug 2019 10:34:03 +0200 Message-ID: References: <20190806221958.19180-1-ranjani.sridharan@linux.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DC96AF800E4 for ; Wed, 7 Aug 2019 10:34:05 +0200 (CEST) In-Reply-To: <20190806221958.19180-1-ranjani.sridharan@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Ranjani Sridharan Cc: alsa-devel@alsa-project.org, broonie@kernel.org, pierre-louis.bossart@linux.intel.com List-Id: alsa-devel@alsa-project.org On Wed, 07 Aug 2019 00:19:58 +0200, Ranjani Sridharan wrote: > > 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" The closing parenthesis missing. The code change itself looks OK to me. Reviewed-by: Takashi Iwai thanks, Takashi > Signed-off-by: Ranjani Sridharan > Signed-off-by: Pierre-Louis Bossart > --- > sound/soc/sof/intel/hda.c | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > > diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c > index 79cce20666b6..724a494702fa 100644 > --- a/sound/soc/sof/intel/hda.c > +++ b/sound/soc/sof/intel/hda.c > @@ -335,10 +335,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; > } > > @@ -346,13 +359,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.17.1 >