From patchwork Fri Feb 16 07:33:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 10224115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7881B603EE for ; Fri, 16 Feb 2018 07:32:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6379F28F97 for ; Fri, 16 Feb 2018 07:32:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57A572911A; Fri, 16 Feb 2018 07:32:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62D6E28F97 for ; Fri, 16 Feb 2018 07:32:19 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A651C267D6B; Fri, 16 Feb 2018 08:32:08 +0100 (CET) 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 71F62267D6D; Fri, 16 Feb 2018 08:32:07 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0044.outbound.protection.outlook.com [104.47.37.44]) by alsa0.perex.cz (Postfix) with ESMTP id 76435267D6B for ; Fri, 16 Feb 2018 08:32:04 +0100 (CET) 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=NgbE3eN6dKxZ/4vXzLSSP2JmTv1ioK95p5MA4YxDZeo=; b=EDTeFox2nM7KL30F87KGMAGJ9fX2FW5QB78yy18B6EVCHUH6M5Jw3cd8pPbPeJk9j24e/wLlVwa38aHOT3SZp1BcDGYzBFtPTuVn2nALhAXar6Urgp5DQLuXL5bB9GMaxxHi8nP2aqqx8bABMI4O58Gdic1AMuqUdZ1SBrC0z+g= Received: from DM5PR12CA0019.namprd12.prod.outlook.com (2603:10b6:4:1::29) by SN1PR12MB0272.namprd12.prod.outlook.com (2a01:111:e400:5145::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Fri, 16 Feb 2018 07:31:57 +0000 Received: from BY2NAM03FT033.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::200) by DM5PR12CA0019.outlook.office365.com (2603:10b6:4:1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.506.18 via Frontend Transport; Fri, 16 Feb 2018 07:31:57 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; 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 BY2NAM03FT033.mail.protection.outlook.com (10.152.84.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.19 via Frontend Transport; Fri, 16 Feb 2018 07:31:56 +0000 Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server (TLS) id 14.3.382.0; Fri, 16 Feb 2018 01:31:56 -0600 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server (TLS) id 14.3.382.0; Fri, 16 Feb 2018 02:31:55 -0500 Received: from LinuxHost.amd.com (10.129.12.246) by SCYBEXDAG03.amd.com (10.34.11.13) with Microsoft SMTP Server id 14.3.382.0; Fri, 16 Feb 2018 15:31:51 +0800 From: Vijendar Mukunda To: , , Date: Fri, 16 Feb 2018 13:03:46 +0530 Message-ID: <1518766434-7911-2-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518766434-7911-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1518766434-7911-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 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)(396003)(346002)(39380400002)(39860400002)(376002)(2980300002)(428003)(199004)(189003)(86362001)(97736004)(50466002)(47776003)(59450400001)(7696005)(51416003)(2201001)(48376002)(6666003)(2950100002)(81166006)(26005)(81156014)(336011)(77096007)(186003)(8676002)(53416004)(2906002)(110136005)(5660300001)(54906003)(8936002)(105586002)(39060400002)(4326008)(50226002)(72206003)(478600001)(53936002)(76176011)(316002)(356003)(36756003)(16586007)(305945005)(106466001)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0272; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT033; 1:0X9Tf1eN7DmnOUz4x+oxjYuOJ1v8pzCKRTgi7y+hIR+tgWr/Oh9MQqfwrbQxtXhgtAJPoQe/HkIlKIjA98a3rCYbTFtRZVTmvR/bXnBpOwzQfv6DA6AB15jI/7ja7H3E X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c126b674-1515-4fd5-6b2c-08d5750f5bf9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:SN1PR12MB0272; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0272; 3:I/Fwaehgbxa2SPq2fktCYBo1+jywAFsSn5mmsRWv3nkqwKZzzAX9LcUyU8/hRt1hpFVm2YtJ4N4cMNrS/t+nP3bZhrPNpuCOz6++WzBZ6VAuQElLMndYbxN+4jlOYW3rRvmWd1kdl1x04zAJd7R3pLddaQcEPqR3bydfnTBlRTQ5D5GOod/gf9UVPz7SHZlSQnPbwtoKA0jFoGVgR3TSsF+BHkGsBEEPjuTCaKqccjPA/lbuOzb+/sP8S60xR/TnTt8W9TwMpaTCwPzfPud2/LcGJ4aPhxmjTaHC8dvgw8Xmndia3dmCDddP8pZRxfGuVQIJeL1Vsi9FgoOQ0uUC5WWYr6poNAsVybY5hvQP8Dw=; 25:AUYzd8/TVFP2Q4+t4zbJxGjhvj07jM76pVIjIVGCeqsdCcxooWbF/fOKK+uC3g4exUyCgGbsarYJ/9nvrAqKeknYkqm4IRAy4zVsrHXaVfvGSLh0fhd18fJYuCeMMmi4O9bAwRWP+VHzBI2A7ErA/N66MiNqgTERxsdsD+v+wwtPZfxfVbuPvmt4Zb93FX/emOF3V059ZtIl3BxXoY6YrOPbOziIIZDzpENlJbWvqI71vgK8dtczsymcHMqWG2PnJ6pEd0x8UpMv9w8F5CQWRQvQQwnp3VLiHzgvJSTL+4qm+w5DNxrOVLMo+0tix1SMtZ6COvOPHxki4thkG1STFA== X-MS-TrafficTypeDiagnostic: SN1PR12MB0272: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0272; 31:CwmLM5WkEINrkIdBQdeioftss+M3+geduHG3sVkVaPQejuI4Ypi/bRKXt0+zfUfkZqJ4ek8I2iA5i9+Ua31yYdXrZIDW60IDPZ8Y4ABLrPnddUHK2z29mPq225JSjYyZXfU6hi3+3akqbrRFUYP6mamu44roJjNXDLy3//Gn9NSLpwvVc+4nrybmVqvcmesvgMVG/IftdkgFH/rGQHyYqYGZcQ4feCh+g2HnWgP/Aho=; 20:TFBtibn3uUyBx/Qg5iyA7zd/XXZMd944Pg6b1TUzDTstaAopaKzveiETSFLEvAtmu2fhS/3G5VxUW8Rw9ShHszt38GfM+rkth0KbATX2LSXiqPPfmy+ib8BeQeC5QWTS331suBossoyTWy1IgTejSeciotLxPFnBo4Y9+1ticrbMtJ2M1neQGxqqCplnHWVQ7LFqPqj23vSfx5HCZ1Pwhk9mSIIusxuHv8DjVw2UjHj3LwJddNj8HR56iiZDGjnNQxCL7NtjQlGClW+8n7di+e9eubZiQewONytDCL8GtOdBaGHZw2F0evrqmoGzEkW1Wsd2r3MoTgvEXEqKi244YroxFIUhklCEpkWhTCEFIJQAjDqXlvvs0ktuGexm5y7QKssBO0GVTGEyZntpctJwug5P/8Ly7G5i1rrLYMLHn1Wj63Ti+G2kB67DNBYtADLb1Iffm/FaIKzAXFiC4iYC/VTaS7LSS3WKDiFi2LOdae09nGmuYM3uRJz46Rq3el7W X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231101)(944501161)(3002001)(93006095)(93003095)(10201501046)(6055026)(6041288)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:SN1PR12MB0272; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0272; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0272; 4:/7+r1r9ZYbYh2sOkBbye8+HAtpRZxWnGOh+lzNY+R4/MMFky+OOrov1rfmSflIVYCoEqjBltwX7dd6ef2z9zH9De9yuQob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zcHcANNl0zNFraHZQXh2bifkkIkjpw1/XD1M4kEygYDzdOY2EkISWDS9VJxRMDLUuFZYcj2KJ3Ih1GDdwsH4FsKTD38gwC9aF5YdbvQPknlBjxHjk=; 24:b5QyuB+0jTagr57X8p9eIx7EaBmUIvSAl/rcwRh2d2+A79Z6NDgWIjWuDdzMfFxRLcyVqJGJVCN3Y4G1Nt936SFMZRJnkktV3Onp7tNk3/E=; 7:CCtDhVWACIBrdLOHwFZqxTXrHGSLc/hjLSOUsWairQzENtYTJJI3hpDWEbxToCaYrdPQGPvM1eP+u6xhl1Rt5+2jb30gmTzUAg7w1OT7QJAGZ8i7VAOQelSR+ukuelR9t08ztUEcJni7EZLCIAiZAuMJevLGqMnYVF67m3k1m2jU3loAoe15NUGP/3jhlJ2Ea8jLzmWCVq3E5eAEs3rPwa/kL6SRcm0acRU1pAsNS5acg+MH1wWlyfmpwap769Vz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0272; 20:GR4/joevtrga/YrsyOgmqY4ooyUYhPoOD2MmMvxdAvXljnTp74oehuJMo6ePIKsW4vDgX3dD3RO77lMayZ6WTQpRnyHUrMWbVCQtNiFgNBbe15Gyj++eKUDpp3OcrwYeCmVZ6ZpLSgOFwOZIhpAt7nRy2Mt0SosS1hsXxfIz5nOrTrSpNz6Cctq4wUa1QO0DYgDVJnIjP6NZ8SgIUO8t+MQ/8wy8BruqzrvPkGkohlRMnYsCChkYXNPTHBfU8tPZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2018 07:31:56.8613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c126b674-1515-4fd5-6b2c-08d5750f5bf9 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: SN1PR12MB0272 Cc: tiwai@suse.de, Alexander.Deucher@amd.com, lgirdwood@gmail.com, Vijendar Mukunda Subject: [alsa-devel] [PATCH 1/9] ASoC: amd: renaming pcm substream names and bytescount params 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 With in ACP, There are three I2S controllers can be configured. (I2S SP ,I2S MICSP and I2S BT).These controllers can support both playback/capture scenarios. Default enabled i2s controller instance is i2s sp instance. Renamed stream names and bytescount params as i2ssp. These changes required to distinguish with other I2S controller instance pcm substreams and bytescount params. Signed-off-by: Vijendar Mukunda Reviewed-by: Alex Deucher --- sound/soc/amd/acp-pcm-dma.c | 49 +++++++++++++++++++++++---------------------- sound/soc/amd/acp.h | 8 ++++---- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 78d7b62..fcc5b4f 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -664,7 +664,7 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) 1, 0); acp_dma_start(acp_mmio, SYSRAM_TO_ACP_CH_NUM, false); - snd_pcm_period_elapsed(irq_data->play_stream); + snd_pcm_period_elapsed(irq_data->play_i2ssp_stream); acp_reg_write((intr_flag & BIT(ACP_TO_I2S_DMA_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); @@ -687,7 +687,7 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) if ((intr_flag & BIT(ACP_TO_SYSRAM_CH_NUM)) != 0) { valid_irq = true; - snd_pcm_period_elapsed(irq_data->capture_stream); + snd_pcm_period_elapsed(irq_data->capture_i2ssp_stream); acp_reg_write((intr_flag & BIT(ACP_TO_SYSRAM_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); } @@ -745,11 +745,11 @@ static int acp_dma_open(struct snd_pcm_substream *substream) * This enablement is not required for another stream, if current * stream is not closed */ - if (!intr_data->play_stream && !intr_data->capture_stream) + if (!intr_data->play_i2ssp_stream && !intr_data->capture_i2ssp_stream) acp_reg_write(1, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - intr_data->play_stream = substream; + intr_data->play_i2ssp_stream = substream; /* For Stoney, Memory gating is disabled,i.e SRAM Banks * won't be turned off. The default state for SRAM banks is ON. * Setting SRAM bank state code skipped for STONEY platform. @@ -760,7 +760,7 @@ static int acp_dma_open(struct snd_pcm_substream *substream) bank, true); } } else { - intr_data->capture_stream = substream; + intr_data->capture_i2ssp_stream = substream; if (intr_data->asic_type != CHIP_STONEY) { for (bank = 5; bank <= 8; bank++) acp_set_sram_bank_state(intr_data->acp_mmio, @@ -860,11 +860,11 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) bytescount = acp_get_byte_count(rtd->acp_mmio, substream->stream); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - if (bytescount > rtd->renderbytescount) - bytescount = bytescount - rtd->renderbytescount; + if (bytescount > rtd->i2ssp_renderbytescount) + bytescount = bytescount - rtd->i2ssp_renderbytescount; } else { - if (bytescount > rtd->capturebytescount) - bytescount = bytescount - rtd->capturebytescount; + if (bytescount > rtd->i2ssp_capturebytescount) + bytescount = bytescount - rtd->i2ssp_capturebytescount; } pos = do_div(bytescount, buffersize); return bytes_to_frames(runtime, pos); @@ -921,8 +921,8 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) bytescount = acp_get_byte_count(rtd->acp_mmio, substream->stream); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - if (rtd->renderbytescount == 0) - rtd->renderbytescount = bytescount; + if (rtd->i2ssp_renderbytescount == 0) + rtd->i2ssp_renderbytescount = bytescount; acp_dma_start(rtd->acp_mmio, SYSRAM_TO_ACP_CH_NUM, false); while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & @@ -939,8 +939,8 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) ACP_TO_I2S_DMA_CH_NUM, true); } else { - if (rtd->capturebytescount == 0) - rtd->capturebytescount = bytescount; + if (rtd->i2ssp_capturebytescount == 0) + rtd->i2ssp_capturebytescount = bytescount; acp_dma_start(rtd->acp_mmio, I2S_TO_ACP_DMA_CH_NUM, true); } @@ -957,11 +957,11 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ret = acp_dma_stop(rtd->acp_mmio, ACP_TO_I2S_DMA_CH_NUM); - rtd->renderbytescount = 0; + rtd->i2ssp_renderbytescount = 0; } else { ret = acp_dma_stop(rtd->acp_mmio, I2S_TO_ACP_DMA_CH_NUM); - rtd->capturebytescount = 0; + rtd->i2ssp_capturebytescount = 0; } break; default: @@ -1009,7 +1009,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream) kfree(rtd); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - adata->play_stream = NULL; + adata->play_i2ssp_stream = NULL; /* For Stoney, Memory gating is disabled,i.e SRAM Banks * won't be turned off. The default state for SRAM banks is ON. * Setting SRAM bank state code skipped for STONEY platform. @@ -1021,7 +1021,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream) false); } } else { - adata->capture_stream = NULL; + adata->capture_i2ssp_stream = NULL; if (adata->asic_type != CHIP_STONEY) { for (bank = 5; bank <= 8; bank++) acp_set_sram_bank_state(adata->acp_mmio, bank, @@ -1032,7 +1032,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream) /* Disable ACP irq, when the current stream is being closed and * another stream is also not active. */ - if (!adata->play_stream && !adata->capture_stream) + if (!adata->play_i2ssp_stream && !adata->capture_i2ssp_stream) acp_reg_write(0, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); return 0; @@ -1083,8 +1083,9 @@ static int acp_audio_probe(struct platform_device *pdev) * and device doesn't generate any interrupts. */ - audio_drv_data->play_stream = NULL; - audio_drv_data->capture_stream = NULL; + audio_drv_data->play_i2ssp_stream = NULL; + audio_drv_data->capture_i2ssp_stream = NULL; + audio_drv_data->asic_type = *pdata; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); @@ -1148,7 +1149,7 @@ static int acp_pcm_resume(struct device *dev) return status; } - if (adata->play_stream && adata->play_stream->runtime) { + if (adata->play_i2ssp_stream && adata->play_i2ssp_stream->runtime) { /* For Stoney, Memory gating is disabled,i.e SRAM Banks * won't be turned off. The default state for SRAM banks is ON. * Setting SRAM bank state code skipped for STONEY platform. @@ -1159,17 +1160,17 @@ static int acp_pcm_resume(struct device *dev) true); } config_acp_dma(adata->acp_mmio, - adata->play_stream->runtime->private_data, + adata->play_i2ssp_stream->runtime->private_data, adata->asic_type); } - if (adata->capture_stream && adata->capture_stream->runtime) { + if (adata->capture_i2ssp_stream && adata->capture_i2ssp_stream->runtime) { if (adata->asic_type != CHIP_STONEY) { for (bank = 5; bank <= 8; bank++) acp_set_sram_bank_state(adata->acp_mmio, bank, true); } config_acp_dma(adata->acp_mmio, - adata->capture_stream->runtime->private_data, + adata->capture_i2ssp_stream->runtime->private_data, adata->asic_type); } acp_reg_write(1, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h index ecb4589..27803b2 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -84,14 +84,14 @@ struct audio_substream_data { u16 num_of_pages; u16 direction; uint64_t size; - u64 renderbytescount; - u64 capturebytescount; + u64 i2ssp_renderbytescount; + u64 i2ssp_capturebytescount; void __iomem *acp_mmio; }; struct audio_drv_data { - struct snd_pcm_substream *play_stream; - struct snd_pcm_substream *capture_stream; + struct snd_pcm_substream *play_i2ssp_stream; + struct snd_pcm_substream *capture_i2ssp_stream; void __iomem *acp_mmio; u32 asic_type; };