Received: by 10.192.165.148 with SMTP id m20csp3863317imm; Mon, 7 May 2018 21:46:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoSWyGc+thpsMRSKBGUv77p9Fx1nkZR4Z0QjqGo0FOllnvas9Q1pdRo30wllBP/jrgmSuiF X-Received: by 2002:a17:902:bcc4:: with SMTP id o4-v6mr28382352pls.308.1525754796230; Mon, 07 May 2018 21:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525754796; cv=none; d=google.com; s=arc-20160816; b=Ey9ZXZUpDKJU19A4WaTYliD0CrzBsDSBcu7vG+Edcl39+x7Z2+RnpeQXqfE8QlfFE6 nOH9Ff+oBASg6D0xZ6V+93Z+3h8fF7/Io5aM7BybD2isIBs2LfgCmBUFbCVr9E8v+nOX MrEEUKhUrZWX3x6Vfs+k8BA6IdOBYwi2772/ROxoOQ0Ucud5m/x57a17iWICAYrt7uyj IGSSD4ZrvyV2otYFSepSEuAeE43JaSlaPLkDxAaTggnGCBLZHjhDw37sQgYEDAfd0nXm C8A2I2Bbb1XxI3oPsIcylFAIi3NZ2qe8M+dCOa06U3ms+qlUkBuvlEX7c9fALJPQ2HMZ XTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:from:dkim-signature:arc-authentication-results; bh=bl0GQPvHEDwTxrsDh7bvbFOHIRUXS3eDSkIaPPTUWcM=; b=IeDODjXmUpDaCTw29/utuELtqS5dOhdLHfpa70CjlD2RRSCuWc1uxQhm6mj2fA5rh8 dI2MhQZ/Bcdn/U3Qd30qvl4SdJly3XvvMHOHt+jbtt1eVQx/ddeOD8RcuBnDyEUFOOiT usZcXczk6LQedv1rJoAnoD9gWTOw2idoRu+nTrX2pjgyaf8C4VawzTy4JrEXVvTvT0Up v/i6DOuw33I35XT43JZxeRjOtP8l2vMIcvaCkA3MlEs3Lpa4QiaTQU564VE57ob5PSS0 N+GPLIL2+uXZJqDQxIkRRKraRsVZhjRB+gWEFiClmWI8KCMgsK8KlNuDntHAQggduvM2 Ukog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Cos9G8eR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si17811404plc.14.2018.05.07.21.46.21; Mon, 07 May 2018 21:46:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Cos9G8eR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753861AbeEHEpQ (ORCPT + 99 others); Tue, 8 May 2018 00:45:16 -0400 Received: from mail-sn1nam02on0080.outbound.protection.outlook.com ([104.47.36.80]:25232 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750818AbeEHEpO (ORCPT ); Tue, 8 May 2018 00:45:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bl0GQPvHEDwTxrsDh7bvbFOHIRUXS3eDSkIaPPTUWcM=; b=Cos9G8eRuAZ2GzMrO55F/bOxFrJ8NYsRsvGyVgV/458DlMApb5Kjbp92w+/x+ahX4rKlTcWl7fXt0ceHdEgsdCxUyca2wKxoxWEJr8yL2KrEHwMrTWIlq4C9UKWnwic98pAfVz4+A039obDDtYd9rWciDadQetwptqGzJtsSd8U= Received: from DM3PR12CA0101.namprd12.prod.outlook.com (2603:10b6:0:55::21) by CY1PR12MB0327.namprd12.prod.outlook.com (2a01:111:e400:50fa::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Tue, 8 May 2018 04:45:11 +0000 Received: from DM3NAM03FT028.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by DM3PR12CA0101.outlook.office365.com (2603:10b6:0:55::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.735.16 via Frontend Transport; Tue, 8 May 2018 04:45:11 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT028.mail.protection.outlook.com (10.152.82.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.735.16 via Frontend Transport; Tue, 8 May 2018 04:45:10 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Mon, 7 May 2018 23:45:09 -0500 From: Vijendar Mukunda CC: Vijendar Mukunda , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Alex Deucher , Daniel Kurtz , "Akshu Agrawal" , Guenter Roeck , "Greg Kroah-Hartman" , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , "open list" Subject: [PATCH V2 03/10] ASoC: amd: removed separate byte count variables for playback and capture Date: Tue, 8 May 2018 10:17:46 +0530 Message-ID: <1525754888-14124-3-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525754888-14124-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1525754888-14124-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(376002)(39380400002)(2980300002)(428003)(189003)(199004)(2906002)(356003)(97736004)(104016004)(48376002)(86362001)(8676002)(68736007)(81166006)(486006)(2616005)(50466002)(446003)(36756003)(81156014)(11346002)(4326008)(5660300001)(336012)(7696005)(126002)(426003)(476003)(39060400002)(6666003)(478600001)(72206003)(54906003)(53416004)(26005)(53936002)(77096007)(105586002)(305945005)(8936002)(50226002)(106466001)(76176011)(6346003)(47776003)(109986005)(186003)(16586007)(316002)(51416003)(1671002)(266003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0327;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM03FT028;1:7YgWQeeawY+A7k3AgxHZ/QTtZmqvzdwotMFQ2swsw5UXZH//464j8uaegFAotdRVzKYMXuV5VYG8Uctydo94pNkW6rrQu4b4uSwJQIcksZP60SHRfNvXa+19pqajBFBu X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060);SRVR:CY1PR12MB0327; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0327;3:1IgUOYTq/UKyjVSHhsuKfiKgS1F3l+A1ep8f9Xtb/yWUIQHj19SzSor03nKn1nd8rO8sBl1gWZGNhykXofd1ia733ZmjbwukUfq1vbBBxScEVszxW83/rEXb7A2B73grgEd04PEE6WTgC7L8SQwSxYYqOHzGYF3weP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Flks60UONjnq+5ENHdvho9mNj68PzdwPyxSgDUiyS96i4HZklW1knKp3E8bSiiZEi/WaK/WaBlo6EEB8dFUv+Tyl3bpMN1kIG5hGMj9Fd3F6357tnwNgEVrZhQJUvfm7hD8g521WJWwhSInvVuMrRpcHYo/PgLi0uoQ1QOaoTybrrH4Oqd48ZHTtfQeHFyl2NgiCQlBGtZRyXKMWcjitmkd+b7VOPBsEC0oGtbKdJlIYtC91dcDe0HktqPMpGc/JGCAIT4sjOXzezUUHv32YEEaxVxE6CSCuL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93003095)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:CY1PR12MB0327;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0327; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0327;4:Ud5NIywEP7Talq1cv9AqWY1JddZCq+lXiP/SEskeLC/AwZxowfrpEgbuqk0BfSSkF49o6rq8BzzTR5jBAYAjLLHsWeCCFxREanrIiX6IPdDEz5MURWHgKE4RF34kmIFjAq6ACtTIOlBvpVwD4tI7vW0t0CnnPNEdX95mx5df50H4JV4rs6VJDVeb10KdyrgM4edxBjD+HqHsgEFGH1xKYn1qq2pIQaDRlhreNKrnbPKdQzW8wXq712Ts2ZqcaN4up/mt8iUC1nzxBgugtOsMhZda1WqY2SbHRz2AGEaLI6GcW93cStnURi8BCEJ1feRd X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0327;23:7jIEtGbTrDkripj76637iICUf3k+PK/XZfgfFXxjk?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spMY36Y8NhYqsx4LlY0Ll1u+pe93eFCOPKBsplx1mpy0K79LfZvA8XyT+LQLBrroI/C7+BYwf3XoOfDviCyQ==;5:lHb8fCjvwPetxlbCYPVOQ+xg70CW+FeFsNtCJ5pP5nDUbXU4ZJ4gEiS1Z99J8gjoOkjJIW1r7sMyqNb5vDijTMqgxLExVMuX3FNmSVNEyXBwECWGFK9qJu5v4gxpjwOf0jN6ORL0TzCGJ62OoL/1pMKmxm0epd4Ijq13qLrWdY0=;24:ZKli6a5GlyUH5dYNcMsSTtiOVU6zx3TmW+j7T0h1AfP3LoMTLTVs4FvSVjkh5rklw9828GEGlHMZa7jl4XZtIRFDBePEX9aHmg9eYG3x4ao= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0327;7:NCCJhnJ3/s6XWgrRBnPycKWubFY+ZNkR4lxIQVdco5DghENy7OszV4KbXfdsEePCQgA0iVAYuSfs+gG3s7TQO1NFX24XUQGX1GBUTiD4jdJvRk7qmYW55Ha6e4lni4uCh3c2HzhCUAtaiWFi+xtlbE4Q4kNmAeWKIu6wVd1ADcBszh3OZIplvwsZSoZCeTXakLWtLE+aTneAqW0ddBiYQLor2tGjTDzCdoUvt17YH6bDcO3JCYhsjJ5vSmToAbtg;20:eA28j3VZODqV24XPJr411Z2sIYTCwbPEXcHTI194K/lvXhG/2qtUbrzAfpFHhct6HjIbcWS7l8B5GC+hXIjhJ833Sf1Q4SDNY3R2dM+yTtVJ2EHuk9k53bj/1u2McEcb0n103avpk/7nNQ3/ei+ifDOFwe/wDE52as/Sz9SQ2XEwvHionyiBRulz9NoaoqhxfWhsCmqHJJyFHcA5E12g5aRP0KRS2adrK1a+uIlm5AjGtGEjgEQDiies0XSq9b9f X-MS-Office365-Filtering-Correlation-Id: 1fa59a2b-2c8a-4a1e-b4c1-08d5b49e7b32 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 04:45:10.1764 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fa59a2b-2c8a-4a1e-b4c1-08d5b49e7b32 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0327 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Removed separate byte count variables for playback and capture. Signed-off-by: Vijendar Mukunda Reviewed-by: Daniel Kurtz --- v1->v2: Fixed review comment in acp_dma_pointer callback sound/soc/amd/acp-pcm-dma.c | 19 +++++-------------- sound/soc/amd/acp.h | 3 +-- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 6e338fe..862c1cf 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -866,13 +866,8 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) buffersize = frames_to_bytes(runtime, runtime->buffer_size); bytescount = acp_get_byte_count(rtd); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - if (bytescount > rtd->i2ssp_renderbytescount) - bytescount = bytescount - rtd->i2ssp_renderbytescount; - } else { - if (bytescount > rtd->i2ssp_capturebytescount) - bytescount = bytescount - rtd->i2ssp_capturebytescount; - } + if (bytescount > rtd->bytescount) + bytescount -= rtd->bytescount; pos = do_div(bytescount, buffersize); return bytes_to_frames(runtime, pos); } @@ -921,9 +916,9 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: bytescount = acp_get_byte_count(rtd); + if (rtd->bytescount == 0) + rtd->bytescount = bytescount; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - if (rtd->i2ssp_renderbytescount == 0) - rtd->i2ssp_renderbytescount = bytescount; acp_dma_start(rtd->acp_mmio, rtd->ch1, false); while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & BIT(rtd->ch1)) { @@ -934,9 +929,6 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) } cpu_relax(); } - } else { - if (rtd->i2ssp_capturebytescount == 0) - rtd->i2ssp_capturebytescount = bytescount; } acp_dma_start(rtd->acp_mmio, rtd->ch2, true); ret = 0; @@ -955,12 +947,11 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { acp_dma_stop(rtd->acp_mmio, rtd->ch1); ret = acp_dma_stop(rtd->acp_mmio, rtd->ch2); - rtd->i2ssp_renderbytescount = 0; } else { acp_dma_stop(rtd->acp_mmio, rtd->ch2); ret = acp_dma_stop(rtd->acp_mmio, rtd->ch1); - rtd->i2ssp_capturebytescount = 0; } + rtd->bytescount = 0; break; default: ret = -EINVAL; diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h index 3b076c6..82470bc 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -93,8 +93,7 @@ struct audio_substream_data { u32 byte_cnt_high_reg_offset; u32 byte_cnt_low_reg_offset; uint64_t size; - u64 i2ssp_renderbytescount; - u64 i2ssp_capturebytescount; + u64 bytescount; void __iomem *acp_mmio; }; -- 2.7.4