ASoC: SOF: Intel: hda: reset stream before coupling host and link DMA's
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Thu, 25 Nov 2021 10:15:13 +0000 (12:15 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 26 Nov 2021 13:24:18 +0000 (13:24 +0000)
The recommended programming sequence for HD-Audio DMA is to reset the
stream before coupling the link and host DMA's.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-stream.c

index c2895bdd3f0791d6252191a809224824324e5af5..440827ce390dc39225930d656d641cd78521d7ad 100644 (file)
@@ -659,6 +659,11 @@ int hda_dsp_stream_hw_free(struct snd_sof_dev *sdev,
                                                        hstream);
        struct hdac_bus *bus = sof_to_bus(sdev);
        u32 mask = 0x1 << stream->index;
+       int ret;
+
+       ret = hda_dsp_stream_reset(sdev, stream);
+       if (ret < 0)
+               return ret;
 
        spin_lock_irq(&bus->reg_lock);
        /* couple host and link DMA if link DMA channel is idle */