summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/sst-haswell-ipc.c
diff options
context:
space:
mode:
authorLibin Yang2015-02-10 03:02:47 +0100
committerTakashi Iwai2015-02-11 09:58:15 +0100
commit1b006996b6c44d9d95462e382921954756cec99b (patch)
tree72852960cce0fcf464671d851823734b7e421b07 /sound/soc/intel/sst-haswell-ipc.c
parentALSA: hda - Add docking station support for another HP machine (diff)
downloadkernel-qcow2-linux-1b006996b6c44d9d95462e382921954756cec99b.tar.gz
kernel-qcow2-linux-1b006996b6c44d9d95462e382921954756cec99b.tar.xz
kernel-qcow2-linux-1b006996b6c44d9d95462e382921954756cec99b.zip
ASoC: Intel: Clean data after SST fw fetch
The BDW audio firmware DSP manages the DMA and the DMA cannot be stopped exactly at the end of the playback stream. This means stale samples may be played at PCM stop unless the driver copies silence to the subsequent periods. Signed-off-by: Libin Yang <libin.yang@intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/intel/sst-haswell-ipc.c')
-rw-r--r--sound/soc/intel/sst-haswell-ipc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index 0ab1309ef274..394af5684c05 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -31,6 +31,7 @@
#include <linux/dma-mapping.h>
#include <linux/debugfs.h>
#include <linux/pm_runtime.h>
+#include <sound/asound.h>
#include "sst-haswell-ipc.h"
#include "sst-dsp.h"
@@ -242,6 +243,9 @@ struct sst_hsw_stream {
u32 (*notify_position)(struct sst_hsw_stream *stream, void *data);
void *pdata;
+ /* record the fw read position when playback */
+ snd_pcm_uframes_t old_position;
+ bool play_silence;
struct list_head node;
};
@@ -1347,6 +1351,30 @@ int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
return 0;
}
+snd_pcm_uframes_t sst_hsw_stream_get_old_position(struct sst_hsw *hsw,
+ struct sst_hsw_stream *stream)
+{
+ return stream->old_position;
+}
+
+void sst_hsw_stream_set_old_position(struct sst_hsw *hsw,
+ struct sst_hsw_stream *stream, snd_pcm_uframes_t val)
+{
+ stream->old_position = val;
+}
+
+bool sst_hsw_stream_get_silence_start(struct sst_hsw *hsw,
+ struct sst_hsw_stream *stream)
+{
+ return stream->play_silence;
+}
+
+void sst_hsw_stream_set_silence_start(struct sst_hsw *hsw,
+ struct sst_hsw_stream *stream, bool val)
+{
+ stream->play_silence = val;
+}
+
/* Stream Information - these calls could be inline but we want the IPC
ABI to be opaque to client PCM drivers to cope with any future ABI changes */
int sst_hsw_mixer_get_info(struct sst_hsw *hsw)