From patchwork Thu Jun 22 15:23:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694923 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 8355DEB64D8 for ; Thu, 22 Jun 2023 15:26:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5D76B84B; Thu, 22 Jun 2023 17:25:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5D76B84B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447570; bh=06gW/+7f5AX/nNLyYfVUa3ByQYmK/1veHOVwh9nurfM=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YMaBx5EXN2o/MofMKNwA24LRQQXahQtzKx02joPXD2tdg7ng38KJF6jtTVcRxFxkR RaISdb7jRs/U8yUQ/tirGs21RYE64Bd3OOwOj9cTJu7wLfmI1xbppUo3qDFWFAF41J aLVArYKW995MHx4bnhG9S/xy8qPryffVUFycPko4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 650CEF8055A; Thu, 22 Jun 2023 17:24:40 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D82D3F80557; Thu, 22 Jun 2023 17:24:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2D97BF80549; Thu, 22 Jun 2023 17:24:37 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::60c]) (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 D14A6F80163 for ; Thu, 22 Jun 2023 17:24:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D14A6F80163 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=tNEesaUz ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jmKXd5qjNjfOYyaSCjJmr45XOhg9Hi3eWuhYC29qt5fl1AJ6iQlzt63RpFQ4hHRZPnxPGwlR77noVT1p6teb3T+9iTuO+1BmUr5u1xou34MQT73XXKxY0zAs6JdpBUxU6pBkVS3yyqPyDFpRKFT8Tz70523hO8rLtz/WIGOzOQc1EW0R/14PpLc/M8t/1BnTdqWCHbPwV8E6M52cJUif8m/jKfxzAMU4uBMQZMRlif7oXIcB+cz5Yfw/KpJS0vCR/E65cLOwe+sQwZi/+PnpNq6EREtiwRCd6lnQXkoHooYa8hjgykBMngcBZhuL9DiNMdJtGECIYJfohM0KJq1gHQ== 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=ZvE7+sHAx7gFFMEXYrdJmw8Y+MxDll2Zrp6Zoj6FHjM=; b=doxce6imwRpfvvNSauUCto86qdA9B/JzfpizRl+AKD/99deHTW/zg6aR94+KI8AAIM7erIc1xDY/WNk5039WYiXOVzjJzACfYWAK6GVtnxmtSPDcKtxqqp6iAgEBW4Qosy9yIcwiVTgXziOxYiaT3cXbXdiCtFC6W5+yyA+tuKAn5n/UErZKCpwRcjXgmB2MiF6DpjIn59KgCCfWI73hov40yBHeyF98oon/A8qGaGLvlI94+Op3wATMdLjR5NPl2P0naMOPRNnbk5Ezd1tFz+1m8tiySdaJ9Sdyp2+dzYm5nimr9tL8WmdZFAknmjtLyObCxFp4bv6yd5K7DO9elg== 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=ZvE7+sHAx7gFFMEXYrdJmw8Y+MxDll2Zrp6Zoj6FHjM=; b=tNEesaUzP8+/zpd+LAi6FMPrl/Hbf3g++gpnLN/CPtGJQFHRxUR/RM/JmWdACsI+oHDxl17tg+WS3hA1/P5mquvlMFoGN/etg25USEMsehCw9S00kJFTMrWEIs9E6Q/hiBqdNVEg5NWgptUxrCbtA25nB5yh+b+W58jSiWX3q/Y= Received: from MW3PR06CA0009.namprd06.prod.outlook.com (2603:10b6:303:2a::14) by DS7PR12MB6287.namprd12.prod.outlook.com (2603:10b6:8:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 22 Jun 2023 15:24:26 +0000 Received: from MWH0EPF000971E3.namprd02.prod.outlook.com (2603:10b6:303:2a:cafe::fe) by MW3PR06CA0009.outlook.office365.com (2603:10b6:303:2a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:24:26 +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 MWH0EPF000971E3.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.19 via Frontend Transport; Thu, 22 Jun 2023 15:24:25 +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.2507.23; Thu, 22 Jun 2023 10:24:25 -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.2507.23; Thu, 22 Jun 2023 10:24:24 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:24:21 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6ni?= =?utf-8?q?g?= , "open list" Subject: [PATCH 01/11] ASoC: amd: acp: remove acp poweroff function Date: Thu, 22 Jun 2023 20:53:39 +0530 Message-ID: <20230622152406.3709231-2-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E3:EE_|DS7PR12MB6287:EE_ X-MS-Office365-Filtering-Correlation-Id: 8eca2618-32fa-4c10-1a87-08db7334c3a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e3qUePiNR8Ra8HXL5HEyspS96cXAuTX0KqxO/DbICt5TMTtq/V3+vQUwFsPTkVCqXSbQhq7VFyNnuh1Q7VToT4x0aA0bmotqYZIUTtBMYbZ/NgF6k2AMSkGmaO4XbEnxjj9Vv+KwFKTJJU39jMiC9LGmT0Q/DsrVXM4rq44jgGGow9McF6SqePOqiIoDxNX/k9BFfonlnsw0TA37euk/qv7C1RDQ2B4jMBZWGpdVRTf006jRLgDsPFNFVRYNFP8GKDOPAy5V+Vp4CEc0gAaBU++mPuGlYJcj8LLOkInq5OYDftRqBbVJ625gulBVl0dzmqseD1Dq5VnVRRK/f3zDGE8UrE5XjnJlomxO3ICJHCISyODdEDTyKKhnDLX72k31Av4QBF4TsCKjtnHwguVpSbm4fBXi8cJu/tnmnGsPkqox2/7z+xvSmNDYo5ikPf5F9rf+gxec9u1mNIlPwD4d9cyxEeV4nvCOUQWBf4eZRrGv+nAyAnsWJKE0bdmdHg0MGUiAOQ+6+xYCcav1+4g9I91c0my8TYo6/YP8qUlaR1c3aw4d6szK2+y5ePQ4eyjziANVJcuBWBgkQEpeOqBTECu0U5xnD0CHH+uSOYjJJNpRcfWvAwg4oqVPbP26a9XUYxOsM+C3nj26dbv/+ufiSBHbDlkUxGNOl8woUVI/F3hGV+jmgUgXmxXTYDf4+SQ/wNBgosl56Y/urINNDNbuIddGlz5c/WXnYJgSeENEE7KMkNVyBpzhxSeZLi/7MmM7EnAzawz6znHUXwRtmgHvcQ== 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:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(26005)(2906002)(8676002)(8936002)(86362001)(70206006)(316002)(4326008)(70586007)(478600001)(41300700001)(54906003)(110136005)(5660300002)(82740400003)(82310400005)(83380400001)(6666004)(7696005)(36860700001)(47076005)(336012)(426003)(2616005)(40460700003)(186003)(81166007)(356005)(1076003)(36756003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:24:25.9521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8eca2618-32fa-4c10-1a87-08db7334c3a5 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: MWH0EPF000971E3.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6287 Message-ID-Hash: IHTE3W35X3LHPONYSRMJ54FS6ZDPI2AZ X-Message-ID-Hash: IHTE3W35X3LHPONYSRMJ54FS6ZDPI2AZ X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: BIOS invokes ACP Power off sequence based on ACP device state. Remove redundant code from ACP PCI driver for ACP Power off sequence. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-rembrandt.c | 25 ------------------------- sound/soc/amd/acp/acp-renoir.c | 17 ----------------- 2 files changed, 42 deletions(-) diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index 5c455cc04113..1b997837c7d8 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -204,23 +204,6 @@ static int acp6x_power_on(void __iomem *base) return -ETIMEDOUT; } -static int acp6x_power_off(void __iomem *base) -{ - u32 val; - int timeout; - - writel(ACP_PGFSM_CNTL_POWER_OFF_MASK, - base + ACP6X_PGFSM_CONTROL); - timeout = 0; - while (++timeout < 500) { - val = readl(base + ACP6X_PGFSM_STATUS); - if ((val & ACP_PGFSM_STATUS_MASK) == ACP_POWERED_OFF) - return 0; - udelay(1); - } - return -ETIMEDOUT; -} - static int acp6x_reset(void __iomem *base) { u32 val; @@ -299,14 +282,6 @@ static int rmb_acp_deinit(void __iomem *base) } writel(0x00, base + ACP_CONTROL); - - /* power off */ - ret = acp6x_power_off(base); - if (ret) { - pr_err("ACP power off failed\n"); - return ret; - } - return 0; } diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index b3cbc7f19ec5..f188365fe214 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -169,17 +169,6 @@ static int acp3x_power_on(void __iomem *base) return readl_poll_timeout(base + ACP_PGFSM_STATUS, val, !val, DELAY_US, ACP_TIMEOUT); } -static int acp3x_power_off(void __iomem *base) -{ - u32 val; - - writel(ACP_PWR_OFF_MASK, base + ACP_PGFSM_CONTROL); - - return readl_poll_timeout(base + ACP_PGFSM_STATUS, val, - (val & ACP_PGFSM_STAT_MASK) == ACP_POWERED_OFF, - DELAY_US, ACP_TIMEOUT); -} - static int acp3x_reset(void __iomem *base) { u32 val; @@ -246,12 +235,6 @@ static int rn_acp_deinit(void __iomem *base) return ret; writel(0x00, base + ACP_CONTROL); - - /* power off */ - ret = acp3x_power_off(base); - if (ret) - return ret; - return 0; } static int renoir_audio_probe(struct platform_device *pdev) From patchwork Thu Jun 22 15:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694922 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 E2752EB64D8 for ; Thu, 22 Jun 2023 15:26:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 23F80832; Thu, 22 Jun 2023 17:25:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 23F80832 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447594; bh=06gW/+7f5AX/nNLyYfVUa3ByQYmK/1veHOVwh9nurfM=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VvDFUTncUwM7TPecOzPJl8na4S2iAUGXQTOtfnTd9yuxu4DdbN9Ll1n1UuUSTTxwz e/eAbNCYD0ZXLIN4bwGMLr+AypO6kFJ30EzOXW9DbKCRrwAKUhSYFAptZ/iuGVxNbh Nx9bgh158gV9ZMUlaIr42zb54T4iF2rcUYcrbTgo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C79B2F80571; Thu, 22 Jun 2023 17:25:08 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 37465F80571; Thu, 22 Jun 2023 17:25:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D1B1F8055C; Thu, 22 Jun 2023 17:25:03 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2062f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::62f]) (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 798EDF80535 for ; Thu, 22 Jun 2023 17:24:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 798EDF80535 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=H3c0bvLR ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDZTZ+JRXxFEVO1/bFzL71Eli0T/WiYkUM8QiO9nvoq7HJGM03hlfZla7GEjWk/Xf/mPnHFMcvdXCwV8bHRhK9lfy1vX1hnK0mssYBZ8CR2PjC+PiH+jKkhlFw2Er4grPiaamOh/wEZtYQItqLZQ734LMbexT1rFqN4dJyp7YfQ1hdca5QcAekUoIe+BlY0Cwx9KyGK4hHvbNPyyK3asFA+knVzXYRC3R3TFUaarlW+pyPoxbs/fxGglMxxHqBH50gk9kdardWD+xnc5VlAUtEXHFikuPD9+hjN9YLnE+bmc4urUVe5RefDbyXcYJ0Tpds1idcVgLHC+FvXAtRCUyw== 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=ZvE7+sHAx7gFFMEXYrdJmw8Y+MxDll2Zrp6Zoj6FHjM=; b=jqWK/Ls6hlDRc8E9vzKkuD5K/RdHHaYIrhk0V6//rQrymgOLuHJYjgv8WymjvqNW/GEhVsCYLxbJanCfiT31wQ0GU0JMyGTYFoWpcp3MZaE4G9oC36v5LJsdn6O8k2iNUHa4Qda+nk8s9+wHpufKSEQkBx4c7am0GJkKIesgH6eA0Vf+NTJHw7y4kN3WHq9KEoanOXLhol8i0T7dfqZLUQpHMj81qtE97wRDXHfgYZAKmff0v+Ii6lQCHj+7cPowRuDKRsZ8zB+iqDF0WEamve4O/UHP6ADjviBng1x+1IwVwaQ2a6ZqMq9vrKDq6HJB/fvS6ldGmDKg0+kqEomefw== 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=ZvE7+sHAx7gFFMEXYrdJmw8Y+MxDll2Zrp6Zoj6FHjM=; b=H3c0bvLRUuTDtqa/2GU0BQ2LlkbbqlLGcpRnN/9SWVcrLV2DsL7JCBmdvYUhoVpmRaF5O5Dzz+K/h4vsRZGOtN/hwVBGUiwq1g2r0y10BOy3PNTXmmoCq9UVFKW6OrSglSWXK6Qx2FEesXnXbVFVvD1Y4SrwnSaVh4c4dpBI7+U= Received: from BYAPR08CA0055.namprd08.prod.outlook.com (2603:10b6:a03:117::32) by MN0PR12MB5929.namprd12.prod.outlook.com (2603:10b6:208:37c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 22 Jun 2023 15:24:54 +0000 Received: from MWH0EPF000971E6.namprd02.prod.outlook.com (2603:10b6:a03:117:cafe::d8) by BYAPR08CA0055.outlook.office365.com (2603:10b6:a03:117::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:24:54 +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 MWH0EPF000971E6.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.19 via Frontend Transport; Thu, 22 Jun 2023 15:24:54 +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.2507.23; Thu, 22 Jun 2023 10:24:52 -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.2507.23; Thu, 22 Jun 2023 08:24:51 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:24:48 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6ni?= =?utf-8?q?g?= , "open list" Subject: [PATCH 02/12] ASoC: amd: acp: remove acp poweroff function Date: Thu, 22 Jun 2023 20:53:41 +0530 Message-ID: <20230622152406.3709231-4-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E6:EE_|MN0PR12MB5929:EE_ X-MS-Office365-Filtering-Correlation-Id: 114562e0-6ee2-4b15-e38f-08db7334d46e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V180SkfO6GvLM/lOTYUokf8gDHHbMOjyJ4+6Z//Zyg2Mzti3PciHQ7vbJGGWRupCkV/v9b8viSdg/BGKF8zPiD0gYCQqOb5mg11AqSreXPQZ2kiREvw8PEGKXYfbjk5Kg9T5SNyHQjyYUOVcbvnbxhCLMWck4p9HSL8DHiohnmantGEHCGiZ+dUySGfiHVZuoTs/fOBFiTHCzSmxC0ZE68+TXp0O4eNyk9RejJ27GLwRiTqqf8rEuej+rl0FO+SY9RKYZc9N9L9F2eh7B1UVUzOxPdrrtHZKcj17vv7UV0CbEJd9gkWVRhtwr5LF7KO+iA1aJV9DDrbDIUiSbePuiD5bQBGlDBBK2GshAl5vuwfVVFWl8rLff0sMCqZMMtCeKr1l3j87Q65UP+yiVB4sytX+SFuw+iKYap/mkWFwZyCfJZByOwkJhfA2Sde/wgTl4ScZrKfsQCAeB9Kkv7aj8LpzLAr7mkfC6r+VP5ly3DhHj3q1iDpysCDkZLMVbkdTBEoiJG0IUDXIsC/fk+1amCqvuSN23o2Gjtjgjw8N+8WqtEKyVdgyReUSCw0tIHkrpPpVJy9ngIWEaxPCIZ670FPMNUCrIwOfsHQo5eQRmt6jvWXU7VeWvAoU6Vt118Gihv+0wntMKEhH/Q2Mao/hCRJ5NNp6FXIxpztnpucHLZUZDhXgeR2OEKUcIWv6OIa/L6t5VyVs73No/x6WkWGkYro7qnoukUV24HFRUrJwc0OTDiGUBtB4bo+OUddKdZWB2cNZxX0cRNprLvoJqijdbg== 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:(13230028)(4636009)(39860400002)(376002)(136003)(346002)(396003)(451199021)(40470700004)(46966006)(36840700001)(40480700001)(110136005)(356005)(478600001)(40460700003)(26005)(186003)(8676002)(8936002)(336012)(41300700001)(82310400005)(316002)(81166007)(2616005)(54906003)(70586007)(70206006)(82740400003)(4326008)(36756003)(6666004)(1076003)(7696005)(5660300002)(2906002)(86362001)(426003)(83380400001)(47076005)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:24:54.0869 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 114562e0-6ee2-4b15-e38f-08db7334d46e 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: MWH0EPF000971E6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5929 Message-ID-Hash: A7VIGB2HF3O2MJSVSRVFPA2GSCXX2TEV X-Message-ID-Hash: A7VIGB2HF3O2MJSVSRVFPA2GSCXX2TEV X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: BIOS invokes ACP Power off sequence based on ACP device state. Remove redundant code from ACP PCI driver for ACP Power off sequence. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-rembrandt.c | 25 ------------------------- sound/soc/amd/acp/acp-renoir.c | 17 ----------------- 2 files changed, 42 deletions(-) diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index 5c455cc04113..1b997837c7d8 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -204,23 +204,6 @@ static int acp6x_power_on(void __iomem *base) return -ETIMEDOUT; } -static int acp6x_power_off(void __iomem *base) -{ - u32 val; - int timeout; - - writel(ACP_PGFSM_CNTL_POWER_OFF_MASK, - base + ACP6X_PGFSM_CONTROL); - timeout = 0; - while (++timeout < 500) { - val = readl(base + ACP6X_PGFSM_STATUS); - if ((val & ACP_PGFSM_STATUS_MASK) == ACP_POWERED_OFF) - return 0; - udelay(1); - } - return -ETIMEDOUT; -} - static int acp6x_reset(void __iomem *base) { u32 val; @@ -299,14 +282,6 @@ static int rmb_acp_deinit(void __iomem *base) } writel(0x00, base + ACP_CONTROL); - - /* power off */ - ret = acp6x_power_off(base); - if (ret) { - pr_err("ACP power off failed\n"); - return ret; - } - return 0; } diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index b3cbc7f19ec5..f188365fe214 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -169,17 +169,6 @@ static int acp3x_power_on(void __iomem *base) return readl_poll_timeout(base + ACP_PGFSM_STATUS, val, !val, DELAY_US, ACP_TIMEOUT); } -static int acp3x_power_off(void __iomem *base) -{ - u32 val; - - writel(ACP_PWR_OFF_MASK, base + ACP_PGFSM_CONTROL); - - return readl_poll_timeout(base + ACP_PGFSM_STATUS, val, - (val & ACP_PGFSM_STAT_MASK) == ACP_POWERED_OFF, - DELAY_US, ACP_TIMEOUT); -} - static int acp3x_reset(void __iomem *base) { u32 val; @@ -246,12 +235,6 @@ static int rn_acp_deinit(void __iomem *base) return ret; writel(0x00, base + ACP_CONTROL); - - /* power off */ - ret = acp3x_power_off(base); - if (ret) - return ret; - return 0; } static int renoir_audio_probe(struct platform_device *pdev) From patchwork Thu Jun 22 15:23:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694921 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 08B52EB64D8 for ; Thu, 22 Jun 2023 15:27:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7A1D785D; Thu, 22 Jun 2023 17:26:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7A1D785D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447622; bh=M9mhmeDdix1Vnsr8C9OlWuYHEWrpitGtHEJdlKgPmeA=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qGaYkZBFR9KFpIQLMC1HVsu+7DLADaWrrDTakfCK8kYRQwYgmCU7tLMpxaFonJfJc 17Ze/vyFbqDCQpv9KObWJEYVRb5xg9EDL44t8FXpX3OHTsbHJcZ8GO7VQmRZEPCHBI SKLRtAerHFECPGHoXIkbeKGrW9uU8OdoypDNhnjo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1290AF801F5; Thu, 22 Jun 2023 17:25:36 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 80A86F80589; Thu, 22 Jun 2023 17:25:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 05ABEF80544; Thu, 22 Jun 2023 17:25:31 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on20609.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::609]) (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 28FF9F80169 for ; Thu, 22 Jun 2023 17:25:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 28FF9F80169 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=dmzc10NU ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ja7CW6rsBCt6sJie/UwgLG274fdZUyMGJOf87cQnU5R7mEzN0RfHEgxsz4f+szjY32XHaE4ZEPXNfzV7+mInhSa9XbTfDaWYF5gQj5DFqAUrhbm6cFlzD1OMiknY3JPT6G48Td9jsyFbv5mtEpOdh3N3sWhlkWaxtJtfu+CkBihOow0STIwopUVcUG6qHGuxfDifLnikhDTjb3WVsqzNlIA5IhtvgNBtpFdBGXLGQZgZuwoo8KpHGq/dn5+rMxxYR91f7FQnRC4gqHE7iA6FqNs05MrfMjh/3P8BfKf5+r0/3nsvu2DIAw2paIkqnC2/JTdGYLeqIozq1GeLKm9Deg== 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=gycwDhAyFF+K1xbN3kqPBoobKHCJK/+BUp0Tu2LksTU=; b=UeO8pJX2TMY9txk5mWPC/fX3zXWBdotCAFHRzOZhqTIsEM3oMf+CJH5Sfdzzp/nzfk6b04SKMP2so68q504ZaPc4VHUdQcWi2x4IPCXiVyaWLlnNXvYg0xkCDt0oWc8RnUark71zAWaUnbL5noSCb2bae3aAInQXRkpQVAlwkZpGlL58k+InoirwdpUjO7p59/cjfwCsW4Q2TrMVWYbGRDd8PpjWczLgkkMkpVDKSBwxfQ9FGWaMQdVmuZGIYd8OwT0/g3oHiQ8/Ys79wz3+A9MLPpjy67IsqQ3yhCKQdX9thwg640JTT0huLQIknBCHCDND2g50qKEgDK2epY10Ig== 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=gycwDhAyFF+K1xbN3kqPBoobKHCJK/+BUp0Tu2LksTU=; b=dmzc10NUEpjOP+8/2gwAV7+lFB+UdRkiLP0HhyBXRHdFQx1vberrFb5vbt9Tm+Sm8A6M0Eyyy0D+lMjRQ/LmuPxQm6pPQyvoA5fYkriqeduVWemnweMGRIKyOB3/CLMvWUGo84U4yZohbBUcNxPiP3lZp9aGDd5bjHxybRycp50= Received: from MW4PR04CA0221.namprd04.prod.outlook.com (2603:10b6:303:87::16) by CY5PR12MB6035.namprd12.prod.outlook.com (2603:10b6:930:2d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 22 Jun 2023 15:25:23 +0000 Received: from MWH0EPF000971E8.namprd02.prod.outlook.com (2603:10b6:303:87:cafe::94) by MW4PR04CA0221.outlook.office365.com (2603:10b6:303:87::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:25:22 +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 MWH0EPF000971E8.mail.protection.outlook.com (10.167.243.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.17 via Frontend Transport; Thu, 22 Jun 2023 15:25:21 +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.2507.23; Thu, 22 Jun 2023 10:25:21 -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.2507.23; Thu, 22 Jun 2023 10:25:20 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:25:16 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Yang Yingliang , Venkata Prasad Potturu , ye xingchen , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6ni?= =?utf-8?q?g?= , "Ajit Kumar Pandey" , open list Subject: [PATCH 03/12] ASoC: amd: acp: refactor the acp init and de-init sequence Date: Thu, 22 Jun 2023 20:53:43 +0530 Message-ID: <20230622152406.3709231-6-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E8:EE_|CY5PR12MB6035:EE_ X-MS-Office365-Filtering-Correlation-Id: 49c02349-33a5-4ab6-ef7e-08db7334e50b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F/KayTk/RkMTN5WItat2G2Sq99kvZNiyEw1zJD7el/JZau2VBTzksDDfuhVkh6ZAUQaHqyaohl8ZLaD8+J+//l5a7w10R0ySarmBv6Jj6X+ulK0KBLavxX7vGVt3tvjLdqBJp1bI1o5TVI7vzzWBLYf8XIBJxyFjKcGffbIWIh7mFZUzOwPpSJ9MfPhFb1KBp4Ry27MElLFVXkqU2eTwVAWwR9lljX9LO7OLUglhN5XNxkGReVaQ0ijrUXvap6EzWI//F68/jhGsxTFS8OpETU9UwX1jFDGQitooRiE96O8V6sOYE5F78u5MspOCixZMZHtClNss0C/ABKKMbR1ze9ja9C+mPJ3p6MQtd0vZY5Z9Ilyv0kXP5QqaCMQy0ffrOGR/FL3IrVHHoIgLjF5kwo4Dmlq/4ci9E5OYTvuY7LBMCFyJPjiGmt8tK4modUQzeR+QU0RLxOyLe/4oo0a2rqdPlUV4SGPl2IrlPyvSaPUYROLzEMztHXqw9rrglqSc9Hs3yIYO8dPAIAFESFbBD3eHfqotbTCP1L5SA62T0czgm58sjlU4fJazy5FnbvcsPCG7a+RefjbZgIMcisFdHmpSzzC67R76Qw/i/7Y4GcZ2uQqjRDy5onFvi6DkbicDfmZNizHZZaMbKXCGc+cDZjF8fser2poL+EIm8sn7IrgsM+0mxK+VLW0GLazKIVQjOswWHs+BOJfQY46v6FDQpjhOLCxZkh/C08ubznMqZiQoyFJxtspz+s+X/Kc/3fKkfLZOHespf7NncFzRfON7rw== 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:(13230028)(4636009)(39860400002)(136003)(376002)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(70206006)(1076003)(186003)(26005)(8676002)(2616005)(336012)(7416002)(82740400003)(83380400001)(426003)(7696005)(82310400005)(36756003)(2906002)(47076005)(36860700001)(478600001)(6666004)(30864003)(316002)(54906003)(40480700001)(4326008)(70586007)(40460700003)(110136005)(86362001)(41300700001)(81166007)(5660300002)(8936002)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:25:21.9127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49c02349-33a5-4ab6-ef7e-08db7334e50b 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: MWH0EPF000971E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6035 Message-ID-Hash: DC2QENQBWWYXRR3ALEUUG56E5GPM6HIZ X-Message-ID-Hash: DC2QENQBWWYXRR3ALEUUG56E5GPM6HIZ X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Remove the individual acp init and de-init functions from different variants of acp pci driver(for renoir/rembrandt platforms) and use a common file to define callbacks and refactor the callbacks to support existing platforms. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/Kconfig | 4 + sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/acp-legacy-common.c | 99 +++++++++++++++++++++++ sound/soc/amd/acp/acp-pci.c | 9 +++ sound/soc/amd/acp/acp-rembrandt.c | 110 -------------------------- sound/soc/amd/acp/acp-renoir.c | 92 --------------------- sound/soc/amd/acp/amd.h | 21 +++++ 7 files changed, 135 insertions(+), 202 deletions(-) create mode 100644 sound/soc/amd/acp/acp-legacy-common.c diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index ce0037810743..6a369e5d825c 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -18,6 +18,9 @@ if SND_SOC_AMD_ACP_COMMON config SND_SOC_AMD_ACP_PDM tristate +config SND_SOC_AMD_ACP_LEGACY_COMMON + tristate + config SND_SOC_AMD_ACP_I2S tristate @@ -28,6 +31,7 @@ config SND_SOC_AMD_ACP_PCM config SND_SOC_AMD_ACP_PCI tristate "AMD ACP PCI Driver Support" depends on X86 && PCI + select SND_SOC_AMD_ACP_LEGACY_COMMON help This options enables generic PCI driver for ACP device. diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index d9abb0ee5218..4e65fdbc8dca 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -8,6 +8,7 @@ snd-acp-pcm-objs := acp-platform.o snd-acp-i2s-objs := acp-i2s.o snd-acp-pdm-objs := acp-pdm.o +snd-acp-legacy-common-objs := acp-legacy-common.o snd-acp-pci-objs := acp-pci.o #platform specific driver @@ -22,6 +23,7 @@ snd-acp-sof-mach-objs := acp-sof-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o obj-$(CONFIG_SND_SOC_AMD_ACP_PDM) += snd-acp-pdm.o +obj-$(CONFIG_SND_SOC_AMD_ACP_LEGACY_COMMON) += snd-acp-legacy-common.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCI) += snd-acp-pci.o obj-$(CONFIG_SND_AMD_ASOC_RENOIR) += snd-acp-renoir.o diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c new file mode 100644 index 000000000000..5b7000eae693 --- /dev/null +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// This file is provided under a dual BSD/GPLv2 license. When using or +// redistributing this file, you may do so under either license. +// +// Copyright(c) 2023 Advanced Micro Devices, Inc. +// +// Authors: Syed Saba Kareem +// + +/* + * Common file to be used by amd platforms + */ + +#include "amd.h" +#include + +static int acp_power_on(struct acp_chip_info *chip) +{ + u32 val, acp_pgfsm_stat_reg, acp_pgfsm_ctrl_reg; + void __iomem *base; + + base = chip->base; + switch (chip->acp_rev) { + case ACP3X_DEV: + acp_pgfsm_stat_reg = ACP_PGFSM_STATUS; + acp_pgfsm_ctrl_reg = ACP_PGFSM_CONTROL; + break; + case ACP6X_DEV: + acp_pgfsm_stat_reg = ACP6X_PGFSM_STATUS; + acp_pgfsm_ctrl_reg = ACP6X_PGFSM_CONTROL; + break; + default: + return -EINVAL; + } + + val = readl(base + acp_pgfsm_stat_reg); + if (val == ACP_POWERED_ON) + return 0; + + if ((val & ACP_PGFSM_STATUS_MASK) != ACP_POWER_ON_IN_PROGRESS) + writel(ACP_PGFSM_CNTL_POWER_ON_MASK, base + acp_pgfsm_ctrl_reg); + + return readl_poll_timeout(base + acp_pgfsm_stat_reg, val, + !val, DELAY_US, ACP_TIMEOUT); +} + +static int acp_reset(void __iomem *base) +{ + u32 val; + int ret; + + writel(1, base + ACP_SOFT_RESET); + ret = readl_poll_timeout(base + ACP_SOFT_RESET, val, val & ACP_SOFT_RST_DONE_MASK, + DELAY_US, ACP_TIMEOUT); + if (ret) + return ret; + + writel(0, base + ACP_SOFT_RESET); + return readl_poll_timeout(base + ACP_SOFT_RESET, val, !val, DELAY_US, ACP_TIMEOUT); +} + +int acp_init(struct acp_chip_info *chip) +{ + int ret; + + /* power on */ + ret = acp_power_on(chip); + if (ret) { + pr_err("ACP power on failed\n"); + return ret; + } + writel(0x01, chip->base + ACP_CONTROL); + + /* Reset */ + ret = acp_reset(chip->base); + if (ret) { + pr_err("ACP reset failed\n"); + return ret; + } + return 0; +} +EXPORT_SYMBOL_NS_GPL(acp_init, SND_SOC_ACP_COMMON); + +int acp_deinit(void __iomem *base) +{ + int ret; + + /* Reset */ + ret = acp_reset(base); + if (ret) + return ret; + + writel(0, base + ACP_CONTROL); + return 0; +} +EXPORT_SYMBOL_NS_GPL(acp_deinit, SND_SOC_ACP_COMMON); + +MODULE_LICENSE("Dual BSD/GPL"); diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index a0c84cd07fde..d3b2ccbe7fd8 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -107,6 +107,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id goto unregister_dmic_dev; } + acp_init(chip); res = devm_kcalloc(&pci->dev, num_res, sizeof(struct resource), GFP_KERNEL); if (!res) { ret = -ENOMEM; @@ -155,10 +156,17 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id static void acp_pci_remove(struct pci_dev *pci) { + struct acp_chip_info *chip; + int ret; + + chip = pci_get_drvdata(pci); if (dmic_dev) platform_device_unregister(dmic_dev); if (pdev) platform_device_unregister(pdev); + ret = acp_deinit(chip->base); + if (ret) + dev_err(&pci->dev, "ACP de-init failed\n"); } /* PCI IDs */ @@ -178,4 +186,5 @@ static struct pci_driver snd_amd_acp_pci_driver = { module_pci_driver(snd_amd_acp_pci_driver); MODULE_LICENSE("Dual BSD/GPL"); +MODULE_IMPORT_NS(SND_SOC_ACP_COMMON); MODULE_ALIAS(DRV_NAME); diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index 1b997837c7d8..59b1653b8479 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -24,26 +24,6 @@ #define DRV_NAME "acp_asoc_rembrandt" -#define ACP6X_PGFSM_CONTROL 0x1024 -#define ACP6X_PGFSM_STATUS 0x1028 - -#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 - -#define ACP_PGFSM_CNTL_POWER_ON_MASK 0x01 -#define ACP_PGFSM_CNTL_POWER_OFF_MASK 0x00 -#define ACP_PGFSM_STATUS_MASK 0x03 -#define ACP_POWERED_ON 0x00 -#define ACP_POWER_ON_IN_PROGRESS 0x01 -#define ACP_POWERED_OFF 0x02 -#define ACP_POWER_OFF_IN_PROGRESS 0x03 - -#define ACP_ERROR_MASK 0x20000000 -#define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF - - -static int rmb_acp_init(void __iomem *base); -static int rmb_acp_deinit(void __iomem *base); - static struct acp_resource rsrc = { .offset = 0, .no_of_ctrls = 2, @@ -180,54 +160,6 @@ static struct snd_soc_dai_driver acp_rmb_dai[] = { }, }; -static int acp6x_power_on(void __iomem *base) -{ - u32 val; - int timeout; - - val = readl(base + ACP6X_PGFSM_STATUS); - - if (val == ACP_POWERED_ON) - return 0; - - if ((val & ACP_PGFSM_STATUS_MASK) != - ACP_POWER_ON_IN_PROGRESS) - writel(ACP_PGFSM_CNTL_POWER_ON_MASK, - base + ACP6X_PGFSM_CONTROL); - timeout = 0; - while (++timeout < 500) { - val = readl(base + ACP6X_PGFSM_STATUS); - if (!val) - return 0; - udelay(1); - } - return -ETIMEDOUT; -} - -static int acp6x_reset(void __iomem *base) -{ - u32 val; - int timeout; - - writel(1, base + ACP_SOFT_RESET); - timeout = 0; - while (++timeout < 500) { - val = readl(base + ACP_SOFT_RESET); - if (val & ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK) - break; - cpu_relax(); - } - writel(0, base + ACP_SOFT_RESET); - timeout = 0; - while (++timeout < 500) { - val = readl(base + ACP_SOFT_RESET); - if (!val) - return 0; - cpu_relax(); - } - return -ETIMEDOUT; -} - static void acp6x_enable_interrupts(struct acp_dev_data *adata) { struct acp_resource *rsrc = adata->rsrc; @@ -248,43 +180,6 @@ static void acp6x_disable_interrupts(struct acp_dev_data *adata) writel(0x00, ACP_EXTERNAL_INTR_ENB(adata)); } -static int rmb_acp_init(void __iomem *base) -{ - int ret; - - /* power on */ - ret = acp6x_power_on(base); - if (ret) { - pr_err("ACP power on failed\n"); - return ret; - } - writel(0x01, base + ACP_CONTROL); - - /* Reset */ - ret = acp6x_reset(base); - if (ret) { - pr_err("ACP reset failed\n"); - return ret; - } - - return 0; -} - -static int rmb_acp_deinit(void __iomem *base) -{ - int ret = 0; - - /* Reset */ - ret = acp6x_reset(base); - if (ret) { - pr_err("ACP reset failed\n"); - return ret; - } - - writel(0x00, base + ACP_CONTROL); - return 0; -} - static int rembrandt_audio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -303,8 +198,6 @@ static int rembrandt_audio_probe(struct platform_device *pdev) return -ENODEV; } - rmb_acp_init(chip->base); - adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); if (!adata) return -ENOMEM; @@ -345,9 +238,6 @@ static void rembrandt_audio_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct acp_dev_data *adata = dev_get_drvdata(dev); - struct acp_chip_info *chip = dev_get_platdata(dev); - - rmb_acp_deinit(chip->base); acp6x_disable_interrupts(adata); acp_platform_unregister(dev); diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index f188365fe214..a73fd70171c1 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -25,20 +25,6 @@ #define DRV_NAME "acp_asoc_renoir" -#define ACP_SOFT_RST_DONE_MASK 0x00010001 - -#define ACP_PWR_ON_MASK 0x01 -#define ACP_PWR_OFF_MASK 0x00 -#define ACP_PGFSM_STAT_MASK 0x03 -#define ACP_POWERED_ON 0x00 -#define ACP_PWR_ON_IN_PROGRESS 0x01 -#define ACP_POWERED_OFF 0x02 -#define DELAY_US 5 -#define ACP_TIMEOUT 500 - -#define ACP_ERROR_MASK 0x20000000 -#define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF - static struct acp_resource rsrc = { .offset = 20, .no_of_ctrls = 1, @@ -154,38 +140,6 @@ static struct snd_soc_dai_driver acp_renoir_dai[] = { }, }; -static int acp3x_power_on(void __iomem *base) -{ - u32 val; - - val = readl(base + ACP_PGFSM_STATUS); - - if (val == ACP_POWERED_ON) - return 0; - - if ((val & ACP_PGFSM_STAT_MASK) != ACP_PWR_ON_IN_PROGRESS) - writel(ACP_PWR_ON_MASK, base + ACP_PGFSM_CONTROL); - - return readl_poll_timeout(base + ACP_PGFSM_STATUS, val, !val, DELAY_US, ACP_TIMEOUT); -} - -static int acp3x_reset(void __iomem *base) -{ - u32 val; - int ret; - - writel(1, base + ACP_SOFT_RESET); - - ret = readl_poll_timeout(base + ACP_SOFT_RESET, val, val & ACP_SOFT_RST_DONE_MASK, - DELAY_US, ACP_TIMEOUT); - if (ret) - return ret; - - writel(0, base + ACP_SOFT_RESET); - - return readl_poll_timeout(base + ACP_SOFT_RESET, val, !val, DELAY_US, ACP_TIMEOUT); -} - static void acp3x_enable_interrupts(struct acp_dev_data *adata) { struct acp_resource *rsrc = adata->rsrc; @@ -206,37 +160,6 @@ static void acp3x_disable_interrupts(struct acp_dev_data *adata) writel(0x00, ACP_EXTERNAL_INTR_ENB(adata)); } -static int rn_acp_init(void __iomem *base) -{ - int ret; - - /* power on */ - ret = acp3x_power_on(base); - if (ret) - return ret; - - writel(0x01, base + ACP_CONTROL); - - /* Reset */ - ret = acp3x_reset(base); - if (ret) - return ret; - - return 0; -} - -static int rn_acp_deinit(void __iomem *base) -{ - int ret = 0; - - /* Reset */ - ret = acp3x_reset(base); - if (ret) - return ret; - - writel(0x00, base + ACP_CONTROL); - return 0; -} static int renoir_audio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -256,12 +179,6 @@ static int renoir_audio_probe(struct platform_device *pdev) return -ENODEV; } - ret = rn_acp_init(chip->base); - if (ret) { - dev_err(&pdev->dev, "ACP Init failed\n"); - return -EINVAL; - } - adata = devm_kzalloc(dev, sizeof(struct acp_dev_data), GFP_KERNEL); if (!adata) return -ENOMEM; @@ -300,17 +217,8 @@ static void renoir_audio_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct acp_dev_data *adata = dev_get_drvdata(dev); - struct acp_chip_info *chip; - int ret; - - chip = dev_get_platdata(&pdev->dev); acp3x_disable_interrupts(adata); - - ret = rn_acp_deinit(chip->base); - if (ret) - dev_err(&pdev->dev, "ACP de-init Failed (%pe)\n", ERR_PTR(ret)); - acp_platform_unregister(dev); } diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 5f2119f42271..83c9a3ba8584 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -92,6 +92,25 @@ #define SLOT_WIDTH_24 0x18 #define SLOT_WIDTH_32 0x20 +#define ACP6X_PGFSM_CONTROL 0x1024 +#define ACP6X_PGFSM_STATUS 0x1028 + +#define ACP_SOFT_RST_DONE_MASK 0x00010001 + +#define ACP_PGFSM_CNTL_POWER_ON_MASK 0x01 +#define ACP_PGFSM_CNTL_POWER_OFF_MASK 0x00 +#define ACP_PGFSM_STATUS_MASK 0x03 +#define ACP_POWERED_ON 0x00 +#define ACP_POWER_ON_IN_PROGRESS 0x01 +#define ACP_POWERED_OFF 0x02 +#define ACP_POWER_OFF_IN_PROGRESS 0x03 + +#define ACP_ERROR_MASK 0x20000000 +#define ACP_EXT_INTR_STAT_CLEAR_MASK 0xffffffff + +#define ACP_TIMEOUT 500 +#define DELAY_US 5 + struct acp_chip_info { char *name; /* Platform name */ unsigned int acp_rev; /* ACP Revision id */ @@ -168,6 +187,8 @@ int acp_platform_unregister(struct device *dev); int acp_machine_select(struct acp_dev_data *adata); +int acp_init(struct acp_chip_info *chip); +int acp_deinit(void __iomem *base); /* Machine configuration */ int snd_amd_acp_find_config(struct pci_dev *pci); From patchwork Thu Jun 22 15:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694920 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 38112EB64D8 for ; Thu, 22 Jun 2023 15:27:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6894883E; Thu, 22 Jun 2023 17:26:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6894883E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447665; bh=+R4XmTrFwaSPZwH3n9c9o3zSDnKfAzvl/fm1st5WNQg=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=I/qSNb0EYyuIeC31rKsWF3gLUupfVmb+fx43shdABZEupTpIgrdwUxVg60Ukz82dv Ko4sGybBxcKqOEqwBhaBI1jn0cYmRVmvJCCb/uiy8kQJvvlqKgKJJcCqFdD6F77uia OCZBNnavKu9n1KoSBXFwqXVrRkjcp0d6THpJJzRQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 215D8F805BB; Thu, 22 Jun 2023 17:25:59 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B8D08F80163; Thu, 22 Jun 2023 17:25:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 25D6AF80567; Thu, 22 Jun 2023 17:25:55 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8b::604]) (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 E7E9AF80163 for ; Thu, 22 Jun 2023 17:25:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E7E9AF80163 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=eij3R0BT ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ectumxovtPGFn2ABv6teSi0Axgs+1vlHpmTDkumNRWmm3LQGAN1BpXtukwAlza4sCq27AUxNafuQq13nGzzbj5eb7VHV6+5OOHTI04JnP2RCTqfCDkD2WeF0lCRN/VbPZ2fiXjHfAbGpUn1CBK4O5ij0UDzxdD7NoB9xfZuqEF20xSAKvSKfG5P2tmgNCE+nwU8jJN1tbFJqT2ipFrcLbuiYSF35bK8vJetju56k5bDkN1Nk2D8UlwiWmvrMhcIM1tVgpOnYntikF0GolLbfQd5NfnySJIQal3u3d1KUqpHEtBUOISScufQns2tBtpZNGjWwebUnIOSLrPQMnCia3Q== 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=lyb4oUKPqZp6YQRg2tTH63rwDvDI64BEIOp/IMCkntM=; b=OA2XWmQu3WDe6Z+gfn15Lqgu+Ichwu5Qm9uW9VHegbTukWyHsUXYywA72cdHpKMqlu1OyzO4BSl4b7Pqr2IcbXjatVSGmKmbDlQLkHQpHcAxPNNCQ6xyDLY0dw45aCwdU0jhDsM2hqqIugrkm5ArBbvN/1kYUXIfNlAjD89VYN0Ytk3ZhaVbnaF6nCbkx8ERloV5+kzyM28pN1shLkekXCw/s92ibRIVfccDKYeVzba2izv1b3HEvhYEssd0DCn25wqLpTXy/bUufGLUZyho66MOoHFlvYtsYy6SXsc0P9SkcIdvEGG21RBXgbU8mvWZKqH4ZxOWV8EYMwy83SpJrg== 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=lyb4oUKPqZp6YQRg2tTH63rwDvDI64BEIOp/IMCkntM=; b=eij3R0BTPRNqJGHio7G/TxljvihpTKM/n/x2QCEfa+fc2yxEm8Ww3LJqWRXOENu4euAcjlCC+zCcdvSa0fvfUpoD0hcdm0rOzDCZJ/861Gk+x7EgsaVBFmfb22RvDjkm0We5SYWl/GVekhiclUB/cvd9BjHo+0p4Qy8AiZ2N9fE= Received: from SA1PR02CA0019.namprd02.prod.outlook.com (2603:10b6:806:2cf::12) by PH0PR12MB7791.namprd12.prod.outlook.com (2603:10b6:510:280::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 22 Jun 2023 15:25:46 +0000 Received: from SA2PEPF00001508.namprd04.prod.outlook.com (2603:10b6:806:2cf:cafe::57) by SA1PR02CA0019.outlook.office365.com (2603:10b6:806:2cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:25:46 +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 SA2PEPF00001508.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.19 via Frontend Transport; Thu, 22 Jun 2023 15:25:46 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.2507.23; Thu, 22 Jun 2023 10:25:45 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 22 Jun 2023 10:25:45 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:25:41 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V Sujith Kumar Reddy , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6ni?= =?utf-8?q?g?= , Venkata Prasad Potturu , Ajit Kumar Pandey , open list Subject: [PATCH 04/11] ASoC: amd: acp: remove the redundant acp enable/disable interrupts functions Date: Thu, 22 Jun 2023 20:53:45 +0530 Message-ID: <20230622152406.3709231-8-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001508:EE_|PH0PR12MB7791:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f7914ac-77cc-4c0c-6aa4-08db7334f357 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PbKAxFdhXsToY88g0aulNCkzyOz+uCYwR9ZvQwUBKrQWaW0gSY+z1qhkstMeaOSSpmRs6Pyfhhqwd8odQQUx7B88PWKFRSw9tgrASUx4SB9qFQuQAzDCGtna+G4F1mvSDTIyAdVKlkniiWHxR3rrm9G59+t+NZQc7o5x/LxHchwej4i2ZeSrigXzmJAHxmNPxX23aXlPaa5D1U1M4kHBiRf8YLmgNHYzo9Tpy8TEyiUWjeQ2ksn+4wkF1m9G2WN24NikfW2VXHlitQNnabr3xCAcT0sH3km9mHvEmnomC0OI4Ibpx04FWcK0It4bbJZIBiM+d0EJYFnSvtZFvPdzarQJlqfQ2S7Quqecu2Fy08e6He82gOiZNt1nCifpRRvHWochIvurZZcUSfygAFypeXXhA9FaOLWq62Bc5Ghpdhh5ZUGGUmEfSFBLxMfvEgjp2rf0ATrBgbr/VJdgdh950eFHHLjvxdnx5CfWsu10W7YqIS40uCKKTti/dSzxzwqlHC7ateEp4Ijo4kqyedOe0OPPyMC5CD+jPbAjEPvaPcPs7H/Y9k7HgWAaY5t+cVUXb330a8D3PUelzrKsmfqUkd6lZVwl14KUeLZVXqJb45a0zWwA+NlrJ/JVLNIOkpb6raoOPcf1TJXmw8wHRv9CR7Pg3uph+vOHEzHzNPIUz7cDqBZHHIBgy662JwBO4WIElXbWVnPdyoQw0I0TjfoTOnDBpvD3Eu31y/U+j81uCqf0wpi2M8jqACm/EAR1JuVa/wlmiT9XeLbAyZQrm0pbFw== 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:(13230028)(4636009)(39860400002)(136003)(396003)(346002)(376002)(451199021)(36840700001)(46966006)(40470700004)(82310400005)(478600001)(70206006)(36756003)(316002)(70586007)(40460700003)(54906003)(110136005)(4326008)(7696005)(426003)(86362001)(83380400001)(186003)(2616005)(81166007)(336012)(82740400003)(36860700001)(26005)(8936002)(1076003)(2906002)(356005)(8676002)(41300700001)(5660300002)(40480700001)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:25:46.0674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f7914ac-77cc-4c0c-6aa4-08db7334f357 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: SA2PEPF00001508.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7791 Message-ID-Hash: Q43FE32ZD6D3VQL4ZMFCBDYBGA6BKRRN X-Message-ID-Hash: Q43FE32ZD6D3VQL4ZMFCBDYBGA6BKRRN X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Instead of having individual acp enable/disable interrupts functions for each platform, implement common place holder to handle the same for all AMD platforms. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 21 +++++++++++++++++++++ sound/soc/amd/acp/acp-rembrandt.c | 24 ++---------------------- sound/soc/amd/acp/acp-renoir.c | 23 ++--------------------- sound/soc/amd/acp/amd.h | 2 ++ 4 files changed, 27 insertions(+), 43 deletions(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index 4302d8db88a4..45a45d002915 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -16,6 +16,27 @@ #include #include +void acp_enable_interrupts(struct acp_dev_data *adata) +{ + struct acp_resource *rsrc = adata->rsrc; + u32 ext_intr_ctrl; + + writel(0x01, ACP_EXTERNAL_INTR_ENB(adata)); + ext_intr_ctrl = readl(ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); + ext_intr_ctrl |= ACP_ERROR_MASK; + writel(ext_intr_ctrl, ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); +} +EXPORT_SYMBOL_NS_GPL(acp_enable_interrupts, SND_SOC_ACP_COMMON); + +void acp_disable_interrupts(struct acp_dev_data *adata) +{ + struct acp_resource *rsrc = adata->rsrc; + + writel(ACP_EXT_INTR_STAT_CLEAR_MASK, ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); + writel(0x00, ACP_EXTERNAL_INTR_ENB(adata)); +} +EXPORT_SYMBOL_NS_GPL(acp_disable_interrupts, SND_SOC_ACP_COMMON); + static int acp_power_on(struct acp_chip_info *chip) { u32 val, acp_pgfsm_stat_reg, acp_pgfsm_ctrl_reg; diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index 83515ee753f3..bc8e1de45170 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -185,26 +185,6 @@ int acp6x_master_clock_generate(struct device *dev) return 0; } -static void acp6x_enable_interrupts(struct acp_dev_data *adata) -{ - struct acp_resource *rsrc = adata->rsrc; - u32 ext_intr_ctrl; - - writel(0x01, ACP_EXTERNAL_INTR_ENB(adata)); - ext_intr_ctrl = readl(ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); - ext_intr_ctrl |= ACP_ERROR_MASK; - writel(ext_intr_ctrl, ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); -} - -static void acp6x_disable_interrupts(struct acp_dev_data *adata) -{ - struct acp_resource *rsrc = adata->rsrc; - - writel(ACP_EXT_INTR_STAT_CLEAR_MASK, - ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); - writel(0x00, ACP_EXTERNAL_INTR_ENB(adata)); -} - static int rembrandt_audio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -254,7 +234,7 @@ static int rembrandt_audio_probe(struct platform_device *pdev) dev_set_drvdata(dev, adata); acp6x_master_clock_generate(dev); - acp6x_enable_interrupts(adata); + acp_enable_interrupts(adata); acp_platform_register(dev); return 0; @@ -265,7 +245,7 @@ static void rembrandt_audio_remove(struct platform_device *pdev) struct device *dev = &pdev->dev; struct acp_dev_data *adata = dev_get_drvdata(dev); - acp6x_disable_interrupts(adata); + acp_disable_interrupts(adata); acp_platform_unregister(dev); } diff --git a/sound/soc/amd/acp/acp-renoir.c b/sound/soc/amd/acp/acp-renoir.c index a73fd70171c1..1899658ab25d 100644 --- a/sound/soc/amd/acp/acp-renoir.c +++ b/sound/soc/amd/acp/acp-renoir.c @@ -140,25 +140,6 @@ static struct snd_soc_dai_driver acp_renoir_dai[] = { }, }; -static void acp3x_enable_interrupts(struct acp_dev_data *adata) -{ - struct acp_resource *rsrc = adata->rsrc; - u32 ext_intr_ctrl; - - writel(0x01, ACP_EXTERNAL_INTR_ENB(adata)); - ext_intr_ctrl = readl(ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); - ext_intr_ctrl |= ACP_ERROR_MASK; - writel(ext_intr_ctrl, ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); -} - -static void acp3x_disable_interrupts(struct acp_dev_data *adata) -{ - struct acp_resource *rsrc = adata->rsrc; - - writel(ACP_EXT_INTR_STAT_CLEAR_MASK, - ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); - writel(0x00, ACP_EXTERNAL_INTR_ENB(adata)); -} static int renoir_audio_probe(struct platform_device *pdev) { @@ -207,7 +188,7 @@ static int renoir_audio_probe(struct platform_device *pdev) acp_machine_select(adata); dev_set_drvdata(dev, adata); - acp3x_enable_interrupts(adata); + acp_enable_interrupts(adata); acp_platform_register(dev); return 0; @@ -218,7 +199,7 @@ static void renoir_audio_remove(struct platform_device *pdev) struct device *dev = &pdev->dev; struct acp_dev_data *adata = dev_get_drvdata(dev); - acp3x_disable_interrupts(adata); + acp_disable_interrupts(adata); acp_platform_unregister(dev); } diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 96bd87290eee..0d8c0febbbfc 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -192,6 +192,8 @@ int smn_write(struct pci_dev *dev, u32 smn_addr, u32 data); int acp_init(struct acp_chip_info *chip); int acp_deinit(void __iomem *base); +void acp_enable_interrupts(struct acp_dev_data *adata); +void acp_disable_interrupts(struct acp_dev_data *adata); /* Machine configuration */ int snd_amd_acp_find_config(struct pci_dev *pci); From patchwork Thu Jun 22 15:23:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694919 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 9D123EB64DA for ; Thu, 22 Jun 2023 15:28:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 17D58AE9; Thu, 22 Jun 2023 17:27:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 17D58AE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447694; bh=Ro4Q4nju2Y/NYEEX1VTJ4Oxv9pXqhye2tVMsckDVfZA=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LpMrQIk3RZxFAV/wteFVUlrLPafnv5wGcpt5q+Q0IfbA+ZUHA30zsO5k3Kpk8gOdn 3HpgIggnuIB21rC9BLx6fmmbc0kDIqTqWjzOjWsu9EM/yLEqvqw/5ADHSdAFkzRI+d NilQbpFZbEcb9FW7YF4RnwidSybZfe/Tpc1Unj48= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DB1F3F8059F; Thu, 22 Jun 2023 17:26:42 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 33538F8057F; Thu, 22 Jun 2023 17:26:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E040AF80580; Thu, 22 Jun 2023 17:26:38 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::61c]) (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 10B22F8059F for ; Thu, 22 Jun 2023 17:26:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 10B22F8059F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=Y/uBczpc ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V2T7JvQSNWT8S/JpQE20/0jH60WuoMSgstAK6ZlkMY6KayRZfUMaXJwHBJ8Gs5TgS1iV3zwZasOG6Gm56mxDc2caY6+OXxnojErnuJDiOUn+bWPEs39OzZnl26htgnPcYrUHU5uGeBDeACuuZjjAhP8cFG/qsYFDyxdK/i+7KGxtzcBM6BPeF0/7pzyrJ7ZE7QZrLSVgIqR462lUDOfPp7++UROIRo3JW7iCUv13PHAPNp1UGsSM8+z8oAnExhFSoUriDIexaEC3AbpLRLTRzB9wZrB6aNUHY4iGGLO3fQPArOR4WPnHWeBDidvGEcsPkcQtdGugkeHGfhn6/SBLlA== 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=CvCBKnW1XfiJYktEn5OXvrGZ5iyfve+4NEgu2JLMNvQ=; b=RFuO/k5Qt/SmJdeQWJsnubSoQkbgNjZ/rlP90stngDI3dnWwcCqZgrV83qpsilXxkAJGrwfSYqdnBx+t+hZnG/VVG5xi1YmZAwalZ+s0qFEgrxffPfjQaTKTBDvjoKZffGfqVRAMWkBWT/TBaqB9xye3MxIuwjboL8oLdeuT7FFEA2+PnycHgKRYJeURwRtY0yhZ5LopRoCnjzo2lO57JK3iiG6YwJeEvoYlmpRHF9C4pQgQSQ7xaCMZLxyfV1EBOaqjeFoSp/+RdfVfM4RcQSPHt2iznsvV7HFKnE9dNo1WG/DiEYXepChCuSP4ILiI69CCT9TgHvjRqIYdJwuw3w== 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=CvCBKnW1XfiJYktEn5OXvrGZ5iyfve+4NEgu2JLMNvQ=; b=Y/uBczpcxLm4N3WGc4ZernV6i9BlkA3MDqbAFQ5WYfJMeFpR7zgoFVXADp42s733qfQjByWAU9chB0GeMzQJ013BfaKxrq0fuWPWe2bbNOrTgGEkFqX+L1TGP5VM0QvrhI3A0hZyNnciG59qdh4RwRRz7lAfaFD6lJG6LhG6TFI= Received: from BY5PR04CA0029.namprd04.prod.outlook.com (2603:10b6:a03:1d0::39) by MN0PR12MB5979.namprd12.prod.outlook.com (2603:10b6:208:37e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Thu, 22 Jun 2023 15:26:16 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:a03:1d0:cafe::23) by BY5PR04CA0029.outlook.office365.com (2603:10b6:a03:1d0::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26 via Frontend Transport; Thu, 22 Jun 2023 15:26:15 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6477.13 via Frontend Transport; Thu, 22 Jun 2023 15:26:15 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.2507.23; Thu, 22 Jun 2023 10:26:04 -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.2507.23; Thu, 22 Jun 2023 10:26:04 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:26:00 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Yang Yingliang , Venkata Prasad Potturu , V sujith kumar Reddy , ye xingchen , "Ajit Kumar Pandey" , open list Subject: [PATCH 05/11] ASoC: amd: acp: store platform device reference created in pci probe call Date: Thu, 22 Jun 2023 20:53:47 +0530 Message-ID: <20230622152406.3709231-10-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|MN0PR12MB5979:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b47fbb3-3eaa-4735-1b82-08db733504db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bGfl243QyBOZyzioI2Lz/nEh7X7WEvhoTBCSTRUGonr8gxDmyOmV6WC0ADzBEmHgzIsVrj1tYju9cQIYuRoL+YfPT2KR9+nI9/GLKhdY0UAIHrM6nvk9uGd3WehGrQC928SSu50VhQZ0tOfl98bRKNGbH0i9isWYTSKJ7/d5qNVJYpzc2KJEpyCbD3KA28ZEICYQ3mJzHE0+y4+2o3SIFxHnXySwIkGdONmQ2dIHgiQTkjwwBNA7rMFJCN1kDrPm53ACx9uZHtvtyZKKRx8cKvwWUAOAxZUtpuQPGunRgCiJ9MBzNZBoVwBvC7NckXVkrUVSLaCjn6QnOJQJ9dn62srQ4m2VENxT7Fj49++2VBkuiY+LjZkIZlz87N9nxFI1E6eGKcURZ0ajagtK8dHl6YDQ74i8ajDIUnVc4X2tQ1nYSLYe6IRuDhFdCPJy29ctPZfXx18pSB6sExMd5tDLHdC7p4mir2WAJHjhz4XjaI/Q7w5yt/csAiBHacqZy1IBc55pHxHVHi1YNDGYC8Ar2D1XVZ/r/CdVXtyeLvahO+rUwYES/vcxsfD9QYvCC1U+F8WzBMvGJ30+/S6LncefgviQsAzczuF9BH+tRdU00xggB+NBzfr7E79E/bT7QsUJ9G6sfVXA5+NN015bn6OWmb3SRzQIN6Lx0V5Oz02Ra87GNZSNM4BJ9NGOUlzWOinezhx5xtxzvBm3DRc0K++hUwH1NxIa9IysrapbUOJxZjf10AEyh4183TCn8hS5KwZOFXg0HeHzJvZ69zvyKEbdqg== 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:(13230028)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199021)(36840700001)(46966006)(40470700004)(82310400005)(36860700001)(2906002)(47076005)(1076003)(110136005)(6666004)(7696005)(54906003)(478600001)(336012)(83380400001)(186003)(2616005)(426003)(26005)(5660300002)(40460700003)(81166007)(36756003)(356005)(86362001)(70206006)(4326008)(82740400003)(40480700001)(70586007)(316002)(8676002)(8936002)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:26:15.3423 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b47fbb3-3eaa-4735-1b82-08db733504db 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5979 Message-ID-Hash: M3KX6ORSTTNY57FTZDHJ3JKMHBJQZKHN X-Message-ID-Hash: M3KX6ORSTTNY57FTZDHJ3JKMHBJQZKHN X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Store the platform device reference created in pci driver, it will be used in restoring the interrupts during system level resume. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-pci.c | 2 +- sound/soc/amd/acp/amd.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index d3b2ccbe7fd8..0d91181364e3 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -141,7 +141,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id ret = PTR_ERR(pdev); goto unregister_dmic_dev; } - + chip->chip_pdev = pdev; return ret; unregister_dmic_dev: diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 0d8c0febbbfc..f53613216397 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -115,6 +115,7 @@ struct acp_chip_info { char *name; /* Platform name */ unsigned int acp_rev; /* ACP Revision id */ void __iomem *base; /* ACP memory PCI base */ + struct platform_device *chip_pdev; }; struct acp_stream { From patchwork Thu Jun 22 15:23:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694916 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 815BEEB64DA for ; Thu, 22 Jun 2023 15:29:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 84ABCA4D; Thu, 22 Jun 2023 17:29:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 84ABCA4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447797; bh=Ro4Q4nju2Y/NYEEX1VTJ4Oxv9pXqhye2tVMsckDVfZA=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bTPbFlS4w/DYvuylXNaNzvkzu+gDvCyBebzuAGSeK80KHwFeqYOY5NNnjgzK0v+Ob sdqRRrBkYxTSMskxuvTWz61lgu8r+aNSCfFm0Mx33LhSl19DnMeeVgEVaZjdpOFSF2 H5HEPgAeh4oHsMviSIcW1qIq/PY8Ix6kNt3NiTV0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC4C7F805E7; Thu, 22 Jun 2023 17:27:21 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0094DF805C1; Thu, 22 Jun 2023 17:27:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F04BBF805AE; Thu, 22 Jun 2023 17:27:07 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8b::604]) (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 B1153F8056F for ; Thu, 22 Jun 2023 17:26:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B1153F8056F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=IarlYrr4 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/W/ynJ9k9ySZTdlV8AfoDBO+YYN/qDNa/08Zw4dd66Q6+CCxzp8K/xWGxv8WoIeYBYQv7jMKviRGtCABXvKOWDQT2Ud3xxL25ElMqzVN/4KT7wanUNBNfpjHqPF84LqDl5T5nQt0UmGWeS6dkcxIko2E0pP/c2/yhgAksg/D84A2jL6/9BUgDeGZTxu4vJ+ub8TPQPfPmO9WZs1bmQA2V2bJGJlttohkUeKZ5YIrCIVOt/NNOU2MJHvKNJsH1nWRg1HYFiCHVs3Xu3SOCduPMf1cppEAyQilM0Zk2QhZVLbTQzLrtHgejx7rwwUNxEX3kDmi+bE8jmeebgKqEB6Tg== 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=CvCBKnW1XfiJYktEn5OXvrGZ5iyfve+4NEgu2JLMNvQ=; b=nYI6PYpykVJBBRwH6SltpOCPziAapnu8fkfmSvy9w36eCdbpnMI+D/KGRQqfQ/+jYUK8BMEXXUwUpkawoygDcySTYmW4DuAs+5kJODgzpU3OXyIM+r2mLWgx4v8Y5zWvBHnygHsx9ctoYkVATRedBy1f4ivkKeU1E0I1gy7knv48FZxFACUhoCof0f2NT5Cu6ih1nAQ3PJmmShETq+e5QndtljEuSKyxG1T9YiQEHDmuLqREZo4HTYjuVORWRk2ynPxPBrLBdcRivbJbBX+iZbAGJxBPeVSUIIwYtzb8xrDL6NqVG+vOlGz/jgcce9pEL4S4m7botVXIL6xYZHe+hQ== 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=CvCBKnW1XfiJYktEn5OXvrGZ5iyfve+4NEgu2JLMNvQ=; b=IarlYrr4U0G4zrdngAb4iG7y+vGDSBs4GbEpBtexZ1QFFxblB/a0uHE4b4uMjGTdDYPELdHrqyXxu0jYEb6JkktePsms8ucM5u8/ROzPUEGmIWGm18TcDXo2l1qh+ZmhXSNkPmM8doz1lCnP5QTbQcnYwJcrpUj5yARWj0bEJ+A= Received: from BY5PR04CA0003.namprd04.prod.outlook.com (2603:10b6:a03:1d0::13) by SN7PR12MB8131.namprd12.prod.outlook.com (2603:10b6:806:32d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 22 Jun 2023 15:26:17 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:a03:1d0:cafe::88) by BY5PR04CA0003.outlook.office365.com (2603:10b6:a03:1d0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:26: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6477.13 via Frontend Transport; Thu, 22 Jun 2023 15:26:17 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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.2507.23; Thu, 22 Jun 2023 10:26:16 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Thu, 22 Jun 2023 08:26:16 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:26:12 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Yang Yingliang , Venkata Prasad Potturu , ye xingchen , V sujith kumar Reddy , Ajit Kumar Pandey , open list Subject: [PATCH 06/12] ASoC: amd: acp: store platform device reference created in pci probe call Date: Thu, 22 Jun 2023 20:53:49 +0530 Message-ID: <20230622152406.3709231-12-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|SN7PR12MB8131:EE_ X-MS-Office365-Filtering-Correlation-Id: b59ba72c-3d6c-41f8-36a2-08db733505f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4XOXJgG5+8qfPIUlYR5ZIW2q1JMs2Km05Ai2OCe7moyta1nYJanMj9Gro5FG03aZIElxUQd38FP1aOopnXw5kHceRgRuz+vK0OFdjrsy0EIxkksW/4mC2ZX00hDReD5WqJ8C9RwGrD3/N4sdWr8yYFJFrgGXx5u1SCypbaX1z2B7EdidAkYZ1ojpgfYc1XOLsQgZl4G0K4dzHxmxh3jUM6WEsL40ARAQbeqDSM+A3XLkA7ZOutN9ijtfTzsJ0KSkN0Fh1bCPCVl8AqFfJw1ZZKXYwVBmiah4yNqUWo92YWWdiHWCKUmo2/dc+VKnIWGtldfPtJzCo0BJ7p3gg+UXwjuT2CHlpVW8svG9WK1e24xYdT2aUYCdrqyOg4x3U4tja7pWfOjIaBif81og2yymqlTBQmwO/AIK5s3pEhXDN3QTVUqtiTWLgEftZEuONaagcqm2ZnD0h1x1mHE0NtKVXvJDrmqLDpOUvt12LazxRm6cw5ysfw10a9NeqaOAK0Z3zBXoS+GkvLLrp+2Ptr9yN198rVJIc0b7Fgg4uZ1G9IQ7Hkg0Ddd9dflm/SOz6n6OtNUQFMQCv2Mlnj7Lc871jXNMBvFhht09hL39jBFxpYl7Rvta0lX+Y8VxQEdMHH/B8ogNspUX+gdH12ixirq0UWHtsZE9eYDml1gS4EmJApkNwaIpQhV2Mgbo30LZoklGGJLXHj7L5COJ8TdjQzIWNfsaLUgIPCi/2F2ZEvA0BpNKVYhsq94DgqZxuD1OB6DFsXWYYj2SzbPf0FOZ8l7gdw== 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:(13230028)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(2906002)(41300700001)(8936002)(40460700003)(8676002)(36860700001)(6666004)(478600001)(82310400005)(81166007)(356005)(2616005)(83380400001)(82740400003)(426003)(26005)(186003)(1076003)(336012)(7696005)(47076005)(40480700001)(54906003)(86362001)(110136005)(36756003)(316002)(4326008)(70586007)(70206006)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:26:17.2330 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b59ba72c-3d6c-41f8-36a2-08db733505f9 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8131 Message-ID-Hash: 6QDH2J3UNHK3ZBEKHY3Z5P2DQWXWQBCB X-Message-ID-Hash: 6QDH2J3UNHK3ZBEKHY3Z5P2DQWXWQBCB X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Store the platform device reference created in pci driver, it will be used in restoring the interrupts during system level resume. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-pci.c | 2 +- sound/soc/amd/acp/amd.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index d3b2ccbe7fd8..0d91181364e3 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -141,7 +141,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id ret = PTR_ERR(pdev); goto unregister_dmic_dev; } - + chip->chip_pdev = pdev; return ret; unregister_dmic_dev: diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 0d8c0febbbfc..f53613216397 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -115,6 +115,7 @@ struct acp_chip_info { char *name; /* Platform name */ unsigned int acp_rev; /* ACP Revision id */ void __iomem *base; /* ACP memory PCI base */ + struct platform_device *chip_pdev; }; struct acp_stream { From patchwork Thu Jun 22 15:23:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694915 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 35AC4EB64DB for ; Thu, 22 Jun 2023 15:30:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D4C0D82C; Thu, 22 Jun 2023 17:29:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D4C0D82C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447826; bh=y+ZfWDUxYTSf8q/ctAIdcL29anqS6jG+6WwclrSsgDM=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jVW1GiQRIUmr7c0o4rsnUPGn11++0j/vyvz5XtN2U0I652QeaareZ5Td6/nspI7wt ZMEtskKW14rsedP6e4iDWuN0FXc+8pTkKXGYui+LPZlI8CjhnP4P5SGaWEWGE9qWD+ CZvE0hkOXxODMMndVZwvIwA/cODG2my0l8hT3GUQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F944F805BF; Thu, 22 Jun 2023 17:27:27 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 624C6F805F4; Thu, 22 Jun 2023 17:27:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C2C7FF805C6; Thu, 22 Jun 2023 17:27:09 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20621.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::621]) (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 A6D75F80544 for ; Thu, 22 Jun 2023 17:26:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6D75F80544 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=zzyTTJAK ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HH9beaWM3mhd7ya8egdfcyIXmP595QDYJM+FBJvGEUqsBwbrlwvBm+MoU6BjzJmM9c7MdsMmZjk762OrwCKFIGqBr+0vWErwD0PHa8YGOTnQaB/QirR9kK99AIrC3oez4lsH3VJO6JHHu3rEpV2zTXxrpeZu4xQc4+raGjsdgROXYHfGQDZpDoU4J0y/+wkXDjReSGme5m+gCXVHThGh1orVDa0qpHkY2b9Bbk9rpQDXLQ+saUA6mgJeg0uTTg2SJX6DMP++Dd9oD3jpkblciXgztftvsjgk3ApXcD+yXEGiK6Ti7TzW9qpcC8Zau5ynTWlygnD3jeWlO69VjGTAvw== 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=yI3RABJT8UJ6M1AbIKgLcTBeQk/w3uJCYhqBgvHJTQg=; b=YwERGQuNFbHSLoAZHsRU8KQzrqB/p/IcOWscUXtWXLt1EAiCHzOp2gLFZ3X4xFzmkpRrJxtV2vly/iO5aRgL4QRd/iDgUPuyemE2DD+DilAasgYPobK+kQLCpbzRy8NcPjxJI3Ab58cPwbY2czQmJPr/9kAsJ9BrATAzxIXAqQ8EhE6M/BiYD47s0D93IsmOZIED1lofYq/z5xHAF2gnUqMH5vgzeG0EadqlMNpl4hiUfTpygMSv3EvgtFFpzLaexCwWqUbzRhifBAoj2HkiROPgiIdGsp06Y7nvZMudjsoJoIoCH4/KPGEqQACxLsu+Q+4479gYiuVnyH/FLxin5Q== 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=yI3RABJT8UJ6M1AbIKgLcTBeQk/w3uJCYhqBgvHJTQg=; b=zzyTTJAKFc3JKUfNPnMEU33rPD32RwuhhQKbtol38JSjawy3HJYxxogxdd7JWDW4VDriEbsl0tcCgsBSYTWe+eciYXuWvMj8ondcCZ4gNb63s4862a/FcgQOHBefIOXPkKgwtSqbVUmJgrjAFU081UpoveITup1fOi5uYgSts+U= Received: from SA1PR04CA0010.namprd04.prod.outlook.com (2603:10b6:806:2ce::16) by IA0PR12MB8421.namprd12.prod.outlook.com (2603:10b6:208:40f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 22 Jun 2023 15:26:22 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:806:2ce:cafe::5d) by SA1PR04CA0010.outlook.office365.com (2603:10b6:806:2ce::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:26:22 +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 SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.19 via Frontend Transport; Thu, 22 Jun 2023 15:26:22 +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.2507.23; Thu, 22 Jun 2023 10:26:21 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:26:18 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Yang Yingliang , Venkata Prasad Potturu , ye xingchen , V sujith kumar Reddy , open list Subject: [PATCH 07/12] ASoC: amd: acp: add pm ops support for acp pci driver Date: Thu, 22 Jun 2023 20:53:50 +0530 Message-ID: <20230622152406.3709231-13-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|IA0PR12MB8421:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b21ad13-63ad-4d8c-a4fb-08db733508e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K6f1qX8r7WE4Ln30k6oIwvbpcLWfaCQMzUvFWvAmRTcDPCBynxJQ5Ucd/+S0tTNpRToKFQcLezm6Onv0Iej7wLMQLCI64/cR0Oq+RgUx2mT+3K6bxx7xU47Z3wuS3uz+IP8kEeYbdmN4oqdwYJaxeWzw8lvEwBvw/1l7Xl+Q4p8GfV26QTlvQttzXo37jal1vFW3acg440CuN4UmrA+5fCADi5wRXmLI0o2t4ZUgd7V39ElhAiJV1r2WNjmN37sDpdtqqw8Q5RDtF+x6Yjb/4yu7s6Ei1LEad0ocbeAoHOvO9HfHCbIa4GJOB6QARUAbVGWLK/7m7+ZAo387nrokA2eeBg7o1jUh2/9Jz4mjNRynBzL2KodyPqr+YkyYG1MvBJdV+vuSTMsaFrGEaKR23z/1GmzRLV9vOuip93YutfOFvtc1HBbEXZTbexfCx9d7E7I3H5aZe236cVVrgriclEw2LabFCzwHThB6vbe13PFgtuFw9ngHeKoYLK6jyFoeI8tB+9tqPaHnKkmnTuFQ/t8iGduWSoR721o2oi/68miBu01ggTKYqhvRuBcoRTbgtSU8BMdedIoYCmkvD1d310NeFE1fhg706KpwZd8wwQeLi+8SG8EvqMzYQIZ6hSQRy922KwnQVcbfGCYXvJxlejkkr7iA2yVVWsQCr+QPmdcKygJld7Lhg9pExC5T0YBDJcure7ThsAusGBZL1m5lVAebX/XtIxXDnMCRIh05hmxMjfsp4AiqLOGNHCeHDeBnbWmIAMmWA57noDvKnQDgZw== 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:(13230028)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(54906003)(2616005)(86362001)(110136005)(478600001)(40480700001)(7696005)(6666004)(186003)(4326008)(41300700001)(316002)(47076005)(83380400001)(336012)(426003)(1076003)(26005)(70206006)(70586007)(82310400005)(8936002)(8676002)(5660300002)(36756003)(40460700003)(36860700001)(2906002)(82740400003)(356005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:26:22.2422 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b21ad13-63ad-4d8c-a4fb-08db733508e9 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: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8421 Message-ID-Hash: QZTFEAJODGUUIMUIX6XCQHE2AIZDVBVD X-Message-ID-Hash: QZTFEAJODGUUIMUIX6XCQHE2AIZDVBVD X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add pm ops support for common acp pci driver. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-pci.c | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c index 0d91181364e3..73115ae78b6e 100644 --- a/sound/soc/amd/acp/acp-pci.c +++ b/sound/soc/amd/acp/acp-pci.c @@ -142,6 +142,11 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id goto unregister_dmic_dev; } chip->chip_pdev = pdev; + dev_set_drvdata(&pci->dev, chip); + pm_runtime_set_autosuspend_delay(&pci->dev, 2000); + pm_runtime_use_autosuspend(&pci->dev); + pm_runtime_put_noidle(&pci->dev); + pm_runtime_allow(&pci->dev); return ret; unregister_dmic_dev: @@ -154,12 +159,49 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id return ret; }; +static int __maybe_unused snd_acp_suspend(struct device *dev) +{ + struct acp_chip_info *chip; + int ret; + + chip = dev_get_drvdata(dev); + ret = acp_deinit(chip->base); + if (ret) + dev_err(dev, "ACP de-init failed\n"); + return ret; +} + +static int __maybe_unused snd_acp_resume(struct device *dev) +{ + struct acp_chip_info *chip; + struct acp_dev_data *adata; + struct device child; + int ret; + + chip = dev_get_drvdata(dev); + ret = acp_init(chip); + if (ret) + dev_err(dev, "ACP init failed\n"); + child = chip->chip_pdev->dev; + adata = dev_get_drvdata(&child); + if (adata) + acp_enable_interrupts(adata); + return ret; +} + +static const struct dev_pm_ops acp_pm_ops = { + SET_RUNTIME_PM_OPS(snd_acp_suspend, snd_acp_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(snd_acp_suspend, snd_acp_resume) +}; + static void acp_pci_remove(struct pci_dev *pci) { struct acp_chip_info *chip; int ret; chip = pci_get_drvdata(pci); + pm_runtime_forbid(&pci->dev); + pm_runtime_get_noresume(&pci->dev); if (dmic_dev) platform_device_unregister(dmic_dev); if (pdev) @@ -182,6 +224,9 @@ static struct pci_driver snd_amd_acp_pci_driver = { .id_table = acp_pci_ids, .probe = acp_pci_probe, .remove = acp_pci_remove, + .driver = { + .pm = &acp_pm_ops, + }, }; module_pci_driver(snd_amd_acp_pci_driver); From patchwork Thu Jun 22 15:23:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694918 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 55D3EEB64DA for ; Thu, 22 Jun 2023 15:28:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CDBE8DE5; Thu, 22 Jun 2023 17:28:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDBE8DE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447730; bh=6kbpSSTDUblxoNf9LyE/yIKCY1TOouabuN/d1ZNkh48=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Hj2xFYdqYl8F3MwCbNw30OkYi4OVSSka9Ir6DJXPueU7pr+plNkCz5Q1rWc3hJshd zaOYlR0C0k8dZdJ5gwBS02Ao9FWxSceMbdXsYA+59W9zlwfIdV4de21goOdcsegsss 4iVnwkkJ/LcPz3MQHWH10IbN9BLdnVAVbyS4AE1s= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1C522F805B5; Thu, 22 Jun 2023 17:27:04 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B72A3F8057A; Thu, 22 Jun 2023 17:27:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 488DBF8055B; Thu, 22 Jun 2023 17:26:57 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::60e]) (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 B34D3F80571 for ; Thu, 22 Jun 2023 17:26:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B34D3F80571 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=TnjE0i3R ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gDoXbTSGBemT0/BssXc3ZcV5S7OrnprUqWDo7jQpxaK38XcxdEcTNGTd9+jcEPmlLgc4aUq7p+viZZurLcnjx4sNPPuKGksMhw9Jc+XHMKxAbz3CI+ev0NNNNRinlxn5PfcDPN65dFlZDn4KQy6IGj9WhfdI2PYuTwAppNKBXyvwyZwlOuD1TY5Xt/5ZR0wr3e2NjbL+3xFLKfK4lA6Z1cVsSC+N/TcaYiUCo3D1EuiGkcDKTAc7Dh8hx3Qx50yuQxm9fV5kLn5CBsxc3kMxDm06I+31ma6IRoHQbUfabCvNCUEFIfO9foiks0SSVz4pGloyuddNqHnCwYMvFfbaLA== 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=ZHl3imB2MTXt7pew7uDec0h5NMyhhOl3FKPgVMdbHuw=; b=GbtshzSbLH2YDHCyLW6iZ7PpFrNVsX8TBWcXYMjuTcf/i5EPq7EmjDWnpc3tO0fhCM62YqGGqeXXpWO759qe8ey4STT+zAxSBytaxK/AFohflPlAnrUNx1MlH8bMJzc5Hd2n3cq939JFuAFtNfslAUZcFrovMo2brtBQ96I9KYbJzUirxzzT/Fy9q9/u1lQOtIvjgVV/e27KIxXOmX4X579jwTTzecRAC+kitzeaS9fYXVTlS0KlCTR1NHTbyjMF2ZWrJzovv3Ytuco5XU3h0C3NAEJKcSUgoHoi/hbn27rcnumF96cFFuWSiaWpdKSLRm21amEYZFVeSWcfWzLFWQ== 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=ZHl3imB2MTXt7pew7uDec0h5NMyhhOl3FKPgVMdbHuw=; b=TnjE0i3RK7xf68/unYsvrwZOID6ueJdy3b2vUY3Z4nEdHon3DjmAbYZZNcdKhT1ovQ+XaWLH7TQdKrz9ZoKja0HS8JY7g0Xtnqm0weha6yPsSTONIYe35EXrWp7EoQqkzNK4J/lcgO0MTl15TkivsReQDhqRLKbDCKeGDcPIshw= Received: from BY5PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:1d0::24) by SN7PR12MB7371.namprd12.prod.outlook.com (2603:10b6:806:29a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 22 Jun 2023 15:26:35 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:a03:1d0:cafe::39) by BY5PR04CA0014.outlook.office365.com (2603:10b6:a03:1d0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:26:34 +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 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6477.13 via Frontend Transport; Thu, 22 Jun 2023 15:26:34 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.2507.23; Thu, 22 Jun 2023 10:26:33 -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.2507.23; Thu, 22 Jun 2023 10:26:33 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:26:29 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Venkata Prasad Potturu , V sujith kumar Reddy , Gaosheng Cui , Charles Keepax , Ajit Kumar Pandey , open list Subject: [PATCH 08/11] ASoC: amd: acp: export config_acp_dma() and config_pte_for_stream() symbols Date: Thu, 22 Jun 2023 20:53:52 +0530 Message-ID: <20230622152406.3709231-15-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|SN7PR12MB7371:EE_ X-MS-Office365-Filtering-Correlation-Id: 33e82ac4-85d3-4fd5-1325-08db73351071 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gDAhX2fAztzW83J0YqCv2cJEQDxOHQXvQXvA4ClKjVpiFdI2ZDSr/b4uxxQqbtRJkT1lv6iHmVbX39zUGWVI4fCAvtqOwHfKPr1ijyby/13Tt0thkigCSn0CFUwsd/JfSiN+2nBKJZEeFfqQuQM1JHX7fnsnkuQumDpat+GuzQ1bqsoof31aDh0DA5/BrY83+t861iGEd4A5E4smUDZDu08p8ujnS8jTAH8V09u6t5WawRQ1PpziRamGqJsm91GDe77Eix5bg1PXgP9OqbJbLBAY+1iTIukpvIgAQ23gIdBsbF4jQfwN3xIpaLO/hgmhtj/9V1bqNBkpxeeVQDdwYdq95siGtg4mQLQMS08hiB1tkEmmT9JSI5pAWkdxvbzg6BciQb0dnU3gsfMqvxGS6Ln+7dEh1hJ2zb17Uiyc0Zc3E7aRhH4ZxtP9M27ed+sqS9ic1sDyAoKnjBqbMuqfjyT5JysK94DwX1/GqrWmTv5BqAbQN3QcXIK5WbdGLt6ilbpPk3N+ZZ5QzgWeRJFYLwwjqPw2ls853XBSuM3KbTezKVP12F3OLa+R7cO+2Fk0rv3t7vx6cbjpwEZv6XGhanFZIS6wJzKTNS5Rrl3zSSnPyCFSE2D73n8vb9KWxL7+ptAwmawkK/g4nOt/Z5lpSYX39uU2YeCep/TS0SKfrMjk2lqjAaJylDITFveLJgnWuJ9kZOvDcLjcz5iDcXcp2S0yzLajZYN97pitb0UagugwlDXI73ulse6aqaxfesJ+jST86Tfxv97OgpbGMc0hXw== 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:(13230028)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199021)(36840700001)(40470700004)(46966006)(40460700003)(36860700001)(5660300002)(36756003)(8676002)(8936002)(82740400003)(356005)(81166007)(2906002)(40480700001)(478600001)(186003)(7696005)(6666004)(110136005)(54906003)(2616005)(86362001)(82310400005)(26005)(1076003)(70206006)(70586007)(336012)(426003)(83380400001)(316002)(41300700001)(4326008)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:26:34.7801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33e82ac4-85d3-4fd5-1325-08db73351071 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: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7371 Message-ID-Hash: ZJQ3ZR766JMEADKNBAA5XONO4HG6RDE6 X-Message-ID-Hash: ZJQ3ZR766JMEADKNBAA5XONO4HG6RDE6 X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Export config_acp_dma() and config_pte_for_stream() functions. These functions will be used to restore stream configuration during system level resume. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-platform.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 447612a7a762..d34271862e42 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -128,7 +128,7 @@ static irqreturn_t i2s_irq_handler(int irq, void *data) return IRQ_NONE; } -static void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream *stream) +void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream *stream) { struct acp_resource *rsrc = adata->rsrc; u32 pte_reg, pte_size, reg_val; @@ -144,8 +144,9 @@ static void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream writel(PAGE_SIZE_4K_ENABLE, adata->acp_base + pte_size); writel(0x01, adata->acp_base + ACPAXI2AXI_ATU_CTRL); } +EXPORT_SYMBOL_NS_GPL(config_pte_for_stream, SND_SOC_ACP_COMMON); -static void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream, int size) +void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream, int size) { struct snd_pcm_substream *substream = stream->substream; struct acp_resource *rsrc = adata->rsrc; @@ -169,6 +170,7 @@ static void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream addr += PAGE_SIZE; } } +EXPORT_SYMBOL_NS_GPL(config_acp_dma, SND_SOC_ACP_COMMON); static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { From patchwork Thu Jun 22 15:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694917 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 E0FEAEB64DA for ; Thu, 22 Jun 2023 15:29:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DA459832; Thu, 22 Jun 2023 17:28:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DA459832 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447759; bh=6kbpSSTDUblxoNf9LyE/yIKCY1TOouabuN/d1ZNkh48=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LZar2ereF0cUxLjyDc6E6yUwMFbMJ9v0iLMqfGA6KpPDwEgZhBSlgoc4uDAWGi5Fi AM3LgOepIhGsZAFmk/CvXBXt0zJImCqPsv6V3tfbKOK40XJa89hj8JiNdXerHpi83S Lc1tH7+80H5lhDluSAccZZPgW3ZnHrKJNgPvxf58= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59B94F805C9; Thu, 22 Jun 2023 17:27:13 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 37CEBF805D2; Thu, 22 Jun 2023 17:27:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 449BCF80551; Thu, 22 Jun 2023 17:26:59 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e83::61a]) (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 E8131F805AA for ; Thu, 22 Jun 2023 17:26:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E8131F805AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=0ad5k0Rr ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=koCr2Fxc76jkBsx/plBmW4YKwfH3MqD0FUp+oMeZmkufBvwkWvzkIszzljfrxcJjVHC6JAGD9aJwPAgE7VLLs/DMNoqwEttu1D7Dvl4W6roNDayEZF1tYt0FBiL3Gsws+PKmOtwhnWnh0hFxWRD6ZjPJHWNlZyjdeBYAssOonI8IQ726hFpXBjYKWcZ2pu8SWFjhKGpYPzpdW7oyaZRFkjR4BsRkdkuO0uKakra/8zYZs4TG535MjA+ibd6QYrrY/ut65YUhHMwswBA36LzsJVJgLPW7Ndu4OAYzFHH1IYRs6zgR/KtVBMgoegWfrsDU7tUTHi6ucSv9G5JCfMB5SA== 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=ZHl3imB2MTXt7pew7uDec0h5NMyhhOl3FKPgVMdbHuw=; b=Rdabt8eLpX7+7FFbTTFgMcwkkagg7nUpadk2fJssBplpQ7iWXbl++EvfATw+qGb3LlvYndBfJu5+pSsF3eAvWKiA26nVRZmyYtoDHMebvh+nRaBTjPxFWmPBAMQBpe+LlatTmWX0uU6jbFIrUZjTqxUv+4NoTTfHIGL3b3w+XkPXKIkFLM6OnVf0hjdmFNvZt9We0dok2z5aS02EBnR7BFG/eb38xpH7+OSBfqtpH7dTG4DuGsf+hfgKvYALPU1mIY3GwOJUge6GW+lxOFtdsYrm5tGmtaJuwcI9RQnWel40m1ZahMIDoZ8cqhPHu/v+XySzcriFVTpIteM/XckJsw== 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=ZHl3imB2MTXt7pew7uDec0h5NMyhhOl3FKPgVMdbHuw=; b=0ad5k0RrNMQjD0y1xbAruSX9uxs4CCkzeV9HB/OfTyhXL3MxF5jJj/n/17tanHSVgv0/HaVyKNkrtmiGhU0gCuyNOe5ayKzvIE/geJZCgICB0Gz6TBe4nQqyW2ALvw8C7cBvLxKtRUU8Aowkk49bzyNVpITZ/7m24nn4mESt0p0= Received: from SA1P222CA0040.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::8) by BL1PR12MB5192.namprd12.prod.outlook.com (2603:10b6:208:311::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Thu, 22 Jun 2023 15:26:45 +0000 Received: from SA2PEPF00001504.namprd04.prod.outlook.com (2603:10b6:806:2d0:cafe::1a) by SA1P222CA0040.outlook.office365.com (2603:10b6:806:2d0::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:26:45 +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 SA2PEPF00001504.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.17 via Frontend Transport; Thu, 22 Jun 2023 15:26:45 +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.2507.23; Thu, 22 Jun 2023 10:26:45 -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.2507.23; Thu, 22 Jun 2023 10:26:44 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:26:40 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Venkata Prasad Potturu , V sujith kumar Reddy , Charles Keepax , Ajit Kumar Pandey , Gaosheng Cui , open list Subject: [PATCH 09/12] ASoC: amd: acp: export config_acp_dma() and config_pte_for_stream() symbols Date: Thu, 22 Jun 2023 20:53:54 +0530 Message-ID: <20230622152406.3709231-17-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001504:EE_|BL1PR12MB5192:EE_ X-MS-Office365-Filtering-Correlation-Id: ea3277e4-ea6d-4fae-6143-08db733516c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cMltbWdW+skZ1LWf/x3yX0UntCSfmIqeqiGXqi+yWWkfoawh+aQznWRK60k9fA5HWvWFArbhMESOnOxnfJZ09N5nPIiMfzqZDm+arpFu41EQl0oaWKcVTb5Pxj7aFY81uz85K0/katySINLVuPCEOFaW6R/2w3EgBNdVLGgcFMB9llI+dCpbnKJd/DjW4JWDDjqByHV9iTHW0bABixrL2CrOoAfGoQBGClgqGTGr5xVeYcOkt7BoLKUwmMooAGZNcv2fLMTnc6X6WM+2k60Oe07g3oMmlErk6aYMpNDmegxBDJqKMjHs6JskvfGNwENFEp3PaEvaDSEIxP12kopMWplsbJH0HmZY3LtYVKHmtc1ybr0YSOBTMFqb5GmEJuZFt0c0zT60s5s6qE3kW8nR8A+NtRHHOhNLsM4Pdrn/A9+dFlAEVgs3DfC+8G5VU55okZkzUPMSntHC9GswkeR/Jq43ikZeQV5HaIsFRz26J3Aky2IT+nvUn7mVOejHzlcA8vqOaVpbbdRdkXXpgiw9Ea/fPXDILb+iHlKsNJGhiOMuRzVg3A7b0aKL3+msxj5SNS6kopV+q8AsSrFpih+E9lQUVYpciKi6gkJ1ges9Bi5Qz9UlDckqXBsy5AS7GdikfvH/SAADyfwYcz0H0cCO6c03KbHSL/18n/yFYqOuYsWhhZcB5IkIhhtQxLcFNpy8P7GtlE5MDLHiOS+KBkBZk+SdvbCx0nLAhFFT+TOHdst5sTwX9+q6iCdPaQRx/iz1wIeESaip3ZUZbdw4WpSsPA== 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:(13230028)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199021)(46966006)(36840700001)(40470700004)(70586007)(40460700003)(70206006)(4326008)(356005)(81166007)(2616005)(82310400005)(86362001)(1076003)(36860700001)(26005)(186003)(47076005)(83380400001)(336012)(426003)(82740400003)(110136005)(478600001)(7696005)(36756003)(40480700001)(2906002)(6666004)(41300700001)(5660300002)(8676002)(8936002)(54906003)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:26:45.5018 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea3277e4-ea6d-4fae-6143-08db733516c4 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: SA2PEPF00001504.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5192 Message-ID-Hash: QOYADG4N4N73NMPD56OXSUPJU4WZ3ANI X-Message-ID-Hash: QOYADG4N4N73NMPD56OXSUPJU4WZ3ANI X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Export config_acp_dma() and config_pte_for_stream() functions. These functions will be used to restore stream configuration during system level resume. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-platform.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 447612a7a762..d34271862e42 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -128,7 +128,7 @@ static irqreturn_t i2s_irq_handler(int irq, void *data) return IRQ_NONE; } -static void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream *stream) +void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream *stream) { struct acp_resource *rsrc = adata->rsrc; u32 pte_reg, pte_size, reg_val; @@ -144,8 +144,9 @@ static void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream writel(PAGE_SIZE_4K_ENABLE, adata->acp_base + pte_size); writel(0x01, adata->acp_base + ACPAXI2AXI_ATU_CTRL); } +EXPORT_SYMBOL_NS_GPL(config_pte_for_stream, SND_SOC_ACP_COMMON); -static void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream, int size) +void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream, int size) { struct snd_pcm_substream *substream = stream->substream; struct acp_resource *rsrc = adata->rsrc; @@ -169,6 +170,7 @@ static void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream addr += PAGE_SIZE; } } +EXPORT_SYMBOL_NS_GPL(config_acp_dma, SND_SOC_ACP_COMMON); static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { From patchwork Thu Jun 22 15:23:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694914 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 C6408EB64D8 for ; Thu, 22 Jun 2023 15:30:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 80FA8E74; Thu, 22 Jun 2023 17:30:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 80FA8E74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447854; bh=aJDIrlpJaogXrlZvww+cNv5yDAT/rm5vPXpBBkSP/G4=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e6kkv51UsfS8Zf/mN3D7Y9I3sLMZQLDJIKGZGfqw/4VD8IiVhcPEImn8QUbMQd/Uk aDmTHsBbCEkjTWuCbYbSTl1KZABv8s7JH2gIWw0nq+TBSRvEETNuqkKhhMgtvoKDNh CVTyP6dAW3c9PwlU5T2ctCnjbh6ea7G2DKcMWLt0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 802E9F80609; Thu, 22 Jun 2023 17:27:36 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6A437F80606; Thu, 22 Jun 2023 17:27:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE95CF805FD; Thu, 22 Jun 2023 17:27:29 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) (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 AF9AEF805D5 for ; Thu, 22 Jun 2023 17:27:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF9AEF805D5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=Ees8tQpg ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFVwV/LyLPhqp31pVznWNkj5MRgrkGMeTmzetOpjLJHiRB+efzHGMWtdTaxCxXEVqna7Gz/XZ4QhTzmYf17Nu+wFMm+fdQLwPyiJh0V2gWAJSV8e9XIiN0/HlBXjLmlH96IV57qXIswLXtNuYI+6FbwnFkc+/WZGFrObr0FoFH+vNvIPtLi7V1SKz9AQqhUF0HyWVkoDEd+uBA7p/EubbsOtrLPJpO6voNY0zMM3y6Hax5n0y128OLv0JeVdNRVEo++DzdjXH3JKgjYUq/892mNIogDeIqV3sBWhKQqSmL/3GRHBFLIbZtN3aYJSAI3MlN2JlKat/6Y2so1Z3VCCVg== 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=RuC/p36abO8JEZCdYis01V1LLwMVRik6s9LS9KgnaLE=; b=aUjxE9fjhIWv0BGnxAIZw9zbNDw9TxTPax+Z9rFfO90G3UwjQLvfsc5h67A7B7ws4yUoqD7RwwNiU01WQQw1iL22QzvE5GXph/QqCtRyZFLCCXhnQ10QZ2k853nvYa6whvtbEeSjVkXUJArq/ML+33GymyYsC8SGu3aJwW93thQFEjNoHlTfmxUF4eQ5/WAmEyA8tF/I5zSpYYVPeZuuhh8OBDd5sytrYB9LAt8RbtYrfrWtzn0jRviBiTHCfp3xmz1iVL0RpxlVHGy9SvK7CUuHxplowAQfiRWvTvPiekFkZO0dBjJMG4qyyEN9I8xzGu8EGJW6RiMpxIFcu3FFCA== 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=RuC/p36abO8JEZCdYis01V1LLwMVRik6s9LS9KgnaLE=; b=Ees8tQpgHvu70+U4Em5FhHH3fM34l3wOZDq34ZsM2r/2Z5SpVdw9Jg1RaZh8F1zmUzAJl3RM6F7LTvFD7hsZ+8dzSzTUWLpmtSjM09hL3OXBnrFojgQhXn0ztX5E+Z6MhPJICz5IPhfL+qKGnhXWkzO1drGBKv8snRYU4L+yOgg= Received: from SA1PR03CA0012.namprd03.prod.outlook.com (2603:10b6:806:2d3::15) by CH3PR12MB8403.namprd12.prod.outlook.com (2603:10b6:610:133::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 22 Jun 2023 15:27:11 +0000 Received: from SN1PEPF000252A0.namprd05.prod.outlook.com (2603:10b6:806:2d3:cafe::b5) by SA1PR03CA0012.outlook.office365.com (2603:10b6:806:2d3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:27:10 +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 SN1PEPF000252A0.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.23 via Frontend Transport; Thu, 22 Jun 2023 15:27:10 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) 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.2507.23; Thu, 22 Jun 2023 10:27:03 -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.2507.23; Thu, 22 Jun 2023 08:27:03 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:26:59 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Venkata Prasad Potturu , Ajit Kumar Pandey , open list Subject: [PATCH 10/12] ASoC: amd: acp: store the pdm stream channel mask Date: Thu, 22 Jun 2023 20:53:57 +0530 Message-ID: <20230622152406.3709231-20-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A0:EE_|CH3PR12MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a44dc3c-38b6-40d1-481b-08db733525ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J/oMpo+DEurf46h0l+XXiT3P2nfYdLBxN5lYemnb1aHnlWx+H1klfqncyl5xScku8NnVPXZTiSi1uClvjJ8h/AM91yjKlWguGexny6yRjtifKQ2pHnShPzSJFzEFKou4rFquqDs33GvZWuA02bA7VCik/kdIl0c4rMxV2/tQMX0OGNtDaLw73u5q8MvsK1F78iraDgv5egTKKrU/e0ZfpIHPPdLrvGPL0vrk7lvy5M1QZhpjGpfUSX5eUKc9jDJfoLzSLeZZW50zLtlKFHxfXZp3Fkaj9Kx8bf/bO7ixWDFVNlQubZ1hGu4kWcnxJdu4EofL1thLP2gchto1x6gpNHdV7StvHK2YL5kYCHymvrH847lTpOn0IDFyS7C41thaxrAO9JoxRYrW7NbLdLEFvZe400XvibKLTkbv9o7r06tIs+dYj47L0krTdKr7u/VEoaDwnY6ciOeP/R/VPeRwvZMq/lIlQJ6AcFbWeiIzYHIaUhKGQrcvo4DV8yrHgSVJiPeIqgcqgx+BK/8MshC17TSDKMH66cyicdDsnOgvMrU1VWdPx8itf52oLPZUM0/BWLqpNoCx0H/2cWnFjR3HhQ6tGAVmbSSIYhC1g9C+8to4lCNLsWDMcfOCXazHXPntI1HaEzg92vD8bX4RAz/YloWwuSlXFFV3suMQzFRvbWD+Q2h77TdwGuzefFkl7Vz8gD7Jd9ILLvwpffPzGssjvDUju6zjjB+VV+ArKMrF4AwxhjaywKkjzorH9Wwtz3vM8N30YlSZysM+wM8KKxztaQ== 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:(13230028)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199021)(40470700004)(36840700001)(46966006)(2906002)(82310400005)(7696005)(70206006)(70586007)(4326008)(478600001)(36756003)(40460700003)(316002)(110136005)(86362001)(54906003)(186003)(47076005)(1076003)(26005)(426003)(2616005)(336012)(81166007)(82740400003)(356005)(8936002)(41300700001)(5660300002)(8676002)(36860700001)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:27:10.9003 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a44dc3c-38b6-40d1-481b-08db733525ea 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: SN1PEPF000252A0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8403 Message-ID-Hash: C55KFTCD5LL2IBKLAK2LQDPWWZJOK2FZ X-Message-ID-Hash: C55KFTCD5LL2IBKLAK2LQDPWWZJOK2FZ X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Store the pdm stream channel mask, it will be used during system level resume. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-pdm.c | 1 + sound/soc/amd/acp/amd.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sound/soc/amd/acp/acp-pdm.c b/sound/soc/amd/acp/acp-pdm.c index f8030b79ac17..2833d2b7e596 100644 --- a/sound/soc/amd/acp/acp-pdm.c +++ b/sound/soc/amd/acp/acp-pdm.c @@ -135,6 +135,7 @@ static int acp_dmic_hwparams(struct snd_pcm_substream *substream, return -EINVAL; } + adata->ch_mask = ch_mask; if (params_format(hwparams) != SNDRV_PCM_FORMAT_S32_LE) { dev_err(dai->dev, "Invalid format:%d\n", params_format(hwparams)); return -EINVAL; diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 38c152c6c8c6..82e0684cb284 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -164,6 +164,7 @@ struct acp_dev_data { u32 lrclk_div; struct acp_resource *rsrc; + u32 ch_mask; u32 tdm_tx_fmt[3]; u32 tdm_rx_fmt[3]; u32 xfer_tx_resolution[3]; From patchwork Thu Jun 22 15:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 694913 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 461ADEB64DB for ; Thu, 22 Jun 2023 15:31:35 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2B2E083E; Thu, 22 Jun 2023 17:30:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2B2E083E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447893; bh=pxVEIZ17WqFcpZY8z1C60Ryv4TgMD+t0u4d7C+kbAQk=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=At1S034CMdXaKAxiYkY2sil7qMLuJfI6CDhHX7JTB/CI+KUKVtb7Zs27IiANXN2X5 q9mAbGRCwJns7CJpehG68xqeuVPkE2tnb7+rMQrd99/VoEdAcxZFqgWwM/8c1hQQ5j IDuixcBr2LtJ6gBJF+hrAkt5tva5ZjWi3CC0ZnD0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A7D4F80568; Thu, 22 Jun 2023 17:27:47 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 62730F8061A; Thu, 22 Jun 2023 17:27:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8E762F80613; Thu, 22 Jun 2023 17:27:40 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::600]) (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 8D86DF805FA for ; Thu, 22 Jun 2023 17:27:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D86DF805FA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=Wg7/Wb4S ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKkE8mowltoetLO6I9meJ9cPh7EauSi9qGujYrfzncdA1RbnHOBKHIiOiStKjMvRMW/XvNzLN5v2fJVtxeYFiaWECG8flmjGQtQY6zFAFqMusbnUkC+ejXs1T6bo5zz0v6t+E2qbgD7IdVqlxkIj9E7YW7sHMjrHkRi1VcPI0c4K8IjpyObtLfpbPYZMgdG/cGI6EM+YTNAsJXn4kf+f9Jn2tDpVex34ZbyNnQJ9E9xnYyxz66QT6MISeY7NVDB5NEfND5pOszfevbBNpniapt8WI7Gx1DGnL+n8MJEjUfDboCt0ScKjxIgtGJx8F5iiDHLtkFBQcjlajZjJlgMvJA== 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=iBy8FZtzhflK/O11biPfyMuMDcZU0bVlpYPp66Nv80c=; b=hbdy+zblFjuwwRxvE2ACfa7smEbCH7/tLRhaurTp+ATgPuUkl+nRnHSBAeOiITz2AW90YNkuqKlwdkkse8XRlpYahAmEI2IXbadzC+q1Lg9i3GfUYTs/F9yNJs327tdZwepRf4ghDUllzl83QFNCArl6fK2x9wxEgXYGK21t/SJq2QNBC++RuAJTHdnC49XqNq51kOB0Fwb2voK5vhXxobAbrGeeB7S+TIxYjZvfb0kEtWYszJs6P0inDxLA9xVDXtifvgvLPRk0EFZWMpKXLaSLi4MXoLBtYBRlDHoD5dxhEqfpQPaSuhCwjy062n5WjVvGqbaxVZbdILewFIJzSw== 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=iBy8FZtzhflK/O11biPfyMuMDcZU0bVlpYPp66Nv80c=; b=Wg7/Wb4SwyCOV5sL1LcSHHTa/7aZNpb+NWuKXRxsj1QLRg2wUOkdJvHfb1WXKpdvENmUjId06gb7KKWsuZ05gxrDt6wu/qwj2lU1BLlLIQGYBU1XlBNWpNapLNwB/UU5uYEI0TeK+6QP3ci5wD7mMfA9Jtv7rP9Z1doJa9Zrn+w= Received: from SA1PR04CA0019.namprd04.prod.outlook.com (2603:10b6:806:2ce::26) by DS7PR12MB5837.namprd12.prod.outlook.com (2603:10b6:8:78::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Thu, 22 Jun 2023 15:27:21 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:806:2ce:cafe::e0) by SA1PR04CA0019.outlook.office365.com (2603:10b6:806:2ce::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26 via Frontend Transport; Thu, 22 Jun 2023 15:27:21 +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 SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.19 via Frontend Transport; Thu, 22 Jun 2023 15:27:21 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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.2507.23; Thu, 22 Jun 2023 10:27:21 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Thu, 22 Jun 2023 08:27:20 -0700 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:27:17 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V sujith kumar Reddy , Venkata Prasad Potturu , Ajit Kumar Pandey , open list Subject: [PATCH 11/12] ASoC: amd: acp: move pdm macros to common header file Date: Thu, 22 Jun 2023 20:53:59 +0530 Message-ID: <20230622152406.3709231-22-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|DS7PR12MB5837:EE_ X-MS-Office365-Filtering-Correlation-Id: b28c9b13-a6e2-4fcb-a9bc-08db73352c2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sw8dU52qtSR69YDwSMklMwD4V3Ea3k8oL9udZ6zeVHGss0OS7Xao+uZSy2mOvEcTGj28DFSf/4KBVbLYS2Y92Gv8zoiY6egg4umGUkrWB3NaraH00s5yTHOklbFcatrv4ntgkFQxcCWRivIbsU2jfCOgaAanbyATJU211sK2AHsTGb1qocKmw2P6AsFN2Y/kY/f/YXeJVfC7TpdjIpEIj42i+uEHvaJPQeo/xH/p3AmCCihtBjW23tjkOtKAbW2OQfEj4W8+trY5mqyvvhHCDYmgJhQdcDao7hc3X4rO1GOUZvN8PsoVvp3SdvcQBaN8feLoR4K2yaQEfGcqrDJJo0ZxMUVJDAhyE8h8I4hiYTRgCdNdjaBjDgASRYko+/shZtqFqdNnhFNUoLgBL12rBWkM13Uh6i8pwP0XIvXiRDeytDkI9lX5iXMFSY1o/PFKonN1xI07sTPrshMAVu5nZDPWPt466ibQ08h/aI7O1maP4cVrE+FyLil/vHIWsNTKTeGxHyLRjzBa0TtOZIhxJADXsFp8JqC7D27rzdBKZQYoEKRnOCSy7Otg1QNe6w6TRKrGMFJAqq48pNMHxqELgj6AzZLYaGD1rNMZkpKcIVgh8WviNoLpjHnBl5eSRSJmfTkG8s5/KcEfKoIFLo2kQPLH2sDWewztB8M7sHKyz3Bbf8Z0qy12h2eWkF25Muqw4miIdtOd0ZsdKKSQb5+djxfT43DOt6iPw0MB12q/bVq3slstrQHckAvOXufU9S8TykRWGtXIDVBvA16H69MBvA== 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:(13230028)(4636009)(346002)(396003)(39860400002)(376002)(136003)(451199021)(36840700001)(46966006)(40470700004)(186003)(336012)(36860700001)(1076003)(2616005)(70206006)(4326008)(83380400001)(70586007)(2906002)(82310400005)(26005)(426003)(47076005)(36756003)(86362001)(82740400003)(40460700003)(81166007)(5660300002)(356005)(8676002)(41300700001)(7696005)(316002)(8936002)(40480700001)(478600001)(54906003)(110136005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:27:21.3992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b28c9b13-a6e2-4fcb-a9bc-08db73352c2e 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: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5837 Message-ID-Hash: 3RAKFVCL4UHJXY5NRT5Z2DOSPGXJCB5G X-Message-ID-Hash: 3RAKFVCL4UHJXY5NRT5Z2DOSPGXJCB5G X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move pdm related macros from pdm file to common header file so that it can be used across different files. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-pdm.c | 12 ------------ sound/soc/amd/acp/amd.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/amd/acp/acp-pdm.c b/sound/soc/amd/acp/acp-pdm.c index 2833d2b7e596..f754bf79b5e3 100644 --- a/sound/soc/amd/acp/acp-pdm.c +++ b/sound/soc/amd/acp/acp-pdm.c @@ -25,18 +25,6 @@ #define DRV_NAME "acp-pdm" -#define PDM_DMA_STAT 0x10 -#define PDM_DMA_INTR_MASK 0x10000 -#define PDM_DEC_64 0x2 -#define PDM_CLK_FREQ_MASK 0x07 -#define PDM_MISC_CTRL_MASK 0x10 -#define PDM_ENABLE 0x01 -#define PDM_DISABLE 0x00 -#define DMA_EN_MASK 0x02 -#define DELAY_US 5 -#define PDM_TIMEOUT 1000 -#define ACP_REGION2_OFFSET 0x02000000 - static int acp_dmic_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 82e0684cb284..8dc663c8d98a 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -111,6 +111,18 @@ #define ACP_TIMEOUT 500 #define DELAY_US 5 +#define PDM_DMA_STAT 0x10 +#define PDM_DMA_INTR_MASK 0x10000 +#define PDM_DEC_64 0x2 +#define PDM_CLK_FREQ_MASK 0x07 +#define PDM_MISC_CTRL_MASK 0x10 +#define PDM_ENABLE 0x01 +#define PDM_DISABLE 0x00 +#define DMA_EN_MASK 0x02 +#define DELAY_US 5 +#define PDM_TIMEOUT 1000 +#define ACP_REGION2_OFFSET 0x02000000 + struct acp_chip_info { char *name; /* Platform name */ unsigned int acp_rev; /* ACP Revision id */ From patchwork Thu Jun 22 15:24:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saba Kareem, Syed" X-Patchwork-Id: 695297 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 B5157EB64D8 for ; Thu, 22 Jun 2023 15:31:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 85326E89; Thu, 22 Jun 2023 17:30:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85326E89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687447905; bh=Cnau7PzQ5xCtgnsD0tIaH/4POOUAUYD2rQis0peXwrQ=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Z33D+Wv+w3cYu/vXG5aLvSTn0UUdqOrl3gbE1AMoml430k3HIJXOPJyqixQJPBvkC P/vzQlSTT3Reciv0KA+QzeXNbx2uI+KcdsL50BYB1a0qHurLqQbBv0KK+j1vPeT9Jx wSfMDD6Na1LPUF0R9BVGizxAr+lYOetAWRhuNTyU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C4C7FF80618; Thu, 22 Jun 2023 17:27:57 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 24291F8057D; Thu, 22 Jun 2023 17:27:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B0A29F8057D; Thu, 22 Jun 2023 17:27:53 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::61b]) (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 2FFA1F805AB for ; Thu, 22 Jun 2023 17:27:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2FFA1F805AB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=EmXbDNR1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m37EMcW3EFkQOsFpen9UnT0J8IbjH6jCsBkiRXk8q+MDDuk8NAwtkfOktJHCx3kOfIL4bvJWdSvyfmC9gSgeksy7VkbCY0o4uGr99HVQzkgJ4tBlb7dAhRwzhZQZCSAO2LN3l5PVZdtCXJS09XL6LcBgUBddi9z/GBrzco20avIEB2RShQG4CUNDj1WG1FczS++u7N72VRuxeUO4zzfCyBUZczKuRK8qbxRbcnsWHAmQUEn5ERGXZZ7K+7KkAX+xSUWU9//1dLgBtl1vx5l3PgqNcmJYnQa2lhGursILVLwfqO0viEJc5T7HY/SpKOcvSYHGH+GeM12zkCibgOY5qw== 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=Rwq6fDAuv0vFz/YvtKA/oSK/5+p+hkoQrRMmsbd4jtU=; b=nDyEcEYKfiFIz2IE4FMg74HDXd4fTNkUIiTRWDVdXGMsjkE8ptC1OO+nK0PlZtRfCqLse902TD4LKTdi7DJGla2M168l8Y8tFDSWw8grt3n8e7P9peXY8p5kdReSmqOSIAV9kA0sadkhymWrTQDpYtgWO8nuKzILaV67UTaGGWDvcL19ckKIkmjHG3M09uwWsMnan3RGpwNe9YRSofVBCwXuxHEsYTz4aqs6bwsyQdDbIkLz10XWjBya5uuZ3LjWqNC/nYKvToj9OtiaZzFNzvb145QIcsrT6hpJJF41DnUPjuy5wsorrh8yiOfddwNhh219t5NE0nUwwxIz96vRNw== 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=Rwq6fDAuv0vFz/YvtKA/oSK/5+p+hkoQrRMmsbd4jtU=; b=EmXbDNR1jdS+o9QcqKQAmvm4c2hcZsUWhHrC67W9/HaFTt5u9ikC0bNO/fCgF74rPl0iOL+5Klb6aCEBS2CXrmtqq8pZYxPBHR//SDQMSrSXukDd9vQpRwbZv3DCLpObc3fLrkBOX0Gk8rFW8M9dSkmpLEOBlMRgwtbOmVwaZHs= Received: from SN7PR04CA0226.namprd04.prod.outlook.com (2603:10b6:806:127::21) by MW4PR12MB6852.namprd12.prod.outlook.com (2603:10b6:303:20b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Thu, 22 Jun 2023 15:27:33 +0000 Received: from SA2PEPF00001505.namprd04.prod.outlook.com (2603:10b6:806:127:cafe::a8) by SN7PR04CA0226.outlook.office365.com (2603:10b6:806:127::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24 via Frontend Transport; Thu, 22 Jun 2023 15:27:33 +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 SA2PEPF00001505.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.17 via Frontend Transport; Thu, 22 Jun 2023 15:27:33 +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.2507.23; Thu, 22 Jun 2023 10:27:32 -0500 Received: from amd-B450M-DS3H.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 22 Jun 2023 10:27:28 -0500 From: Syed Saba Kareem To: , CC: , , , Syed Saba Kareem , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , V Sujith Kumar Reddy , Nicolas Ferre , =?utf-8?q?Uwe_Kleine-K=C3=B6ni?= =?utf-8?q?g?= , "Venkata Prasad Potturu" , Ajit Kumar Pandey , open list Subject: [PATCH 12/12] ASoC: amd: acp: add pm ops support for rembrandt platform Date: Thu, 22 Jun 2023 20:54:00 +0530 Message-ID: <20230622152406.3709231-23-Syed.SabaKareem@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> References: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001505:EE_|MW4PR12MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fb49249-e365-410f-92e7-08db73353327 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gI/g7sQI5hi5PPjlUXiK2Ke6xHh1eZ8Xa8NLlaYOfkZLp0eLiS1fWhKEFQIkCgYYpLIStXgLx0C8g/xJrnzTMKjC3cOoSLC0RkIwQLpDvyOLHNlipyRvhQvYGOYIbbIewN0CJNA68+D4Pfr9/dcc2V+cvhXeLwuFc/se6oqAUOz1Fo35lTe1XSY424UrTap3nkaigsIAM+nlOaXkrh0PnsYKBnuvkmymxMQgADHIOovIUpPvbOCXrEAX4ZjVHEyA8Nq2X0QwHfEVrWR022Dv+YAffIEdU3zUgA181Qhic0gqDXnv6svBtWRUIu4C0SNKrx8eCaOIweaZEkFo5p5L55uPhGUxjDH8yRlOie5SdMeJ7ZdzukBmpIAaK5yeU24eM0i9rNPN1vXUIZmdMJmdihf0zaEw5sYjhYbZK6SUpkOmSJH45Gg+Qi4DLJzroy5IEa/ITbl2z0MhdgH7D9sY47H5Qz1wNPyidl5p1EJRRSpTR8nYc5W4iUBLp3BxlpJN0D8NEXSjUOSvyojvHXt7Cwguidr+Vp9hI6gL69Gf2Cyzg5jmfWZUMy+/cklKhLPyJ+bcvQFUsH0BPc6RG8A26MC29xrssmSTNuHdHaM5ScpU7+/KWHZG+mlG1z1BZz3Akkxf+aXkfCZMUavCYxqE5EgYUTiGAwqCO3xiMpQmLeZCpNeUjG2zIacqFXIkIr3MXu1T25G0XVljC3z4Y31/60gBrVr2NbarW0x+tcr/wn/MZNPX5dGlG7GNXKgF5q8Thk3HbIjXtd1S6ELHlmJPtQ== 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:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(41300700001)(8676002)(316002)(8936002)(7696005)(36860700001)(47076005)(70586007)(4326008)(70206006)(86362001)(36756003)(6666004)(54906003)(110136005)(478600001)(40460700003)(1076003)(26005)(186003)(336012)(426003)(83380400001)(2616005)(40480700001)(5660300002)(30864003)(2906002)(82740400003)(81166007)(356005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 15:27:33.1124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb49249-e365-410f-92e7-08db73353327 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: SA2PEPF00001505.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6852 Message-ID-Hash: GQQOSLCJL43RFXD3WCPQ6MP4QHMDKZBL X-Message-ID-Hash: GQQOSLCJL43RFXD3WCPQ6MP4QHMDKZBL X-MailFrom: Syed.SabaKareem@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add pm ops for rembrandt platform. Signed-off-by: Syed Saba Kareem --- sound/soc/amd/acp/acp-legacy-common.c | 208 ++++++++++++++++++++++++++ sound/soc/amd/acp/acp-rembrandt.c | 42 +++++- sound/soc/amd/acp/amd.h | 9 ++ 3 files changed, 258 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index 45a45d002915..ba58165cc6e6 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -37,6 +37,214 @@ void acp_disable_interrupts(struct acp_dev_data *adata) } EXPORT_SYMBOL_NS_GPL(acp_disable_interrupts, SND_SOC_ACP_COMMON); +static void set_acp_pdm_ring_buffer(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct acp_stream *stream = runtime->private_data; + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + + u32 physical_addr, pdm_size, period_bytes; + + period_bytes = frames_to_bytes(runtime, runtime->period_size); + pdm_size = frames_to_bytes(runtime, runtime->buffer_size); + physical_addr = stream->reg_offset + MEM_WINDOW_START; + + /* Init ACP PDM Ring buffer */ + writel(physical_addr, adata->acp_base + ACP_WOV_RX_RINGBUFADDR); + writel(pdm_size, adata->acp_base + ACP_WOV_RX_RINGBUFSIZE); + writel(period_bytes, adata->acp_base + ACP_WOV_RX_INTR_WATERMARK_SIZE); + writel(0x01, adata->acp_base + ACPAXI2AXI_ATU_CTRL); +} + +static void set_acp_pdm_clk(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + unsigned int pdm_ctrl; + + /* Enable default ACP PDM clk */ + writel(PDM_CLK_FREQ_MASK, adata->acp_base + ACP_WOV_CLK_CTRL); + pdm_ctrl = readl(adata->acp_base + ACP_WOV_MISC_CTRL); + pdm_ctrl |= PDM_MISC_CTRL_MASK; + writel(pdm_ctrl, adata->acp_base + ACP_WOV_MISC_CTRL); + set_acp_pdm_ring_buffer(substream, dai); +} + +void restore_acp_pdm_params(struct snd_pcm_substream *substream, + struct acp_dev_data *adata) +{ + struct snd_soc_dai *dai; + struct snd_soc_pcm_runtime *soc_runtime; + u32 ext_int_ctrl; + + soc_runtime = asoc_substream_to_rtd(substream); + dai = asoc_rtd_to_cpu(soc_runtime, 0); + /* Programming channel mask and sampling rate */ + writel(adata->ch_mask, adata->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS); + writel(PDM_DEC_64, adata->acp_base + ACP_WOV_PDM_DECIMATION_FACTOR); + + /* Enabling ACP Pdm interuppts */ + ext_int_ctrl = readl(ACP_EXTERNAL_INTR_CNTL(adata, 0)); + ext_int_ctrl |= PDM_DMA_INTR_MASK; + writel(ext_int_ctrl, ACP_EXTERNAL_INTR_CNTL(adata, 0)); + set_acp_pdm_clk(substream, dai); +} +EXPORT_SYMBOL_NS_GPL(restore_acp_pdm_params, SND_SOC_ACP_COMMON); + +static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct device *dev = dai->component->dev; + struct acp_dev_data *adata = dev_get_drvdata(dev); + struct acp_resource *rsrc = adata->rsrc; + struct acp_stream *stream = substream->runtime->private_data; + u32 reg_dma_size, reg_fifo_size, reg_fifo_addr; + u32 phy_addr, acp_fifo_addr, ext_int_ctrl; + unsigned int dir = substream->stream; + + switch (dai->driver->id) { + case I2S_SP_INSTANCE: + if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + reg_dma_size = ACP_I2S_TX_DMA_SIZE; + acp_fifo_addr = rsrc->sram_pte_offset + + SP_PB_FIFO_ADDR_OFFSET; + reg_fifo_addr = ACP_I2S_TX_FIFOADDR; + reg_fifo_size = ACP_I2S_TX_FIFOSIZE; + phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset; + writel(phy_addr, adata->acp_base + ACP_I2S_TX_RINGBUFADDR); + } else { + reg_dma_size = ACP_I2S_RX_DMA_SIZE; + acp_fifo_addr = rsrc->sram_pte_offset + + SP_CAPT_FIFO_ADDR_OFFSET; + reg_fifo_addr = ACP_I2S_RX_FIFOADDR; + reg_fifo_size = ACP_I2S_RX_FIFOSIZE; + phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset; + writel(phy_addr, adata->acp_base + ACP_I2S_RX_RINGBUFADDR); + } + break; + case I2S_BT_INSTANCE: + if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + reg_dma_size = ACP_BT_TX_DMA_SIZE; + acp_fifo_addr = rsrc->sram_pte_offset + + BT_PB_FIFO_ADDR_OFFSET; + reg_fifo_addr = ACP_BT_TX_FIFOADDR; + reg_fifo_size = ACP_BT_TX_FIFOSIZE; + phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset; + writel(phy_addr, adata->acp_base + ACP_BT_TX_RINGBUFADDR); + } else { + reg_dma_size = ACP_BT_RX_DMA_SIZE; + acp_fifo_addr = rsrc->sram_pte_offset + + BT_CAPT_FIFO_ADDR_OFFSET; + reg_fifo_addr = ACP_BT_RX_FIFOADDR; + reg_fifo_size = ACP_BT_RX_FIFOSIZE; + phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset; + writel(phy_addr, adata->acp_base + ACP_BT_RX_RINGBUFADDR); + } + break; + case I2S_HS_INSTANCE: + if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + reg_dma_size = ACP_HS_TX_DMA_SIZE; + acp_fifo_addr = rsrc->sram_pte_offset + + HS_PB_FIFO_ADDR_OFFSET; + reg_fifo_addr = ACP_HS_TX_FIFOADDR; + reg_fifo_size = ACP_HS_TX_FIFOSIZE; + phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset; + writel(phy_addr, adata->acp_base + ACP_HS_TX_RINGBUFADDR); + } else { + reg_dma_size = ACP_HS_RX_DMA_SIZE; + acp_fifo_addr = rsrc->sram_pte_offset + + HS_CAPT_FIFO_ADDR_OFFSET; + reg_fifo_addr = ACP_HS_RX_FIFOADDR; + reg_fifo_size = ACP_HS_RX_FIFOSIZE; + phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset; + writel(phy_addr, adata->acp_base + ACP_HS_RX_RINGBUFADDR); + } + break; + default: + dev_err(dev, "Invalid dai id %x\n", dai->driver->id); + return -EINVAL; + } + + writel(DMA_SIZE, adata->acp_base + reg_dma_size); + writel(acp_fifo_addr, adata->acp_base + reg_fifo_addr); + writel(FIFO_SIZE, adata->acp_base + reg_fifo_size); + + ext_int_ctrl = readl(ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); + ext_int_ctrl |= BIT(I2S_RX_THRESHOLD(rsrc->offset)) | + BIT(BT_RX_THRESHOLD(rsrc->offset)) | + BIT(I2S_TX_THRESHOLD(rsrc->offset)) | + BIT(BT_TX_THRESHOLD(rsrc->offset)) | + BIT(HS_RX_THRESHOLD(rsrc->offset)) | + BIT(HS_TX_THRESHOLD(rsrc->offset)); + + writel(ext_int_ctrl, ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); + return 0; +} + +int restore_acp_i2s_params(struct snd_pcm_substream *substream, + struct acp_dev_data *adata, + struct acp_stream *stream) +{ + struct snd_soc_dai *dai; + struct snd_soc_pcm_runtime *soc_runtime; + u32 tdm_fmt, reg_val, fmt_reg, val; + + soc_runtime = asoc_substream_to_rtd(substream); + dai = asoc_rtd_to_cpu(soc_runtime, 0); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + tdm_fmt = adata->tdm_tx_fmt[stream->dai_id - 1]; + switch (stream->dai_id) { + case I2S_BT_INSTANCE: + reg_val = ACP_BTTDM_ITER; + fmt_reg = ACP_BTTDM_TXFRMT; + break; + case I2S_SP_INSTANCE: + reg_val = ACP_I2STDM_ITER; + fmt_reg = ACP_I2STDM_TXFRMT; + break; + case I2S_HS_INSTANCE: + reg_val = ACP_HSTDM_ITER; + fmt_reg = ACP_HSTDM_TXFRMT; + break; + default: + pr_err("Invalid dai id %x\n", stream->dai_id); + return -EINVAL; + } + val = adata->xfer_tx_resolution[stream->dai_id - 1] << 3; + } else { + tdm_fmt = adata->tdm_rx_fmt[stream->dai_id - 1]; + switch (stream->dai_id) { + case I2S_BT_INSTANCE: + reg_val = ACP_BTTDM_IRER; + fmt_reg = ACP_BTTDM_RXFRMT; + break; + case I2S_SP_INSTANCE: + reg_val = ACP_I2STDM_IRER; + fmt_reg = ACP_I2STDM_RXFRMT; + break; + case I2S_HS_INSTANCE: + reg_val = ACP_HSTDM_IRER; + fmt_reg = ACP_HSTDM_RXFRMT; + break; + default: + pr_err("Invalid dai id %x\n", stream->dai_id); + return -EINVAL; + } + val = adata->xfer_rx_resolution[stream->dai_id - 1] << 3; + } + writel(val, adata->acp_base + reg_val); + if (adata->tdm_mode == TDM_ENABLE) { + writel(tdm_fmt, adata->acp_base + fmt_reg); + val = readl(adata->acp_base + reg_val); + writel(val | 0x2, adata->acp_base + reg_val); + } + return set_acp_i2s_dma_fifo(substream, dai); +} +EXPORT_SYMBOL_NS_GPL(restore_acp_i2s_params, SND_SOC_ACP_COMMON); + static int acp_power_on(struct acp_chip_info *chip) { u32 val, acp_pgfsm_stat_reg, acp_pgfsm_ctrl_reg; diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c index bc8e1de45170..b2b78a69dc24 100644 --- a/sound/soc/amd/acp/acp-rembrandt.c +++ b/sound/soc/amd/acp/acp-rembrandt.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "amd.h" @@ -236,7 +237,11 @@ static int rembrandt_audio_probe(struct platform_device *pdev) acp6x_master_clock_generate(dev); acp_enable_interrupts(adata); acp_platform_register(dev); - + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); return 0; } @@ -247,13 +252,48 @@ static void rembrandt_audio_remove(struct platform_device *pdev) acp_disable_interrupts(adata); acp_platform_unregister(dev); + pm_runtime_disable(&pdev->dev); +} + +static int __maybe_unused rmb_pcm_resume(struct device *dev) +{ + struct acp_dev_data *adata = dev_get_drvdata(dev); + struct acp_stream *stream; + struct snd_pcm_substream *substream; + snd_pcm_uframes_t buf_in_frames; + u64 buf_size; + + acp6x_master_clock_generate(dev); + spin_lock(&adata->acp_lock); + list_for_each_entry(stream, &adata->stream_list, list) { + if (stream) { + substream = stream->substream; + if (substream && substream->runtime) { + buf_in_frames = (substream->runtime->buffer_size); + buf_size = frames_to_bytes(substream->runtime, buf_in_frames); + config_pte_for_stream(adata, stream); + config_acp_dma(adata, stream, buf_size); + if (stream->dai_id) + restore_acp_i2s_params(substream, adata, stream); + else + restore_acp_pdm_params(substream, adata); + } + } + } + spin_unlock(&adata->acp_lock); + return 0; } +static const struct dev_pm_ops rmb_dma_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, rmb_pcm_resume) +}; + static struct platform_driver rembrandt_driver = { .probe = rembrandt_audio_probe, .remove_new = rembrandt_audio_remove, .driver = { .name = "acp_asoc_rembrandt", + .pm = &rmb_dma_pm_ops, }, }; diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 8dc663c8d98a..1d8457383e3f 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -110,6 +110,7 @@ #define ACP_TIMEOUT 500 #define DELAY_US 5 +#define ACP_SUSPEND_DELAY_MS 2000 #define PDM_DMA_STAT 0x10 #define PDM_DMA_INTR_MASK 0x10000 @@ -213,6 +214,14 @@ void acp_disable_interrupts(struct acp_dev_data *adata); /* Machine configuration */ int snd_amd_acp_find_config(struct pci_dev *pci); +void config_pte_for_stream(struct acp_dev_data *adata, struct acp_stream *stream); +void config_acp_dma(struct acp_dev_data *adata, struct acp_stream *stream, int size); +void restore_acp_pdm_params(struct snd_pcm_substream *substream, + struct acp_dev_data *adata); + +int restore_acp_i2s_params(struct snd_pcm_substream *substream, + struct acp_dev_data *adata, struct acp_stream *stream); + static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction) { u64 byte_count, low = 0, high = 0;