All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init
@ 2019-08-06 22:19 Ranjani Sridharan
  2019-08-07  8:34 ` Takashi Iwai
  2019-08-07 13:30 ` Applied "ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init" to the asoc tree Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Ranjani Sridharan @ 2019-08-06 22:19 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, pierre-louis.bossart

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>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init
  2019-08-06 22:19 [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init Ranjani Sridharan
@ 2019-08-07  8:34 ` Takashi Iwai
  2019-08-07 13:30 ` Applied "ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init" to the asoc tree Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2019-08-07  8:34 UTC (permalink / raw)
  To: Ranjani Sridharan; +Cc: alsa-devel, broonie, pierre-louis.bossart

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 <tiwai@suse.de>


thanks,

Takashi

> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Applied "ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init" to the asoc tree
  2019-08-06 22:19 [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init Ranjani Sridharan
  2019-08-07  8:34 ` Takashi Iwai
@ 2019-08-07 13:30 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-08-07 13:30 UTC (permalink / raw)
  To: Ranjani Sridharan; +Cc: tiwai, alsa-devel, Mark Brown, Pierre-Louis Bossart

The patch

   ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From cc352735d49c9c25fd711795bee35d3d001ddffa 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

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>
---
 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 136f98bf5d7e..82f61c4e74bd 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -321,10 +321,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;
 	}
 
@@ -332,13 +345,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.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init
@ 2019-07-15 20:34 Ranjani Sridharan
  0 siblings, 0 replies; 4+ messages in thread
From: Ranjani Sridharan @ 2019-07-15 20:34 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, pierre-louis.bossart

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>
---
 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 136f98bf5d7e..82f61c4e74bd 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -321,10 +321,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;
 	}
 
@@ -332,13 +345,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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-07 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 22:19 [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init Ranjani Sridharan
2019-08-07  8:34 ` Takashi Iwai
2019-08-07 13:30 ` Applied "ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init" to the asoc tree Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2019-07-15 20:34 [PATCH] ASoC: SOF: Intel: hda: Initialize HDA controller after i915 init Ranjani Sridharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.