diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2014-08-11 07:15:36 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-11 08:40:23 -0400 |
commit | 27d3f02689cce5c4063a4f8dd88ce19d08a33fe6 (patch) | |
tree | 09629de1ab39712f0cc59cf2adbbfee60537e204 /sound/soc/intel | |
parent | 9b11eb44eff7ede6bc3a94511cf9dfda75af9c9f (diff) |
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>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r-- | sound/soc/intel/sst-baytrail-ipc.c | 10 | ||||
-rw-r--r-- | sound/soc/intel/sst-baytrail-ipc.h | 1 | ||||
-rw-r--r-- | sound/soc/intel/sst-baytrail-pcm.c | 18 |
3 files changed, 1 insertions, 28 deletions
diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c index d207b22ea330..5008c8f09aac 100644 --- a/sound/soc/intel/sst-baytrail-ipc.c +++ b/sound/soc/intel/sst-baytrail-ipc.c | |||
@@ -797,7 +797,7 @@ static struct sst_dsp_device byt_dev = { | |||
797 | .ops = &sst_byt_ops, | 797 | .ops = &sst_byt_ops, |
798 | }; | 798 | }; |
799 | 799 | ||
800 | int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata) | 800 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata) |
801 | { | 801 | { |
802 | struct sst_byt *byt = pdata->dsp; | 802 | struct sst_byt *byt = pdata->dsp; |
803 | 803 | ||
@@ -806,14 +806,6 @@ int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata) | |||
806 | sst_byt_drop_all(byt); | 806 | sst_byt_drop_all(byt); |
807 | dev_dbg(byt->dev, "dsp in reset\n"); | 807 | dev_dbg(byt->dev, "dsp in reset\n"); |
808 | 808 | ||
809 | return 0; | ||
810 | } | ||
811 | EXPORT_SYMBOL_GPL(sst_byt_dsp_suspend_noirq); | ||
812 | |||
813 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata) | ||
814 | { | ||
815 | struct sst_byt *byt = pdata->dsp; | ||
816 | |||
817 | dev_dbg(byt->dev, "free all blocks and unload fw\n"); | 809 | dev_dbg(byt->dev, "free all blocks and unload fw\n"); |
818 | sst_fw_unload(byt->fw); | 810 | sst_fw_unload(byt->fw); |
819 | 811 | ||
diff --git a/sound/soc/intel/sst-baytrail-ipc.h b/sound/soc/intel/sst-baytrail-ipc.h index 06a4d202689b..8faff6dcf25d 100644 --- a/sound/soc/intel/sst-baytrail-ipc.h +++ b/sound/soc/intel/sst-baytrail-ipc.h | |||
@@ -66,7 +66,6 @@ int sst_byt_get_dsp_position(struct sst_byt *byt, | |||
66 | int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata); | 66 | int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata); |
67 | void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata); | 67 | void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata); |
68 | struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt); | 68 | struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt); |
69 | int sst_byt_dsp_suspend_noirq(struct device *dev, struct sst_pdata *pdata); | ||
70 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata); | 69 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata); |
71 | int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata); | 70 | int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata); |
72 | int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata); | 71 | int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata); |
diff --git a/sound/soc/intel/sst-baytrail-pcm.c b/sound/soc/intel/sst-baytrail-pcm.c index 599401c0c655..ba7ed9720732 100644 --- a/sound/soc/intel/sst-baytrail-pcm.c +++ b/sound/soc/intel/sst-baytrail-pcm.c | |||
@@ -404,23 +404,6 @@ static const struct snd_soc_component_driver byt_dai_component = { | |||
404 | }; | 404 | }; |
405 | 405 | ||
406 | #ifdef CONFIG_PM | 406 | #ifdef CONFIG_PM |
407 | static int sst_byt_pcm_dev_suspend_noirq(struct device *dev) | ||
408 | { | ||
409 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); | ||
410 | int ret; | ||
411 | |||
412 | dev_dbg(dev, "suspending noirq\n"); | ||
413 | |||
414 | /* at this point all streams will be stopped and context saved */ | ||
415 | ret = sst_byt_dsp_suspend_noirq(dev, sst_pdata); | ||
416 | if (ret < 0) { | ||
417 | dev_err(dev, "failed to suspend %d\n", ret); | ||
418 | return ret; | ||
419 | } | ||
420 | |||
421 | return ret; | ||
422 | } | ||
423 | |||
424 | static int sst_byt_pcm_dev_suspend_late(struct device *dev) | 407 | static int sst_byt_pcm_dev_suspend_late(struct device *dev) |
425 | { | 408 | { |
426 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); | 409 | struct sst_pdata *sst_pdata = dev_get_platdata(dev); |
@@ -458,7 +441,6 @@ static int sst_byt_pcm_dev_resume(struct device *dev) | |||
458 | } | 441 | } |
459 | 442 | ||
460 | static const struct dev_pm_ops sst_byt_pm_ops = { | 443 | static const struct dev_pm_ops sst_byt_pm_ops = { |
461 | .suspend_noirq = sst_byt_pcm_dev_suspend_noirq, | ||
462 | .suspend_late = sst_byt_pcm_dev_suspend_late, | 444 | .suspend_late = sst_byt_pcm_dev_suspend_late, |
463 | .resume_early = sst_byt_pcm_dev_resume_early, | 445 | .resume_early = sst_byt_pcm_dev_resume_early, |
464 | .resume = sst_byt_pcm_dev_resume, | 446 | .resume = sst_byt_pcm_dev_resume, |