Received: by 10.192.165.148 with SMTP id m20csp1924676imm; Thu, 26 Apr 2018 04:17:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4GwZkGl8koboinWO/vvEKCGDR5mPA0bWeD+na+NNWFMi77xm1duJETBb8BfH7xokdHUyO X-Received: by 10.99.191.68 with SMTP id i4mr25299759pgo.66.1524741421333; Thu, 26 Apr 2018 04:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524741421; cv=none; d=google.com; s=arc-20160816; b=dwp6gs/HgIOx9k/EEXlN4SSa2GpKd273qHs1+R3Bhz4uM9tLg+4LVgkzHlZ3imjEVY 8FPkPtqiBhYgZTl2kqjYum7iaZGPzoBi3QBR0DgWKrzF9jPgFglOfVHn2zkrew8FNntr bhcgCQDvSHNX0KXC/q51SgMRAQnpL3jPtz2KCd6TdCXJJI0zTwj6Xmv2y7fasRpvttBL vW25bo8UzJT2mNogi3iMmGxlYkjajCt+wo1YLvYHlypk8ru7T2sRuv0cpR4qmhONBCmb rlVBb8gHycUPYbJTzCElqUoi2Y5sdwvFZkgScMgs+ZioCFLlT3HAhz9FA0bLFWizpejH XgnA== 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=WflTQJLH4FrarZPGM512Jv32kCrLdscV79NQ+onGVgA=; b=YZAg/qA3w1ABhVeSNDu5VWihGd6g3pY64hjyLpKrCUPfwmjPZn63FNewBQkEmwOCHn 4naZwSSzdiGm/1+TcVEZ9dtIz+mZY7TLAGyOkEAMh3N0VIPlvgOzppcB0QnTOvDmSxtv dFr6rNlu+nBdi8QCfwSwc3VgnEgzYr94T3Huooij50pRUtngLPu+gPkwazDuWdMt1fP/ 0IWA+Ny5fTKRlk41ckE/64sNI2IgEmUSUnmHUwEDupfZqKAdkAbOi4RWLFsk0tXJ28xG hQwzlKVC7FjDJnFuVXSLShqqPkrUuvH4gc1o/m4ba2xQBH9JxNGm3gebnkWb5eBDQKk3 iuTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=FRpwyNsF; 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 o2si15553679pgq.451.2018.04.26.04.16.47; Thu, 26 Apr 2018 04:17:01 -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=FRpwyNsF; 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 S1755493AbeDZLPa (ORCPT + 99 others); Thu, 26 Apr 2018 07:15:30 -0400 Received: from mail-cys01nam02on0088.outbound.protection.outlook.com ([104.47.37.88]:63040 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754295AbeDZLP3 (ORCPT ); Thu, 26 Apr 2018 07:15:29 -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=WflTQJLH4FrarZPGM512Jv32kCrLdscV79NQ+onGVgA=; b=FRpwyNsFWRjj3iAPbFgIDLzr4VJXFYsBv4pHJp26BiR9tYxxcTpEVkoiFj6xf0fssHu6c6j/fOIFGTS6MMf53dYK6DoBQwfhpzDeTDF2DNRgrBA1aVN/imvRG/fgIuysuPmb9aOwSR6VxiGitvrdJEZM51Jmd/V/17+LzDpviuk= Received: from BN4PR12CA0016.namprd12.prod.outlook.com (2603:10b6:403:2::26) by DM3PR12MB0761.namprd12.prod.outlook.com (2a01:111:e400:5984::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.17; Thu, 26 Apr 2018 11:15:26 +0000 Received: from CO1NAM03FT049.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by BN4PR12CA0016.outlook.office365.com (2603:10b6:403:2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.715.18 via Frontend Transport; Thu, 26 Apr 2018 11:15:25 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT049.mail.protection.outlook.com (10.152.81.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.696.11 via Frontend Transport; Thu, 26 Apr 2018 11:15:24 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.382.0; Thu, 26 Apr 2018 06:15:22 -0500 From: Vijendar Mukunda CC: Vijendar Mukunda , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Alex Deucher , Jason Clinton , "Akshu Agrawal" , Guenter Roeck , Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH 04/11] ASoC: amd: removed separate byte count variables for playback and capture Date: Thu, 26 Apr 2018 16:45:50 +0530 Message-ID: <1524741374-13523-4-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524741374-13523-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1524741374-13523-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)(346002)(376002)(396003)(39860400002)(39380400002)(2980300002)(428003)(189003)(199004)(105586002)(109986005)(72206003)(186003)(51416003)(54906003)(2906002)(7696005)(26005)(53416004)(81166006)(76176011)(97736004)(5660300001)(16586007)(8676002)(305945005)(81156014)(77096007)(50226002)(316002)(7416002)(356003)(36756003)(104016004)(478600001)(106466001)(8936002)(6666003)(68736007)(2616005)(446003)(4326008)(486006)(47776003)(426003)(48376002)(336012)(476003)(53936002)(50466002)(126002)(86362001)(11346002)(1671002)(39060400002)(266003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM3PR12MB0761;H:SATLEXCHOV01.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM03FT049;1:vBeraGPVezFrsggQN9wp4MALakm2cmbvVMPsvmxQ5wMitjmF1WcAT+i3myTOqzHmR6EmJRLBVjD6CdnsTakabZ+SIxmVTP3H9H01ttMRM/GHoLfYwSVrPMneEPN9bwCo X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060);SRVR:DM3PR12MB0761; X-Microsoft-Exchange-Diagnostics: 1;DM3PR12MB0761;3:ezE1jNs8eThAy9F1GYbb7PbzxCSZ8zkxVh6HmTqE4VIw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aDalT3vXh6dbInJjX6EG+ZPNyPClzKNZI0sx1DecgqpFs7XpePaEECmJ7Udz5XZOE6VXndQodY5rBgCjhsfYli+SIL+N+65t1XuDBAd/S48eaxy4dzImbb1pq0XwXX6rLbxIQ6zlWYTCc65vE4ytc3rfjMJ3Is3+WdvLcVVKll4RcHcFlDm5RjnnQadWhpeZSYp/3iOYiSyhFJBORq4Z+sSRjCSvFKt0IT99/ZPqmkH1+VYTT+Q3J7O2Pjxn9CKl+YD6zAVpBgR6wWU5Dj448XM5y6SWjri2NtUUzhcKiD+uWaPYe/18wa1Y3MmHgiiYYHaAYJ0DcxDtNW7SdE1Q/6wSFz4V+jUtOhDVIYyM3OkGiLY//XsR/sA+KP0u1c37vly+ckgsJ1If6sYvA67ivOU2t2yQ3PN8hSS/EpxJ5ElNcXJZVXO1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231232)(944501410)(52105095)(93006095)(93003095)(10201501046)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011);SRVR:DM3PR12MB0761;BCL:0;PCL:0;RULEID:;SRVR:DM3PR12MB0761; X-Microsoft-Exchange-Diagnostics: 1;DM3PR12MB0761;4:0GMckGKyZaR+3aTHBOGDD2Mb/r+t5pIZZxiDgo4nH8WZf6bDNRZoQU46+BvUd1aaer1NN1/VNr83bupFpkTJFCH+8KpBcDh67yaw83fveOJX7ifWFSZxTV/C2FOmBPuiD7Cil78yUUBoCgsAvApMxm2JA3cJ+s3rLhs/eM+8oybbHjprYvFc/E2q5LJaCvLsky7gkb6oMT+vIcuNMCbMw/EfsyIUIFwWXPYteNlw2jlOy0cC4nCI2rABOHInI2dM49FneGGpJVU3zxCPpuNJo7oXR1j7qt6ZHsCgyQY19Ld3HKSCe1hkH0R3gQE5BJEj X-Forefront-PRVS: 0654257CF5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR12MB0761;23:OoKBBDz0+e4/xrQXU5ek2W1lIvJkc7Usr18U54Jsh?= =?us-ascii?Q?kKbbFS3uTDyfLZunes+WOo9IocOxZMv+suDbmU6FhhfGRrFOQWCtUUC/W9W2?= =?us-ascii?Q?VEn+TuIH37eT2GdAs+ZNmHP7uXPstluQe3M+DL8Tf6wvTKNaZwEEeBRj8hzg?= =?us-ascii?Q?laLUgwOzVWGT/daFRkBph+Z3nU9u4xVMBZCL4aMFsOOxwCACx+++5TwlAvCr?= =?us-ascii?Q?Wpl4T8kpd7bIKQxidg6XVNOGa3fVb0o8xPeTVm7Vuepxy0dEbswSRIoN6w39?= =?us-ascii?Q?fkhUDt97bfq9o5vEHIS5QvQwjhQYf5tmNa2NBo5xn9gsA+gqzU8+bT/5HcbR?= =?us-ascii?Q?WDfh+llPER57gh7v6HoF3nVWKz/BvjPXgF7VQTAgxUBqGual3oKKO7CgoUjW?= =?us-ascii?Q?iqz/XO2lEBf2/OLduFzciHDEweY5Yi/tKuHJIbaDtbiNSLvnElC9cpLSRycI?= =?us-ascii?Q?kGkJiz8OlK023RrUvkeXksb3gvTvkx1CvIZj2bg6qSaHlmE7/0zf8whk4bv7?= =?us-ascii?Q?R+AjjkJ0VKgy8v6tNlfOZVjiF9yYQUSCPQ+ulCiPyfSYcqdZW5DhzJab8zo5?= =?us-ascii?Q?QbW9i7qKqMzrKIrKjQYy/6ptTiV7pRIXk0MkFcV8jNWWfYkWYfgARS7wt0PW?= =?us-ascii?Q?hS0s00KXCogMYQ+bF+ee/wmoWeF8CTZ3Twwxbr/50qppQKvrdOlHtQNupp3J?= =?us-ascii?Q?eCzK1CN80JQnv91xxLd0hkLlkd2v/Dz0Ykx65NDHspyUjUio39YfFC/V/nT1?= =?us-ascii?Q?B8NWGAuwwPozuYWo2jkCbYg5oRoXCWitmwIV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m5cHnWUjHkukgJjm+ X-MS-Office365-Filtering-Correlation-Id: d92df93c-0b40-4f35-d7bc-08d5ab67025c X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 11:15:24.8350 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d92df93c-0b40-4f35-d7bc-08d5ab67025c 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0761 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 --- 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 019f696..5f34be1 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 = 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; @@ -947,12 +939,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