diff options
-rw-r--r-- | sound/soc/intel/sst-haswell-dsp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/intel/sst-haswell-dsp.c b/sound/soc/intel/sst-haswell-dsp.c index 535f517629fd..a33b931181dc 100644 --- a/sound/soc/intel/sst-haswell-dsp.c +++ b/sound/soc/intel/sst-haswell-dsp.c | |||
@@ -359,6 +359,17 @@ static u32 hsw_block_get_bit(struct sst_mem_block *block) | |||
359 | return bit; | 359 | return bit; |
360 | } | 360 | } |
361 | 361 | ||
362 | /*dummy read a SRAM block.*/ | ||
363 | static void sst_mem_block_dummy_read(struct sst_mem_block *block) | ||
364 | { | ||
365 | u32 size; | ||
366 | u8 tmp_buf[4]; | ||
367 | struct sst_dsp *sst = block->dsp; | ||
368 | |||
369 | size = block->size > 4 ? 4 : block->size; | ||
370 | memcpy_fromio(tmp_buf, sst->addr.lpe + block->offset, size); | ||
371 | } | ||
372 | |||
362 | /* enable 32kB memory block - locks held by caller */ | 373 | /* enable 32kB memory block - locks held by caller */ |
363 | static int hsw_block_enable(struct sst_mem_block *block) | 374 | static int hsw_block_enable(struct sst_mem_block *block) |
364 | { | 375 | { |
@@ -378,6 +389,8 @@ static int hsw_block_enable(struct sst_mem_block *block) | |||
378 | /* wait 18 DSP clock ticks */ | 389 | /* wait 18 DSP clock ticks */ |
379 | udelay(10); | 390 | udelay(10); |
380 | 391 | ||
392 | /*add a dummy read before the SRAM block is written, otherwise the writing may miss bytes sometimes.*/ | ||
393 | sst_mem_block_dummy_read(block); | ||
381 | return 0; | 394 | return 0; |
382 | } | 395 | } |
383 | 396 | ||