From patchwork Mon Jul 14 08:37:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jie, Yang" X-Patchwork-Id: 4543421 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9DBEC0514 for ; Mon, 14 Jul 2014 08:40:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2988A2012B for ; Mon, 14 Jul 2014 08:40:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 340CD2010B for ; Mon, 14 Jul 2014 08:40:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5105926262D; Mon, 14 Jul 2014 10:40:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1754C261A27; Mon, 14 Jul 2014 10:38:52 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EB3222619DB; Mon, 14 Jul 2014 10:38:46 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by alsa0.perex.cz (Postfix) with ESMTP id E09F72617AB for ; Mon, 14 Jul 2014 10:38:38 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 14 Jul 2014 01:38:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,657,1400050800"; d="scan'208";a="456637776" Received: from keyon-u1310.sh.intel.com ([10.239.13.3]) by azsmga001.ch.intel.com with ESMTP; 14 Jul 2014 01:38:23 -0700 From: Jie Yang To: alsa-devel@alsa-project.org Date: Mon, 14 Jul 2014 16:37:54 +0800 Message-Id: <1405327075-27831-5-git-send-email-yang.jie@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1405327075-27831-1-git-send-email-yang.jie@intel.com> References: <1405327075-27831-1-git-send-email-yang.jie@intel.com> Cc: mengdong.lin@intel.com, broonie@kernel.org, liam.r.girdwood@intel.com Subject: [alsa-devel] [PATCH 4/5] ASoC: Intel: Add dummy read for SRAM block enable X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add dummy read after each block enable, to workaround SRAM write missing bytes issue. Signed-off-by: Jie Yang --- sound/soc/intel/sst-haswell-dsp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/intel/sst-haswell-dsp.c b/sound/soc/intel/sst-haswell-dsp.c index f4276fb..cc58b31 100644 --- a/sound/soc/intel/sst-haswell-dsp.c +++ b/sound/soc/intel/sst-haswell-dsp.c @@ -381,6 +381,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) { @@ -400,6 +411,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; }