Skip to content

Commit

Permalink
ASoC: Intel: Add dummy read for SRAM block enable
Browse files Browse the repository at this point in the history
Add dummy read after each block enable, to workaround
SRAM write missing bytes issue.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Jie Yang authored and Mark Brown committed Jul 14, 2014
1 parent 8e89761 commit c761b58
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sound/soc/intel/sst-haswell-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,17 @@ static u32 hsw_block_get_bit(struct sst_mem_block *block)
return bit;
}

/*dummy read a SRAM block.*/
static void sst_mem_block_dummy_read(struct sst_mem_block *block)
{
u32 size;
u8 tmp_buf[4];
struct sst_dsp *sst = block->dsp;

size = block->size > 4 ? 4 : block->size;
memcpy_fromio(tmp_buf, sst->addr.lpe + block->offset, size);
}

/* enable 32kB memory block - locks held by caller */
static int hsw_block_enable(struct sst_mem_block *block)
{
Expand All @@ -378,6 +389,8 @@ static int hsw_block_enable(struct sst_mem_block *block)
/* wait 18 DSP clock ticks */
udelay(10);

/*add a dummy read before the SRAM block is written, otherwise the writing may miss bytes sometimes.*/
sst_mem_block_dummy_read(block);
return 0;
}

Expand Down

0 comments on commit c761b58

Please sign in to comment.