From patchwork Fri Jul 18 08:14:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Jiang X-Patchwork-Id: 4573351 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 42D4EC0514 for ; Thu, 17 Jul 2014 08:19:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A49820148 for ; Thu, 17 Jul 2014 08:19:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7584920120 for ; Thu, 17 Jul 2014 08:19:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BDCB526557D; Thu, 17 Jul 2014 10:19:35 +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.3 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_12_24, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4441C265532; Thu, 17 Jul 2014 10:19:04 +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 D33A6265522; Thu, 17 Jul 2014 10:19:01 +0200 (CEST) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0182.outbound.protection.outlook.com [207.46.163.182]) by alsa0.perex.cz (Postfix) with ESMTP id E4833265526 for ; Thu, 17 Jul 2014 10:18:46 +0200 (CEST) Received: from BN3PR0301CA0083.namprd03.prod.outlook.com (25.160.152.179) by BL2PR03MB354.namprd03.prod.outlook.com (10.141.89.22) with Microsoft SMTP Server (TLS) id 15.0.980.8; Thu, 17 Jul 2014 08:18:45 +0000 Received: from BY2FFO11FD043.protection.gbl (2a01:111:f400:7c0c::189) by BN3PR0301CA0083.outlook.office365.com (2a01:111:e400:401e::51) with Microsoft SMTP Server (TLS) id 15.0.990.7 via Frontend Transport; Thu, 17 Jul 2014 08:18:44 +0000 Received: from nwd2mta2.analog.com (137.71.25.57) by BY2FFO11FD043.mail.protection.outlook.com (10.1.14.228) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Thu, 17 Jul 2014 08:18:44 +0000 Received: from NWD2HUBCAS9.ad.analog.com (nwd2hubcas9.ad.analog.com [10.64.72.142]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id s6HApg63012487 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 17 Jul 2014 06:51:43 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS9.ad.analog.com (10.64.72.142) with Microsoft SMTP Server id 14.3.158.1; Thu, 17 Jul 2014 04:17:32 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id s6H8HU2S017787; Thu, 17 Jul 2014 04:17:31 -0400 Received: from localhost.localdomain (unknown [10.99.24.124]) by linux.site (Postfix) with ESMTP id ECE083AEB6B0; Wed, 16 Jul 2014 18:15:24 -0600 (MDT) From: Scott Jiang To: Lars-Peter Clausen , Mark Brown Date: Fri, 18 Jul 2014 16:14:57 +0800 Message-ID: <1405671297-17792-2-git-send-email-scott.jiang.linux@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1405671297-17792-1-git-send-email-scott.jiang.linux@gmail.com> References: <1405671297-17792-1-git-send-email-scott.jiang.linux@gmail.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130500587246336072; (52f37747-95c3-483a-bd05-08d153b03fac); () X-Forefront-Antispam-Report: CIP:137.71.25.57; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(99396002)(102836001)(87936001)(64706001)(79102001)(19580405001)(19580395003)(95666004)(229853001)(61266001)(62966002)(48376002)(46102001)(6806004)(21056001)(33646002)(87286001)(85852003)(107046002)(44976005)(77156001)(106466001)(73392001)(92726001)(89996001)(31966008)(93916002)(50986999)(74502001)(36756003)(85306003)(82202001)(81442001)(77982001)(73972005)(86362001)(20776003)(80022001)(87572001)(55446002)(49486002)(4396001)(74662001)(88136002)(92566001)(81342001)(50466002)(83072002)(81542001)(50226001)(47776003)(105596002)(76176999)(49496006); DIR:OUT; SFP:; SCL:1; SRVR:BL2PR03MB354; H:nwd2mta2.analog.com; FPR:; MLV:sfv; PTR:nwd2mail11.analog.com; A:1; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 027578BB13 Received-SPF: SoftFail (: domain of transitioning gmail.com discourages use of 137.71.25.57 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.57) smtp.mailfrom=scott.jiang.linux@gmail.com; Cc: alsa-devel@alsa-project.org, Scott Jiang Subject: [alsa-devel] [PATCH] ASoC: blackfin: use samples to set silence 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The third parameter for snd_pcm_format_set_silence needs the number of samples instead of sample bytes. Signed-off-by: Scott Jiang --- sound/soc/blackfin/bf5xx-i2s-pcm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index a3881c4..bcf5913 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c @@ -290,19 +290,19 @@ static int bf5xx_pcm_silence(struct snd_pcm_substream *substream, unsigned int sample_size = runtime->sample_bits / 8; void *buf = runtime->dma_area; struct bf5xx_i2s_pcm_data *dma_data; - unsigned int offset, size; + unsigned int offset, samples; dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); if (dma_data->tdm_mode) { offset = pos * 8 * sample_size; - size = count * 8 * sample_size; + samples = count * 8; } else { offset = frames_to_bytes(runtime, pos); - size = frames_to_bytes(runtime, count); + samples = count * runtime->channels; } - snd_pcm_format_set_silence(runtime->format, buf + offset, size); + snd_pcm_format_set_silence(runtime->format, buf + offset, samples); return 0; }