From patchwork Thu Jul 21 06:20:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 12925498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46E65C43334 for ; Thu, 21 Jul 2022 15:59:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 50812184D; Thu, 21 Jul 2022 17:58:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 50812184D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658419186; bh=tgsWalgR4XAHT4F7AAUGzpmA8W7EbMgWPyEqZNr94w4=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=oatb/jzBTsOyb7sKK6NTQ0dTJh4qdq3stZTPHmee59+kgTY0nSfoYtzFduZ1niM3v Iw5Gxu/pJisPdL3pPB9ulsdx3bfSOFXgNvA+AE61WGyXXbD+soZ7i2Vu/RknZ6roa4 AG3DfI5rn+st1arBlCCDrnDYduXAgn/OPIhW8wxE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 98A05F80527; Thu, 21 Jul 2022 17:58:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 96E86F8016D; Thu, 21 Jul 2022 08:18:02 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2050.outbound.protection.outlook.com [40.107.212.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8F65EF80166 for ; Thu, 21 Jul 2022 08:17:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8F65EF80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Nuz1yOWk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=inl80c9HRIjH+q+yTvEZihCoo2ONpTWFtGuw4daG4YMCLf9EuNCEtMa5+E74dE9faLFvs8BccBM//weroEPiXxj6Utc1jxTR22LViIdpcwduLGbEJKdh5+/N/kZvKfdOHPW5olMwQeMGgfH3WeokokAAKcU2V4fqkr5i4UgT2lvYHN1l6t6ElYHHmYugvygbEcjzEn0fZ+MXUpEbFwU7NNlc2Xy/x+tUpa8v7/Oh2rJ2CVaYTNrXBhWqHrXnUA2b2GSI3S3erMmzX66/C3p5nk2ZpAPmmQixDH6HpO2lfSQyDFqHiXzKQq6bF2owTES/dD7ccrpkocEg9VyoiH/bpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wlXfnXgIedlRjCxyBZjj2xZaKqIMr08iSBqCjCO/6L8=; b=YzGtlRuKNIknx0XbiuBF/xPmYb/caVae8MvIiNJqVU3X21M7A2qtUpGF4EpTgp9QGHGi/hPNaMux/QGcKKMzi+7OCv6QWvOTNP7sDLBJH0ghqAhOrt6GACnROVBF1YU1L3csdYl1Yv8hIwSF53fdRe5APfPvIvDse8kjYEdXVIeVeX19fgtinV42+2lSI0RG1h0SuwjK8wudlV8E1K69rTPhildiWfo+QsQu6Doi2e9vVHlg2jN25Bk1lwD1Nd4pMdOGjRzIYe0rNDSmQ9jw398bk6nQ50V6zChCCmt6BwqQvM4FphUShL0CwLCBnTDBEnm2gaSEzwECt3oeyLgCIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wlXfnXgIedlRjCxyBZjj2xZaKqIMr08iSBqCjCO/6L8=; b=Nuz1yOWkwQ+DwYYkBNADA8aCLOophCsz4B5/WvH+ttCnhAEcqXL2ixYaQrLGasc7fwfbtJRBS38UrKX5Gpn12ztj3acvmXdxZhDfMw8BPTKEVDdcFBj5i4bHPuyQDo2xRBFQwATgbLFa8OdliMDB2gLdzXMKRm1ElAqv9C8b/VU= Received: from BN7PR02CA0010.namprd02.prod.outlook.com (2603:10b6:408:20::23) by MWHPR12MB1933.namprd12.prod.outlook.com (2603:10b6:300:10b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 21 Jul 2022 06:17:49 +0000 Received: from BN8NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:408:20:cafe::f1) by BN7PR02CA0010.outlook.office365.com (2603:10b6:408:20::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14 via Frontend Transport; Thu, 21 Jul 2022 06:17:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT034.mail.protection.outlook.com (10.13.176.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 06:17:49 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 01:17:47 -0500 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Thu, 21 Jul 2022 01:17:38 -0500 From: Venkata Prasad Potturu To: , Subject: [PATCH 1/5] ASoC: amd: acp: Modify local variables name to generic Date: Thu, 21 Jul 2022 11:50:33 +0530 Message-ID: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e9cd981-038b-42a0-ceae-08da6ae0bc5d X-MS-TrafficTypeDiagnostic: MWHPR12MB1933:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dUxAbAtK6d9+mn4IHAi8wUoTs5uo4EzWOWMVLwuh39qNP4mhPhP1+uHP4y5PzFt3EJci0FAGq8SV9Zs94qmYVOUo7DaXBrfZ30Ixq5yXFejt181dGDTiDRLXcNxw9woYE/G0mz+rMABfSUFtaPT0eoDPofU7ml9Bba/Y+bq0T0HC12O6aXiUCx1n+G0xFi4di6gTIqhz8ijdcjeScKEjfmMAFLlkaEUer6kqVwXs8tHLPPgd5/f3dGozLMTblXbSjKyJ9DdB3XpcnrdfcB6Gzt2GxM09yrbex9w7ve5/AXTVoqYLTO/R/vDZK2AvJlp00AJlNHeuTzrTzcF1iaK2tAqIKlmiO9PRXG63zM/BjZOry0JM0i/mpy0gsLd6Vqa3S/foHiB3ds/nQgSEUXqVjMg7LE10AGKlebJ7J5PoIbdQSZlP9yOiCvTFZfIWRDkwTEVQSrOcacaMW+fCAlx22CkrrcZU3Ec2cb6mGb1Dpp0qiltpK5LgsuHlfQE973/Ogw9nROcEubQSWKTkF0y+UcjCiOHnLkT08yqQqLpbfLfPsrQexKmAmmzYj5KZjcn+c2mF19WJa+OeDViAlHLm506EBPrl0wXBwt41ztlRoxM2oDcdxbY1fUxQFLGmzG96aip6ToprtkZBiWMgD4PALtotweAq5Y59sYpfpfDKDOvVb34sEmaPOKeWrWaDLHSXe8R68qPl97qNfeDvU7i4zxEVR5sfsKrEuCgk95FFbpQKfpQnH+6plfYJ/thDC3kZGHN8zr/zXsKL8+WiOUXc81Zszv+RdQ27dnTLJlmAYtCrtyiQIj7WjacCszAJR/7E3sezLTco1SBbHIG9tV5yQIx2jojF7pX4+yH0WfICZlA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(39860400002)(346002)(376002)(36840700001)(40470700004)(46966006)(26005)(81166007)(36860700001)(186003)(86362001)(2616005)(83380400001)(356005)(82740400003)(36756003)(426003)(47076005)(336012)(110136005)(6666004)(7696005)(54906003)(478600001)(1076003)(70206006)(41300700001)(316002)(70586007)(5660300002)(2906002)(4326008)(8676002)(8936002)(82310400005)(40460700003)(40480700001)(41533002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 06:17:49.1048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e9cd981-038b-42a0-ceae-08da6ae0bc5d 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1933 X-Mailman-Approved-At: Thu, 21 Jul 2022 17:58:02 +0200 Cc: Sunil-kumar.Dommati@amd.com, Charles Keepax , ssabakar@amd.com, Ajit Kumar Pandey , Venkata Prasad Potturu , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Yang Yingliang , Vijendar.Mukunda@amd.com, V sujith kumar Reddy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Change local variables name to be generic in irq handler. Signed-off-by: Venkata Prasad Potturu Reviewed-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-platform.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 327e17736dbd..b1ca52274375 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -94,19 +94,19 @@ static irqreturn_t i2s_irq_handler(int irq, void *data) struct acp_resource *rsrc = adata->rsrc; struct acp_stream *stream; u16 i2s_flag = 0; - u32 val, val1, i; + u32 ext_intr_stat, ext_intr_stat1, i; if (!adata) return IRQ_NONE; if (adata->rsrc->no_of_ctrls == 2) - val1 = readl(ACP_EXTERNAL_INTR_STAT(adata, (rsrc->irqp_used - 1))); + ext_intr_stat = readl(ACP_EXTERNAL_INTR_STAT(adata, (rsrc->irqp_used - 1))); - val = readl(ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); + ext_intr_stat = readl(ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); for (i = 0; i < ACP_MAX_STREAM; i++) { stream = adata->stream[i]; - if (stream && (val & stream->irq_bit)) { + if (stream && (ext_intr_stat & stream->irq_bit)) { writel(stream->irq_bit, ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); snd_pcm_period_elapsed(stream->substream); @@ -114,7 +114,7 @@ static irqreturn_t i2s_irq_handler(int irq, void *data) break; } if (adata->rsrc->no_of_ctrls == 2) { - if (stream && (val1 & stream->irq_bit)) { + if (stream && (ext_intr_stat1 & stream->irq_bit)) { writel(stream->irq_bit, ACP_EXTERNAL_INTR_STAT(adata, (rsrc->irqp_used - 1))); snd_pcm_period_elapsed(stream->substream); From patchwork Thu Jul 21 06:20:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 12925499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC0A8C433EF for ; Thu, 21 Jul 2022 15:59:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B6124185D; Thu, 21 Jul 2022 17:59:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B6124185D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658419196; bh=JWPt0nWRAXdKwF16BPnkbjD3oJdFiUQAIzUoJN5/J20=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ZStl2QKEUfKZt4w/JqgKyaEoFLA7WWCcSVuhoIZ6ytjMHtG5wGYHRvDfFOYax8It1 rK6abfJWemr1DbQGBGNJbBIBvG+hmb6+J9/4OyHhc0pc6VD+WJzl5LEJpIaVrVQjeo 17RkzISOaLE8rHFBF9B5mJk9893yQn2zB8wywHDo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 169C8F80538; Thu, 21 Jul 2022 17:58:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6F8DCF8016D; Thu, 21 Jul 2022 08:18:13 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2075.outbound.protection.outlook.com [40.107.243.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 607C7F80166 for ; Thu, 21 Jul 2022 08:18:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 607C7F80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NRNDA4VE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hnpUX4LskkGW+Y2ZQxghqTHgymmMgZqrUFRRRs4zIQhsZ0VsYAHjwXiDKCxu/7kf9WDP9fWrgL75VwWLtw4U3+a8xDHD1I9NYWAZYVxKB6g7DsoPjrw+kY1Jja88VuYq2pnQfEsmCe8rQblpiufPi5UpkRU14m04Nl6EQoP6tltGc2sQxgKrT0omke+uamXl4ZxC/c4xA1rb6qrRxK4ipycNHes4MEjmRgMhku5SWaSOtW8agWauNv+RfRzPcywdsm1MpygZ1NoSsladUSiBLWtccqNP1ZkTT+TrKNyPcV19YW2RmRb5FUCEwNsudILxWwOxoJnPXYPdmuaY5xBbmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eThbKtCT178v2dr8J5T+2E9j8WFE2t0DDdgclW/YKac=; b=g7Pgq1oe1qgzqmu8956W5+qgK6OZZLycsCpbL7i6+wz0T88SJO8H3A7n3KTvJnQTFX4ApbaT05AtaMEi+zUCsQUuM+VPXm8DaqFmE0JOTxvYfqo0xrOOUkmsIQ9X7IobhVvLCgfOoi38JDat0F2XobRtJAOTD1bDP/ygSBegh4hwb13IYqf/jdtePbXRJSaBAY1D3MnUI1iTZmQ5QVkIjl2YPmC8YHmM/w/RHRINiUxlFMa3NE/AgfY9x02cGNACh/fNb/pYY460e6Xc99sp069E8G6Bo7CV6yclx1QgNjJWW9I8WGfL944AXCps59wMpGA6Cj72Fw8zVgsln5Kmyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eThbKtCT178v2dr8J5T+2E9j8WFE2t0DDdgclW/YKac=; b=NRNDA4VECAx8KfCl9ZlWAXwOyyUxDGehiVHVz63X8phLN391En7KRlpT9vOzsMApci17J52sKD8Zy895ygm83ooB+ELOvXGBAcafc0m0iCe7bBApB/Te+ZEhJqcofoeS7Bewco95H06wSpcJMtmv6k18J0/Tm0goQQaYqL2BdP4= Received: from BN7PR02CA0005.namprd02.prod.outlook.com (2603:10b6:408:20::18) by MN0PR12MB5713.namprd12.prod.outlook.com (2603:10b6:208:370::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Thu, 21 Jul 2022 06:18:01 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:408:20:cafe::43) by BN7PR02CA0005.outlook.office365.com (2603:10b6:408:20::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Thu, 21 Jul 2022 06:18:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 06:18:01 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 01:18:01 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 01:18:00 -0500 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Thu, 21 Jul 2022 01:17:50 -0500 From: Venkata Prasad Potturu To: , Subject: [PATCH 2/5] ASoC: amd: acp: Drop superfluous mmap callback Date: Thu, 21 Jul 2022 11:50:34 +0530 Message-ID: <20220721062043.3016985-2-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> References: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fa08c2e-adfc-40b3-f4f9-08da6ae0c3be X-MS-TrafficTypeDiagnostic: MN0PR12MB5713:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kcE9IjBKZiR6nUcI8/gAWLXvrwfYuc1KYA4LzUmzRptfVdw9MFqfRdWKvGoW60Kxw3zCR36VAeGvIWlqM/GUL0o9HGvnzrX5nGQQ5gcLPUh72DvIU6zN4MDPDjbU/yk3sB4bW5INlJORtCE3tEOc0WyxP8VaRU01+1tQCxGwetRsRkVvGTxiaR6a96KN7OqBRG4T+4p7lzaWo+8UQsCOWYfh1hC0oMEFqnm889Hg5Qy843T9XKqhWc8Xb/Lxie0lwjGesMipWTA05YqLqln/d2oNRX49ePCU5TgZFYI0JMuFZIpW5edCCURn+vgxc4sai8nkoOaUMEBQCP36hXXLuIPwtkliVKJvZIC1IZdbQ9gvv9xf4Q5M1wP8AtsSuKaF7UAAK47u7f37ax4hsjGblJ/r+3W87BdWsw5uNunIqoFtH8rpe5AMu77eTwW878Z9j43DwQOpuzn65fXCRhmFIOzsoI2LVdWCbg+gaItChsThxWS4rGuDjVznGa5c6kRmrBn+UOf55JI4jAW0z+d1P2GwMOSTiWmhnca4+uz2C8KTi1AkFC2jnC/tgrrGGsz5J1lzMQQXUfHmL8OX5sdHGirmsWlHgh8wc0dT3eHlLqJ0q4hOiKwQsD1Xp0fcZpafVo7VNCTkDQ42saHRlnmvWfFSOM7D7ORncVe9GAv17mTGXauHSGHQoyFD68RTf3wZ+uRv8ZLGqTRXRfM7J9mstsxzTLIPn26Y/LUHp8VRwpFI20gqv3x9Eq10WJ7VQpYzn/IENsn3PVC4h53Byt0fOwQO4v8vjEFdoScaEHjfxsV9T21TeTRyIE18ipLm6ZB4+6eac+VEZj2mUFora93FFA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(396003)(39860400002)(136003)(36840700001)(40470700004)(46966006)(70206006)(70586007)(8936002)(5660300002)(4326008)(8676002)(82310400005)(40480700001)(36860700001)(54906003)(40460700003)(83380400001)(2906002)(478600001)(82740400003)(86362001)(36756003)(356005)(426003)(336012)(316002)(81166007)(26005)(1076003)(2616005)(186003)(47076005)(110136005)(7696005)(41300700001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 06:18:01.4855 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa08c2e-adfc-40b3-f4f9-08da6ae0c3be 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5713 X-Mailman-Approved-At: Thu, 21 Jul 2022 17:58:02 +0200 Cc: Sunil-kumar.Dommati@amd.com, Charles Keepax , ssabakar@amd.com, Ajit Kumar Pandey , Venkata Prasad Potturu , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Yang Yingliang , Vijendar.Mukunda@amd.com, V sujith kumar Reddy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Remove mmap callback as ASoC AMD drivers just call the standard mmap handler. Signed-off-by: Venkata Prasad Potturu Reviewed-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-platform.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index b1ca52274375..10730d33c3b0 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -258,13 +258,6 @@ static int acp_dma_new(struct snd_soc_component *component, return 0; } -static int acp_dma_mmap(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - struct vm_area_struct *vma) -{ - return snd_pcm_lib_default_mmap(substream, vma); -} - static int acp_dma_close(struct snd_soc_component *component, struct snd_pcm_substream *substream) { @@ -288,7 +281,6 @@ static const struct snd_soc_component_driver acp_pcm_component = { .close = acp_dma_close, .hw_params = acp_dma_hw_params, .pointer = acp_dma_pointer, - .mmap = acp_dma_mmap, .pcm_construct = acp_dma_new, .legacy_dai_naming = 1, }; From patchwork Thu Jul 21 06:20:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 12925500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EAD4C433EF for ; Thu, 21 Jul 2022 16:00:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9C0491862; Thu, 21 Jul 2022 17:59:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C0491862 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658419211; bh=rVtMHuUJaItz0qk7v2ShuviqFACo3DDGqzcsTnW6t6k=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qsRTUoMq0TuZn5wODnCE1pBV/NNFqy4eKyckp7PF5L7Fedh/UUaAw2MWeO2P4fyWG t74wCv4vlDDBoI5uSyOHZBKF9rFyXUpxkgH/b/4VMQec7w0QXBRwocidDEeiPGEpJG QaIlqLPtwEGqXIbCUiFc0Nv53c0ZYJo9dhK9dBQQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 88453F8054A; Thu, 21 Jul 2022 17:58:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC9D5F8016D; Thu, 21 Jul 2022 08:18:30 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2F411F800BA for ; Thu, 21 Jul 2022 08:18:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2F411F800BA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="F8517QQE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuY3vDI/gArAVhNu4BdMqrsn2+I98hJ9s+DLDsYuajes8FC5H59mofsLU9cmKpeWCUjQEMyANdCviOBVaaUVZ0kEgUBwbsiM9QjgEWFv7Z4pXmCVwIjEaeKqViO7VB6ROVfuCaTHCmBPt0EOhTpWBiEbPlBMcLmMVkgHx/qHw9ieKsigTeiN8wkgsQ9Nl5ZQjTFCj3tZjy2e5jB/7UxcgYCPyM3m5CUQUTxmQB0AcP46F08Uel8MPDHN+pWEvPpdBNog6Si7gJV+Ji0BFNtc3/HjHXgPKdGxv01+CDkSRSrq4S+sZhwZ/Hhlr1VctKrccw/FB9B4J2smNmoBKX9vdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pv+D49UnsJe1APYUJaIp52MXmIO632MLsALEAe04Ddw=; b=hR2ZF8rhxUbPAsPb5WIQKWnVzZByah5JoegT3rCnTRT7928Md/X0VJRgfw0kQA6uZkth3/eqPKIuIxyGzeJzVBB60xniBAyttTlHbij5uyTbOIgenEoLQHxAOdRp/DwkDlPwnKpl7WaEh7syhro0no1WJ45cOjngMl5aue2Y8deXteCr+7nVLl46wItylFtEmuHwtq2c5VeFSNqwHSvq8X86FqtxwWGGhhdHXRDqGPWIAibXVtU9vxVToayndTaRnaI/jUWGvDjPb5vXcUbpqp5xY3bOgkuq0lsAUby1irQpl7qIGKUht/AlFCzuOQG88pppsrVBhNq1jmsnKPWlaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pv+D49UnsJe1APYUJaIp52MXmIO632MLsALEAe04Ddw=; b=F8517QQE96fpEJMqglvp5lqcO/xMQxOp1pLx/5/4QhkgRGFmRqCnBV9nzbGE03/mYGx072lVvF9qsfigtEtq0MMyX250O3dHY8dWdMvHiBMfNqwqcsWVkHXcDS2TOYJ3oDfZwfLJzbt//QfwOc4/jcwhvk4I9GkWuBcIqc2mzfw= Received: from BN0PR03CA0055.namprd03.prod.outlook.com (2603:10b6:408:e7::30) by MWHPR1201MB0253.namprd12.prod.outlook.com (2603:10b6:301:52::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15; Thu, 21 Jul 2022 06:18:18 +0000 Received: from BN8NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::ca) by BN0PR03CA0055.outlook.office365.com (2603:10b6:408:e7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.19 via Frontend Transport; Thu, 21 Jul 2022 06:18:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT037.mail.protection.outlook.com (10.13.177.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 06:18:17 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 01:18:15 -0500 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Thu, 21 Jul 2022 01:18:06 -0500 From: Venkata Prasad Potturu To: , Subject: [PATCH 3/5] ASoC: amd: acp: Initialize list to store acp_stream during pcm_open Date: Thu, 21 Jul 2022 11:50:35 +0530 Message-ID: <20220721062043.3016985-3-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> References: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f606bbc1-a3e5-43b3-39e0-08da6ae0cd39 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0253:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C0ibHbnv1gfX5fO/u5YFJLDbOGh0AFGw5cEf+3TbBsHpU3vbMV7HwwLlBFKHr/wlwkJF5xzAnCX7a2uimQTzmRej/qsx1EEQWqNJbxwvtzGAcpY4rZ3KubDasTfnxNhv5icG2wB3GJcQSvuslzlUJ1Qy+nLDviC/PX8lizspDhuTox663j4osm/YVoK8bKTKeXyNiv5sdZjQwLKt2JIS9Rl5aANGvg7wRu/UYJWT17n5mx3snLNQgt962f/U2NGJoZeYgOYxqvPPtygoQAtoOLP0xqhRMUnU+jT7jz6g7fHRtIRidwdEcAWCU6qjVNMoYVktZvLQqfClCQeoEhil6YyUYgwNVmBhsYhOYZMRfZI7rDpxvg1qzTJLxmUSEoc+Z3tKQjBF1yc9r2nISRZiBsWccHiWA4ava+Bmcntm+Hx2tEti3jBsRD22lOgemAp4V36/MKcLZIPgbbkyKcRWpVqUNTqIyFAXFKTfZXnRpUekLt0JYQBAM+qR9AlUtt/r9XZJKeDnV9PkyopQTgYbgaKpsax9Z8jKaL7YcauGJOuWFIBxnNwa6iJ5OtbGuNwsUncF8EJurJ8l1YqZ6+LEuJIi3KcZgr19ivDqKr4hxgANjLWDJQebHuQIrg2sjvRhERuSkSMqlSv/zFUNpopuJfQ/UkDEIGqPLkn+o51JqTY2Fkd4xSgIzgi21tLHN6vRqcyyTTUNXy/MCo8+ueHi4tWRqbSgRqMlOzlSVNNrjadVS4i+XsstZ2fKEGfd2PjgxLcGnYsX6gf/qBGDoGK/phL2BaN53CIXtVlLAg/3o9itcEngz1nBBYBupUbg9nVG6pQo7XYJk0kUZqYme3Hb/w== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(136003)(376002)(396003)(346002)(36840700001)(40470700004)(46966006)(82310400005)(70206006)(8936002)(81166007)(5660300002)(478600001)(40480700001)(40460700003)(8676002)(70586007)(4326008)(2906002)(36860700001)(86362001)(83380400001)(336012)(110136005)(186003)(356005)(54906003)(41300700001)(82740400003)(26005)(36756003)(316002)(2616005)(7696005)(1076003)(426003)(47076005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 06:18:17.3863 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f606bbc1-a3e5-43b3-39e0-08da6ae0cd39 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0253 X-Mailman-Approved-At: Thu, 21 Jul 2022 17:58:02 +0200 Cc: Sunil-kumar.Dommati@amd.com, Charles Keepax , ssabakar@amd.com, Ajit Kumar Pandey , Venkata Prasad Potturu , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Yang Yingliang , Vijendar.Mukunda@amd.com, V sujith kumar Reddy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Ajit Kumar Pandey We are currently allocating acp_stream during pcm_open and saving it in static array corresponds to array index calculated based on cpu dai->driver id. This approach will fail if we have single dai linked to multiple pcm device as we will have same dai->driver id or array index for multiple pcm open. Initialize new linked list stream_list to store opened pcm stream info dynamically. Signed-off-by: Ajit Kumar Pandey Signed-off-by: Venkata Prasad Potturu Reviewed-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-platform.c | 30 +++++++++++------------------- sound/soc/amd/acp/amd.h | 3 ++- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 10730d33c3b0..97198db7000e 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -104,7 +104,7 @@ static irqreturn_t i2s_irq_handler(int irq, void *data) ext_intr_stat = readl(ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); - for (i = 0; i < ACP_MAX_STREAM; i++) { + list_for_each_entry(stream, &adata->stream_list, list) { stream = adata->stream[i]; if (stream && (ext_intr_stat & stream->irq_bit)) { writel(stream->irq_bit, @@ -146,9 +146,8 @@ static void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream writel(0x01, adata->acp_base + ACPAXI2AXI_ATU_CTRL); } -static void config_acp_dma(struct acp_dev_data *adata, int cpu_id, int size) +static void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream, int size) { - struct acp_stream *stream = adata->stream[cpu_id]; struct snd_pcm_substream *substream = stream->substream; struct acp_resource *rsrc = adata->rsrc; dma_addr_t addr = substream->dma_buffer.addr; @@ -174,13 +173,10 @@ static void config_acp_dma(struct acp_dev_data *adata, int cpu_id, int size) static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { - struct snd_soc_pcm_runtime *soc_runtime = asoc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(soc_runtime, 0); struct snd_pcm_runtime *runtime = substream->runtime; struct device *dev = component->dev; struct acp_dev_data *adata = dev_get_drvdata(dev); struct acp_stream *stream; - int stream_id = cpu_dai->driver->id * 2 + substream->stream; int ret; stream = kzalloc(sizeof(*stream), GFP_KERNEL); @@ -188,7 +184,8 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs return -ENOMEM; stream->substream = substream; - adata->stream[stream_id] = stream; + + list_add_tail(&stream->list, &adata->stream_list); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) runtime->hw = acp_pcm_hardware_playback; @@ -212,16 +209,13 @@ static int acp_dma_hw_params(struct snd_soc_component *component, struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { - struct snd_soc_pcm_runtime *soc_runtime = asoc_substream_to_rtd(substream); struct acp_dev_data *adata = snd_soc_component_get_drvdata(component); - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(soc_runtime, 0); struct acp_stream *stream = substream->runtime->private_data; - int stream_id = cpu_dai->driver->id * 2 + substream->stream; u64 size = params_buffer_bytes(params); /* Configure ACP DMA block with params */ config_pte_for_stream(adata, stream); - config_acp_dma(adata, stream_id, size); + config_acp_dma(adata, stream, size); return 0; } @@ -261,16 +255,11 @@ static int acp_dma_new(struct snd_soc_component *component, static int acp_dma_close(struct snd_soc_component *component, struct snd_pcm_substream *substream) { - struct snd_soc_pcm_runtime *soc_runtime = asoc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(soc_runtime, 0); - struct device *dev = component->dev; - struct acp_dev_data *adata = dev_get_drvdata(dev); - struct acp_stream *stream; - int stream_id = cpu_dai->driver->id * 2 + substream->stream; + struct acp_stream *stream = substream->runtime->private_data; - stream = adata->stream[stream_id]; + /* Remove entry from list */ + list_del(&stream->list); kfree(stream); - adata->stream[stream_id] = NULL; return 0; } @@ -305,6 +294,9 @@ int acp_platform_register(struct device *dev) dev_err(dev, "Fail to register acp i2s component\n"); return status; } + + INIT_LIST_HEAD(&adata->stream_list); + return 0; } EXPORT_SYMBOL_NS_GPL(acp_platform_register, SND_SOC_ACP_COMMON); diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index af9603724a68..148a9ab6206d 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -91,6 +91,7 @@ struct acp_chip_info { }; struct acp_stream { + struct list_head list; struct snd_pcm_substream *substream; int irq_bit; int dai_id; @@ -123,7 +124,7 @@ struct acp_dev_data { struct snd_soc_dai_driver *dai_driver; int num_dai; - struct acp_stream *stream[ACP_MAX_STREAM]; + struct list_head stream_list; struct snd_soc_acpi_mach *machines; struct platform_device *mach_dev; From patchwork Thu Jul 21 06:20:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 12925501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15A40C43334 for ; Thu, 21 Jul 2022 16:00:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 42E951867; Thu, 21 Jul 2022 17:59:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42E951867 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658419232; bh=LjcLn/GLQi/FPw7F1OyY69ydzk1a6cPYJdd21p8l17Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rd30unHhi7e74bu1UVYgZML5jb50LP+23bv0qLiuu3HrOqRMIYy2OfIV1t8xscpKv RNAYY2+ONND10Y5Vy5A5AaPjsxj9SQdhpIKcwVYJ9r6FVY4t2H7RHzxBX1uL/Zf4De 8/thmqVw6NvNimNZfz2V9T4XfRQfMDs2u0SataCc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1D287F80559; Thu, 21 Jul 2022 17:58:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 675E0F8016D; Thu, 21 Jul 2022 08:18:40 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2080.outbound.protection.outlook.com [40.107.95.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9B53EF80166 for ; Thu, 21 Jul 2022 08:18:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9B53EF80166 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Z9VZmSeX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lYuRY99WDwqgIxaFSsoZR/T+y9HuLCXSP7awsnPd9ct4c0Kvn6tNONo4NhJyAbDJa/4YkefM3mALazes6AnJApXDzHGEXR3G5TfYKhmrvBIZQMWiEkZeXHeM8kjk8qjFqg+1gdVzRfXt5tu6mA/GP0TqCdRR+erVyfSWUzVcXn3KbmUnLyeAeSQjthOQKa1geOSJYh1/RuvWymdj5aS9jQzX3G3HevO2F0soDaYLVBbdV44AsqzfaRsCszdlEQUnDLornV3IASMNnBlcSipfk5c61JrYeCO6mlkBDuU1oukt8xWHQq+l42Qlkuy3wTPKVe8m8HWrBPEBYEvEuREMSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=53UPKWwddkq2HDXrU43x19XlSwhYok/Q3gxki6j0hhc=; b=f+uxY9sqQFyRND3AhzVZkvJy0a40rJuwWTxaT8naFtqYZYqH44ITVDSMNtD37TPqTnMgKh6YsiMH5Umm7Y9ctSqEC/kzX1KT/TyxtLAzZlBW9Xslt/6iiRGNhBFTKnV+o9Z47M1ZMbdsciegoBFakFggg1P976+phmb7b/QK3Agn5tY3by4oHh66qjNUWlfU3nSoAtXYaZAm3utGomxDL543V6fiSV6azNs1n0hX9aaItXA9zJmjiMgzIGSMvl0iJ5Pj2bXRyvugIV3jdtOay/fS+N+aoDQ8nNTpplxN2kHBJu57FA4a0i9KESvq9KjhiRwgmJRfs+FR6P20iQm6Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=53UPKWwddkq2HDXrU43x19XlSwhYok/Q3gxki6j0hhc=; b=Z9VZmSeXpLPbKutGf7WnPp00LTxblvIk++SMj6FX63xaG/iwxEQvOOmCIY8L5Bugh+6uS9XRddRSIFzhzn2+eKDHpaYuRxuNxqBomTP5DwSFP9AsjutLbRgaocm1FjMYzfVH8J3BMvbot769+hPUte0e/kc5/icnoHtNYVdqrUQ= Received: from BN7PR02CA0019.namprd02.prod.outlook.com (2603:10b6:408:20::32) by BL1PR12MB5827.namprd12.prod.outlook.com (2603:10b6:208:396::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Thu, 21 Jul 2022 06:18:28 +0000 Received: from BN8NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:408:20:cafe::48) by BN7PR02CA0019.outlook.office365.com (2603:10b6:408:20::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25 via Frontend Transport; Thu, 21 Jul 2022 06:18:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT034.mail.protection.outlook.com (10.13.176.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 06:18:28 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 01:18:27 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 20 Jul 2022 23:18:27 -0700 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Thu, 21 Jul 2022 01:18:18 -0500 From: Venkata Prasad Potturu To: , Subject: [PATCH 4/5] ASoC: amd: acp: Modify const resource struct variable to generic Date: Thu, 21 Jul 2022 11:50:36 +0530 Message-ID: <20220721062043.3016985-4-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> References: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe8301a9-1ee1-4eb3-1479-08da6ae0d3b4 X-MS-TrafficTypeDiagnostic: BL1PR12MB5827:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q5L9Z5/Mrj7J0T3tfbj+327wSqiwpOga5DbrojdxYt1qWRtEHJG0xEG8YpJrX51k2tfDvBZYU26NqhFybSCPdy/zvfmxs4WvEywwjIdHoPvDLeCijORC5nwrhLi9f7BAI71wOXvQ15bweAkFST4PCHVVqnd9lypYIbLEjIzZ2BiqvxPGuniK+TlnuaPJs0DrrPOFYrl+gR8nZ3bT/HC4GLNvhx80kroF/JODbBKB1Y64Wf8gYVwjgAzNFIa8IxFCiZR0InypAfD9fdRLtuaWxCd2WRE0uLcUz5TslzgnY+Ki9Hd3X2a9GnNpRJtS8lA3yZ2XuE36+Rzt2Y7OU4vCwKFJWuXc/BUtCVupTxSCXnGNTerDH9higC7KpgjPVj8DJ+EaaBEfSCYQ4pSaBBrpSqnnDbswnkSro57dktXF99q+7/tR0GeOXZhE0JYAevjUk5awXTsDidTIM68j7/GdKW/6zWGEpENZBmoEAQqq3gBaEkl8+yP9yjmWbTOVLxNJnVMW5k50t7kJp7yYgpHdQTzgTZPDQcFq0IKV7DjJekgnXL8oJd6phGG+CD1ngB63QTiz/NpBOa5qZJk/yW0L9bYtMen1XCZ9k1cjNR79IKxZqTJvitNxAkV0HSruFGAjdbvyQRs0OTejEVoymBiEhX7M0vaJkaguz/MarfQ4mZBLDXUbrTk4kwBb5KKueYfpJLSh4Znn20/flDRP3AzgUMMoUmH2m2AICWSgkfh3m70Vu4Q4Jj4iRjM/rTk5QRbmzAgR7Yg/lT6oVi4ukgf/yTHEUFozU2ICcpVyJeagHfnt32z9sXZQG9/4YW1MxpdcKb193YU59JwZPZfdQDSdUJyRC5pbZ2vu2/4a+zy56eA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(396003)(376002)(346002)(39860400002)(36840700001)(46966006)(40470700004)(36756003)(5660300002)(40480700001)(8936002)(2616005)(2906002)(82310400005)(86362001)(40460700003)(8676002)(70586007)(70206006)(1076003)(82740400003)(478600001)(426003)(186003)(41300700001)(4326008)(26005)(54906003)(356005)(110136005)(6666004)(316002)(7696005)(336012)(36860700001)(83380400001)(81166007)(47076005)(41533002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 06:18:28.2578 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe8301a9-1ee1-4eb3-1479-08da6ae0d3b4 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5827 X-Mailman-Approved-At: Thu, 21 Jul 2022 17:58:02 +0200 Cc: Sunil-kumar.Dommati@amd.com, ssabakar@amd.com, Ajit Kumar Pandey , Venkata Prasad Potturu , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Vijendar.Mukunda@amd.com, V sujith kumar Reddy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Change platform specific constant resource structure variable to generic name. Signed-off-by: Venkata Prasad Potturu Reviewed-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-pci.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index c03bcd31fc95..34d75603eea1 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -29,7 +29,7 @@ static struct platform_device *dmic_dev; static struct platform_device *pdev; -static const struct resource acp3x_res[] = { +static const struct resource acp_res[] = { { .start = 0, .end = ACP3x_REG_END - ACP3x_REG_START, @@ -75,16 +75,15 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id pci_set_master(pci); + res_acp = acp_res; + num_res = ARRAY_SIZE(acp_res); + switch (pci->revision) { case 0x01: - res_acp = acp3x_res; - num_res = ARRAY_SIZE(acp3x_res); chip->name = "acp_asoc_renoir"; chip->acp_rev = ACP3X_DEV; break; case 0x6f: - res_acp = acp3x_res; - num_res = ARRAY_SIZE(acp3x_res); chip->name = "acp_asoc_rembrandt"; chip->acp_rev = ACP6X_DEV; break; From patchwork Thu Jul 21 06:20:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkata Prasad Potturu X-Patchwork-Id: 12925502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CDEC3CCA487 for ; Thu, 21 Jul 2022 16:00:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D6E6D184C; Thu, 21 Jul 2022 17:59:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D6E6D184C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658419244; bh=UEcHR1TCSKxAfSxDZHtU8y4mo4hYD/kojzGnY7O2wME=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CGYNgRQkU+dfVvk+zjgArGINd8J9DUqhWCFWTSgfPwPxZDPjG3fFP78lCfbcl2wzQ U0ESzrA2LTLiKxhRLB4G1nJneTACYsvyyzsjPm3s4DFGJAam3DAXEV2U7vYwGgCkHc ETYolraXmpx9Uii1pgKRuxWt01KOYSR7uI5a2AZw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A8D07F8055A; Thu, 21 Jul 2022 17:58:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1216F8016D; Thu, 21 Jul 2022 08:18:52 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2060.outbound.protection.outlook.com [40.107.101.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DBDBDF800BA for ; Thu, 21 Jul 2022 08:18:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DBDBDF800BA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tLRoFjKV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YNthUB9QLiWTF590gnacxO970rBq1fwQ0dhO0iZ5itcQExTm//mcI+ItyIG++CVkrxz1qkNiP6VJ9M6G3QbXakC6C24wTR9xrcJKH/dStrKFc1ihiiNWRkixn3GIE+v/8IRW2B01AIX7HNdvfw2Xgs6HlGgBgN9CL+kOENYZEmMAVdHDt/NqT66chdcD40xzJlyb2kg4S2v8ab4Nx5P0y5Y+KbTwWlSdFBRZnJaFdDI7YWk99yMBhmAkyfclA6kTihpT2E/z+Hyl5PO+Y7jVlblTeTkQ/s/a+tyaEHCe50mx3mYlmOIuH+QIDU3S6rsRH+I/kvcWGXyXCVFddJ+b3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/p+rk0BGYC0DgF53jOHSj9wrk5wufS85RPVfdOhWV7k=; b=EbssZ/WUIUzvmdn1qAHDEoomRDY+bp5wzhiTK6Fme5PiJBFx1/MEvtpgTCTW1DkOUrmUNt4jDKXmFjuQcvNYcgCH6kcrjIPymSr7N5texUtfKZH6+2rX2i+4RRK5sYyYjpdVRZgQRq5Np4l2l5qpan3dJhmrDFRscNLk7g14B8jggxtP4cEn4ssCTh1OgPZ/GaAB4tJtQfu0ITf7GW8BcFw+sEXbfGl8Pk6Z5sFQUjE3swp+n383xBA+wLZXQYJa5cY4ZmjavWMcMRjDwpK5DE88MeAVBkAiqoU3Fwv/EP7YJc5Z61tam3X1Naw+hwqNGdXbN85IVFWB/idlUWX73g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/p+rk0BGYC0DgF53jOHSj9wrk5wufS85RPVfdOhWV7k=; b=tLRoFjKVwgtXzTxGFIQkoW7Zn/0nSukWhHKlwi5WTDFyIMHjdx2xGyWINHx2gOjT+ueVuU2d/yC5rH0gDWpNp/u1OxoKgwJJv3jK/h0YePWN+rp2sq82kLsbaVVShVE96p43XZklVPvVpDe6lr6ke9EWgtVCuXtwUjMxJXuEbg8= Received: from BN0PR08CA0029.namprd08.prod.outlook.com (2603:10b6:408:142::15) by MN0PR12MB6174.namprd12.prod.outlook.com (2603:10b6:208:3c5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Thu, 21 Jul 2022 06:18:40 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:142:cafe::ce) by BN0PR08CA0029.outlook.office365.com (2603:10b6:408:142::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18 via Frontend Transport; Thu, 21 Jul 2022 06:18:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 06:18:39 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 01:18:39 -0500 Received: from amd-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Thu, 21 Jul 2022 01:18:30 -0500 From: Venkata Prasad Potturu To: , Subject: [PATCH 5/5] ASoC: amd: acp: Add error handling cases Date: Thu, 21 Jul 2022 11:50:37 +0530 Message-ID: <20220721062043.3016985-5-venkataprasad.potturu@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> References: <20220721062043.3016985-1-venkataprasad.potturu@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db7fa325-035d-4875-a34c-08da6ae0da94 X-MS-TrafficTypeDiagnostic: MN0PR12MB6174:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ygj2I0UUC6Ok80adDwG2nUytn8nFBVJwiwJHlM+0xx5QiBbUU0moQpzizM91ehiXjdm8xpAHza72pPTvaE59llRJXFlNlVz5zabxKJINCIN2Bih9wQvlYVDgKqzt7MCo7wtioWXr8Y8VJVprRmQYPZRXAJ+mS0T4Ymuxn66ZDv/WB6RS7aduFVTSYT1PN5DyDV6SviJJGU2kvepL/auqPMMTeCpQOHuskBnmrdskpuHDJuFdF8N7IBiqkZ9LJeffHJwCAnVphbVBwq8M7+Qb2LCPKhQQ/1BI9qASVJjLRmk+l1qg1Ddd/LGfWK2NykJ57Jza0Q5rofRhoEOwmI4pvyuqIBRAUUNO6of4qRdsrHM701a+ZmrvBnyMb9Oo0Dzph6k03dKWbSr0fsk8NScsbstHJxOy6DfmKUfGj6QYheTrbaBR1YZ4KNZ1DsJlelp9UmTkzyzRv1PQxQMw20AN6W6UoZyUQgGOaVZjtez6O06yQ52yV2zrYnmFlitqung+8up7qO+gRqphonahY1OK28Hfyg8GUT6eA/XUkzar/vfBQqrdAeZLZPf8SdDL42aZbsewRKu6k9o9TDnuQCq366lzGeRjoQk7lFjYdTTjwGyqmXkmJ5ca0NRHlKlc0JVMRtpC35QxJxiCgD5om8uuh/mz1jiMJqoA/euVZOlirfaOksYAJa7J6Sgh+rx7RuOcPgJU2CJjiPPPGkv1w4vYQJ2dLb68D4r9EMBnv2kEa7VXkBmrHqiKybqEl7FLCLFLcIXQuLYoMFKORN3N9GIgon6cEMHup+NdqSYkEHd19UQQp5EzpyEYtyqu3yRqG5f6QNS33/Z0X3sqG9ukYdQXuA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(39860400002)(346002)(376002)(46966006)(36840700001)(40470700004)(54906003)(110136005)(40460700003)(26005)(316002)(83380400001)(70206006)(70586007)(47076005)(336012)(8676002)(36860700001)(426003)(36756003)(86362001)(2906002)(82310400005)(40480700001)(186003)(2616005)(41300700001)(8936002)(7696005)(81166007)(4326008)(1076003)(5660300002)(356005)(82740400003)(478600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 06:18:39.8114 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db7fa325-035d-4875-a34c-08da6ae0da94 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6174 X-Mailman-Approved-At: Thu, 21 Jul 2022 17:58:02 +0200 Cc: Sunil-kumar.Dommati@amd.com, ssabakar@amd.com, Ajit Kumar Pandey , Venkata Prasad Potturu , open list , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Liam Girdwood , Vijendar.Mukunda@amd.com, V sujith kumar Reddy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" Add error handling in acp pci driver probe function. Signed-off-by: Venkata Prasad Potturu Reviewed-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-pci.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index 34d75603eea1..2c8e960cc9a6 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -70,7 +70,8 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id ret = pci_request_regions(pci, "AMD ACP3x audio"); if (ret < 0) { dev_err(&pci->dev, "pci_request_regions failed\n"); - return -ENOMEM; + ret = -ENOMEM; + goto disable_pci; } pci_set_master(pci); @@ -89,22 +90,29 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id break; default: dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision); - return -EINVAL; + ret = -EINVAL; + goto release_regions; } dmic_dev = platform_device_register_data(dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); if (IS_ERR(dmic_dev)) { dev_err(dev, "failed to create DMIC device\n"); - return PTR_ERR(dmic_dev); + ret = PTR_ERR(dmic_dev); + goto release_regions; } addr = pci_resource_start(pci, 0); chip->base = devm_ioremap(&pci->dev, addr, pci_resource_len(pci, 0)); + if (!chip->base) { + ret = -ENOMEM; + goto release_regions; + } res = devm_kzalloc(&pci->dev, sizeof(struct resource) * num_res, GFP_KERNEL); if (!res) { platform_device_unregister(dmic_dev); - return -ENOMEM; + ret = -ENOMEM; + goto release_regions; } for (i = 0; i < num_res; i++, res_acp++) { @@ -133,8 +141,16 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id dev_err(&pci->dev, "cannot register %s device\n", pdevinfo.name); platform_device_unregister(dmic_dev); ret = PTR_ERR(pdev); + goto release_regions; } + return ret; + +release_regions: + pci_release_regions(pci); +disable_pci: + pci_disable_device(pci); + return ret; };