From patchwork Mon Jan 20 10:13:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944982 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2066.outbound.protection.outlook.com [40.107.94.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 432311B4F0B; Mon, 20 Jan 2025 10:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368032; cv=fail; b=O7rPWfFUPnuxQKsNLdEV8F09U0E4IQOUE03LHNcfMvr6du9w39P7MtH/GptMAAq3zFehQLU+7lskH1RKisrqxHlPExF8q0djPJGBoX0Jx0wbFghgyYXeTiGUynMmWn0nQogd6I1UpwwSFtaSagI1aa/cowbp/El1CAKg4bof2Pk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368032; c=relaxed/simple; bh=zM2zh0uJM8rvEjfNegpihH264PTE4XAZU4iWLdI353Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Iq+j/ZvvP0pDuODf8MlAzManUO3rPEbvH16wX3tRr8sgHkXpYDoFuDOXqZ0QjWdhTPJseWjJikczBSTdddDrQ8y0b07GKdT0s8UdZVRt5/36zt/zrTzjGS86TsvMqHb8lgWit5UI+DYYnsPavRnFKt6VUi9WVIfEmh6KfoaT9LA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=dxQPjYFc; arc=fail smtp.client-ip=40.107.94.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="dxQPjYFc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JTx/xGxcVCgfjBGn9vhZ2RIWO8wraUGh4HjYtgi3cCeQ1tIGW+X0VpsA7AFO4eHNFXyb2ScfAyaCKVYm7eVssa3+GR4i2ftHhzT38e8Up5cpz2XY6bbZuIGtMYDkhh+cADwbpGK68VGIC16vOk/Zb7TcS40pj3YDtVYChzek4aN3i9fGLql2f/plzOIWxxIsISLsh7+k1tPs474SX9J4mqYaiS6JhOlSr1IlkZGVdFVa/H6EkFy3KP4doTXs/iIviMTeX7WO84+8LuekooGX/QYCPIR+78CvrSJvrfr4wkJx7NV3Us2N4OL14MA6JZ3mhunUtSkYDXBYjAyZ40kRQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=PLKy6dTIYcrqkT+OBBEkmVnloXRQGYN6kFXV5rWHDsk=; b=MZMOp2F4lwHNFrIkRM/Gjgzi3EJ4k098MiQeZrq48gpbyhY4bILXjqPZLLszdZ20mT9aELAoPlvs70k8echG58oiXW4EGzfhx1Rq+/mCenvAr4PKGYHZpaDOdJPUU6zcskUua+h02RhHV2g5VbKZjz5B+XgjpCKYjFbOmBa5ETb/mLI7Vw/weTXe7zloGp58gSQalcI7tUPkXMqJbMGU40DczFqbiJ4YbaGv22hNlMaC3QY7mTKLDqGk7JzdcKfabwwgxw/lpQDh5L8v9/ZBh0h7APt9BF7YSjdnbAk2N75H9AaJ60rnkm+AMgzgvfVzwWwGjkPaEYVtfNxWSMvjAg== 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 (0) 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=PLKy6dTIYcrqkT+OBBEkmVnloXRQGYN6kFXV5rWHDsk=; b=dxQPjYFcf447Dfa/TE4oRmMwcdacMqcZO+tRpevsYoZMbcmQ6S49W9X56Ql5TYzCv4TBav44khP7uNNMUqhpzpxaaxHpul+A97gPS9M0Y/J9Ocm40gxKuAakotQ6weFSzunVa2GAybCNzktlATus2g3yKxFOO7e2FClXF1lSsfA= Received: from BN9P220CA0003.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::8) by CY8PR12MB7314.namprd12.prod.outlook.com (2603:10b6:930:52::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 10:13:47 +0000 Received: from BN3PEPF0000B370.namprd21.prod.outlook.com (2603:10b6:408:13e:cafe::c8) by BN9P220CA0003.outlook.office365.com (2603:10b6:408:13e::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.20 via Frontend Transport; Mon, 20 Jan 2025 10:13:47 +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 BN3PEPF0000B370.mail.protection.outlook.com (10.167.243.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:13:47 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:13:43 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 1/7] soundwire: amd: change the soundwire wake enable/disable sequence Date: Mon, 20 Jan 2025 15:43:23 +0530 Message-ID: <20250120101329.3713017-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B370:EE_|CY8PR12MB7314:EE_ X-MS-Office365-Filtering-Correlation-Id: 071c4d08-1074-4322-69a3-08dd393b20fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: 4gDGKzVhScHZxXDMakkPKNVoQtE6ep8Ix4p200Ym1WrdR1T6zxQ3wRDmD+JblB2D7Q7Z11hONcxJATCc7Osr1WWN7KtqY15QxWbqvi7RGDxYtgM6eOq7JIkMZeb5n82tucyusj6w0RW5/KIodS91P5rc17NVoIlUjS5q3FVOxNuSUmCP07hcx7S8MXaXdvmMPnArNtRoFpi2yKGUx94vwjJAWf1aMgjpgGC6VDDaJrwVfGzPh7uAorHiF1kX7FCTIUrV7OpAw71qNek3R2BZoR6AkNl3L7yvfhdJPpf+XcH6tlCDzwgRTDv7C4a2K1o/SjeShrMg1MiQbBUovOOJkTh0urbN+7dLYa1GiEEBlu4zKa4JvPUCaiPqCwoL7o0+7SBNVnaArvLUvUo+aalOPhaOxWv2BKe+csrKhYEbrcZ8v1XLUx4lIvIkMb0WYXZoQ5GCZ+nTN+7U/Ut0Xf6k4pIK28NAfHPT8UrT21BmQYRsCH30p3foDCCILXWEe3YjvUWcK0YL9prSdEPQzRgquNCkp9WPVwO2Fos4NQnhWKRrM5w1w/1Yi5qJEnYUMGFwbJ7hWvzAnUVAdf70UXx5j8iytCHhXLfzs9YxVkOvmkrmHuqxf8DIOPJKCAaNUcDXrLtNu9MJ8d8hZdl/ftLWkI6GS4kmZPj43IwH+H5Cyv2jG8IFe6Q8XNZyrdkoe23ZqAm2Vxkbn47Pu0NOclx/rhrXw9P6z95OpTMFqgUqnlp8kHRipkSeKO+k/TLPGKIooIyxe8Z8PGgk89cNgz4kouWTzpJBvLmMYAkEGzN40Wn+13g6HqiQqnwrzMSyJXhalCnrHcZrxBUYUSZ5xGm/2haQXHdN/nbc3aGV7fHDpnUys1jKMo79k6Mk95vzhmuT8SYSkQsLizpXrsFZ2nYWZEdUmJbZcoErkrXwvovZibGUQaevz7wRJg7PxGHw8vaVYOIEsA6XYbScNM6lXCf8PlzSpQZ+F0v8ajS/3DkLBZpYWtEF9J6xIRLmn3wkcLBN4z4G0EZ6+kcOV1DG5SnRxCSfVzUAOC7jIgDjFOVhITw6qyGdfxZWT+GvipWVaQFtFLAZHUqatNAbazblbe4i6FwNve7KAIvlrFl6NDg5/jdvVEtRKPBPiBzvJMa1UMB4hOwhBCWM79lHN3H/jcCB2uVvBGBTgFDYlzxhf71GfZLRfoF0fd87zXwqkImMQgm+pZ2R60V8xXyY0itYOhLpKiMkVmUAKMfsnbGli4TOsIY2YzXShHwie3ETSgmJESEveqgkBy8/Yxz3Dalzwkm5d8vlWZzP0tApOKQMXBdskiAM9s7UoS10TvHfqUcmuclnfK9+TJCvMyety8ZYKcz928i0lAO7xZhbiUWBc6lld2M5aDYSVrrAtwDJ6dJ08TYM2CJ0HbapgHnjxzoJdfYotsUaMTGFa61FzBIZyUPTJjTn0shZsQ97OkoPB6NeidVX0/It6jCtq71M7+/k05AKoPTri+l+k8vJ0h/PPH9ywFY= 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:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:13:47.5095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 071c4d08-1074-4322-69a3-08dd393b20fe 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: BN3PEPF0000B370.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7314 During runtime suspend scenario, SoundWire wake should be enabled and during system level suspend scenario SoundWire wake should be disabled. Implement the SoundWire wake enable/disable sequence as per design flow for SoundWire poweroff mode. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 71b3cf2df89d..187006e68ad6 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -1139,6 +1139,7 @@ static int __maybe_unused amd_suspend(struct device *dev) amd_sdw_wake_enable(amd_manager, false); return amd_sdw_clock_stop(amd_manager); } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { + amd_sdw_wake_enable(amd_manager, false); /* * As per hardware programming sequence on AMD platforms, * clock stop should be invoked first before powering-off @@ -1166,6 +1167,7 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) amd_sdw_wake_enable(amd_manager, true); return amd_sdw_clock_stop(amd_manager); } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { + amd_sdw_wake_enable(amd_manager, true); ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; From patchwork Mon Jan 20 10:13:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944983 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 925261B85D2; Mon, 20 Jan 2025 10:13:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368036; cv=fail; b=js9ss3GfeAAYdhQRgwsZimvinRbqWTK8efwM7oRU06NYwKk7HIKYYkAbQI6AQUOKiGb9Gu40Hp7uvYDxwBSv51mTg9M9BvZkzvf24ROJcHP0Pn5o18U1NspFMbpef3fQGtj1/8zK7EHPg/j/tYwaGtdqMMGo87dwYyDldwkOWFw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368036; c=relaxed/simple; bh=rUDS1W7GSY9x3ufKyR5TU335l/+EBtmFCipUhA7YfhE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N23YVycQ4rUzJUFbqUbfw578WATSn34k+sepc9MVxOfWW34Rc5zJ+UjLBx4NEmXW8XHX5bVbJE15Y5UER4kMdWe7U9kZAU5RjRxcMhcfPPMPWr4mooPnb1RyT/eSLRPK1gxR/awuni8bRti1ldwPlxUVKSgtwxPYjZ1hr2B36QY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Xb8rLpEU; arc=fail smtp.client-ip=40.107.244.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Xb8rLpEU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RU+NfdNIdxLhh2AqpFHqKA+SalVae1I5afvgjqUuz3NrWq+0FJLiI/l8psCpwC84m0hSnzqnqBMmi9aCeTOrl4JwDwF502B98MdOVCXQEBzuHnXop5F9IPu6XoeF6Z8dXLEXAlH/S+zA60Mb+DDwfFh11a1dnHcZfJNAP65Tfd7ZXDcekUOg0+VW8KvQczPlWsYaGuOkrqJ3yZxsS1FGOi6iDn7iMmUZOKXbZfVDJ7JTK5olvQ6HZCwTSgks+bN73Cj3PmH5ThdutjsIJebVmx2BIhTpaVzUtJE/p7Wnfxw05ELJdeKonUedc9gyH4xSG20bRqfee6d18NKeWKp0gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=o+TII58PpEldSfBplN7Tj5YOOwq3yThcAXWsizYmDV4=; b=hI7KtgYB6x1sUBbHtP9acAtAe8sj3yURMIOFWfKtBc9AiUzxmhnYq/aRr42lghRKsuDYd3e9f0qDFQdJ7mqBijZTzMjwzC2ZvCmVrpZ05lfdC+jMx5OlRgi1mkzlAfPPGs2+O+aZKcPpt4GgtJXiHB9+AVY8QSkOKbTspXFC+pdIRPja73EQvIQhtvPlCEAdjoRne9VXkM1bDPvRcfhab725XC2uDoE0BSiDSm3Shx57TgIUaQUjPoRbpEW1g44xU4l6RUfRVdHCU0DoZujsNJu5dnhP/gmNEDNSjZQao0WUQALapYPHr/4R56AKOJWBumTd3jASnEGVFowqrqR0Pw== 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 (0) 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=o+TII58PpEldSfBplN7Tj5YOOwq3yThcAXWsizYmDV4=; b=Xb8rLpEU6UkYeTC19HQVBKKvX4RY72uWfp8LN63p55dWZhy6IXfEkLKornDFTQta36he4TM2NUic5L8eYsztANw6VGpsFBuxc6st8vyzBslGGiZwe6Ppz3iUSUUXr7e1MPTkl42Psrj4qcJb55NVhinxfqbxYr1jrFNMmB0YPZU= Received: from BL0PR1501CA0003.namprd15.prod.outlook.com (2603:10b6:207:17::16) by DM3PR12MB9414.namprd12.prod.outlook.com (2603:10b6:0:47::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.22; Mon, 20 Jan 2025 10:13:51 +0000 Received: from BN3PEPF0000B374.namprd21.prod.outlook.com (2603:10b6:207:17:cafe::a) by BL0PR1501CA0003.outlook.office365.com (2603:10b6:207:17::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Mon, 20 Jan 2025 10:13:51 +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 BN3PEPF0000B374.mail.protection.outlook.com (10.167.243.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:13:50 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:13:47 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 2/7] soundwire: amd: add debug log for soundwire wake event Date: Mon, 20 Jan 2025 15:43:24 +0530 Message-ID: <20250120101329.3713017-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B374:EE_|DM3PR12MB9414:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bf4005b-14ac-47c2-c69b-08dd393b2301 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: 9U5ZnFHnRolcVd7+byS/Yr1zP5D7DoLRyaYlrhFDTSpgEDLQweJdlTYl5kFFspVC06MwR1i5/iT9Z9969lxfDBvJQ2sqSaJXmloOZLbHzNtmSpCvdkpA/9T0AvYNH8lmEM4UfxbkjFHdyon3G8ZfcH9s8e4v/h/4BGMIodWxVoGstzBoPbd0zlPVYUivrbuNKyax7vlecchM+cumyHdlSvidsLXIeY9IVIhNMZCX0/qets/DUIyCLuG+2Zg2Xucu9wNIe/73hQcaO5KXHNrZaIoWhCTjyeSy2j2+z62+pFxbZxC4Jy/vw5E0J+JaCx5FKB8iQZbeRwPhIwlMO6nScp7Cs08HP5vJIVP58O9MEc8xbz7a3zCNDKZcQdIDYihh4M+HyAOXMgND835XbR8GWp5gCAsZgcPSbKPf4UYtp/mZReMhFGASIKyeCV2muI8YGVm955p2XcyfYle8cHLeqPNy3/wtpgba2j8N+1EVMhQ2hxygBR3xixLtAKDTKDt4ll59O2pm8BWbzV3DOROXIDv4VV9D0jO9QNO54i8duW3ajkEgC+0wCGOiDCWN/dwNNNPsmcx13QrxqsLCmkGpcJ14lBNatbdGnKeHeseJCYYQ2d/gUlr7+Tk1UMemwQq8ooZsFXEJzfukduXPk2vnb95ZvKjCO0BfL53u+VhKgFlhi21RhpuaZJB/dXb61dPlnSSFJrKVnDsnXx/XPqUM5kv/C5n9Dz3x5dsObM567u2AKaBT8R2EmWKNIqo3wfqPqV1kkl0pOHZL3JP+bmj8UlQ8bY2GZoOkWMBWh4ilPr+2tKBuN+a7Bf8k7x/zKkr+VgBfyXAI1IvjLa+3pgdjZGD5UOTjUJ5LJsQf29c6mJp7cjvyIbBHSuC02wqHSzNsksBGGJKFNlx5t2oRMm5ZNdB5QMWIdzFwhkEFIx/JtH9Kv2q32GlVmB0klBLebFM4FLKwVTk1eMAbRQtgFb3K9vDB2aylmmYlbjIIN//iM7opQmp8Xu2wws46NC+FVo/Wm7vrXPwF3sbasCR2XS94H2QG+ziGuxHN1Lc0rQfGCvzejc4RPmekNAuetUqdsoA/BgDyMPnLcip6jEE+1unJXP0Bll9NmNLVv/SeVlUWeJkrr+4Ua5XtzPY6fm9QjO0PDypUwDprN8R7a8KUPmHPVX4bmfoXS0WabMpMru4k0v/mi1tWYvoU+MA/+05Iujsydq3M1vMgY05Jl4RBl39ldxeDesoxaBu0iUb5GmCs6Vwb+zwmHPVjOITOa8i+xupZRI/0otXW79CZ4KdGC26bWCEglXlDZBgmJuIa3xYuVNcZJmU1ZYfdd3cTemUmdL30muKtghWfGMLFU8DLlc9KELf3MIXuWgR3LNDPaVFGNtwMzb2WHCxSasXNFOnd2xwj3L9j7lFSgZGJwjGRB1hswjsXHd5biw2aAnMhU/aLKF1wcHHUt3mxOm8TWWqsZFhFYD2C1KeTTvJLN0rgwa1/8mwklpoEcoXy5uD2O68qiPQ= 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:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:13:50.9026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bf4005b-14ac-47c2-c69b-08dd393b2301 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: BN3PEPF0000B374.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9414 Add debug log in amd_sdw_process_wake_event() function. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 187006e68ad6..60be5805715e 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -849,6 +849,7 @@ static void amd_sdw_update_slave_status(u32 status_change_0to7, u32 status_chang static void amd_sdw_process_wake_event(struct amd_sdw_manager *amd_manager) { + dev_dbg(amd_manager->dev, "SoundWire Wake event reported\n"); pm_request_resume(amd_manager->dev); writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance)); writel(0x00, amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_8TO11); From patchwork Mon Jan 20 10:13:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944984 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 657881B4F0B; Mon, 20 Jan 2025 10:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368038; cv=fail; b=CUddwSAkAP4mRQjOV8TCEdbse4AZ5HQCfM5mMnLNIXhyi838FMPQJ8VHrkUO4ooPG1m9TUKoz79qN7NhBm24IOWZ6L1zQI3WYAmTu3x1pKMbhupgphP4RP+8rQw4TS9zd5cT8eV07ne+jRH1zLV/gysBfBVjU1sKZUg1VwA4jzg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368038; c=relaxed/simple; bh=1vVmNfq8H+MF8cFUabtR1dg1mENZPacQbwpf4RcYRqs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PIyxt3JXsJyFGUPo8oC+Dee+m9IsMLqKGS+lLmmGeKrLihTF1F1NtfybLF00EPQY/CKiq1v1MyFWQS0DiFohk2p5ATzfW8TUEll0oNRw99MKrA3+FUhLFM/vvWZakfmeZu4enZ338tQQq6Z0b22ICuosPGBHo11MwmjCsqc5nes= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=0uXLXmM5; arc=fail smtp.client-ip=40.107.243.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="0uXLXmM5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lHrLjy0tHSmpjfB8ETz8HygbFVhhyQXrnZtDJB6QeIY21fTMKG4B7ahuQZQVhMtTkme4KEHFBEyt5rpJsh23VZbQFejLLt04QP2ukzQ8NCNZFuxkM4yOutDuaS5UEmkezWXJYw5r7ZbyhbsY4nLhrtN5ixPidnEZfQvk8184E90UkIBh2jyOlNOwPOxKzK+cPEIltSFPqJ3mtlAjpWeEGj3ITqJNIbLMEG3W/5ERJdDEkj5p0I46G/dTSlCzTXnSKbNw4ITSkfJ8AWM2p0DWyYjGqcXx8OQft7TtxB813SSdrwQuebzp+bpleZblQpFYq2Q2Is3QFiQE8kNfA0KM/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=41PUfFjatuc7da+InPcOcLM/ud0y8M9s1/dqpC1dL3A=; b=kkmXtHnbdNa0pMnBjwkNLh5a7QXxBfdJ+VClhTcTJ4zL4lTEhjMBRj1t4UuxI9Dx0mLEvQTC9wBv0RPT2JrJrdEz30c2AJufl5wqPsMHg0nDD7L3egDY/YJDI1UWW/3YE2WqRf4LnxeI6I7d2nLejile7uezX9Bh+uORCTcEPnz/Jo1RibZ6ur1C2KC3k46jE/hIgVK0P1en5+K0G/5+fUNGrZzo1Y4sU4bCQSAxj5CHAAg1iMKKS3kgRhj+r+oLSy5qHtkjLT5HOyTJSGHSXmsxTwtq5zxfcl2zN4g7sYNCx9aJyCvAKX1M+vfxMWF7g98bn9kf+oUkUx4NhB0iew== 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 (0) 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=41PUfFjatuc7da+InPcOcLM/ud0y8M9s1/dqpC1dL3A=; b=0uXLXmM5Q1WX6XffhbhMXioSUxH8EyGumvKHPVc6rVaa3eiLvFSljqz/rZ1qImjbTup4WIjEQdeaurIphGZO4oAdDr9TpTG64pBdVpFuSA8FuP+m0PdBjaGXCiXX+Vhux6ONigs76NddPlGi1TJx+CFcAqeNMtfrxX20YPtOxp0= Received: from BN9P220CA0008.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::13) by DS0PR12MB6631.namprd12.prod.outlook.com (2603:10b6:8:d1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 10:13:54 +0000 Received: from BN3PEPF0000B370.namprd21.prod.outlook.com (2603:10b6:408:13e:cafe::13) by BN9P220CA0008.outlook.office365.com (2603:10b6:408:13e::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Mon, 20 Jan 2025 10:13: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B370.mail.protection.outlook.com (10.167.243.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:13:54 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:13:50 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 3/7] soundwire: amd: add conditional for check for device resume Date: Mon, 20 Jan 2025 15:43:25 +0530 Message-ID: <20250120101329.3713017-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B370:EE_|DS0PR12MB6631:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e31bd00-7aab-4ca1-284c-08dd393b2509 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: Amf6RDISE3lq7IA2b4gJcn95I1dXG8Z3p7nfgWWcyfeLfQlHCKdjonz5nnEK/4NBKf5K1nz0Y484zybyUVoLCgkCc8nekGmkLNO9kOUN6OVP0aABoc7tU9R3+mWeppXhlaTDwkt7MUcPaCfmT1hFc+Okxvzv6XVj6ofShixEZLlgQoeBodEM4O+xDlGbXlvJYQbKLDm6uzpeOJvV8NSbgZIOIIqyYeRQVZaVMTuQWrPVya+ykAN7n2vH47ZYGVeX2JOPtUsOhJQrfoj/3bJ0bWigqcps6VfpkNrcny58GPgx8TOx+S+O+wCgy2MwTaa7+ZTzOe9GLaxMx8qP0IZ9vCAZI9Rs4yGCB7/Vvm4bBkfVr17dajyGcTH10JDTsW2ho9zk4AaY1ab5L2u+r9R2/MTrcO0p483nqOiUPxsVVyLFIRD2SaqvPgFd6QvB2SSgQfVRapbJSOxo/UssyYU3aK6RWpxIEuXDjSbNK6QBCgcWvCn0ZNKbVzVNmXRzVbAvgtGPjVYhsr4lVqf3k8XECQvxP6dBJVZ6xZxrqdKUasVGB21/pWQE84lglPkC90OlCoGZR6yi8pM76k4GAvZ25oYVTkMsIRX6T9N28KEIs59Jw03jr831QxkyxkE8sXLuIZ3zILfCgiwRNU2QkezP9nHSL+a+97InbFJoy2arx/x83vwIJHev7KOSZgR8/H9pDaeBK4tKISsHBwj3/4XzHc38yi2Buszk6zJMgV1jqOdqe3loEJ8xJiRbnzuZdffupauFM7nQulXr/Gbao75Xepbw0YbWxjXxOo3suLXj8glNYAB9jZw+TItlVkyp89PHT048WjtOGc/Y5fcIXp27B+jM9BubpsOkWy53AMvK9FQ4sSpI39csGNLrskU8rQqVG3Y7jnLt8OBWHWGhvToIwJC/8bkliiAfSJRN39lMz5Shei4bJDzws0094EPp+mcdCeZAjTSHkbU0XlyN2XfUdJOlJtaMoin2kRxx2qWgUuBPghMVavIvpFP6femzODLocMvv4hZG9hCinObe5tE2MoOpBbHgG9HbA6kyAIthnL6BSJePB+n6TgPs4G0BuGrCGZ5dcxnO9KwGTs/4xoyGUvUDf+5h0/6Gc93geAnt6/T8goqNde1Z7WQtSHietMZBesNFyyFFhR4sVDErqCS3uXZGudp146NWsY629TtxD+KTgefabZIdNVx+wYUkxYXaPajZBUtJMl3luy1vqB3toNph/W35p0vFaSJNvBThPUS2Rbe6KOwuoc0ERNui2edc4vXP0ryyFG+yr6wPPVdaGlaIw7bo3eiwSpo9W4Eti0EPJTFlHOTRhxLnalW+x3nEIETvhwzj0kCxxPYcweixQculSu0B+XuRhrB2//+NC1cEDJdUyMfjyGwLwmddmy7nqhOMofyEoKomfC2WXeUgPNycRG1+jeYSn4YF8hPp3fbYZfYNKzwkpjHBFNsOo1pQjRlYwnmuSRhepnUya+/VkB1n0CSJWj8XaKiMvuvD1zU= 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:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:13:54.3064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e31bd00-7aab-4ca1-284c-08dd393b2509 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: BN3PEPF0000B370.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6631 Add a conditional check to resume SoundWire manager device, when the SoundWire manager instance is in the suspended state. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 60be5805715e..6831b3729db5 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -850,7 +850,10 @@ static void amd_sdw_update_slave_status(u32 status_change_0to7, u32 status_chang static void amd_sdw_process_wake_event(struct amd_sdw_manager *amd_manager) { dev_dbg(amd_manager->dev, "SoundWire Wake event reported\n"); - pm_request_resume(amd_manager->dev); + if (pm_runtime_suspended(amd_manager->dev)) { + dev_dbg(amd_manager->dev, "Device is in suspend state\n"); + pm_request_resume(amd_manager->dev); + } writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance)); writel(0x00, amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_8TO11); } From patchwork Mon Jan 20 10:13:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944985 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2057.outbound.protection.outlook.com [40.107.220.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B05B1BC07B; Mon, 20 Jan 2025 10:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368043; cv=fail; b=ESE+GDU/Q3ObKcRc+X8dObWbn0QLNXDft4LWXiJPw8eCXDILWAQHrsLgZUFNpoZ/GtBYgGoHEpGKHEDXPdI3erAMoCuTtLV06aV0SM5rmd2tvS8SHkal5jGGCwwCcMGKt25/PmxYdiQIUUmMqns0zcCR80EtrK8b0mw6INRHqjI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368043; c=relaxed/simple; bh=k9Oz06RhQF42q/XAvlMAQM+ouIyukbClTMhuTOPhkbs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d8KnShMY+5IVlpmGHcJUTQ3PJmPC/TOfHyynUCifMLwqpodDcwivnsP/gDX+cYQtgLwSnA/6+BnDiIcjg62/wNuu0AGW1Gf+74lKCIJkc4ScfRD0F8JFMYVliCMlh/e2VAPBq09uURbglSibLWhIxRapeiIWBt2hcETVWkSXsB0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ClJNkxZ6; arc=fail smtp.client-ip=40.107.220.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ClJNkxZ6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yQuw4JjlaUwDfHVPG6zijzoE0Tx8hgryO8Wo5EZ9ZifyD/gQ288N2V1+zjjlrZ9ngsksphI2NeCFklvm+HcvDqsPdJgU7CmWbOpRbFwyEQxKwkyy5MAui6py3+UeFh3hUO+7orX5Wwi4cNIUOoF9jFa+YVvBfJzr+MYi6zJGp9Y5frAt3uabNht7hIzKnTs+NtvRqM0tvZtxWKHS4Mv7sR75nQEi2XR+XuTPxtRRbZnepAHH9QKVe+JmU5DRsVMH3g2mKJBZpXMiHyh+zaX2FI3xtiW/CuSEuH5UM7QT4aSPxPXkwtV+rU/GEGvaRpFtasnVMG4r5474njGUQT4avg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=C3WxOOMvL4pQK+BApD8q9r4vu1VBRD3F/XVuLfuP1pA=; b=HGfskfWFEZGOH7clLvY0pJCLuzOSi5L6N+DXbKwnWP1HgUDg4OCGQxLRrOLiKBMNZc7E79T04ud+98xvEKJZen39v5RDXSrAWxaxIW1o2XQMMcoWb+K9wJL6p2dKr7TQq1wySv11NHUMOQU5zhg46P3f80RRg3NKMDjhL+HO1DkPthxEmfpIcQgs32ZA2AUaDHWPJU8dk5GnPQ8BPG5K7MX017a+C0h52mFaGUzX3qspxZh13wPRA+rk+xUxmT0Z/SmCVdkn2p0YtNUqYpB9C8wzGRx+eN40lB1N/0yLFwyPLoG+btmepuqMkuvX4e0eBQ6Svv953+lJu+fnHPNnag== 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 (0) 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=C3WxOOMvL4pQK+BApD8q9r4vu1VBRD3F/XVuLfuP1pA=; b=ClJNkxZ6Rbcx9Yv7uHiXK4YRfocgFU7QNADLiQVhGyFQm7lPyzMr/rbwoI87OTaYwayEm8lme0nYhsaG5/izjiNxwmwJIN15+4iG7m/LNl6WdEzxo4xQMwRaKFS/MKSeq/G6I1XAHpcQ3v5nmQCeOEwybolFtjAyLSVcItkHea0= Received: from MN2PR16CA0022.namprd16.prod.outlook.com (2603:10b6:208:134::35) by CY8PR12MB7147.namprd12.prod.outlook.com (2603:10b6:930:5d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.20; Mon, 20 Jan 2025 10:13:58 +0000 Received: from BN3PEPF0000B373.namprd21.prod.outlook.com (2603:10b6:208:134:cafe::69) by MN2PR16CA0022.outlook.office365.com (2603:10b6:208:134::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.16 via Frontend Transport; Mon, 20 Jan 2025 10:13:58 +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 BN3PEPF0000B373.mail.protection.outlook.com (10.167.243.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:13:57 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:13:54 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 4/7] soundwire: amd: add support for ACP7.0 & ACP7.1 platforms Date: Mon, 20 Jan 2025 15:43:26 +0530 Message-ID: <20250120101329.3713017-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B373:EE_|CY8PR12MB7147:EE_ X-MS-Office365-Filtering-Correlation-Id: 046c90ff-30a5-4641-b2c1-08dd393b272f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: secUlAD+6hmBhDno4SXUiifj9+MaAid7voJXABG26I3XaFIyAZ4NVjBSoeRm0QgaRyb2lbnGYzZm78W9bzW3b/Oc1r2Q9+BGlXFFk1JnwlJkUIESl93N7EDn+u3bk4OPfkjyRpSxLIWxv3rNLnd7Zxbc0A4CExZg2LdEoR15S7AYsGpycIJzfINxqy3/w1nz3Vz16N71iWGdSo4bmI/Bcgsqgx1oQk3GWUMgMomWj5l+VtuZ7mYMKblNwMRHvgqIAscBpdsWjMTDqeak0wCblJGj8QDBAc2Ua/fdpVEmhgJ0XpllWtsODgF/HRF33F9wKmJqVrPE2Mslrd607Xya5wgPvzQjHJbVAId4GjjIS+oMXor2lTmUYRAFUwQ8ORornM8Xzb9UhEJ2Ld20B2ia2hL6g/Wlc1CT0AcPK8MrSRg8dTGX0mMIyplm4rrXHrzGRk8EOLzgAORhNFeFSPdifB64KElwptjPSzJQ6JU8ZISYa5lBIFuAJIoca666VJWQdo03/ynVbgty0vTxcn+02c/ARmF3GDnIx4nXykiw+uZglizrHsZfuPsA14VHFOgtlmlpHmeFX9pCD8XnLlqZnx3kZhk1x9Tmf2dnUOrl+kNSP51zwyJ6HP3bhKbSNWlClian/L1efl+dYwmW7ibmReuAlvP0iM3GLF+x5kBAK3HhSAWMvhTnRjt83LmLNWFmWe31ZzGLKP2LTHPZPScIDvSoID4uQ0ijiCcdQM9SqJOk/qfGS7I8iFm9w2HmFuRg5AFs1J3qmxdiX9pSNrh6DxaD7/8XP1T3FWlm0lazniE68KQrEd6WLLVOHsBfRs0Hxuk/GDbYO/z97yW9mdmUy6Fg9G1NVu9/g1nNzRlrCoIc7nEBviiAxEu2H/oLaeEv1JLOE9ziG3H4FuHW3Zxv9D0poCUKH8mBY2A9Sp2btZ7sNnZhrgWid5wB26eyWKCOabwByKwF7q57vgXPTMk+XoL6AFiXBsm5omSouGmBtT2eiXtbGf/xhA2qNwTP469vXUxyoz3bSTA64yzmmBEZugi3EZ0nsf1AmtRLyBiG6q13F7ViIFxhMH6Ca+qIkEpiG4dz9JPozVaucIjKywl2lYU7TJTr5RrGGNLbf6f/m0ZGtKJ3OLsmL1qxKF+/h91Bsmtbsv2HOySSvtWfgXtQIT2ev02AkZ5T24SHlNfG0O17d7nTWQxHhXh2Zty9W7dn34I6txyYFJV6U2gepnH+p+f9zmvAKrCQ0JGFmnHvYH/Dju/yZ8pgSMNI7gM8rItZQgoHBzgkcNVn3DHn41dyKKQvojl1d9/I537XtXvxsxuhKwIgfbnoVZQhEM4NV7Pm9hbwLP1L5ZHFq0Ws0+o+q4V+3FnPTvrgkWfU7EJrfitruJYiMzyW1rLGQVa4S/RKkzOzmTbmiwynm457WJhc6KLF3cpWY1Hs+PwjJzx/Y627d3jWxt82ap1GpQ1uWGgvNm7tAat/q7GuxvPVAuIl5gH2PcF68Ya6n2VdeU6LJnI= 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:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:13:57.8988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 046c90ff-30a5-4641-b2c1-08dd393b272f 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: BN3PEPF0000B373.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7147 Add SoundWire support for ACP7.0 and ACP7.1 platforms. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 22 ++++++++++++++++++++++ drivers/soundwire/amd_manager.h | 18 ++++++++++++++++++ include/linux/soundwire/sdw_amd.h | 2 ++ 3 files changed, 42 insertions(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 6831b3729db5..d611498d5488 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -446,6 +446,10 @@ static int amd_sdw_port_params(struct sdw_bus *bus, struct sdw_port_params *p_pa return -EINVAL; } break; + case ACP70_PCI_REV_ID: + case ACP71_PCI_REV_ID: + frame_fmt_reg = acp70_sdw_dp_reg[p_params->num].frame_fmt_reg; + break; default: return -EINVAL; } @@ -494,6 +498,14 @@ static int amd_sdw_transport_params(struct sdw_bus *bus, return -EINVAL; } break; + case ACP70_PCI_REV_ID: + case ACP71_PCI_REV_ID: + frame_fmt_reg = acp70_sdw_dp_reg[params->port_num].frame_fmt_reg; + sample_int_reg = acp70_sdw_dp_reg[params->port_num].sample_int_reg; + hctrl_dp0_reg = acp70_sdw_dp_reg[params->port_num].hctrl_dp0_reg; + offset_reg = acp70_sdw_dp_reg[params->port_num].offset_reg; + lane_ctrl_ch_en_reg = acp70_sdw_dp_reg[params->port_num].lane_ctrl_ch_en_reg; + break; default: return -EINVAL; } @@ -549,6 +561,10 @@ static int amd_sdw_port_enable(struct sdw_bus *bus, return -EINVAL; } break; + case ACP70_PCI_REV_ID: + case ACP71_PCI_REV_ID: + lane_ctrl_ch_en_reg = acp70_sdw_dp_reg[enable_ch->port_num].lane_ctrl_ch_en_reg; + break; default: return -EINVAL; } @@ -898,6 +914,7 @@ int amd_sdw_manager_start(struct amd_sdw_manager *amd_manager) ret = amd_enable_sdw_manager(amd_manager); if (ret) return ret; + amd_sdw_set_frameshape(amd_manager); } /* Enable runtime PM */ @@ -969,6 +986,11 @@ static int amd_sdw_manager_probe(struct platform_device *pdev) return -EINVAL; } break; + case ACP70_PCI_REV_ID: + case ACP71_PCI_REV_ID: + amd_manager->num_dout_ports = AMD_ACP70_SDW_MAX_TX_PORTS; + amd_manager->num_din_ports = AMD_ACP70_SDW_MAX_RX_PORTS; + break; default: return -EINVAL; } diff --git a/drivers/soundwire/amd_manager.h b/drivers/soundwire/amd_manager.h index cc2170e4521e..30244a31c21c 100644 --- a/drivers/soundwire/amd_manager.h +++ b/drivers/soundwire/amd_manager.h @@ -159,8 +159,11 @@ #define AMD_ACP63_SDW0_MAX_RX_PORTS 3 #define AMD_ACP63_SDW1_MAX_TX_PORTS 1 #define AMD_ACP63_SDW1_MAX_RX_PORTS 1 +#define AMD_ACP70_SDW_MAX_TX_PORTS 3 +#define AMD_ACP70_SDW_MAX_RX_PORTS 3 #define AMD_ACP63_SDW0_MAX_DAI 6 #define AMD_ACP63_SDW1_MAX_DAI 2 +#define AMD_ACP70_SDW_MAX_DAI 6 #define AMD_SDW_SLAVE_0_ATTACHED 5 #define AMD_SDW_SSP_COUNTER_VAL 3 @@ -244,6 +247,21 @@ static struct sdw_manager_dp_reg acp63_sdw1_dp_reg[AMD_ACP63_SDW1_MAX_DAI] = { ACP_SW_AUDIO1_RX_OFFSET, ACP_SW_AUDIO1_RX_CHANNEL_ENABLE_DP0} }; +static struct sdw_manager_dp_reg acp70_sdw_dp_reg[AMD_ACP70_SDW_MAX_DAI] = { + {ACP_SW_AUDIO0_TX_FRAME_FORMAT, ACP_SW_AUDIO0_TX_SAMPLEINTERVAL, ACP_SW_AUDIO0_TX_HCTRL_DP0, + ACP_SW_AUDIO0_TX_OFFSET_DP0, ACP_SW_AUDIO0_TX_CHANNEL_ENABLE_DP0}, + {ACP_SW_AUDIO1_TX_FRAME_FORMAT, ACP_SW_AUDIO1_TX_SAMPLEINTERVAL, ACP_SW_AUDIO1_TX_HCTRL, + ACP_SW_AUDIO1_TX_OFFSET, ACP_SW_AUDIO1_TX_CHANNEL_ENABLE_DP0}, + {ACP_SW_AUDIO2_TX_FRAME_FORMAT, ACP_SW_AUDIO2_TX_SAMPLEINTERVAL, ACP_SW_AUDIO2_TX_HCTRL, + ACP_SW_AUDIO2_TX_OFFSET, ACP_SW_AUDIO2_TX_CHANNEL_ENABLE_DP0}, + {ACP_SW_AUDIO0_RX_FRAME_FORMAT, ACP_SW_AUDIO0_RX_SAMPLEINTERVAL, ACP_SW_AUDIO0_RX_HCTRL_DP0, + ACP_SW_AUDIO0_RX_OFFSET_DP0, ACP_SW_AUDIO0_RX_CHANNEL_ENABLE_DP0}, + {ACP_SW_AUDIO1_RX_FRAME_FORMAT, ACP_SW_AUDIO1_RX_SAMPLEINTERVAL, ACP_SW_AUDIO1_RX_HCTRL, + ACP_SW_AUDIO1_RX_OFFSET, ACP_SW_AUDIO1_RX_CHANNEL_ENABLE_DP0}, + {ACP_SW_AUDIO2_RX_FRAME_FORMAT, ACP_SW_AUDIO2_RX_SAMPLEINTERVAL, ACP_SW_AUDIO2_RX_HCTRL, + ACP_SW_AUDIO2_RX_OFFSET, ACP_SW_AUDIO2_RX_CHANNEL_ENABLE_DP0}, +}; + static u32 sdw_manager_reg_mask_array[AMD_SDW_MAX_MANAGER_COUNT] = { AMD_SDW0_EXT_INTR_MASK, AMD_SDW1_EXT_INTR_MASK diff --git a/include/linux/soundwire/sdw_amd.h b/include/linux/soundwire/sdw_amd.h index 799f8578137b..6b839987f14c 100644 --- a/include/linux/soundwire/sdw_amd.h +++ b/include/linux/soundwire/sdw_amd.h @@ -28,6 +28,8 @@ #define ACP_SDW1 1 #define AMD_SDW_MAX_MANAGER_COUNT 2 #define ACP63_PCI_REV_ID 0x63 +#define ACP70_PCI_REV_ID 0x70 +#define ACP71_PCI_REV_ID 0x71 struct acp_sdw_pdata { u16 instance; From patchwork Mon Jan 20 10:13:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944986 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2045.outbound.protection.outlook.com [40.107.212.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DB9C1C07E7; Mon, 20 Jan 2025 10:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368048; cv=fail; b=qU4xjL6OO852lYjUGXV/AeRv0MgqOmZkkCVy6f6cSxrfQshnojTlLdCpEc0lQFOYqRExag/Ec05eYUhAnJ65wiyKqmHu6B52glnxMV3vyhQym0hqXqmeaHJXoNlfTVZDmIZSzZgsy5V6cxrIcr8AijLhPeOXTpvo41muj7JUabI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368048; c=relaxed/simple; bh=8wETD2CiblFdPNd7uMR2vz+JsM3atB2zGzf2bM4jXII=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t/lSln9e3nzOGxfUe89DLrqbKceT6cFs/+RT4dzChPJ4rNfJNPOY//Te4mzJBLDjiEhwOYv5jQH9w7/vCEhui2dYGtdsqCqNORMUp+kn/2U2DYl9Y8u/biRJ7xZPVbKlPY46Z79dcf1qfLSqlF36/5gEXtu97JL8aJ5yUjM9XHI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=AKhEuQ1I; arc=fail smtp.client-ip=40.107.212.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="AKhEuQ1I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tninXX1SWmr9mLMbOTuLAmTQpmoKN51CtZjQxdE9xp5z3eAL4NkF4GhJjUD3RvbQVzOQeJsVVlgP2foP5FqKMprlIEvklH28CW05YQpq6ovcg3sam41PgEhUKSawDUCPzeP/Le9cDIlwZsOiUDW6LDNnKgRU8dyolRiQfC4VUaooAEXdwnQs9vtUSWcmIsaO1r+lxKq2lkeT1rXNdghVWGDUV2tqyLZ+nMCqy6zPchxASt+HUKn4GD59H+1dLMic2d27zx3Kmx9gQWbjDfD+kBf7srtMIXZr25WqpbDSEUUVh33mzYXpte3CxRRP5sazHkR20DC4So/iL+6vP8hudA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=P7sUVlFmCGQS8oRmNUor2lzsBlfZBpnlJn0jCCIImqU=; b=EE6suCAtT17IsSzVbnpzrSA0+q1MjYKfOJcQnhFWATqk424ws4Zq6OWU8sdz78eVsEEajHxgM2lpq9CmY5q9rO++X5ZTirQLVd86kX7zVYo3V31jlzq8iRs9WWB2fwkjefoJfAlCFsntea1srPDAQMkJC/okqlEAFGpVYbilcbziMlZAXKkwZWuG8XWhNrPKUYaH2BmrrvaqIztx5hVxkFVUe24bHkVY0eZj/efbSXVsx+ykA22MfNbXAQhuw8ET8q/T1YHu90VFV1wlmN9bgqywvGiC+/oG14FtJ/YVTqnwOlbpMlQmXqEvlzatw7nbnGn5b9is/mTIBfYtQH9nXg== 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 (0) 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=P7sUVlFmCGQS8oRmNUor2lzsBlfZBpnlJn0jCCIImqU=; b=AKhEuQ1IxwwV6JHikEfN0cnfG+Ji1OIsWYNW99XUWZJKet/BQAB6I0xQsVhSYfcsU4vidqGn/ORBn6ZZGXXHbbx96DLGGRxk006i0KC2ZX9W4nFTMaeTR6ii05yLMlDWM7Aqv9yE1sMqAvVldrppLufHlan5vkZilPdEntOQF04= Received: from BL0PR02CA0013.namprd02.prod.outlook.com (2603:10b6:207:3c::26) by SN7PR12MB8059.namprd12.prod.outlook.com (2603:10b6:806:32b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.20; Mon, 20 Jan 2025 10:14:01 +0000 Received: from BN3PEPF0000B36D.namprd21.prod.outlook.com (2603:10b6:207:3c:cafe::a6) by BL0PR02CA0013.outlook.office365.com (2603:10b6:207:3c::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Mon, 20 Jan 2025 10:14:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B36D.mail.protection.outlook.com (10.167.243.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:14:01 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:13:57 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 5/7] soundwire: amd: set device power state during suspend/resume sequence Date: Mon, 20 Jan 2025 15:43:27 +0530 Message-ID: <20250120101329.3713017-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36D:EE_|SN7PR12MB8059:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ca63472-8b8f-4336-28c3-08dd393b2944 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: XzBrMfs0bGPIByjudBHF5kqmIkrxq6sVp57JqitG71GbHhrRblNNzNvH/m/9XLQiOoKbLeTOqoveNxOQBv1pCzwfJScFnk4bD7pYqwVU0ToEZgCkxSwsTqhXfAedBGjd41ChKmNPr2sB2ZLLACSOvshHvUvwYPQ0bJ/hTjpCccGjxsp8nx2XVU1eUmUlY4wYOzPdabmIxlYI0tLgjxU4Hno0T3EpTK0vVV3K9Z6vc0MwRBZjMhYT3Hnmg9FgOVFSWszjbvCWHPubcqyj4jrvRk+4gR867w0KFvo7N/T9/XDYZp0prKLFBYeRB8hCIDQ7GQduz9pbx2jWWF001bVbB176QgrsFBlKIzIMsRXavMKBthtSkZkcMWkCk94fjXI10kk1h0YX8jpqs8oiENi+DSRG6nTEQTZ6PCG6kf2v4xyKcr+RYYFjzzEt1wY+E5sY2XH5rVHGNqrXhdogsqIvttn2jZLa4ZDutm1sjm/J7VkH7FxCtWezNJWvzM/tedE1qFmRwyRPcEEZC8zoOXgWEksnw2EZdWRuaDWE15LEVBcvIrV0WorR7bvzeQUmh3NrR/IvfeGo4PCIqZKYMzVrgF4T86z2OP6JMRgInRqLeOLUZynEBaOLFo6f84qo4imzmueorScCC+hinagbyt8im8daPG+PChCkl8y806pXemLBUytnSYW/uoPf3ezSFdXS/NLrU1MR+fgJGvQzmMqjTARdDS0Zp4fh+TfNJd7NPinAmeNiLjGQ3mepE4gIo0OnJ7nd8JYkbOr/+liFZDmjZ6wxzn2D8acViCQxqoGK3N8AmsmYnmn3wEqNWYN/NX4ETFCNbyMkOpi2Hcv1Lak5snCLu+HwVxNxaMUrOdMixVGWr8MQJbJQW7pQoKE31gBl5tr0780WPYcJl7VkZ4L1tQ+j+xQ2J6LZrwBfJVX33fccu46lB6jkDpxt6nKqwRUSkQN+ngqxtVctmKhG+6dj/UVNRNvdhEy5Gf9DZLRovZTJ7I9arSsro/axl3mSk5B88yKeXGDWL55GEw6hVOm55JO7ABm4yqTaRLIbS1GLE6ab1JqVS1RDgMGNkOQWrpWwC86sksGnz35MTPyQxist/dsdJML7U6cyjMo+GXjWtOVudqxI7AWKx5MHSb47ojdjddyRgUqhB02b0Sfjz6UY+ChPwwwNWj/lFJThyYQLAbimlOKFgKJgNGpFNLZxwKI3WjPO1ZaMj+cYorM5VfanyMEmIWd+7jc92E5/nLKSS0tvSYOE6R2hgSgDUJtqTE3BOmYnS3aw6VOdU8AHJJuP2IUiBI7J0V8QNQIlTVmwz05odXmdReJgWlnb2JFKIBGxXPdfptN/Hf820QFuFn0QP79dpRpUd8ZRxIMy7glvSy9AZrQty1xrSHKxL5zBVhRVU0DiQmsVgA45G/eiBoLDqTtQeHfuIT9oqTN9yriYsRsMrYFBH9+R4sNmTfm9RkEBUfRjedYjfIKVc/KJIAB0C1bkCnUtyOlav4R/Cdk2q7c= 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:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:14:01.3883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ca63472-8b8f-4336-28c3-08dd393b2944 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: BN3PEPF0000B36D.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8059 Set SoundWire manager device power state during suspend and resume sequence for ACP7.0 & ACP7.1 platforms. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 58 ++++++++++++++++++++++++++++++--- drivers/soundwire/amd_manager.h | 5 +++ 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index d611498d5488..42d553878e91 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -143,6 +143,29 @@ static void amd_sdw_wake_enable(struct amd_sdw_manager *amd_manager, bool enable writel(wake_ctrl, amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_MASK_8TO11); } +static int amd_sdw_set_device_state(struct amd_sdw_manager *amd_manager, u32 target_device_state) +{ + u32 sdw_dev_state; + + sdw_dev_state = readl(amd_manager->acp_mmio + AMD_SDW_DEVICE_STATE); + switch (amd_manager->instance) { + case ACP_SDW0: + u32p_replace_bits(&sdw_dev_state, target_device_state, + AMD_SDW0_DEVICE_STATE_MASK); + break; + case ACP_SDW1: + u32p_replace_bits(&sdw_dev_state, target_device_state, + AMD_SDW1_DEVICE_STATE_MASK); + break; + default: + return -EINVAL; + } + writel(sdw_dev_state, amd_manager->acp_mmio + AMD_SDW_DEVICE_STATE); + sdw_dev_state = readl(amd_manager->acp_mmio + AMD_SDW_DEVICE_STATE); + dev_dbg(amd_manager->dev, "AMD_SDW_DEVICE_STATE:0x%x\n", sdw_dev_state); + return 0; +} + static void amd_sdw_ctl_word_prep(u32 *lower_word, u32 *upper_word, struct sdw_msg *msg, int cmd_offset) { @@ -1163,7 +1186,9 @@ static int __maybe_unused amd_suspend(struct device *dev) if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { amd_sdw_wake_enable(amd_manager, false); - return amd_sdw_clock_stop(amd_manager); + ret = amd_sdw_clock_stop(amd_manager); + if (ret) + return ret; } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { amd_sdw_wake_enable(amd_manager, false); /* @@ -1173,7 +1198,14 @@ static int __maybe_unused amd_suspend(struct device *dev) ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; - return amd_deinit_sdw_manager(amd_manager); + ret = amd_deinit_sdw_manager(amd_manager); + if (ret) + return ret; + } + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_set_device_state(amd_manager, AMD_SDW_DEVICE_STATE_D3); + if (ret) + return ret; } return 0; } @@ -1191,13 +1223,22 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) } if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { amd_sdw_wake_enable(amd_manager, true); - return amd_sdw_clock_stop(amd_manager); + ret = amd_sdw_clock_stop(amd_manager); + if (ret) + return ret; } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { amd_sdw_wake_enable(amd_manager, true); ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; - return amd_deinit_sdw_manager(amd_manager); + ret = amd_deinit_sdw_manager(amd_manager); + if (ret) + return ret; + } + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_set_device_state(amd_manager, AMD_SDW_DEVICE_STATE_D3); + if (ret) + return ret; } return 0; } @@ -1216,7 +1257,9 @@ static int __maybe_unused amd_resume_runtime(struct device *dev) } if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { - return amd_sdw_clock_stop_exit(amd_manager); + ret = amd_sdw_clock_stop_exit(amd_manager); + if (ret) + return ret; } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance)); val = readl(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL); @@ -1239,6 +1282,11 @@ static int __maybe_unused amd_resume_runtime(struct device *dev) return ret; amd_sdw_set_frameshape(amd_manager); } + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_set_device_state(amd_manager, AMD_SDW_DEVICE_STATE_D0); + if (ret) + return ret; + } return 0; } diff --git a/drivers/soundwire/amd_manager.h b/drivers/soundwire/amd_manager.h index 30244a31c21c..8430f279d88e 100644 --- a/drivers/soundwire/amd_manager.h +++ b/drivers/soundwire/amd_manager.h @@ -194,6 +194,11 @@ #define AMD_SDW_CLK_RESUME_DONE 3 #define AMD_SDW_WAKE_STAT_MASK BIT(16) #define AMD_SDW_WAKE_INTR_MASK BIT(16) +#define AMD_SDW_DEVICE_STATE 0x1430 +#define AMD_SDW0_DEVICE_STATE_MASK GENMASK(1, 0) +#define AMD_SDW1_DEVICE_STATE_MASK GENMASK(3, 2) +#define AMD_SDW_DEVICE_STATE_D0 0 +#define AMD_SDW_DEVICE_STATE_D3 3 static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM] = { AMD_SDW_DEFAULT_CLK_FREQ, From patchwork Mon Jan 20 10:13:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944987 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2073.outbound.protection.outlook.com [40.107.102.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AC881B6CF1; Mon, 20 Jan 2025 10:14:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368049; cv=fail; b=G9yWyM+Ej5eWZ2Kg0zxaYXh+wgpjQO6znI8NR7KrMYgdKslZp/Ni5ENBZn0GmMuTTwF/g6ILk9Fsexmw+o7gSFnj9h60d4ADlKI5H/EcpQHRcTZuL78Qddv9cbVZ4BSRVi3Vcdj7q+T5+dUR8qsGDAxkWPMc0OCX7ZDlJKOCPc8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368049; c=relaxed/simple; bh=PmCZ+qQRTU8/grVFFej73TMT40nwC6JcaTZAK+n3LeI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Im69rSAf9n3BzASgP4j8eR+bWy85EngedooOnr96uMJ8T57rnE14mZnx2cWDVaMlneBJv0RkRZqdd1/OaY/tJazslXITZ/7hZbgkBQXK1mRzqg+yv/Y6t8R+ZjqAzQlFu00EZcXtZATmR2ZGqNPJBYnQjGN5k3xIgRqlNbQc+/s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ThF2jBQr; arc=fail smtp.client-ip=40.107.102.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ThF2jBQr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kZ4TZqlxqMWCnC+FXDMMENsMwLsnOHBJ8caKp4LkVNte3bPe2e3zpefqIlCxZTs7MGL4uTGTIAT7utgyGT6BeCC63wO7TTgG13WvJ0LDg/KfqYy2qXrSYjGFTA47EIjJ3LCnD9WBsegul63maWlv4uDftvoe1eO14Vf0PLruczJ66lOysGNkS7xf9NixGlZdff/RB8oF7PxZJMPrySo04INWSfUpwUo3IekWcBSuxrFXGjfgq0EpYcXKclqxIi1SyrkCowqEhQnqN/S7JApNhC2/Ipf/vFak4m7Qb4e0pw35dtUx2alLkKbs1xU0q/B+wwiqkXBTNRXYFSB3uj/Sqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jLkOkOZ1VicUSKvl1HTnRINVKm/zN1CSPOC9j/hTe+E=; b=jG0ZfSKcfqsiifG6zMeK1pK/kPbcb95LWYNrpngWp9fGMLAF3JDoZDVffYGHcGL+zKVEV8gocFd3siptxu8mujhbq/6QqWBDebhK0iLxBljPoi5LPTFyiCDTZA7A3Lk+1o3KFciNJyPzEMx6VeZWs0TJVechPVzf0reOWQvK6kWXCQckyDH/eIxgm8leZhIU4SRoenUq5u5D2q1bWcWBMfRPNz4xmtqfO/PYmmWjzPagPPyOL7ltaRusIoT5V19ysLWn18SUfdmwKUJgALrIdJ4hOe2/UCHf+ZbsyNr9Zdx8g2gyIrhsRTvYy/+aZsVmGPAShRGckP7IF/6m3jeVKw== 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 (0) 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=jLkOkOZ1VicUSKvl1HTnRINVKm/zN1CSPOC9j/hTe+E=; b=ThF2jBQrOO2nNtPkkn3MyDBcb+Ay9SB6ppbvWnAmulLqpseOagyymgBlpp/hNRIQO6QG0B2yfRR+Q4v/8Qw/MvBJKZbbSAC+oz1ZLq40cZj+WkTE3lqLGIZ8jyuEwN1I0IjU09IbqELeiiupLs4Jb3oe/a0LjgiumO1UpU2JSp4= Received: from MN2PR04CA0007.namprd04.prod.outlook.com (2603:10b6:208:d4::20) by BL4PR12MB9480.namprd12.prod.outlook.com (2603:10b6:208:58d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 10:14:04 +0000 Received: from BN3PEPF0000B36E.namprd21.prod.outlook.com (2603:10b6:208:d4:cafe::18) by MN2PR04CA0007.outlook.office365.com (2603:10b6:208:d4::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Mon, 20 Jan 2025 10:14:04 +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 BN3PEPF0000B36E.mail.protection.outlook.com (10.167.243.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:14:04 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:14:00 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 6/7] soundwire: amd: set ACP_PME_EN during runtime suspend sequence Date: Mon, 20 Jan 2025 15:43:28 +0530 Message-ID: <20250120101329.3713017-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36E:EE_|BL4PR12MB9480:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a9eac20-5ee5-4316-8f32-08dd393b2b06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: ld8jnXD6yWPM5jrfrGTrjQQBt6EfXt5/JIdujgkvCuy4bY5MF+uptvqCMN08k5RSvSIgfpnpE1iCiqx1w+mjDfhHOnf+71mWIPR2KvMO90crfa6hUxe67IFLwBLXFwjJjsagmPCIIE+xj81n5tsulOW8NJec7YHJLxNsWJNI+h6YdY3nhC8XcFyHOQ3RzEL2ZszUa4qYJLvJzST0NJGF+WWrd3Bp+B7YQsFtBR8viB42XlGOtWfSg+K6b++h4rxFWvFq15uvouNpIxrVmLimTPfvlCWPb8EWwRAFzqJD6YdCkE+cCS58SJj+1cLVfuHP2FwqW4+2nzuWwwQTaz78l3LUMnXZdmTBrTGAGHdI6n3N0wI0rK+WEqhI20kmhpr6tdvWEUYmS7JkWYvsvARXje/na2PKiez5vxpCBTSgVVkebNiNaptRv+W7LLRy19BOvUtajJ+IzAfpni/bJ0cPVJ/27C76c8RyNKdRB4wnURqQG8BobPS1mBOUIHnapdhaSko8CHj6y/L8l6t1WEBmMJ8w3nIzjwG+c+euMPAN1SGkYv7zvGdj3Ia4h5A4a+pq0AfOn+z0vwAdpfTlRdsojTLOSBQxy0V/eDzF7XT/HxvKaaiQKlHnH6CWygaGM7Oc/ZDFdVAyZzyDDw/hYT7zhHmZFqt8vxP0QyCuqusD5qUsb6ZCNbwsUAFXNAa/gsHydols5QRe5ea8MtgLW/4SRq+U/BbUoyTp7AREMptNKpuPi9R6RkDj2VZ5CGWxjdkOYuAygye62vLK2VPUEmt0pgQp7qrO7WQp/MnffIaHkcyUdpC5PjaVe2pxZuLxGomzAl4aA2vsscb37skgsL7+eb8I3JgXtMMObOyMiH/j1bWQUloMtC/6/algB85VVbxjE8tqJP21EodkRFkq0DkKqyePr56CVL+GgQlUKe8dsiYYkgVIhk8MHGbFjTl4hBpx38mDeKjbGfJDAo97EtyO2eg3N6wGQKHkRji8Opb9hIIcaSpp48tYupXMZoA3LmzQTT6KgIGGve4DqXXhx3zqcFgPu7WLxlqK3PYHTVF+uLog50WsuBL7zJj/bZorv4QiN0V8FrTwfVLRDUdtBrisIKMjmv12zWN1rYcbuwQYz7SHo0DQQgHc7vAG7ULpyjpA9jFpyOw2XJPm+b+FyTruaMiENMWbLrrKSaesaCwZyB5HE7LAcTFDE+q0Salo2sF46pVsLqsUxJtidOcuGN0PLPurJclQYyqwZT1fTZ7RFtbhW77myYqFz4EogPSGgZlPD8oEST6zlCh0Vn7KmduGmrGiMqsWzVptyayiEfSJm9LkWHUvlugZsVoj0TD71l3WoATDWp+GkFaNYiutYg3L8ogRmN6cJWs+0rICguHkRkbRTJY/one95MWAqktkZxGnLvgbsmk52Qy5gB2hozINWrNdkBbzpnzy/iFe5dKdRZ5s99jBxM5X49BYvBZzqWcA49xkeiZViAhj+HStDxNBQlRyG0QghuXQqmSyrwI/cLo= 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:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:14:04.3557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a9eac20-5ee5-4316-8f32-08dd393b2b06 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: BN3PEPF0000B36E.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL4PR12MB9480 Set ACP_PME_EN to 1 during runtime suspend sequence as per design flow for ACP7.0 & ACP7.1 platforms. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 9 +++++++++ drivers/soundwire/amd_manager.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 42d553878e91..03c9e15dce5b 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -1215,6 +1215,7 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) struct amd_sdw_manager *amd_manager = dev_get_drvdata(dev); struct sdw_bus *bus = &amd_manager->bus; int ret; + u32 val; if (bus->prop.hw_disabled) { dev_dbg(bus->dev, "SoundWire manager %d is disabled,\n", @@ -1239,6 +1240,14 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) ret = amd_sdw_set_device_state(amd_manager, AMD_SDW_DEVICE_STATE_D3); if (ret) return ret; + if (amd_manager->wake_en_mask) { + val = readl(amd_manager->acp_mmio + ACP_PME_EN); + if (!val) { + writel(1, amd_manager->acp_mmio + ACP_PME_EN); + val = readl(amd_manager->acp_mmio + ACP_PME_EN); + dev_dbg(amd_manager->dev, "ACP_PME_EN:0x%x\n", val); + } + } } return 0; } diff --git a/drivers/soundwire/amd_manager.h b/drivers/soundwire/amd_manager.h index 8430f279d88e..1d5e94371f81 100644 --- a/drivers/soundwire/amd_manager.h +++ b/drivers/soundwire/amd_manager.h @@ -199,6 +199,7 @@ #define AMD_SDW1_DEVICE_STATE_MASK GENMASK(3, 2) #define AMD_SDW_DEVICE_STATE_D0 0 #define AMD_SDW_DEVICE_STATE_D3 3 +#define ACP_PME_EN 0x0001400 static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM] = { AMD_SDW_DEFAULT_CLK_FREQ, From patchwork Mon Jan 20 10:13:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13944991 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9EFF1DF268; Mon, 20 Jan 2025 10:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368053; cv=fail; b=PjJzQHwqzzf0J5GltKHKUxKAKLpaKmEBHKxjxXyM5/lt9UlChgqcYY/jxjAGilmV90W93qjGLFX+5si9Jx4PfXTgzy/+hJLBFF6SARi8izuaril5N7+jsv2c5HQj6OlPqxnUnz1BM71q8ZB6cxaGqc2XVaHdkGrVsPzURo7vDRg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737368053; c=relaxed/simple; bh=2mxFfcIffpKTSyLdlghabe4haSladRl1CKXokc98jM4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QQWsNd5OiBGmlJQMw/bDWFjbxcYE7ssb5S8Zmi6RJDe1KhWjCabzuIhmeyeYApQLdsZZsW4n9+goJD1YkddWc4CrhJFkmq+YhlUaI5nhm+FsYQySKZFh/IsLOFfapB6eIr5Zbp5Lgy5Cgk4KeLd61A1EZLqKx4ca+jQXhg3lr6w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=AAghmSWe; arc=fail smtp.client-ip=40.107.92.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="AAghmSWe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yxFY/txHTOkBfgaypi6RpT9a/P8bNDpmfB8yiTIrphsr5yB7bXITy2YIMxxr0TA4kSfK8Sb4FXTRvoT8CenmalNVgG05JYpHQxxF6MY3vWDjGKMjy0jfaCFPpdQ+C0L68VeU+7tFi6gVxKjNuMbJp+nhyJrt8vSHsvLgSn5VQDbb9NAQCrmjlRv42luLIqH3jst2yzZyeU70GQGd/WMSSEVHEAoZjQ7Sg5wApBr6tl/6+8l92+/IvW72rOQvH3I4cx7wtj1R91AGqswCgWlShxmNeN9MGK8J//KK6rTZzd1yV9EtVpe7ahG6c6ePQVYZVPxoYXp3KR6Zu+EmL+TahA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jbFLIc86qhZtS6AqFt18YG5NxzDnVKEfEU/tjDTJ7Aw=; b=lxz68Z+TYF5lTe9yF/lovYunRdzrIxAt1S1PAywuNlGb1xqAt5nbkmG2qzn1R+eOQquDQEXkGqOONaaK1Qfqioslq/OTljfWo3HfDM52II67ryLRL4RD9b5d/DpcMY4gnxFnowWaSCVT1hrbdRWYg81bWla80YWv09lGZOeagZYN94pyNl/+9WOOJKD4KjlHJ8BSJ6D1VQwIX5SNQ7LE0aG8OuhbCjSSHu1MAd+epUfvzRc56Y6XY/kdkJwiCK4oKXF+VmuxrY3iVgc2/d6blB1cyRta9ynKDTI6nJdcJjX7zYhv71cEa7M1Sr1EOTTgc6Mj3NywCx8naqIuUu03Fg== 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 (0) 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=jbFLIc86qhZtS6AqFt18YG5NxzDnVKEfEU/tjDTJ7Aw=; b=AAghmSWeunZ19E7tM7JyJvtxzosXZa7XXCAyo9Zzn1IftKXZkuTt9NDqjT0kZi44yyip/B7OY40C53j+DMBoRAR47MerVW4aEhYL9rwX5FspES1/0xVxQWT/hoE5wpUl9YYsyClDfTF0CSl68X8er9B2LnOVON/CrTnzt1IdQ+k= Received: from MN2PR16CA0006.namprd16.prod.outlook.com (2603:10b6:208:134::19) by SA3PR12MB7879.namprd12.prod.outlook.com (2603:10b6:806:306::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.20; Mon, 20 Jan 2025 10:14:08 +0000 Received: from BN3PEPF0000B373.namprd21.prod.outlook.com (2603:10b6:208:134:cafe::50) by MN2PR16CA0006.outlook.office365.com (2603:10b6:208:134::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.16 via Frontend Transport; Mon, 20 Jan 2025 10:14:07 +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 BN3PEPF0000B373.mail.protection.outlook.com (10.167.243.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.0 via Frontend Transport; Mon, 20 Jan 2025 10:14:07 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.39; Mon, 20 Jan 2025 04:14:04 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V2 7/7] soundwire: amd: add soundwire host wake interrupt enable/disable sequence Date: Mon, 20 Jan 2025 15:43:29 +0530 Message-ID: <20250120101329.3713017-8-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> References: <20250120101329.3713017-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B373:EE_|SA3PR12MB7879:EE_ X-MS-Office365-Filtering-Correlation-Id: c6eb9e7a-6849-478e-d23d-08dd393b2d01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: Hw3j0RtrPdGR55k3tGdkHAHv2TLk7cCeefRRpSj0VC12JTLyKc5ZVVlOkPM5gUT5rove8K2BTTrr8L+v1rwXRsV+NaKgr4ksCBL53ohxHaKbij1hCFUIt/u5GonsqNXq04qz1ygT7GvUjoGgBN6T/ovMgMC05TaiLOZ/20x4YNcBO5bSiTCDmewS8M6EAvJZc2RruvcFsR/xUwHeph8x10xw3C0eTg5x4X/P7wZIePmB+0pe7OTjSMYD0aWzOne6PVPo+g/m9ByYpTz0yCMgU3ORP+fDnGs1VKSyELFeyPwqo5RpdPgztB1EXQC4+rhPRCkicagkZV/z2pqf2Xv00GEOgUeYrGH/w2JvZ/qynkQQEV2dCYg9BjpbgCk7fL4aGexr7quCF3AW7tKljF+rywcU22/Es+ohha0w16QYFuXHVdFCW5d3WwJZGu2ttGRkasozqTE6oTV1uT23rJJSlelfbdV0JB9LT7VtTJhIkIQQQ4VE68pkqUOvDp5/3bIMztFQ8qCMADUxjwSpmZ9H5RF3cs+ZQTIaTqfItcPvB5omCXlyi6r2WbUSR/4v4F81iWoj/ckBewqAavuLi1MnGeo5U//npQGk10y5zrLQFKM93aT0IOqqlPIM/Qp3c3b1FgX8yTqIHwn2wdIBdFOeEFEupETzUUg5YwSiO/VDINjFCCmJk0aK+oZ5c7Hp3QBTpli5/z659Q4htdDRQAdUfJSF6YLynhWOnf+zNx/d1qKjTtGmwdmtH6NAAmDgBobn2G2Y//OxNZgKS8B/DSOLBY341BKn6MUb56iFZf1KnsL8tzElC7sOssrT05Pcpvn8zSw3N/koiC9KOOdf6QGQ/uJ6O+vaYOCYEqsER2bGBZlDt9BCjyxpSZTCmAZ5L6QAYKzYJEhK9wqSt9jLMxnerIiHcQY4Kev5Fej1V2zBrZwMIGGtGjl4GX+4FJPoe3S+2DB1LpZaZTvILHUf5iyZwPudtIwy1KVIpDmP7uywVWPWXoFykVP06o9iuubtNBMnzmb48U4viKJWBFELYbf/vRaB5ljE2NfbkayjcGigeUuSqZFZ6v0f2lCM3kZoiNtCpWKz8foM6jKOeD9/J3hR4r8Ok8sQWzKKz/tPOtJfAAe2EKsySdR+JEXaI+9eQ1KxV59Ii3rofO0rTZiOZe9TtnI5OEH2ca9xW4CwC/B0bnmdV5w8FG+FxZKueN4/k+zArXr7Ey7PAI5H/EgzTQIewiQ56DNBVylGjzCPM30LLgQDBdH1FqS1SJ/2pcZyokEUSJ1ZIpiin8ygXk0GvfGJ+k5bwxpjIBqxhm5Gf6k3SFscniz+GajeurMiW9V94K7/gZdkL8JqAXpq9eBAlAT/AIPR89mGg5U2L4RK6+ZWtiEJM0EnlpV3spQjKN6Q/2FdkY3ZczEqLEZySxq+GKXGxGhrlQYsNXj5ennrLumWdlIJzkZEtg03qcp/IDbKvsafLGk+7AxChUbXD4J9KQOG3niMPSn4ditAF4iJBVy/c4c= 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:(13230040)(82310400026)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 10:14:07.6801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6eb9e7a-6849-478e-d23d-08dd393b2d01 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: BN3PEPF0000B373.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7879 For wake event, SoundWire host wake interrupt will be asserted based on below pre-conditions for ACP7.0 & ACP7.1 platforms. - ACP device should be in D0 state. - SoundWire manager instance should be in D3 state. - SoundWire manager device state should be set to D3. - ACP_PME_EN should be set to 1. Implement code changes to enable/disable SoundWire host wake interrupt mask during suspend and resume as per design flow for ACP7.0 & ACP7.1 platforms. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 58 +++++++++++++++++++++++++++++++++ drivers/soundwire/amd_manager.h | 2 ++ 2 files changed, 60 insertions(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 03c9e15dce5b..161d963c80e6 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -166,6 +166,34 @@ static int amd_sdw_set_device_state(struct amd_sdw_manager *amd_manager, u32 tar return 0; } +static int amd_sdw_host_wake_enable(struct amd_sdw_manager *amd_manager, bool enable) +{ + u32 intr_cntl1; + u32 sdw_host_wake_irq_mask; + + if (!amd_manager->wake_en_mask) + return 0; + + switch (amd_manager->instance) { + case ACP_SDW0: + sdw_host_wake_irq_mask = AMD_SDW0_HOST_WAKE_INTR_MASK; + break; + case ACP_SDW1: + sdw_host_wake_irq_mask = AMD_SDW1_HOST_WAKE_INTR_MASK; + break; + default: + return -EINVAL; + } + + intr_cntl1 = readl(amd_manager->acp_mmio + ACP_EXTERNAL_INTR_CNTL(ACP_SDW1)); + if (enable) + intr_cntl1 |= sdw_host_wake_irq_mask; + else + intr_cntl1 &= ~sdw_host_wake_irq_mask; + writel(intr_cntl1, amd_manager->acp_mmio + ACP_EXTERNAL_INTR_CNTL(ACP_SDW1)); + return 0; +} + static void amd_sdw_ctl_word_prep(u32 *lower_word, u32 *upper_word, struct sdw_msg *msg, int cmd_offset) { @@ -1186,11 +1214,21 @@ static int __maybe_unused amd_suspend(struct device *dev) if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { amd_sdw_wake_enable(amd_manager, false); + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_host_wake_enable(amd_manager, false); + if (ret) + return ret; + } ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { amd_sdw_wake_enable(amd_manager, false); + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_host_wake_enable(amd_manager, false); + if (ret) + return ret; + } /* * As per hardware programming sequence on AMD platforms, * clock stop should be invoked first before powering-off @@ -1224,11 +1262,21 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) } if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { amd_sdw_wake_enable(amd_manager, true); + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_host_wake_enable(amd_manager, true); + if (ret) + return ret; + } ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { amd_sdw_wake_enable(amd_manager, true); + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_host_wake_enable(amd_manager, true); + if (ret) + return ret; + } ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; @@ -1269,8 +1317,18 @@ static int __maybe_unused amd_resume_runtime(struct device *dev) ret = amd_sdw_clock_stop_exit(amd_manager); if (ret) return ret; + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_host_wake_enable(amd_manager, false); + if (ret) + return ret; + } } else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) { writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance)); + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_host_wake_enable(amd_manager, false); + if (ret) + return ret; + } val = readl(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL); if (val) { val |= AMD_SDW_CLK_RESUME_REQ; diff --git a/drivers/soundwire/amd_manager.h b/drivers/soundwire/amd_manager.h index 1d5e94371f81..6cc916b0c820 100644 --- a/drivers/soundwire/amd_manager.h +++ b/drivers/soundwire/amd_manager.h @@ -194,6 +194,8 @@ #define AMD_SDW_CLK_RESUME_DONE 3 #define AMD_SDW_WAKE_STAT_MASK BIT(16) #define AMD_SDW_WAKE_INTR_MASK BIT(16) +#define AMD_SDW0_HOST_WAKE_INTR_MASK BIT(22) +#define AMD_SDW1_HOST_WAKE_INTR_MASK BIT(23) #define AMD_SDW_DEVICE_STATE 0x1430 #define AMD_SDW0_DEVICE_STATE_MASK GENMASK(1, 0) #define AMD_SDW1_DEVICE_STATE_MASK GENMASK(3, 2)