From patchwork Fri Jul 18 08:14:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Jiang X-Patchwork-Id: 4573341 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E9BBE9F1D6 for ; Thu, 17 Jul 2014 08:19:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 885CC2018A for ; Thu, 17 Jul 2014 08:19:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3C05A20120 for ; Thu, 17 Jul 2014 08:19:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9ACFE26554D; Thu, 17 Jul 2014 10:19:13 +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 72DA2265522; Thu, 17 Jul 2014 10:19:03 +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 C8C85265528; Thu, 17 Jul 2014 10:19:01 +0200 (CEST) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0142.outbound.protection.outlook.com [207.46.163.142]) by alsa0.perex.cz (Postfix) with ESMTP id 74E82265522 for ; Thu, 17 Jul 2014 10:18:46 +0200 (CEST) Received: from BL2PR03MB353.namprd03.prod.outlook.com (10.141.89.16) by BL2PR03MB226.namprd03.prod.outlook.com (10.255.231.14) with Microsoft SMTP Server (TLS) id 15.0.985.8; Thu, 17 Jul 2014 08:18:44 +0000 Received: from BN3PR0301CA0065.namprd03.prod.outlook.com (25.160.152.161) by BL2PR03MB353.namprd03.prod.outlook.com (10.141.89.16) with Microsoft SMTP Server (TLS) id 15.0.990.7; Thu, 17 Jul 2014 08:18:42 +0000 Received: from BL2FFO11FD044.protection.gbl (2a01:111:f400:7c09::196) by BN3PR0301CA0065.outlook.office365.com (2a01:111:e400:401e::33) with Microsoft SMTP Server (TLS) id 15.0.990.7 via Frontend Transport; Thu, 17 Jul 2014 08:18:42 +0000 Received: from nwd2mta1.analog.com (137.71.25.55) by BL2FFO11FD044.mail.protection.outlook.com (10.173.161.140) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Thu, 17 Jul 2014 08:18:42 +0000 Received: from NWD2HUBCAS8.ad.analog.com (nwd2hubcas8.ad.analog.com [10.64.72.141]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id s6H8I57C032439 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 17 Jul 2014 01:18:05 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS8.ad.analog.com (10.64.72.141) with Microsoft SMTP Server id 14.3.158.1; Thu, 17 Jul 2014 04:17:30 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id s6H8HPFq017785; Thu, 17 Jul 2014 04:17:29 -0400 Received: from localhost.localdomain (unknown [10.99.24.124]) by linux.site (Postfix) with ESMTP id E02D33AEB6A4; Wed, 16 Jul 2014 18:15:19 -0600 (MDT) From: Scott Jiang To: Lars-Peter Clausen , Mark Brown Date: Fri, 18 Jul 2014 16:14:56 +0800 Message-ID: <1405671297-17792-1-git-send-email-scott.jiang.linux@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130500587223106219; (52f37747-95c3-483a-bd05-08d153b03fac); () X-Forefront-Antispam-Report: CIP:137.71.25.55; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(33646002)(93916002)(20776003)(50226001)(4396001)(92566001)(50466002)(106466001)(102836001)(81342001)(31966008)(6806004)(46102001)(95666004)(47776003)(92726001)(79102001)(85306003)(73972005)(80022001)(48376002)(86362001)(50986999)(64706001)(21056001)(61266001)(55446002)(36756003)(77982001)(87572001)(77156001)(83072002)(87936001)(74662001)(74502001)(229853001)(62966002)(73392001)(82202001)(85852003)(88136002)(49486002)(19580395003)(81442001)(81542001)(105596002)(87286001)(107046002)(44976005)(19580405001)(99396002)(89996001)(49496006); DIR:OUT; SFP:; SCL:1; SRVR:BL2PR03MB353; H:nwd2mta1.analog.com; FPR:; MLV:sfv; PTR:nwd2mail10.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.55 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.55) smtp.mailfrom=scott.jiang.linux@gmail.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: 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; }