diff options
author | Libin Yang <libin.yang@intel.com> | 2015-02-09 21:02:47 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-11 03:58:15 -0500 |
commit | 1b006996b6c44d9d95462e382921954756cec99b (patch) | |
tree | 72852960cce0fcf464671d851823734b7e421b07 /sound/soc/intel/sst-haswell-ipc.c | |
parent | 3271cb22838882bad86f6f2405b29fa7925a08e8 (diff) |
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.c | 28 |
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 @@ | |||
31 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
32 | #include <linux/debugfs.h> | 32 | #include <linux/debugfs.h> |
33 | #include <linux/pm_runtime.h> | 33 | #include <linux/pm_runtime.h> |
34 | #include <sound/asound.h> | ||
34 | 35 | ||
35 | #include "sst-haswell-ipc.h" | 36 | #include "sst-haswell-ipc.h" |
36 | #include "sst-dsp.h" | 37 | #include "sst-dsp.h" |
@@ -242,6 +243,9 @@ struct sst_hsw_stream { | |||
242 | u32 (*notify_position)(struct sst_hsw_stream *stream, void *data); | 243 | u32 (*notify_position)(struct sst_hsw_stream *stream, void *data); |
243 | void *pdata; | 244 | void *pdata; |
244 | 245 | ||
246 | /* record the fw read position when playback */ | ||
247 | snd_pcm_uframes_t old_position; | ||
248 | bool play_silence; | ||
245 | struct list_head node; | 249 | struct list_head node; |
246 | }; | 250 | }; |
247 | 251 | ||
@@ -1347,6 +1351,30 @@ int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream) | |||
1347 | return 0; | 1351 | return 0; |
1348 | } | 1352 | } |
1349 | 1353 | ||
1354 | snd_pcm_uframes_t sst_hsw_stream_get_old_position(struct sst_hsw *hsw, | ||
1355 | struct sst_hsw_stream *stream) | ||
1356 | { | ||
1357 | return stream->old_position; | ||
1358 | } | ||
1359 | |||
1360 | void sst_hsw_stream_set_old_position(struct sst_hsw *hsw, | ||
1361 | struct sst_hsw_stream *stream, snd_pcm_uframes_t val) | ||
1362 | { | ||
1363 | stream->old_position = val; | ||
1364 | } | ||
1365 | |||
1366 | bool sst_hsw_stream_get_silence_start(struct sst_hsw *hsw, | ||
1367 | struct sst_hsw_stream *stream) | ||
1368 | { | ||
1369 | return stream->play_silence; | ||
1370 | } | ||
1371 | |||
1372 | void sst_hsw_stream_set_silence_start(struct sst_hsw *hsw, | ||
1373 | struct sst_hsw_stream *stream, bool val) | ||
1374 | { | ||
1375 | stream->play_silence = val; | ||
1376 | } | ||
1377 | |||
1350 | /* Stream Information - these calls could be inline but we want the IPC | 1378 | /* Stream Information - these calls could be inline but we want the IPC |
1351 | ABI to be opaque to client PCM drivers to cope with any future ABI changes */ | 1379 | ABI to be opaque to client PCM drivers to cope with any future ABI changes */ |
1352 | int sst_hsw_mixer_get_info(struct sst_hsw *hsw) | 1380 | int sst_hsw_mixer_get_info(struct sst_hsw *hsw) |