Skip to content

Commit

Permalink
ASoC: Intel: Merge Baytrail ADSP suspend_noirq into suspend_late
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarkko Nikula authored and Mark Brown committed Aug 11, 2014
1 parent 9b11eb4 commit 27d3f02
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
10 changes: 1 addition & 9 deletions sound/soc/intel/sst-baytrail-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

Expand Down
1 change: 0 additions & 1 deletion sound/soc/intel/sst-baytrail-ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 0 additions & 18 deletions sound/soc/intel/sst-baytrail-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 27d3f02

Please sign in to comment.