From patchwork Wed Dec 25 07:23:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13920641 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) (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 84E8914D2B7; Wed, 25 Dec 2024 07:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111471; cv=fail; b=pkq9lEozhP7PRkRAHm2SsOYYkFjr0yWgzfpu81CQAHM5FOVTVyyw0/UGXQn8G0jSrhG/bZBWmq61l8eDhiVjgdFDMiZjApK+i4lD7pfVydJh7HP3kGRuOPt5KsZzoTO5ivRwYr3yY2LlnD04RgTR0U4d7Kd0mioPZ5MyYQEjRyU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111471; c=relaxed/simple; bh=zM2zh0uJM8rvEjfNegpihH264PTE4XAZU4iWLdI353Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ul7JCRlP8lG70F9Sr/gf+S16iyOQLmDrL4GEwO7gJl80pl4HzkYxgqeCAHOpUsZHZtPq6O/AQ6gMC7XMj4GqIjMz8SlXpsNC2fZBcPwQziiCW1kaiCAzJS/spZrMD87hyyxhHoOuEFyi/W+nTNVuW+wqhTbMyzWloyrGMq1s1WY= 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=toPpxVRJ; arc=fail smtp.client-ip=40.107.92.82 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="toPpxVRJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Es7ZrUx3LTD4lN8yOFweTdttOan16hboed2fnECajcO6rqHV/2DjVBmreA0g4qWQh8DfQtITjOGy7Y15Umh7v91wbMSbzOo6Coq1mGzSXJJ9tvTm7EH5+1OJxfa0TUy3tZLvOgt2NSVfsJS6VDY20/rEzQM//3gY/7uBtqdLI4dD1trEfCLJp/U9VyL2NiRmRFUvYdnS2jynUvxC/4HgdZivRdxDRa0MG9UUQr8J0JFSUI5bS5d5oxwuXdyhQ0jDKprQSYcs2Lb7e5o+Oy4ngez7BT1d0/aRSC9GdHqiKzDFzaRHd5ZnROgqCKmbuM8jMuFr7qiCfP8h+SK9noGWAA== 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=OUbXwsn8vovcShrE2uNFFJF8kP3roV7g85ByyNWjnzSzZ3/VZRceMYYyHtleJf4c81O0/FKSaoKDTB7+Eg4SEzVe0wp2CTg3dib26Jv7k+vq0o6DTEZV+ZdjFOEl5m8lorD4Z3tVkBOTeIwW25WIBdqp2Cqcrjwg0hKAHa3drno2vJF3YL34Mlx3rr7gMi+QSuDMCX8L6z6CPcDq9uzBYWvukrkc3MuLa6QLVPLnuVUAT6kErNe7iDYahzmxXbrG78f+Yea0GXbBamOm2eezF4uyoBaJXnWTeRTraJrZefwvX+zEoKeXDXEckp/18z4FiUjal65zZAhpH4RJ2PBb3A== 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=toPpxVRJYm7oG5x+xouzZRGUIPfhd2LJaGoYnaqRNjfwqc/uwONP42vzGPBvV0fAMhqW0vHP6L5vYRTrbq911xtvaFU/pfBFd9tjXdIHmM4lpJicFe1tgINTIHBRN8shv0tumpEiCD9x6lj8dPEu+6w8EYef0EbXwL1zrFN+/AI= Received: from SJ0PR13CA0017.namprd13.prod.outlook.com (2603:10b6:a03:2c0::22) by IA1PR12MB6236.namprd12.prod.outlook.com (2603:10b6:208:3e4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.20; Wed, 25 Dec 2024 07:24:21 +0000 Received: from MWH0EPF000A6733.namprd04.prod.outlook.com (2603:10b6:a03:2c0:cafe::65) by SJ0PR13CA0017.outlook.office365.com (2603:10b6:a03:2c0::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.10 via Frontend Transport; Wed, 25 Dec 2024 07:24:20 +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 MWH0EPF000A6733.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8293.12 via Frontend Transport; Wed, 25 Dec 2024 07:24:20 +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; Wed, 25 Dec 2024 01:24:16 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH 1/5] soundwire: amd: change the soundwire wake enable/disable sequence Date: Wed, 25 Dec 2024 12:53:56 +0530 Message-ID: <20241225072400.912445-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241225072400.912445-1-Vijendar.Mukunda@amd.com> References: <20241225072400.912445-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: MWH0EPF000A6733:EE_|IA1PR12MB6236:EE_ X-MS-Office365-Filtering-Correlation-Id: 4106f380-dd2c-4a1e-ae22-08dd24b5260d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: l+khqjruzU965Ev66kkuGdo0iCwtdEGxCf+MNjRP8ZLujXNv0Yw3gaTmZif0K+HK4DUv1eQw1SaRmawAdAFqHqLzKyWGgzC+z0vsit+039dzy7B19dV1vZ/UjdtZXZ6n2Yhrco2rNgIPXQpGZOUu63cGbVDjGubPPgREWkq4G4XLrx0zqame8hXJIoozup87dAi8Vf0PN0hsaQ+fgBr5aaU/jGMKeFazdixw1jkmon8A1UW9wyQwT6cKLm5kQbackQcFO7MDevuVxF8QUP69NwYN8snHXKizFhmVri8tARaDTGf5wXsDADEaDZl/+JmtXhTNvPpu4sxCL/TDsluWaH7gpE/36/lWXD7FfZUB0evkLbtllz1e4SdaMr7rS3qVFkQx8DMBFZ5da/jbgHKwkYet7DWObbE/KEhwYNTkwjYk8yGjjbhBz/rW7N1T9SoqvhBnaOIsDLr6TSSg61fgUTwSFwsucGmXgoIs01BcOir1hPHKzV9Risw7h1yGaXsaFKyxvpzn22TQXUYD0vXhOzJa5RTxteM1iZzMN+wHA2586YE/FDLr+uq3P9j4Lxrq06rgC4Lua61XfnThLaxjAi2axryEx0DFaSb2mpPWn/ti+kodTTaC701WXoWFTvmsyVWH4rBylWDMYr5d1M38zBDRQTrT67UtxZwTOGcgsdDrLeU6MCYCUik4Cz/bNS+SzZhVMAz0JWOQzrwP3BDRoyVMmCFVozHNTi6fNBY/JpnMPzfVQm7Cnn8CesvA1RM8x9J+NLopUOoqDcF7zJL7zvq07UIQmcDujuM2hK/OimBc1/HgvcU22ptjjhChQtmYyKzv9Uw+pp46n6lrTsyLCTXZv64JZYlWCM/JejRNaWRiq8W0/2Prec52xSHHQkjAlOoqs++keQQXIU+4s16ZErB+CZoxgH4Vw6hZnxCB7bGl9pE+OKbVkgrcDhLh4HdaHvcvLhM2s/zUa3bzUHwGRZmJre3fPOA68KT9X+Uij6tEpLQglmlwmw0OuwGZaBHJ0Z1t+W0sdGAyt/xmtOaKLpRJZlB2q4U3L/VTNp3vS9icPPM9KB/jZnHFOnvOaVFaK/wfCz6rk1JCaqvwy4hQPahscDsvp/4ux54kmQ3aaHKcGrjHJuhJFuvzEfU8bjAJ+dY1+KB9n+2nr9M3BBsF4V2YVW9sSnR9Zz0tD/FyAU3wq3C3Sr4GMumgJPdk5VBgc6ZQxs0uBGZhnNAWgtaLB+Ci7DjqOt+DfQEx4In8MvjccC03b0Re30ZpIHnADsOwTv3lHv1B5BipZ52icf1/cTug1tkD7CiN3tSeozR2WIKF+RMRm5A1Sm6x8iE4SVzE1LgkKGCIZ+4YEDjwcWd8tCZHa6HFSOIakQGqymgBQgkRM+zbhCnsl1Ub984HKglFHlDp0JfOZNRqvfuDDfKQAWQXWYLTtK3XOCQ8q3ycCojMCg8/g0X1OiXi/spLsa4aF1CErAH4KlhMSgqeX4WNwioQqxpJYrSL49ChqAu++qo= 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)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2024 07:24:20.0870 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4106f380-dd2c-4a1e-ae22-08dd24b5260d 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: MWH0EPF000A6733.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6236 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 Wed Dec 25 07:23:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13920642 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2057.outbound.protection.outlook.com [40.107.237.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 9A7791531F9; Wed, 25 Dec 2024 07:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111474; cv=fail; b=NY1NGLdlBX9PFezoM5j41qnO7fBSqQGhSqm0HGlIIYBjDmFUnqoHdLWFwH+BRGpim6pHP4+ksRoJQK3DsumoRqIZxnK6+CukKqnrb+lWqOQBlk28ZUB4KURF3FDeeTxZrqikIirQhCXOlaKrrF1w5hctg3u7dcMDTkP6ez3iNRM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111474; c=relaxed/simple; bh=rUDS1W7GSY9x3ufKyR5TU335l/+EBtmFCipUhA7YfhE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h8ZtK5/LkZoHfvot5xTdGih1WTWPMhG5iBb/UHExh7PyezqMruWHDwZMj5D5o5Iz78kN0hnHMSp8Z1OhTieSME0irJTF7xS7REEsmJQZg8OaXMVhry2JED6MPtqDJwAxCPPwR1fqNeINjazpaxmRkJy2Kh53CmZXFv1wZLKdivM= 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=oZzEVJqX; arc=fail smtp.client-ip=40.107.237.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="oZzEVJqX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EHmq9W18outfoJUZIE1XlH/QK5S8dOo1Abe5oPtuvQ5x3Q0fqjYSWQz3cyfbbI/L1t4a1RJephq6Xyj0aZbcp+NZ3X8cs6yHOAXvUH9wy5Dmg6uTAQBkqJNr/B2kVJdDB+gQUdb3nDUm6ZV3OTfc2Rs7BCh2qZOGheVmkf3zLECO2WfvwAkZhnAX8E+NhaSnqbVee3qSlzIzr0xDQmkxz3dMYhHmDr7IeZk2YP9UTeS8pjM5cGh8SyBAroUdv8SsDOt/K35DTmZsNyFBubbwdNbYl1fqbp8ExSnvh+UYsSM4zfjMpNjlpCONTzniIJYAgJqCRD4JGv7ny8tI+FuFnA== 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=RwJps0SigMhBGxFxdU3Z/ihj1Zgrv1oXOm9K7h780L7UVjL4UIU2/VuD/FsnTPn8dYyydgHNLQskYnwxJGfT/86l5W1V7BVmHNOwJ1eYRnwwIe7RTW91kz1YtlQBQWK5ZHXIlovQyhqBI2RAcZXtGw6ELe7dSyW7T0EQUDX6ebXtcfN29gJja5oS2owXIpksztUzvniJs5IgifQnVOAkIjZbPiCRzq98tJYntkytFFjl+wCNosZtwCd/4tJLI1t6c4D9p1erAennA/LNYBLcSOMSJ/HUi88qdRniH4nbNuI+xM2E3xazx8IN+/5Ehhr/bmDLsd+10NNRA0iVkH3Qbw== 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=oZzEVJqXSA3hAf6QvHl38WAcoZNAagOxA6KZJhO4NeloZfDnD8r5+0w4EZ8rvqn+WwVEvD5/tsBmiDiyZY55QeiiI9LO3wfI+vNqk9cBA98BnsX/6MYTn7DFQ5lPb/T9ge5WdYxs/npa1y0sB6N79TDirkZEjPsMORWhTd0Cc+A= Received: from SJ0PR13CA0002.namprd13.prod.outlook.com (2603:10b6:a03:2c0::7) by DM6PR12MB4138.namprd12.prod.outlook.com (2603:10b6:5:220::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Wed, 25 Dec 2024 07:24:23 +0000 Received: from MWH0EPF000A6733.namprd04.prod.outlook.com (2603:10b6:a03:2c0:cafe::d4) by SJ0PR13CA0002.outlook.office365.com (2603:10b6:a03:2c0::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8272.8 via Frontend Transport; Wed, 25 Dec 2024 07:24:23 +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 MWH0EPF000A6733.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8293.12 via Frontend Transport; Wed, 25 Dec 2024 07:24:23 +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; Wed, 25 Dec 2024 01:24:19 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH 2/5] soundwire: amd: add debug log for soundwire wake event Date: Wed, 25 Dec 2024 12:53:57 +0530 Message-ID: <20241225072400.912445-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241225072400.912445-1-Vijendar.Mukunda@amd.com> References: <20241225072400.912445-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: MWH0EPF000A6733:EE_|DM6PR12MB4138:EE_ X-MS-Office365-Filtering-Correlation-Id: 7292b5d3-b010-4350-e94b-08dd24b527cd 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: Ha3XbIfdlScqskp7dhV6YIp2aC550y7aojpyuxCDEr+0QMAgBEKblOACsQ8HRq0gHgRF8eAfOE/NKuRTZCcMaEnF4NHumMq9DjV0VE7Av/e5WdQ1JFA9YkjZvGCYRGeiORGSfOQygRtwPfbcmky9Wb1NoAAAIMac8PfiTR08C5PtPhh8BpVtDu6pfYSXYkoyqVWPhPrUzDSZg6FfuJqf0Jt5K8UyGBH3Tvd63qHpw4fnX9/iKiyER6m6d0EwxDZpcxNduV8858JQO80+xI9K4gHCqzApWafA9r/R61y3ixjYqZtZ0QXhDH+p0ySaCwiSLpZ7U4DSavZHY3J4X9CXjyl+C3nGFonhpkTiab+opjq3k9KsarMWlvJmF3se60THLCaRVpoiF1eA0VyesFj/1uO+R3+iDkAS+A+yKtU4UoqgFXkKO5QkehEtmvG7dh2EIVs2c0wN09iFn6nbnKHSZSTWYTamnH0X7G1KQoP6cnr0VAl1KNo6ZbznKM9Mu47OnaUsSIaQsasrZDD7w5cX0FkbVll33i0OrmhtndNAJCbMctJ49rG4Uj1ZUn9qW3TeTKxedMfhZ93GhEfgrHOnrn5WS2D5UMkoZ/4A58qzVx4az48ykfaH8/w0NCyPtAQfENObai4i7f1Hfl2oz3cSrtj//Xhks4P8gbMURB3ocCuC8wWKiptbzoHFu0MpefIVoZyZt+7J+3BSosRD5JPpS1kBRVKIF8JtiCzU2XVkPZjhyxOfRCyF1aNfqcfqJM+zIYsQe46QY0O4YRIzw+oTSaHSEFZv7vhoioIkqzqCBjs6KrdF5mkM8q9blW2No9WhGOWeAXg33nzpkeamYLgU48Ld68Rl6lpQnyTLxbeP99OYmt4+eR2JP7tNsvs6AVSDhU32fh63Uex2fwQRIEgMmv91XLTEmFa0MyTPZGFDWrDT0p0x0fuyAIvRDqqQQ/1HROP5qUIHOhDpldTpal5dDSxzmmdGUaXj5sPzAfBw/zBOYmazUYK+bUt+X8/ynhtsCjNNI2P+zWtMdD/vg5LJ/HSn7beqVhe4ETh+wCApubHmcyjMPwV3w0UKIESTPWATWeUPrxuN7vKw8Rtl9JPuHf59CSH6sac72ggqMCeoIf/45kLznjiYr2rxeKWbNj1N9fN1X2gwRMgcnY+7MleO9sQCax/bZenzSV5JUjYcbojhKYLLfAAFQzNrh04MNjS5uuacSNMgxLVjWS8948rurSZPuVXo7FzPLI+inPjAas7Ba294wnLlWnAqjd5L0V3pptfEY7NnT56Ttv6OiSZ+BHfwelKqcgp7BxVT0omOgsRzyMzdBOA5frVbHuqlBjSVpvcwcIiyg0jPpuRBlzPOLQJ4s+P2cxDJd1utDIL/P/0Wqp3O+Q3X/hM5qjJfJ7X3uvTKuFPoBFx1XhEtqyDI6+VzaR+qz7S+78s0zEbVwhd1y5j/gERsap6kQ0vOKPc5/PCFyiReUwhaQiNskfhsdo1DDxaWTEzizqRh9vhIHTA= 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: 25 Dec 2024 07:24:23.0246 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7292b5d3-b010-4350-e94b-08dd24b527cd 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: MWH0EPF000A6733.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4138 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 Wed Dec 25 07:23:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13920643 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2057.outbound.protection.outlook.com [40.107.236.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 2EEDE14A619; Wed, 25 Dec 2024 07:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111480; cv=fail; b=QuHmSX0mDG7aVWMPm/03epA69vJOjCHdbt/2XgN2LSzeIwbqoYmcBnw5pBnqClHt89BiXiuW0HWGshB3M3Z/Wz5ZZqp2cFltfueYOlL/uF4uQW97GCmW23NKv6GEXlHdjI8N2Z531Vc8MfvuAsxTB3Q41vPQaERah42Jbt1e8C4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111480; c=relaxed/simple; bh=a3Vdvz5mlR1zQHZZ2LWdCCqlFyoeapl/wqXc2VIxCzc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AmLOq6jKhL4VaUggfMXjl4f9C2X3nJooKQVAyQ94lBQrzp0Iksucs5A+uuNxqwxFA1fi2FVdCQyKnb0SPlqnri7C533NXmwKXdFBSeRCJXtBUBUfCr6n/bnCcQZNYxyJN2elRFAHWS1xVMaY/8lGrSNuGMR+vLCBkgaGgZwNsEA= 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=40u0FK22; arc=fail smtp.client-ip=40.107.236.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="40u0FK22" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JfcNT8JiIyyzeqmxxg6uCjkD6vORkJ++TQXOZmi0brDmaLvsHxWlqug05CSI7qfN6X87bO2TvX6OczQBj7yH6AExpYlgWCKKAh9BG9O0w3v6SP09ymdxPTAqwN/rBrpqp9Hqp1WgqfluT4vhqzxuIeq6k85APDhgVX9ILGcHdnafVd4RmKupWjxAT4VO6seVGRHAZ8nR1Q0/z0xM+JWaSokvWh1KyOlo9jfG0mmtS4chq0SnusA52H4QOg5++RG2JYg9216oXBYOyNurA4GRddfNaq8pqSW75AQXVmB6r44NF7Xer7TfpwvE7LQ8YKa7z9aMeVmU4TJ98i3uVHMKXw== 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=TZ0hJO6mlcQw07YY5ESgm55Z66kfVeXHiPAi5NF550k=; b=kEz7EX0vRNK/aeRop1YaSOFVcTs6rcf7UgQc7tDpPS08fmqLN5mf0/l2q6CpSQe9adKeUqTxCseFpW1Yok8w4oUKd692ngtZQ6xtKm1RgZID6xuBhuX0eizxElFTe8NWmR97mJM0XgeN8GivTpcb+WJ6qZ0xJyAJgVxn/OKixDjlREaUgrslup2ltH7HFOb3RaoAeZFZOGdkCiiKoHpO2lao7z5rrM8r1Vo0vQo8KLJR0h9e/KxfyT7w0LciJMvCkxPT9uM59w2rtV+m1OkD2e7JudLye6GjuCeqP3mzauuPwsnlSfXyNRRZFOXC4i048DJQqBFmkeWMHX7hSpLZMA== 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=TZ0hJO6mlcQw07YY5ESgm55Z66kfVeXHiPAi5NF550k=; b=40u0FK22e65iRX4i1/UzKlc5OZK6xcn39wYfP80fypgESrvHmgcycZQ2iGaVoU8S47lezkpoKYujVrl3HIz/RpahxKiC6J0xngxNpmoLlGShYdrVqDDBq9gIR7TlOGU6MHq9i73L6TrcF38CG4f0EpgmNtoMjayMXNXsJU5TuB4= Received: from PH8PR07CA0046.namprd07.prod.outlook.com (2603:10b6:510:2cf::24) by PH7PR12MB8179.namprd12.prod.outlook.com (2603:10b6:510:2b8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Wed, 25 Dec 2024 07:24:27 +0000 Received: from MWH0EPF000A6731.namprd04.prod.outlook.com (2603:10b6:510:2cf:cafe::6f) by PH8PR07CA0046.outlook.office365.com (2603:10b6:510:2cf::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.13 via Frontend Transport; Wed, 25 Dec 2024 07:24:27 +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 MWH0EPF000A6731.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8293.12 via Frontend Transport; Wed, 25 Dec 2024 07:24:26 +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; Wed, 25 Dec 2024 01:24:22 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH 3/5] soundwire: amd: add support for ACP7.0 & ACP7.1 platforms Date: Wed, 25 Dec 2024 12:53:58 +0530 Message-ID: <20241225072400.912445-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241225072400.912445-1-Vijendar.Mukunda@amd.com> References: <20241225072400.912445-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: MWH0EPF000A6731:EE_|PH7PR12MB8179:EE_ X-MS-Office365-Filtering-Correlation-Id: 61416223-5a60-4d29-955f-08dd24b52a1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: pH/WhKe6Y1v7p532cnILa6koGAS9gDJ+cxpwBCwbGJ2BJm9e3nH6oEd9dB5elZDp/TRuTs/KtOOBYggYrmcEoRpuX7/z5/h96L+6+GwgKfpWrEEH3/wjTASHwZUuX/z/llg5D+QQGYCkm63TpNQZYe0C5HOFOq3LASlsxKKoH3x0fo1IttlQKl87HaF820mpK+zvzFwFshH8eDso73jjskHKc80Bpdk9Wjl0X3UII8bIA4eiXZHuQ0ysLy9NXr9k+ESH467asgByyMn7qewAp8uBMA/MVpAAEkLIi+oM5F53l2Z7fg9WjYdhaTziRlkWJnn//8AX9mPC2zAvYfcFKMg56/eqeVAAgA6WOdinK7svDUEah5GfkSwj32m+jqZVTiq1LvfmtydmKKxmD0J+BXHLNCJku4rRjAzwyFhCQkoyU2oyxo/FqqoviBsanIgAeDxk7VriKLXpUUzjJejFRIml5WbEXv8zD2Ggfhcm9sJ4/9zcIuZB1O2bTustRsZseWzieXGkHJlRDCHcUihByNFYSkL3pYFYdxoQeiMXuL7A7S/JZTAlx3bxFJAP1I+T4xq07xsvVx1OL72PoEl3AGDql2QLn4olz++18ZwEYvPncZmaxqKP6VhkX+fHMkGYdJF00n6hr94hSFVVMmbUArp/bczFrnheznrDcFbMDLwMkSALxy9iX5YPUEngTfXCQBy4oXm9dXhObPpllB4Xb2CUJszUW4Rp9fo/QHSyDFxxT5zHApq8DQ1o+/gcqtLAYJrVUm9H3tGm9Df8/jlw9LO01SC6gOioHIP6rjpfKbCVtpslXBUdaKi+8kHhD8Iua4rS/on0V24YtgIsCD/H59QqCbVEbzkfdmBPVsU1ao5UfKtWJaoQEql5Xbs+JgyROGmfQhhrcgArcDx+TRn4r9s7VMeT0iI7lNQEu2pp/1rbjEE9Zzd+TH7rliRuOVFTOVhn2va9093IS+jsfcgPkSA95z+C7FWI3gWWhbqY1huZ1IzSWWHhBfNOnCBr1ogqrYRutw9FdiP7tFTmptjAzCBj11gAWOVIo/aZG/VqipvVlVlHYb20BL73BDY6Pznfq4gfMmIDsSKpvQy2Vw2m88myyyk9G+vYp2OxbFsJxQg6O7B692ZwbdR1SimSTM2DJ/lct6QTEGCtUoJ3c2hUkBkgJ0dKhwZATUHNyv+/Wl5HcmynsOJDosIiHnxIjF6QzJZXOy/ccqgEHm3Rr/sV42dUxJ/5gsXPQ4Ddkj/B4ywl+IyANcTr8jt/hfgvJEsFRcvgE6q5hNySw2OdVV4aNYaUbYm3Rk+RtFlyKllp0cis060VuMtXTN9QLSYevHFj0IwrB9RrOmy5STkP//aUM1S5FJejcYu+8mR+PaxtAaKFqk0B1jdkzixrXYPTbBnsckmflAVdW7pcIusIW7yOM0fFrH34k0zLBNdAXG8q14d3iXx3z2hNcFYKOw+bAycyYAf2zDuuai6tx2kpKH2WrRY18m3sO38CXImSe6G2cV4= 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)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2024 07:24:26.9178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61416223-5a60-4d29-955f-08dd24b52a1d 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: MWH0EPF000A6731.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8179 Add SoundWire support for ACP7.0 and ACP7.1 platforms. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 23 +++++++++++++++++++++++ drivers/soundwire/amd_manager.h | 18 ++++++++++++++++++ include/linux/soundwire/sdw_amd.h | 2 ++ 3 files changed, 43 insertions(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 60be5805715e..9eb8d345b527 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; } @@ -895,6 +911,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 */ @@ -966,6 +983,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; } @@ -1172,6 +1194,7 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; + return amd_deinit_sdw_manager(amd_manager); } return 0; 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 Wed Dec 25 07:23:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13920644 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2050.outbound.protection.outlook.com [40.107.237.50]) (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 75EA01531F9; Wed, 25 Dec 2024 07:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111480; cv=fail; b=CAo1NPR+HU+ILnoYbFwdnEZGQempvi0t3/teqEEWS4tNgh+9L7o1HHb3bu+kdE57d11gHtZt1TxzuLIkVpORCpHiP/Dz+a6dn3FS4ZlB0L0ii57vgiQa5NOzX+JRFA0n9rvh4mN17kBkJfh064Bn2gWgPwZVICJYTbhjuoYxmbc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111480; c=relaxed/simple; bh=aOHZa+Qk/6pAwlvkUIEssC7Ei32tHLtPuoQe+VxkuPs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nnYjl316MCmbLFmJgNvFh0H+M7xlWOmoh9RAPsCgUAplyhLROct2eB/wSMPCn2PMkXDY1zCHHYTlzN1bWZbKtYFQH9JTiE3/wjKpbHPGiSTueP360K7SQkYnpVNm8hzn/ZI+HYRUuj+fDH5J0f4K8WvWhpe1ExmAv63cS9Iu6nY= 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=WvxjDKtP; arc=fail smtp.client-ip=40.107.237.50 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="WvxjDKtP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y4xvZE34xbI0oypy3pIat9oYjK9h2aoi+5qpnuSuTOKgHSDKRY/lGvEjqkQ9CDwmszBlxMttf0NPgD93E/WY8mYlN9lm5oN7iA+GazAlygDraZolEQHR0aG/A+8dK+Y7f+CKrDBaZ3hv3FATlAaWN7SJm/BexHQcBIOBOtqiRS1LnpLq8+B/iJSd2b3rfVzxWkCLE0lwSwg/f3IXzQSftZQSc3rH2CYgo54Z5UV5cSAhAZdqSNHobznEYzqgkj9xm/9Nk/jZUIJZBg03UjDRpup/3URQnk/z2cW/Xf5843yjB7DFPXP1XyEYZMDRlyFSDnma/iUqZpF5kf88T0O6IA== 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=N9/X3BRMGriHmnoiLhcfEh1hJCN+FTGVlUJgmtZRic8=; b=dW52P36OsuTL/yBndbX2ffHRvn7CBIBi9ylhHM+2D6pIL44Bl8eZDuoMBzDGvfGAOAMDrm5TvMhblMPWBGoWVkNXJeXd4K9cKeQjD/S6xLb3KYzxEUpaiB2S0/mRhIBt2T5tqmJAxgo5Fg4ol7bOVc527wpX0M4vO4U7lfdfN/Zj8LkZC2TrKoNuzQ2tn4+JC6d6qhpFNfYkxg55AsLhbdVrq5EwKV9kbZioeEMa21EAVS+KGyUzy1/Btx/Prnaeos/YXD8Fi4dMXwwCTpN3bXgAzhHh/4O8iNRAYMBKAQNmhy/EKvqCDrhV6oyW2MJubVQUCpTuC/nJpF1uSWKr/w== 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=N9/X3BRMGriHmnoiLhcfEh1hJCN+FTGVlUJgmtZRic8=; b=WvxjDKtPz9aAJDq3KA4nG7K2/TsmwoXsKA4J8q4S9B4fIx4/TE8aoprfKVxubHDVGFlcCqn64PrQcUJz0fmsQCE0TxVoM5P5r5z3Td1hPLeMStq2qLdUoFgSVX3fbEr4PaNjdOkE/jWdwZmsYEugS2F85CzUZsWanz010OXF960= Received: from SJ0PR13CA0010.namprd13.prod.outlook.com (2603:10b6:a03:2c0::15) by CY8PR12MB7491.namprd12.prod.outlook.com (2603:10b6:930:92::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.20; Wed, 25 Dec 2024 07:24:30 +0000 Received: from MWH0EPF000A6733.namprd04.prod.outlook.com (2603:10b6:a03:2c0:cafe::d2) by SJ0PR13CA0010.outlook.office365.com (2603:10b6:a03:2c0::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.10 via Frontend Transport; Wed, 25 Dec 2024 07:24:30 +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 MWH0EPF000A6733.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8293.12 via Frontend Transport; Wed, 25 Dec 2024 07:24:30 +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; Wed, 25 Dec 2024 01:24:26 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH 4/5] soundwire: amd: add soundwire host wake interrupt enable/disable sequence Date: Wed, 25 Dec 2024 12:53:59 +0530 Message-ID: <20241225072400.912445-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241225072400.912445-1-Vijendar.Mukunda@amd.com> References: <20241225072400.912445-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: MWH0EPF000A6733:EE_|CY8PR12MB7491:EE_ X-MS-Office365-Filtering-Correlation-Id: ec9e2294-0d14-41ae-f44d-08dd24b52c24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: wzq0/tq9vLsxKR8U6Snp+U1ZeVBXuIhencOydWxgHjVUbOJ4AMYD4/d5WTNU2LgtvvuEUeccRdsHfeXvLFk8CxJ3NJ9fRg2othnLkOXyQxw9xFadbl17HTlMa9+gM2hYw0H8eRtiM0Jan6qOlG9hMhx00mv+g9ijet2kX0GORTZEKDyXnTx8hLRT1qv/PeCycQD8rYoW3X82XO+MH9J7fbCzk36VNTjD/whWFVxPd3aEu0o2PyQVhfIS4Opik8mcrqLT/uc0UTF5mTbKMQChfhT3UW/D3rpiaMK5qPBEjbyfMjI5Uu7rLqOIyDhy7f3pUzGiV5x/+AS8PcNfOR/chnEe2ehwf4DzkVuzrW5R2nQqpHn6Ly8wYNcSKG3mNslTzcl9HfJhHgjubWbI7Wj9yptQ4QM2paX8ToLp77i3AoSip5ixXn6e0mc035ANtJ5wJJALind4Wz+q6SmBRVBVGB++1y44/R7KH5pWccBueuCNJBqgnKEWbHGymZpHBnp5JOFmpXMBHlZOiRDhDJ0UQNDN9KzBqXcRR5SzwTAU34zZLKEvRL4LCYIfggv1As1OK7fwtvdyvZFkKqj6VdTCVA0V5xGxNDZBEHVsih8M0ZHyvGmOBjDH3jv7vTCMmc0iaZU1uMJiRlTF/O+A+ceHlnJXy8oy4mS0tOQOOmLDBfjuVMd08ZRZkNHFlJqidgl1sTwf0LUF3Qm0/dPTlTiVbXXEdZ8c+sf4SWsCXsr1Wmb8P35T1J7g1DIuI4jUIU9ZV3lHLdCeZ9jhyQFEiPv7c5oFVJR/uT59gvXXY2Nzvm9I0uLsSwOOaEwb8Hi6rW4PrVUGYWyWXjHb/+OrWImLiFu0S4qmGpeWCgJ9RetFqh34RBOCEH/4tcknXx+ZcqppjhUUhs8qIq6VK7ZDp4hRJ5E9ma4ySVgyyCUEhVP/94oTlc8Px1Xn6234Guqvinxwu9aJ41o2cwRGcaq7gbyzFraYmTYqmipx1hlm3jOaGBGqXB5mf7TlJrWrqMfgXZP0j0xL9QHRYMcjhTXdU9PgDcVeylKXC87ipXwNderN7TFl488JUnJeZyTUSYRM6G9KJLwo1jq8zjC6CClaV0eLY9xSaxaWoZzu3Wvt1b72HrXMtLEj98l3GtKK8RQG112bWr+UFgQjVoc8UOUzA2ZCW8EQpvXz3ic4Qvll8p7gwXobcvabL3lWDMR4wpkdHt1OAaK9P7Oq4te4N6qffExFfPmJlqLAdKciGiitQ6qORInN1y/tiVNJWkl5b1hAoPzvMKcDCoMhKjou/cFKii7n6y03WU5jlbZiWMXXYjIMjbEf/BP3B5LeCW0N1qqO+lFq56F2T8CenURj3SMvnNsYqKPQpsbNOqL24/YQmOGjd9oGieHa18nzD3ym1GhqoYbRr5YtuO0JBlRF2OpayClBNWoDZMyIwAo7uqHSGuZ2oYq0WWXjOwOBuZnz6UK36491tC7jM6OglHuucxhdn3YZ4g== 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)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2024 07:24:30.3059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec9e2294-0d14-41ae-f44d-08dd24b52c24 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: MWH0EPF000A6733.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7491 SoundWire host wake interrupt will be asserted based on below pre-conditions for ACP7.0 & ACP7.1 platforms for SoundWire poweroff mode. - ACP device should be in D0 state. - SoundWire manager instance should be in D3 state. - SoundWire manager device state should be set to D3. Implement code changes to enable/disable SoundWire host wake mask and SoundWire device state for ACP7.0 & ACP7.1 platforms for SoundWire poweroff mode as mentioned below. - Enable SoundWire host wake mask during runtime suspend sequence. - Disable SoundWire host wake mask during resume sequence. - Set the SoundWire device state to D3 during runtime suspend sequence and set the device state to D0 state during resume sequence by programming 'AMD_SDW_DEVICE_STATE' register. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 45 +++++++++++++++++++++++++++++++++ drivers/soundwire/amd_manager.h | 7 +++++ 2 files changed, 52 insertions(+) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 9eb8d345b527..6f9d9f765a20 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -143,6 +143,47 @@ 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_host_wake_enable(struct amd_sdw_manager *amd_manager, bool enable) +{ + u32 intr_cntl1; + u32 sdw_host_wake_irq_mask; + u32 sdw_dev_state_mask; + u32 target_dev_state; + u32 sdw_dev_state; + + 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; + sdw_dev_state_mask = AMD_SDW0_DEVICE_STATE_MASK; + break; + case ACP_SDW1: + sdw_host_wake_irq_mask = AMD_SDW1_HOST_WAKE_INTR_MASK; + sdw_dev_state_mask = AMD_SDW1_DEVICE_STATE_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; + target_dev_state = AMD_SDW_DEVICE_STATE_D3; + } else { + intr_cntl1 &= ~sdw_host_wake_irq_mask; + target_dev_state = AMD_SDW_DEVICE_STATE_D0; + } + writel(intr_cntl1, amd_manager->acp_mmio + ACP_EXTERNAL_INTR_CNTL(ACP_SDW1)); + sdw_dev_state = readl(amd_manager->acp_mmio + AMD_SDW_DEVICE_STATE); + amd_updatel(amd_manager->acp_mmio, AMD_SDW_DEVICE_STATE, sdw_dev_state_mask, + target_dev_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) { @@ -1191,6 +1232,8 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) 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); + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) + amd_sdw_host_wake_enable(amd_manager, true); ret = amd_sdw_clock_stop(amd_manager); if (ret) return ret; @@ -1217,6 +1260,8 @@ static int __maybe_unused amd_resume_runtime(struct device *dev) return amd_sdw_clock_stop_exit(amd_manager); } 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) + amd_sdw_host_wake_enable(amd_manager, false); 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 30244a31c21c..18faef593865 100644 --- a/drivers/soundwire/amd_manager.h +++ b/drivers/soundwire/amd_manager.h @@ -194,6 +194,13 @@ #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 3 +#define AMD_SDW1_DEVICE_STATE_MASK 0xc +#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 Wed Dec 25 07:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 13920645 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2076.outbound.protection.outlook.com [40.107.95.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 157C018C03E; Wed, 25 Dec 2024 07:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111484; cv=fail; b=R3VDLbglBKuniSUpIArwkqJRpaLyUJ/fep0S8FO0NZIUb4kY2Popqcw025fNWb8zg54WJFY98XVZrDyw3LRU1/BRqy8V+z1bjdMO/329LjJ+ZY4H4DrtPsjSccF9YcKcbO9fRuTyWY280OyS+0WgtISTC5pi0wPYHt5y9e4Sivc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735111484; c=relaxed/simple; bh=OOdXyhMkqgScgDpHVSpCwuWzGddqnAvvJL/f7v8aA2M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PwSPvG/Ht5qzvq9Y9WMGlZi09DIub5RpmW4m2e7cmCaeqCfzqRQZxm3p65wjEKuSkW0mstxVwyHW9UbUDgoijL++vfkmFnPV34ZrhiIbMFeXTGeQWVamFdsZbAfr9KNFZ7+etkMIw/7zAH0Ey/MpE2xDGtLS+R9Pj2W8NilhenY= 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=L0uSTFap; arc=fail smtp.client-ip=40.107.95.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="L0uSTFap" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q939F3LQascPqgVlI6gyW5KsOCAWMiVW1zKnleB7kEHlqimFsYLA79jp3CQsx4vxWdUBb/asN9PtHFywLEIn/2f3xifG/qKZ4PGv0fuLzvYi4N+sYPMY0ehzwHe/fjffoQU6MAsNAbFP4H+9SaK83NOMZmDI14YEoX6T/nT/hTD8dIadfWxvWavtM55RIHddKoXTMJnrmvstQ2BMjX9zXMRHLyi2S3U16tRTRLXD1faxrN1kA5ADw5rY4ysxzWYo75Mfqcey85Halm20THL/l7ZWlb+OGFrLn0IUN31npwiMaGt553HHALH3kUgywt3+Vmxn+awftJpYpGh6C60vvQ== 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=waGrjmuNGIXeE5ThG6mUrYD42PwNTenpevEuZb6f5fo=; b=q7xq1jv/A/gp9b5SNFBrlPCtZHB0wlUj5T53O6hIX/RX7Hse7MlL8A5Lo2rThco3RexzLgbNtLrA8VQacRFas3K5Fri+36ZzAROcSgvT5Yj0B5AXROTEej3QDA/J3wBUM9tdpWXjV+JNEuRKjF0oKiKvNHvcSd/ksCduv+Dfw2tjOVBbAK6uKMpNj0EhBgBN20yu9HQgVKAEsSamLcOZtZ0XiLXo89ygj8AfyguDFdUu3hMKf6UrqylJpyDW7FWvBJYgNe8opPGvs5jV1azyYBXN6YYAYurL/UODp3dXyirxktup2sBxFwp6EDJR6cYP/Je89U8r34cGtVG8HCsP1w== 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=waGrjmuNGIXeE5ThG6mUrYD42PwNTenpevEuZb6f5fo=; b=L0uSTFap/YC7y356XgiGfMBXL1K7q88ZRUCujo+803IoN4c/DCneLcLH2F7Jq5cQWNPOT14Y1X1VwNgreP8xkk/HbwlQB3dYpn1Fbs159pXkvnZveZ90OuCKhsJOtsf7vmeAseaS9l6clFOOOiVW5qyY3o2XF7upYmpXW0970iU= Received: from PH7PR17CA0022.namprd17.prod.outlook.com (2603:10b6:510:324::7) by SJ1PR12MB6268.namprd12.prod.outlook.com (2603:10b6:a03:455::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.21; Wed, 25 Dec 2024 07:24:34 +0000 Received: from MWH0EPF000A672F.namprd04.prod.outlook.com (2603:10b6:510:324:cafe::40) by PH7PR17CA0022.outlook.office365.com (2603:10b6:510:324::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.13 via Frontend Transport; Wed, 25 Dec 2024 07:24: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 MWH0EPF000A672F.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8293.12 via Frontend Transport; Wed, 25 Dec 2024 07:24:33 +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; Wed, 25 Dec 2024 01:24:29 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH 5/5] soundwire: amd: clear soundwire pme wake status Date: Wed, 25 Dec 2024 12:54:00 +0530 Message-ID: <20241225072400.912445-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241225072400.912445-1-Vijendar.Mukunda@amd.com> References: <20241225072400.912445-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: MWH0EPF000A672F:EE_|SJ1PR12MB6268:EE_ X-MS-Office365-Filtering-Correlation-Id: 908fcd25-cfed-4025-4c23-08dd24b52e3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: XqVexGUYHvca/ADAQKtZSA3hxK7/MGeTP4Bru54y7gnzdFjMAfgd8FgFPVSIxFV0Gjrm6y5gPVRQncvC3oVLHAEU0zCv7S8b5LFrU/8ZiQ2aCiEpXu87GZyQQPXp8hQNzFUEJ60b6oj9LKW/266WTNA4HtHXUug4bMUvgFX3qwOP0HXbW9pG9mSBgO7ZbXlR5mDEUdTVlSWBN+1Djc6MYv5JhiV2k0n7ZJjgGkK3PVIx+7ReqyZ7jsPRpcCu5zUdCVKWzCL+Vo+ZpN/FPS70Wg94+fpcD0U8dGKpcqNuFsoy39SzEZRd+zTNwhLKcUiGUk7sFI7cURPtPojRRP4kWVwwNzACX75F0S6G/26v/OuDYWb16Y9MUZc2/VHsdrVw9/LmUkdpy6uwE0xACfbbv4vHyWomHXJlLWCQSVPYXTLsXvUVGEW6gmqXKT6aV/GQmmh/9tWQ2v5E+3+t+LtH54NGYvtxTATkKkbSSZpbeSaVB2ckpfmRQQEB+BxNMMJje+9xdi95BMI5GcXThF39M6Fpjnq//5egLqsxOvGsmpblCIaNHDjvL79z7PGOJ7oQR9CXA95qgQEFUSg4VzkSqieWVKAC0E5iep+csf/ccNVDZkWHq9uqmwGTnCB9QSJ4GpDWO0OZG9Tx1zRJKCRr2y/4+kwYDihJScBOAas7gcQk9cPwBIz1xZ3/i7bQZWIR+jYbiXjk/F+unKsWpyxBOShOLVTSbdgS7aLFeKOl6D2U9B6NqTlCVJMH6S8xD7dsTFOBZzEfFdsSAX3iSB+j3bgCQCHmyREXVHtppWsm9RXjXrmv77434vG8VUjauw/e167R6bzcWp6qo+YUkJtXm567FEDIG54JhfpDAIIj21ucxIEqspgBL6ccysSHk1xik9p/gs8x+kH25eZhT6KgFqKB5o44NOsVKE6fgojAi1sy1PE0orCJaQZZ1WiE4CgmeA+DbxD8DM3MyvCgXnETnncYs5r/wbfK3KR8p9WBg7xX4M1NBYDZIPxXNnMlIlFMg8ESKt5qIyfheDkOUj1VwYZXAlC88yHp3qaXFxMCMM7H6puBq6NliU/7f2qTWg7clHuZFYwoR8B218UWX4tkx3VlVtA6VyAIGIADshPwQSJVo8BR5JiM5P4nAH234nbI/UX7fhUYfq61DH7y1jwb/esNUXvefi1UyqX3E91y6D/qU4cJE0S7zLXeCv6gkPvkcgN2rwiGP2gX02iaDJUQwniUEKLUpoYJ0m+KMbHCKRGYQ5eh9qv9M/pBuKqupJFifag9aLgSQiUaz+taohFDfO+4pQomG4Fw/RaenLr1EbXBlSXxpVoMoxVWPyUFc0y+xs1PFV6mgN+DJocTi2fA9hoE+fEjFpLHfIzMp08TvXaO8XGcmPebdlrBaOaWGAUq2vT20JxxiFu/kPgrts4eBOAAMKidFAkyV4T5L9dkCUM8UtpbUu3JrDrMQieDEzDaeB0L6MokmGSNZ2sjJVisPw== 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)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2024 07:24:33.8168 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 908fcd25-cfed-4025-4c23-08dd24b52e3a 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: MWH0EPF000A672F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6268 Clear the SoundWire PME wake status during resume sequence for ACP7.0 & ACP7.1 platforms. Signed-off-by: Vijendar Mukunda --- drivers/soundwire/amd_manager.c | 33 ++++++++++++++++++++++++++++++++- drivers/soundwire/amd_manager.h | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 6f9d9f765a20..8b1cb07e8aac 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -1132,6 +1132,28 @@ static int amd_sdw_clock_stop_exit(struct amd_sdw_manager *amd_manager) return 0; } +static int amd_sdw_clear_pme_wake_status(struct amd_sdw_manager *amd_manager) +{ + u32 pme_stat, val; + + switch (amd_manager->instance) { + case ACP_SDW0: + pme_stat = AMD_SDW0_PME_STAT; + break; + case ACP_SDW1: + pme_stat = AMD_SDW1_PME_STAT; + break; + default: + return -EINVAL; + } + val = readl(amd_manager->acp_mmio + ACP_EXTERNAL_INTR_STAT(ACP_SDW1)); + if (val & pme_stat) + writel(pme_stat, amd_manager->acp_mmio + ACP_EXTERNAL_INTR_STAT(ACP_SDW1)); + val = readl(amd_manager->acp_mmio + ACP_EXTERNAL_INTR_STAT(ACP_SDW1)); + dev_dbg(amd_manager->dev, "ACP_EXTERNAL_INTR_STAT1 : 0x%x\n", val); + return 0; +} + static int amd_resume_child_device(struct device *dev, void *data) { struct sdw_slave *slave = dev_to_sdw_dev(dev); @@ -1257,11 +1279,20 @@ static int __maybe_unused amd_resume_runtime(struct device *dev) } if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) { + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { + ret = amd_sdw_clear_pme_wake_status(amd_manager); + if (ret) + return ret; + } return amd_sdw_clock_stop_exit(amd_manager); } 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) + if (amd_manager->acp_rev >= ACP70_PCI_REV_ID) { amd_sdw_host_wake_enable(amd_manager, false); + ret = amd_sdw_clear_pme_wake_status(amd_manager); + 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 18faef593865..4f7e236b2e34 100644 --- a/drivers/soundwire/amd_manager.h +++ b/drivers/soundwire/amd_manager.h @@ -201,6 +201,8 @@ #define AMD_SDW1_DEVICE_STATE_MASK 0xc #define AMD_SDW_DEVICE_STATE_D0 0 #define AMD_SDW_DEVICE_STATE_D3 3 +#define AMD_SDW0_PME_STAT BIT(26) +#define AMD_SDW1_PME_STAT BIT(27) static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM] = { AMD_SDW_DEFAULT_CLK_FREQ,