ASoC: Intel: sst: Free streams on suspend, re-alloc on resume

The Bay Trail SST-DSP firmware version looses track of all streams over a
suspend/resume, failing any attempts to resume and/or free streams, with
a SST_ERR_INVALID_STREAM_ID error.

This commit adds support for free-ing the streams on suspend and
re-allocating them on resume, fixing suspend/resume issues on devices
using this firmware version.

This new behavior gets triggered by a new flag in sst_platform_info which
only gets set on Bay Trail platforms.

This has been tested on the following devices:
-Asus T100TA,    Bay Trail    + ALC5642 codec
-Ployer MOMO7W,  Bay Trail CR + ALC5652 codec

Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Hans de Goede
2018-02-18 23:01:43 +01:00
committed by Mark Brown
parent 473858cad1
commit bf642bf573
5 changed files with 53 additions and 3 deletions

View File

@@ -179,6 +179,8 @@ struct sst_block {
*
* @status : stream current state
* @prev : stream prev state
* @resume_status : stream current state to restore on resume
* @resume_prev : stream prev state to restore on resume
* @lock : stream mutex for protecting state
* @alloc_param : parameters used for stream (re-)allocation
* @pcm_substream : PCM substream
@@ -189,6 +191,8 @@ struct sst_block {
struct stream_info {
unsigned int status;
unsigned int prev;
unsigned int resume_status;
unsigned int resume_prev;
struct mutex lock;
struct snd_sst_alloc_mrfld alloc_param;