Skip to content

Commit 9f369f7

Browse files
mrajwabroonie
authored andcommitted
ASoC: SOF: inform DSP that driver is going to be removed
This patch invokes the DSP power down notifier to inform DSP that driver is going to be removed. The module removal entails DSP power down, disabling of IRQs and more. Therefore it is highly recommended to inform the DSP about this upcoming event. Due to hardware limitations on some Intel platforms it is necessary to power gate all LPSRAM banks that were enabled prior to controller reset. Otherwise, an attempt to write LPSRAM control registers may have no effect. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200515135958.17511-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3541aef commit 9f369f7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎sound/soc/sof/core.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ int snd_sof_device_remove(struct device *dev)
343343
{
344344
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
345345
struct snd_sof_pdata *pdata = sdev->pdata;
346+
int ret;
347+
348+
ret = snd_sof_dsp_power_down_notify(sdev);
349+
if (ret < 0)
350+
dev_warn(dev, "error: %d failed to prepare DSP for device removal",
351+
ret);
346352

347353
if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
348354
cancel_work_sync(&sdev->probe_work);

0 commit comments

Comments
 (0)