ASoC: Intel: Merge Baytrail ADSP suspend_noirq into suspend_late

Merge DSP reset and cleanup sequence in sst_byt_pcm_dev_suspend_noirq()
into sst_byt_pcm_dev_suspend_late(). First their order was wrong by first
unloading firmware modules in suspend_late and then taking DSP into reset
in suspend_noirq. Second ACPI has put device into OFF state already during
suspend_late so trying to reset the DSP is a no-op at suspend_noirq stage.

Fix these by moving DSP reset and cleanup into
sst_byt_pcm_dev_suspend_late() before firmware unloading.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Borun Fu <borun.fu@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Jarkko Nikula 2014-08-11 14:15:36 +03:00 committed by Mark Brown
parent 9b11eb44ef
commit 27d3f02689
3 changed files with 1 additions and 28 deletions

View File

@ -797,7 +797,7 @@ static struct sst_dsp_device byt_dev = {
.ops = &sst_byt_ops,
};
int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata)
int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata)
{
struct sst_byt *byt = pdata->dsp;
@ -806,14 +806,6 @@ int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata)
sst_byt_drop_all(byt);
dev_dbg(byt->dev, "dsp in reset\n");
return 0;
}
EXPORT_SYMBOL_GPL(sst_byt_dsp_suspend_noirq);
int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata)
{
struct sst_byt *byt = pdata->dsp;
dev_dbg(byt->dev, "free all blocks and unload fw\n");
sst_fw_unload(byt->fw);

View File

@ -66,7 +66,6 @@ int sst_byt_get_dsp_position(struct sst_byt *byt,
int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata);
void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata);
struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt);
int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata);
int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata);
int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata);
int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata);

View File

@ -404,23 +404,6 @@ static const struct snd_soc_component_driver byt_dai_component = {
};
#ifdef CONFIG_PM
static int sst_byt_pcm_dev_suspend_noirq(struct device *dev)
{
struct sst_pdata *sst_pdata = dev_get_platdata(dev);
int ret;
dev_dbg(dev, "suspending noirq\n");
/* at this point all streams will be stopped and context saved */
ret = sst_byt_dsp_suspend_noirq(dev, sst_pdata);
if (ret < 0) {
dev_err(dev, "failed to suspend %d\n", ret);
return ret;
}
return ret;
}
static int sst_byt_pcm_dev_suspend_late(struct device *dev)
{
struct sst_pdata *sst_pdata = dev_get_platdata(dev);
@ -458,7 +441,6 @@ static int sst_byt_pcm_dev_resume(struct device *dev)
}
static const struct dev_pm_ops sst_byt_pm_ops = {
.suspend_noirq = sst_byt_pcm_dev_suspend_noirq,
.suspend_late = sst_byt_pcm_dev_suspend_late,
.resume_early = sst_byt_pcm_dev_resume_early,
.resume = sst_byt_pcm_dev_resume,