diff options
author | Jie Yang <yang.jie@intel.com> | 2014-07-14 17:11:11 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-14 19:11:27 +0100 |
commit | c761b58306b26ea78fa91488cbb04c61b35d583d (patch) | |
tree | 43e88a87a6489f6aafb3d1e892d798161242a997 /sound/soc/intel | |
parent | 8e89761876611f06ef4be865b4780b4361caf4af (diff) | |
download | talos-obmc-linux-c761b58306b26ea78fa91488cbb04c61b35d583d.tar.gz talos-obmc-linux-c761b58306b26ea78fa91488cbb04c61b35d583d.zip |
ASoC: Intel: Add dummy read for SRAM block enable
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>
Diffstat (limited to 'sound/soc/intel')
-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) 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) { @@ -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; } |