diff options
author | Mark Brown <broonie@kernel.org> | 2019-12-25 20:51:43 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-12-25 20:51:43 +0300 |
commit | a82cf72f94af1135f2edde0a244499af390f333a (patch) | |
tree | ef49c313ce4450e836c4166035d8c276dd977e36 /sound/soc/sof | |
parent | bb9ee1eacb2dfcdf419f14c739b866c3eba4dc1f (diff) | |
parent | dcf08d0f8f09081b16f69071dd55d51d5e964e84 (diff) | |
download | linux-a82cf72f94af1135f2edde0a244499af390f333a.tar.xz |
Merge branch 'for-5.5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.6
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/imx/imx8.c | 5 | ||||
-rw-r--r-- | sound/soc/sof/intel/hda-dai.c | 11 | ||||
-rw-r--r-- | sound/soc/sof/ipc.c | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index cfefcfd92798..aef6ca167b9c 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -209,7 +209,7 @@ static int imx8_probe(struct snd_sof_dev *sdev) priv->pd_dev = devm_kmalloc_array(&pdev->dev, priv->num_domains, sizeof(*priv->pd_dev), GFP_KERNEL); - if (!priv) + if (!priv->pd_dev) return -ENOMEM; priv->link = devm_kmalloc_array(&pdev->dev, priv->num_domains, @@ -304,6 +304,9 @@ static int imx8_probe(struct snd_sof_dev *sdev) } sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM; + /* set default mailbox offset for FW ready message */ + sdev->dsp_box.offset = MBOX_OFFSET; + return 0; exit_pdev_unregister: diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index 638812a41328..313611dcb5e4 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -217,6 +217,8 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream, link_dev = hda_link_stream_assign(bus, substream); if (!link_dev) return -EBUSY; + + snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev); } stream_tag = hdac_stream(link_dev)->stream_tag; @@ -229,8 +231,6 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret; - snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev); - link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name); if (!link) return -EINVAL; @@ -362,6 +362,13 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream, bus = hstream->bus; rtd = snd_pcm_substream_chip(substream); link_dev = snd_soc_dai_get_dma_data(dai, substream); + + if (!link_dev) { + dev_dbg(dai->dev, + "%s: link_dev is not assigned\n", __func__); + return -EINVAL; + } + hda_stream = hstream_to_sof_hda_stream(link_dev); /* free the link DMA channel in the FW */ diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index 6186c7ff0447..b63fc529b456 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -823,6 +823,9 @@ void snd_sof_ipc_free(struct snd_sof_dev *sdev) { struct snd_sof_ipc *ipc = sdev->ipc; + if (!ipc) + return; + /* disable sending of ipc's */ mutex_lock(&ipc->tx_mutex); ipc->disable_ipc_tx = true; |