diff options
author | Mark Brown <broonie@kernel.org> | 2020-03-26 22:04:31 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-26 22:04:31 +0300 |
commit | 7e37c5cf555f525ed84167c26d514476cca46893 (patch) | |
tree | 955ac9ed66c51c3859be66db1ad0d8d50a84a50e /sound/soc/sof/intel/hda-ctrl.c | |
parent | 27821f4ddedcaea0f16d03ee3432bddb729daba5 (diff) | |
parent | 7e26df0ced1643679922d197e798d469ac3bf9c0 (diff) | |
download | linux-7e37c5cf555f525ed84167c26d514476cca46893.tar.xz |
Merge series "ASoC: SOF: cleanups and improvements" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Couple of small patches to improve error handling, inits, logs.
Hope we can have this for 5.7?
Guennadi Liakhovetski (2):
ASoC: SOF: (cosmetic) use for_each_pcm_streams() in sof_dai_load()
ASoC: SOF: fix uninitialised "work" with VirtIO
Kai Vehmanen (2):
ASoC: SOF: Intel: hda: do not leave clock gating off upon error
ASoC: SOF: Intel: hda: call codec wake at chip init
Ranjani Sridharan (1):
ASoC: SOF: Intel: hda: Improve DSP state logging
sound/soc/sof/intel/hda-ctrl.c | 15 +++++++++---
sound/soc/sof/intel/hda-dsp.c | 43 ++++++++++++++++++++++++++++++++--
sound/soc/sof/pcm.c | 4 +---
sound/soc/sof/sof-audio.h | 3 +++
sound/soc/sof/topology.c | 17 ++++++++++----
5 files changed, 69 insertions(+), 13 deletions(-)
--
2.20.1
Diffstat (limited to 'sound/soc/sof/intel/hda-ctrl.c')
-rw-r--r-- | sound/soc/sof/intel/hda-ctrl.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c index 871b71a15a63..f88dbcc4ba66 100644 --- a/sound/soc/sof/intel/hda-ctrl.c +++ b/sound/soc/sof/intel/hda-ctrl.c @@ -18,6 +18,7 @@ #include <linux/module.h> #include <sound/hdaudio_ext.h> #include <sound/hda_register.h> +#include <sound/hda_component.h> #include "../ops.h" #include "hda.h" @@ -176,6 +177,9 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset) if (bus->chip_init) return 0; +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) + snd_hdac_set_codec_wakeup(bus, true); +#endif hda_dsp_ctrl_misc_clock_gating(sdev, false); if (full_reset) { @@ -183,7 +187,7 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset) ret = hda_dsp_ctrl_link_reset(sdev, true); if (ret < 0) { dev_err(sdev->dev, "error: failed to reset HDA controller\n"); - return ret; + goto err; } usleep_range(500, 1000); @@ -192,7 +196,7 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset) ret = hda_dsp_ctrl_link_reset(sdev, false); if (ret < 0) { dev_err(sdev->dev, "error: failed to exit HDA controller reset\n"); - return ret; + goto err; } usleep_range(1000, 1200); @@ -202,7 +206,8 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset) /* check to see if controller is ready */ if (!snd_hdac_chip_readb(bus, GCTL)) { dev_dbg(bus->dev, "controller not ready!\n"); - return -EBUSY; + ret = -EBUSY; + goto err; } /* Accept unsolicited responses */ @@ -268,7 +273,11 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset) bus->chip_init = true; +err: hda_dsp_ctrl_misc_clock_gating(sdev, true); +#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) + snd_hdac_set_codec_wakeup(bus, false); +#endif return ret; } |