diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2014-05-08 17:07:25 +0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-13 01:02:17 +0400 |
commit | 609a13e5c9229ad4f5c78eeb1aefd583fdee9e58 (patch) | |
tree | 68262c79549a8b8a8853e3323bdc38e4a6053475 /sound/soc/intel/sst-baytrail-ipc.c | |
parent | 800be5900bde58a606c177f5515cc7f8de1f40f5 (diff) | |
download | linux-609a13e5c9229ad4f5c78eeb1aefd583fdee9e58.tar.xz |
ASoC: Intel: Allow Rx/Tx message list can be cleared prior to suspend
Suspend/resume requires reloading FW to boot state so we need to also make
sure that the driver matches the FW state at boot.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/intel/sst-baytrail-ipc.c')
-rw-r--r-- | sound/soc/intel/sst-baytrail-ipc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c index 8d8884463173..029da82f07d7 100644 --- a/sound/soc/intel/sst-baytrail-ipc.c +++ b/sound/soc/intel/sst-baytrail-ipc.c @@ -299,6 +299,24 @@ static inline void sst_byt_tx_msg_reply_complete(struct sst_byt *byt, wake_up(&msg->waitq); } +static void sst_byt_drop_all(struct sst_byt *byt) +{ + struct ipc_message *msg, *tmp; + unsigned long flags; + + /* drop all TX and Rx messages before we stall + reset DSP */ + spin_lock_irqsave(&byt->dsp->spinlock, flags); + list_for_each_entry_safe(msg, tmp, &byt->tx_list, list) { + list_move(&msg->list, &byt->empty_list); + } + + list_for_each_entry_safe(msg, tmp, &byt->rx_list, list) { + list_move(&msg->list, &byt->empty_list); + } + + spin_unlock_irqrestore(&byt->dsp->spinlock, flags); +} + static int sst_byt_tx_wait_done(struct sst_byt *byt, struct ipc_message *msg, void *rx_data) { |