From patchwork Tue Jan 28 06:36:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13952079 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2060.outbound.protection.outlook.com [40.107.220.60]) (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 6BCDE5789D; Tue, 28 Jan 2025 06:36:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046214; cv=fail; b=QzFmyphg6xPDG+s7US6Yq3Vlf29TgCWLftT+Q2eH1AaChs7gMnZoJSq/XN1u8zhpxH/XFemwQggkUjbx0NxKgj3iQq2o0JHwPlAKmZWcL5iCtmlTmgbIWnindU5VSDGOfNq6Z4X3q/DeLQoz9/die3oKS2ZkedwFenotS0TLEvo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046214; c=relaxed/simple; bh=zM2zh0uJM8rvEjfNegpihH264PTE4XAZU4iWLdI353Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Xt8bPNp3FGFGc4i9H4mFnMVgIjk8TpkKDcF6uQVer5qqN0jGWT9O10jstk4zaXlFRN/xkUpfnm2Uy+nDaoZdwXehw1+lAHjcuBKOMs1/Is1ybrOWXuej8ydODoaDFlq29mGWQLHYPydK7Pg7P61HPOB3H5qWynxxlMspFMdz42o= 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=eMBvkSg9; arc=fail smtp.client-ip=40.107.220.60 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="eMBvkSg9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tOnCw/UdQA2NLSBpjfmAkqPqpXUrTsZbdvo1sEwhFQCrh5GFIHpyzpCMIqBr9PhYHkSQhtWIoL34zGFGT22KaiJvQV+rNWlE+VgFdH/cFtAQ8iEDrwuQGo01sSubOO245HvDz28yy8uENm3ZLMB1Hqe9F+gDq+gE/qhuOugMu6TcGRiR1I241T+vnCNJlQCv4YXA2syhP8YN5OKxDsd6NCEhmm1F2O3fQ7e2sT/KyBb4UV6AQ3nUuSdn9qkSCf4oBhm5vXK94QfVqeutNgk5Xq7Uon9113Wv942n3ukjFJtu9oNjhDvQGWUvELhn52uIPwCVfysd77PKTHpsE+sP5g== 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=mfnEFUrDA9xkW/uN41NGgIALfrnRcZF98NOLUlIwKmOyFHxpLGehXgSADjxWshGj785bk3c/cvOOnwReFsjxwL183qK6IU4uz2bn5vEHDA9eDJUyOlJRWrbX6sya95DHC6jjnufKe0kigEO9FSWWRy9JBqgE4RuEda/glXhmmBChlx6fbJ4Qbg8344ryxu2kqZs1XptfJ11nrX1+nDiBsZPGKQJXVkAdrOBSYbQjb6Ih83EuQ6HUkUTC9DEW0fSIDFWZ/CZMfqBcbJGeiVyz6JFtmcpaPeC5p5gTgTNxM7Fmkp4Uh29Fg5qtv0i0B1az+Y9Z/8FyghnPVlrSjkBKOA== 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=eMBvkSg9qsE/YcmGalQENSmt88jjQhk/6WRWxS1Cojl8pIc99egLwgNC+hiYmhYyXvDdIxulboZkmH7DpeFSGXQwMt67GBbOWYafuUDDukak1b6YWoUHU5EPn4u1i/S6PmuhlBqOh+qUkROeTtdjKRyQ9fkt9OXHEGlyMrY9sGM= Received: from MW4PR03CA0334.namprd03.prod.outlook.com (2603:10b6:303:dc::9) by DM4PR12MB8522.namprd12.prod.outlook.com (2603:10b6:8:18f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.22; Tue, 28 Jan 2025 06:36:44 +0000 Received: from SJ1PEPF00001CE2.namprd05.prod.outlook.com (2603:10b6:303:dc:cafe::b2) by MW4PR03CA0334.outlook.office365.com (2603:10b6:303:dc::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Tue, 28 Jan 2025 06:36:44 +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 SJ1PEPF00001CE2.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:36:44 +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; Tue, 28 Jan 2025 00:36:39 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V3 1/6] soundwire: amd: change the soundwire wake enable/disable sequence Date: Tue, 28 Jan 2025 12:06:19 +0530 Message-ID: <20250128063624.1922470-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128063624.1922470-1-Vijendar.Mukunda@amd.com> References: <20250128063624.1922470-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE2:EE_|DM4PR12MB8522:EE_ X-MS-Office365-Filtering-Correlation-Id: 695fc11c-bc51-404d-9848-08dd3f6621bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: PjF3cwYD5g0zFhDEAHT1tyYEiUk5y8KtGFEcCUHUDsfbc6u1iWiPhXH+2D8D3jdsKY2eMfKjzrkcTRQo+hkh7kFiR+CFl+FGSwG+l3qAsvColN1ljOx85xu/tcadH0fka1xbStj5DBcYpxs24mtneuZ//j2yUHkSQC31m23/RKaZWhMHblj2y6HFnzFGvi66UDeGvkbR/YOINg+SLElESx0vDH2w7HPjcmLqLm1tpbAwQKKeMLGHb1/4PNQk+xsbA/N8y4Wdy9d8Enyssp6fq7ItKl/2HS1w3GGeVbnWgxzW9XyFTLpADV6p9JbLP+YNCid2w/L57qrrvaj/NQqHTADOR2Trdi93HIyV5NFQ4uHvu92byl2RtxRdofaetJi0qS0Mc+TNhEBtQarhQGNikaUjEnPkWHaM/FNDuma33f+kj/CI7lW047ifEy55v42ThXlRTf7uBQFjgLbsQCSvUanwPBHqVBqKYyE2d2CUhwzDH7DAROxuEWkzcZl66GKk+vDaMstq+ZDcZjOWcXtCSis+ERGJfuxAi/q7PNuitQt6WNMkb9atloIZ0vFZCqiUIM8Q44PzK1JJUXOtcIyDZMZiZIxvHXitZy8MeGiww/vxUOqMHozovnGZYiZXM6cn7aNBxC0/TlZVVBLccMBqVAfkfHmU+7Xjm653b7c4gegkmfR5DJLUrdnlZm/lfG8jTsPsQkO/fd8vYpkhvEpVL7stI6EXKTwAqDJxfkklkXi1nztXYo5XI2pmjpVg/sVZYfN+STNME6IAI5W5V+g4+DWUCt2JyLCHlPoqLVlQk+y/Xw7ClVF7Bj0V1VaZEO6wCTmRkZbRQFfHcX6d5MIHfHUMy9MKQ7Ln9r5kkF5n14cznXnPTFweVXfiK+Vbg6kwsONLUDUEHSG2YN5MvdQ8DHjULlj7Zow1wy8Be+Rk86/UWPcunC9yDJuS2Ok5IfoAa4ivRQMlrPgsQfWT1vzfnNEG+J0VMeiusm/LQzrHDW8k4yn7AVFvAmaFg1+YYMCnB+N2krzOJcXyPS6gSDRMYCmybkPphWgHVZx8WB8FFFly9TDAZ6BB9EVG6mUGfKq0Hw1BO+Jyn7g1XNUqtjapxfCslB98B3pH7ZqlTTXqyXD0So0MxleKt9asf9kVxvS1PUUcFfp+Meb0cgeTn2YAbS0DvouKRaYl2atCjdovHJoaO+sY4Ek2jay30NhHmGCtTb0ugG6KNxZ30bG8mKqiibshn9/my+P8xDLx1n0ATW6atfPPlZuWe7aYeymiR7qADuAR0wCbOkbmWkjS8Hmkm9OefQH4h6DHCO727KW/DxPsnddpY6jIQb6gFhdZslZuj4CXz28pW2n8IkugbtzjFh9FRu/pTH7Xj8kExINzBQA3Kz+I1dD7fKp3cY3fOaJtAVV1UHq5h949jE1se3Cs6gUserktysgxNvzstF/MUxbi1VZzNGjgM1q1+APQyCfugD8/ONpnpwcYSDUOD5IV9IOgLDChs3WgtkvG1YiyyaY= 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)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 06:36:44.0204 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 695fc11c-bc51-404d-9848-08dd3f6621bd 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: SJ1PEPF00001CE2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8522 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 Tue Jan 28 06:36:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13952078 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2051.outbound.protection.outlook.com [40.107.93.51]) (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 2D09616BE17; Tue, 28 Jan 2025 06:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046213; cv=fail; b=H7zlx7lNlIurrkTgl9/tjOlIQRn/m1FdRTbCcO0Hdbr+c3Ve/gl28xF010D+pjGXF8LTYZWckc8FRM7EWTbdgaWcn2aCgsCqM1+fCd9UmWPWREDk1RW6mRgL3QnfBbgBwuKf4oHZP4zIPw4lSOOLt/Fp96/1WGQgDhDoO0eX64E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046213; c=relaxed/simple; bh=rUDS1W7GSY9x3ufKyR5TU335l/+EBtmFCipUhA7YfhE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WMf2NZsZQDK7O8lZw6m9UDmEztqMoWuTZNLfa3qWNzSkbeNtNxQ/otY1THkMM6/Td79r7WxvyQET/Cd6ATn0l9vTtS7tKAY6t+iyM9qeAz2AJbSfwBB99wv2OBtcNnt27+HTqEyyUVl+6ZFI68EPXMcL2M4JCD1O8jw3vCJL9NQ= 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=XhrwgL5A; arc=fail smtp.client-ip=40.107.93.51 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="XhrwgL5A" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eRC24hxY90h9Jj93gR9u3KEShQ1G1W3okN1uTWC9UI024yeL6ka2BhJOdiWwZKq/0qshRTbsADusp5uwDQsDb21kXDk12tB91xOe8JwhLIcs0KQs8IlD6KtMrQXKLRKHPWpvT6uGAvDfPQrZwv5kDklhbirrCotzAvo16MQbmPS69IVdTEpAVIJTc/LKPr/JGuKP3xATR/SG/EoRnFT/LlgrAJs6z49fnU1C2j3paQyVqBOeOf3OO0MwoZ6iZptmouppW1cljPdOjRBpO8O5hLAPxaEgRLss30YE8G9QZL66mOXwIOijilSoGIAJyqta3//LeV9JXXs7n0K4WXMHsg== 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=BvYJ6glw9ncuedopArmxskkCdXWeW8Z5sGL5pLZv4LJnANOLEq9/g8r5s0n3zSywnj7jQmEW4cnictvYlgOFqOAtNYDn6LG//Em+BvNB2zcwxGyP7UMh1QXOmAlNxKZ879JH/dH0q0zyPquS8korGN6VVxvWd5SwJCScqcYX8WWps13sf2c5ngErLpFegfYy813Zx2QzSKKIap9MhHj3HDJg185/1oDIadMqoV4XhP7HpcGC5SHJOvnqPtWwN05POD4ZDXMnW/ipReZ1JYwPdBEbZfG+8B6eSAMVQyJ3SRHWgbOzwwSv+CqaSZIs8lq4u5OB96/MGf3ilPgisD4+cg== 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=XhrwgL5A+Aq8sye3auwUQB1uFeuPllH8c8FM84zfWos51TNobGz/EbLKZMVZCfVzig2WIG/faCZYNrGeNh2BtC84CpGo5kFEQV7WbsKN/WRSaxPL1uoNfyQEC2GLN0SvKLDJB/n0reNC8i18amurMafZBLGgzsHkmmA9MoYKPEg= Received: from BY5PR16CA0014.namprd16.prod.outlook.com (2603:10b6:a03:1a0::27) by CY8PR12MB8241.namprd12.prod.outlook.com (2603:10b6:930:76::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.22; Tue, 28 Jan 2025 06:36:47 +0000 Received: from SJ1PEPF00001CE3.namprd05.prod.outlook.com (2603:10b6:a03:1a0:cafe::49) by BY5PR16CA0014.outlook.office365.com (2603:10b6:a03:1a0::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.20 via Frontend Transport; Tue, 28 Jan 2025 06:36: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 SJ1PEPF00001CE3.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:36: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; Tue, 28 Jan 2025 00:36:43 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V3 2/6] soundwire: amd: add debug log for soundwire wake event Date: Tue, 28 Jan 2025 12:06:20 +0530 Message-ID: <20250128063624.1922470-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128063624.1922470-1-Vijendar.Mukunda@amd.com> References: <20250128063624.1922470-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE3:EE_|CY8PR12MB8241:EE_ X-MS-Office365-Filtering-Correlation-Id: ea1e19b4-b922-4bb6-4dbe-08dd3f6623d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: PQPuDmEP/qo8Qtc46AfyZHE9EMwjL6TUxuDdIlqPn/AC+cl64hFG8zjOVxBs+tUdLJ+EBNNLxJ1Ty2+FF/HzgYsZ5btjHGsl6IZn9YSR83lYGGDMxb62ZVEJJ69WRLCi+KYWjoidDO8o5aLh5pQVXSLuY7HQ6iPpeWXdarQHalTZhotyGaMCP1PFcHGRQ67TsXXOKcrv4LWF7GGYmG1W26P8eWepEgPayx+/KTskqKu4RdCBRMqYuYpm/qK+7CJB/oVl04FBgnQSt4bFTjrj1HkmBiKD9Feu0h5VVOGNcUZExiEHY2g5IsjTodhB7/LV0kb7pLHALjDG+9fsGqVnr+p0XwTsfS14N+zFFwQQfS2xjPVCBd7UOGtAta6VV09z+t/MSYOKAkMzgfmKFifwjyzmLWp/sg+9OEQ92nbqeRLveAhVTqFgUu3H6si5DBWTAvY5LsMJqcZGoYYJlTQZgJ8fiWYOLTSzx3sKPUWT2+T3aQ7URzPs9DjbHLIez/BAIzvQ4TKYsDQunxyrpgFHd7XC+ppYmX73t3NUyeK+8vNvFY9JowtYm5meNOtKs5gudXQvJOmloUYuVBCwAOL5/Hl4VZd/pCGLupFbgb23igfqUe7jH86hHcqHm+3VTp4EKBpJoEXc1mTTs3DTbnv8qO4TRlaZa7x7Sb7XYz8DxJZhAvt7X0fYGb5ncpPwtpQexdgVi+EXkASn74+FJ3Z7lnmBf40KH6hY19Rz2xMJ7twVllD+zGDE2TkkjF9j590IZnOkxTB2BcEutdbZWMNzfy3XqWyl2nVSg0k7gy46iKKdKrjK9bSifaB4cW2aeCk25pbRNpXheAeatx2aMltMiRgQBYeKLKPUwcJuP+o2a7imqLA/86FlQjiOPT61XdQe74erLaBY0KmUQsH7IrYmFOWsGWuB9nLaLys2D5K6WDF9H6pW0wIyExKn2w9oBVXS9wR0r2vPXkQ2ScFUD/+rogtdaFN/Je0d80Wi3VuMYXXaAz7PvDgBIcnC9iBVVLjqgEa+lyJ0SHu6bHm0qq6v1W4qnMr/OH4aL5uTko8V3PICvB44vZk/6ODkCQ3wTrbr6wh8oCSQjg8LjWVMg1hNNrqb31rafjIb/W4XqOk7R4Xa5CryztGdl+XXuAjy5Zmtbm8Hy6I/TktADAK6wmydUzIDcdMsueXbzeLL4HWyHudu8zzPchE2NRdY3+u/Cb21VMlXljKQMLXnYYV6z+f5cCgqkxt0x1m6yWKUEBjaRj2j3MxQVQq41f2ox+1oPEI0EKFsWXXpsmEnDl4R9L32dGgJCMhcZI8hxNEI8POwWRxCJNGsoQjmDmIqZyinK4b7qHrR36+iZjqwlu/bW47Nd9P4+XTPNXuNsP0vFfLtHZ5WTBiG4DCmlY/j6j07ZDToJTkFxjrZLoRZHvrOASUo+1HZy1jjuPRL2xxSDVLUmlCstLdsCgYTqB0P0xyTMnHXKZJM1jAYybzznZPVZ5SLysJjkXhZIsbZwDDghMUIOI8= 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)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 06:36:47.5049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea1e19b4-b922-4bb6-4dbe-08dd3f6623d1 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: SJ1PEPF00001CE3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8241 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 Tue Jan 28 06:36:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13952080 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2055.outbound.protection.outlook.com [40.107.94.55]) (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 7E3161DE4EF; Tue, 28 Jan 2025 06:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046218; cv=fail; b=fc6wHz3KQdjr38Fez6ENk4i46iDlcUAaFkQ5NruuOmwWELs6yXTy7LP3cqZDFJTdXj3JUU0VPhEcHCkQ6is9WqqYY/wmu6pAo9usjmts6KT0LrkSgImeCd/TST3Dao6y+BQ/cL8CU35DB19ABGwHMjiMN41sNO1DQHiRG9wMHD4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046218; c=relaxed/simple; bh=rcZBN7AJvKf2uG4NttdYAadR5da15Euj4ZqZtloJJl0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aZLtvKgYJ7JP33RvACB7TLdM2e6KWjTiRVH8JRr+7MS3jOzkuoyzRpEigM87sob1XvlD1tgPcVxDF1A86oiKfoxp8RBc4nEzF+PeSjqC2klplOO5OEJh3cZs01uQRuYoDMZpoJlP08ZvCL0OhN1HE1SdEyctebM1VPbO3f6PWPM= 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=wVIosA/O; arc=fail smtp.client-ip=40.107.94.55 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="wVIosA/O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nooWtkirKUk8debiMF5R+LY+BIrNVidadT3zEvBRRpr6wktFI3VJkAtIVF/fy6vlmoaKGI1BcMDN8ydUtGcxGFJX564J/ZUdmCp7w19xroYzanoxPiwFk9i9cqNhN2lOs4+GwIJXDx1QjxTfJyKIEFbsSdO6/NmwLSMZYtC1cWTNzbz/IZWP9ICyYYdRqxbwtroeXmrLWG2D2LtaGzAMmVJVp2R7KsgI4scxBQMU7KVh65kgwfaA6eRh/K6+MdveNcScBX97EkEU3xsjfIFPX7lucSVnu5OueO3B7x0+F0xtDOuDztGIgRdKZ9vNIQIRNfw1TiaCZL7yPorjsFOuJw== 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=PopQYIPErPfHw1nK/PJvWUbHyov04i7sKdIOwr1Bha8=; b=IQTNym7BMjhdX+NruTRihjrv1PY1nvDCQ6LnrtNn8lxj5Zp4IM7Q21g70EobVdH27NwmWh2nQ60PQVfs98Wk+TqOHogev1jlSpA3UoZ9npVR6/uDqNx26w1JjZ/meZE7YgmMEg+mB4sc+//Vzc+DooCbIDqGnDMFslJyAGYjPlrrLMk0kClGWZPoDKO4c2w0mQ100NpUdqEoWsOvOR+kBktl+4SXmKT0+RQ6fsLixioxmAa+ksZufVGWBtVqSX7L95mJEvSXusc85VsAUGKq/U/jLuED5OYOOE4quhs6dtB8dX3pT5mLuikfn9M8YAaavLiTSHbn4WFHrPgizCqaxA== 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=PopQYIPErPfHw1nK/PJvWUbHyov04i7sKdIOwr1Bha8=; b=wVIosA/OiPuDJs2LSwkb2LLNJTuEHmt82kyhd9ToQqna8E/9Yq4nmag621onRB0Q+y3pQV7TCmypshWY+w4W/M1go0ypAR1PaNjgG8U/YgPpNRIx0DbiOnP2JGll7cxyUTud/AttNZS3eDm7RY//m04Cq9vEKXsqpXkWrecyHU8= Received: from SJ0PR05CA0171.namprd05.prod.outlook.com (2603:10b6:a03:339::26) by CH3PR12MB9097.namprd12.prod.outlook.com (2603:10b6:610:1a6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.23; Tue, 28 Jan 2025 06:36:51 +0000 Received: from SJ1PEPF00001CE0.namprd05.prod.outlook.com (2603:10b6:a03:339:cafe::1f) by SJ0PR05CA0171.outlook.office365.com (2603:10b6:a03:339::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:36: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 SJ1PEPF00001CE0.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:36:51 +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; Tue, 28 Jan 2025 00:36:47 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V3 3/6] soundwire: amd: add support for ACP7.0 & ACP7.1 platforms Date: Tue, 28 Jan 2025 12:06:21 +0530 Message-ID: <20250128063624.1922470-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128063624.1922470-1-Vijendar.Mukunda@amd.com> References: <20250128063624.1922470-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE0:EE_|CH3PR12MB9097:EE_ X-MS-Office365-Filtering-Correlation-Id: 90f101e5-c7f7-463f-2fe5-08dd3f662604 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: oFTja0a0l3fgWgyP9IUZKaDd74pUv1tHn6MNq9cxcUi4b7u4KbYwX+l1Gi/BdNcHc03wx6tIu8CQL1t24R8hF9OaP8gHXbsfobeE0PQuigfaQAR/PGlGKpnSy6zdD/847xoMLA1fnxfLTmH3vXQSVsm+oZik2SXJ15XmnHzFfg0HhtW3bkkQx3ZyQe8nYEIxWpuFPXqEYQUSsZ/ZccIYOv/EUg6mx4QS0HCCUs6593351zxuOFILKqBAMnmS/Ceuf7UU4FHXCicCkQiUh1KCUSzH3Hcu2KZ6rDgKT83g21Wd0SqKGvf/pDZ3JlGRCUyKcikwqUhDE10elrko/sO8XZsz+PmG+PaNAuW7jRs6zjqIiazKGDUbtuwYQkmR5JGoI3Mslfxw3ljLt7Q969LUAcw58qCMowvGT7LWl7GGi8dnoHk6KDs4OFJIvCSXxmkvi6rCn5ZisCuhlEKryhlisilOC5KHHKzToG6KnQ9zMtdN9TeKv6vSrWO8Mg7WcGMIiuuDauiDxYZNfwEwzlqqLIg8EeUMlt9uVCp5VS7KeenwER0lPIHh5+xTs2G/vpz+uM6046EdwzaGlsugGWUfH4knpCfdIIG151XhiN5+QqhB3M9GfzCqMal2jvBW4Wqc28vFTkyqkZYAK92iR4W+kCqRHVuInJkUOLyFtp8huQrOv5xbkiZnJuKAuzWWm6l+SOfZIgul0Sc31HSevttbtm5gXfinQ2X7hT26hP4fZeMGBBouEWxZY2wvyZaulgfUufCyrc8tOfP7saoNWZOyPgaurhWFjNf7kRj/njZ7M1qQaCk/tGxnbQeg90sqmh+clXuvr2N58PlSL/dgeQGaT7rbwVRejWk4MoP+pD1ciS9sZGjxruzrY047vDwPWjCsOpNuYrB/JgSPL2YAZFPCvFKPJdlHXjHGuh4bi7n0Wvvzjua/A+2HboMOIgI5dlITUTChjvqYKSoyYfj7eUXamVi14yuI9qfQ8c4yVs9GyBLS51qkTSVmGKwZCK2a19vVPApC5W8nerPHmIOCK9X51xOVlYft8nZo14lzMtcIo/DcnF7t/lqt2WEMo35/dn/UgSx0im+iKe8rhrQMRYePTZjjlpj14ukPcOBsf4wZO/MUlgkgPJZ7eHnTH4gJs8AANLlu7XxSKWFxBbORVPK8uJkx97iO3xtHCS+POGyp9DuDwEgi8b1AStzqv7MpCP/fB+wxF7RAWwBN6G7BqJcEO8gw2Z58Vh3wJ4EqphTNwHwFPXCcDv80cLZ3bpvXNGR0ImQCJuNbPKK6TnOoICtUkbxL2jlloORk4wSisVwjK7qLo8cRC416Evwik6uj9wJ5nI6r16WTtiBm1VvKK5W9e39GkB3d40TDc0lddLwUnCMMIjadlBSlN37Llr89RijOY3iHZ63LCzFft5I7js6soOPW6xyaSvU0akhHNZ8LlUQoSQDdedo1FWC802f+8v+E4R/OP/wSf9VPGrc6CM0eiXMlbBUtH0ENOPf+2OMHURA= 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)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 06:36:51.1938 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90f101e5-c7f7-463f-2fe5-08dd3f662604 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: SJ1PEPF00001CE0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9097 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 60be5805715e..216f495d238d 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; } 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 Tue Jan 28 06:36:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13952081 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2054.outbound.protection.outlook.com [40.107.92.54]) (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 964821DC98C; Tue, 28 Jan 2025 06:36:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046221; cv=fail; b=mWVtmUQQek1SOZaUeGB0lqjd+t5vuLflzeA2ptWtmBen4ixJ5YGlt/A6nm+orSQskAZ4vVys0uUwRBlTAe1dFr8COhegapiCjYRm1BaDj8VOaeGs66Vf7aydj2RfhICxI0jkAilOW6KDkzhGTy/QljTyqPSEU+2uSGDnUIwJtGc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046221; c=relaxed/simple; bh=K/ycwqafH0Hq9XLjlelD2muJIuptuEyTWZjWbo3IxP4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iIK3PyX+9vk6VGppUOG9ch/P2EHEOXh+ChNhagnn2/5jwylVhYTCEI/6gvRWUjdb+8DvE2J2HxF5HjLEApH8f3mxj5BwvOIkJqxoPC6Z2P9EeQsZUQ0G+6mlaX4XElpGijxXiS5+l9ZE5KxKvtf/apnxfZB2DK61eH+NR88u+h4= 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=HRtIF9Tf; arc=fail smtp.client-ip=40.107.92.54 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="HRtIF9Tf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X8hcImX7GDzMMKH/CIWTEqQzDBzAhwY6Ynk3L1fVNuHPW4EZooNq14Y+zLtKIBhjvg8Ts+5gie/ZFFISz6dowwpdtYxVlhPFYrUMlXFEoQM9wnbz6zHDkF2g1ln8XPQBsQECMCEHY+ZsYQEoYbxAXBghjHQk1oYXzptowmxBFSlphOw0lw84WhDNwA02j1/pN+79/J5XMe21ReRP13TFf6ynpuOUlNxBYsOm8HWE5R12YREnVWJtZvxcq041hDUZG3ekdcoO0it7gOsKxHXyBftrnb2BWWReVNj8KJ+nCF/Hvr6B7kYSv0qzFVgzQpY8B/852yvqHHUpaFQG7WGZZw== 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=vmTY1EfWyuIScVRUmZpYGys1H55wThfmAk3qY1O9pBw=; b=kT/iWe/1CnzpamT1JV9EqznXUQxxzlxyBVRj6AzdcR7jm2U8p2iGbb2NHQ8O1fFTnoDxc6Sy+pGUcXOzBLA0Nm1wNYz5fHMoMcosagWv72mrqFX+OzeXzGiHLYIqc/xUgBPrAjwrObd86GiFx+1QhdIMySm4yx9poaAuhpKcbEPT1xkvWXjsiEfSaWJZtkNMel+1aZ5UAd1BfhRhh14wbD5jY/F6Hi6s8zkDh0kNGesYaGNQK3JOiX8TWYiFw8Ue+hMubtIWSY/XlxzUaVvPgdY8ilIBN7BFYC3pjqtlH1mX7fWBXvkASPPZ9+7LZKTuYl8qFCNrYGPwlsmSS35D+Q== 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=vmTY1EfWyuIScVRUmZpYGys1H55wThfmAk3qY1O9pBw=; b=HRtIF9TfRzTQsf7AsSaylzn0PU6eOHkmboGJV7QBB/F96c4ODPPPySUeQ45NFCpIB6DTse7e0ihn3GhY+eTHEkf6sUnRF3OlDh9xeJogmU3BpK8AsyYKLfkaXJ9ySwqoKxJC4S0XQSbuD0sCn26fQ/iNm23ZJ1X5gyvr3HD1U7E= Received: from BYAPR08CA0032.namprd08.prod.outlook.com (2603:10b6:a03:100::45) by CH2PR12MB4101.namprd12.prod.outlook.com (2603:10b6:610:a8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.23; Tue, 28 Jan 2025 06:36:55 +0000 Received: from SJ1PEPF00001CDE.namprd05.prod.outlook.com (2603:10b6:a03:100:cafe::1e) by BYAPR08CA0032.outlook.office365.com (2603:10b6:a03:100::45) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Tue, 28 Jan 2025 06:36:55 +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 SJ1PEPF00001CDE.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:36: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; Tue, 28 Jan 2025 00:36:50 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V3 4/6] soundwire: amd: set device power state during suspend/resume sequence Date: Tue, 28 Jan 2025 12:06:22 +0530 Message-ID: <20250128063624.1922470-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128063624.1922470-1-Vijendar.Mukunda@amd.com> References: <20250128063624.1922470-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDE:EE_|CH2PR12MB4101:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ea1db1d-f7a2-46c9-d8d3-08dd3f66282d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: tXJ3lNLJXido26boC87UlO7E5XZvQ5hLsI52e+Yj/4r5ZCf5SLYvfEL6leEAU4hYtqyJBA7XeM46k5Op0PvyghW/vUYlKtIpotW7xspX2nmAguG+DX8eHpEoiASRXrpIQ9apevJZ9uvyZb3uTUaIdeHkw//+oQBCtp3mJlLjLVHVZULDQ/CJTcYd0RfHUTqZBxUtc/3Z9/55wlqHDNdOvYIbFUKqJHQDSZkAdR4XaoeEk53Mb0QVWquHErx3lvna7fEngdjQ+YrebIfa9l/VjwFMUzSgXRsoeshDJkwNKlQ1jzb/zlBVLPmuzJMuUOEvb1oS7fNheniRNy+PwwUSVQzcm0RUP1HGyL3jN+pzR8apHPr/MNzyTCpf5HpKnsEmn/7KDT4WGEPQunlV6fT02GZB63o0AaZqj3jnEiAuzj3BY+z0lCjw5bZquFBrBoY7IXnggiI2Jh8OuItIy7P+XjEK8hJzymH0D1dpFz2pRIA9jVkz5E/Butbh9CtQApZ8lplfTipgHw4AMN/+lMY1QH4+zdPrG4EnPonPRbB6v4nnAyWR76sdpg3RB88YEBUtOfJYsuUEVYePwAYpf2y1RYx1CCmeu7h1rB3kW456J7TqWA2+e86oPv9RBlGLw5neRij7qfn50ZN3TiTsu5E7hP7FXauA8b/tECf4gIWmvkIadRKPPoUntEx16QibQIcMhLMk90LWt8v42SXRqtv8nl5MG+8TWELEO8DteruvRF1Qg+ACSudV6gt3Cbp748wcIYKLcaMzdcKJ5XCuVYddGESFs744MYZ/Hdss+DTjUnHWIebQWr2NIcGj+3rKInfkdk0G1XQsIEdCZ7ty4C7z30UQOb7Mc8TGaZ5SonflHrLqw68yGP8vf0JTJKlOHKRFKYlwvxzCOFJFEvyXtXuF7lGaAGC0S30wJufeED15AkLt4cMeANAHYVE5WtwPTN2WsjahDkbapXzWHifJaGnjFyqgvUNDCwkP9Kq3NkhN8Sdc8riroiva7RXzre8rooo4LrOXvqPf29sne7BPhkNzvdXTvMyE7mk6wUP6Z66h+CXJ+WORniDn7ngBqBbiSsQUfOS055Gf6C/JjL56nw4/xZnH2CduydMtLdOqjHkEd4mt33WBHyyUuS/H92178ozBjxgHnk6mJHnI29nqrr4mgzEF9C1Zn6EnkC/mZydh9it+s3pKG6S6GkGSA47ko1JU+k/EzCVwuMf7lUJxiDzjAc2pzquAXIejK9+EIxIrt2UgsbmCxXXP+IeyGzKxzsFZ9EdYLublmlESglD2VlQw1n8jZ8110c8RB38BSYRBQBHoRr7FkgTmW553mavNVZt81EiaTJnIq6llP68sk2PXHcgxMiwgU/VsqoGfRl/uj0qovc/DGDD8I73ToFa71g9MZYA/+o7rZl12MqEBD3PIBAZC3THMXwIKPyfF5OBZJBbSSm4K0yILcEtgdqkkDNdrSp4H21FawVMnW69UXqfiiw== 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)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 06:36:54.8067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ea1db1d-f7a2-46c9-d8d3-08dd3f66282d 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: SJ1PEPF00001CDE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4101 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 216f495d238d..41ddb491601b 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) { @@ -1160,7 +1183,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); /* @@ -1170,7 +1195,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; } @@ -1188,13 +1220,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; } @@ -1213,7 +1254,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); @@ -1236,6 +1279,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 Tue Jan 28 06:36:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13952082 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2055.outbound.protection.outlook.com [40.107.223.55]) (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 BBA591DEFDC; Tue, 28 Jan 2025 06:37:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046223; cv=fail; b=NOftOct1zfOcT+YYa19rRLkINfJuwvPu/C+FHmuALh9WDFD8rz1xoZ+nQ/sWfGekv/K5M3D+1kCQTZOCMm1NhZj40myefJ3BQ06hw+TGQCJygyGoUM1/xVAWx0ocbTdZgxg0Ha6Glnzl1mp3Q2uiqocTYfp4BTAR4hMF2Bdvwzo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046223; c=relaxed/simple; bh=GeGRnFCLix4npnKlD7S9IX1noWe6lq85u+L7fNHaipE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UK0quvasCWAJkISimdJht+a5vrczroUx9wi5Dugl1RRJtXjPejYABy/oSq/GhN52ttDq8RAWX4jXN0hrWJYuM62Ic8AUboBFd+siZbsJynXZB3sY/1n5xcpeh4yb7R7/u1dV/C4IOtRtbY+ep7B+2ml+NJe1PdoLzSik6+TJfSM= 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=sBf8NgHp; arc=fail smtp.client-ip=40.107.223.55 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="sBf8NgHp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dyYyJ9K6bC5QEpchfLlSxpKyIjl/zJqw2hi0/sv17Z4IwDPn/Yw6SnbuOBlUpz+waJftzOQ/kC/LGiBqLbTdtddW5nb81iLQlkZ0R2zfgt4p5Q7Km7rYu1VS2CIyc0mAMknDtQDx1PkQDyVLAkb1DmpYBo9T87wsUP0gjXwA+s6zDt33aRKsPSiuO3pZC9cXij8QCXTgYOaphKJzQLt0rXnLhzjoxwKpT/RKiZGRml3Y78SabbTYEZuZhgBRGcvz0VThlD213kbErGS/6LQp+wcZSbEjEBo3oatrJ0V6sVOJMocV4BxyKv/bS4cPDZUlbOh7fHNrOAMHPlLGPDDpHw== 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=Dverl8JtniLoEHDf/sPeb47TbT+iuSMeIS47tXvWdYw=; b=LkmJiz81CALUTwIJ4JWnV9jkPL9cBh/O1Sc4OaoIuh0pjCIego1cjEuamrDRGNOPDatge2acC4SqxR1JKFcLFBhQj37usRtvlifgLpBEKR9ynwinEcqGXHvHkkoeO8ILusYJfZewaYE3aXkPW85kM5XJmQnsfhEFZ5dHFvXuNHe7y0VLLi6aIVzTAGcuelq45ryUdpyEp3aBhiJnOMl8PepB+Bcfw5SODdO+jT15nK+vhw/ZZ1t6pjK8WpSW7i0BCJincReRrSv9IGlLNczuSaseVc2rjl2cYrFe8O55mF4UumFgT6i8RiJMDe1AD58Ml9dLziXnqVMrCcOmWZ/CDA== 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=Dverl8JtniLoEHDf/sPeb47TbT+iuSMeIS47tXvWdYw=; b=sBf8NgHpWBXE1w0iQY3jPh30qjzAJUAHzThiMYO6Wlrc/1AWoAmm6nIM5T8ODhDpl+sDDJCUGreB+Ru8KJwU3KA7ty31V928cEg3ZNe3PYEte2QcWu034mUMkTYbvZ7b2M8hGg10FavoFCnX2qNJ/FltsC+qmf8Ew0O2H5R2lRc= Received: from BY3PR10CA0012.namprd10.prod.outlook.com (2603:10b6:a03:255::17) by DM4PR12MB7741.namprd12.prod.outlook.com (2603:10b6:8:103::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.23; Tue, 28 Jan 2025 06:36:58 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:255:cafe::1e) by BY3PR10CA0012.outlook.office365.com (2603:10b6:a03:255::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.22 via Frontend Transport; Tue, 28 Jan 2025 06:36: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 SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:36:58 +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; Tue, 28 Jan 2025 00:36:54 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V3 5/6] soundwire: amd: set ACP_PME_EN during runtime suspend sequence Date: Tue, 28 Jan 2025 12:06:23 +0530 Message-ID: <20250128063624.1922470-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128063624.1922470-1-Vijendar.Mukunda@amd.com> References: <20250128063624.1922470-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDF:EE_|DM4PR12MB7741:EE_ X-MS-Office365-Filtering-Correlation-Id: 9761c403-c996-42f9-ff7b-08dd3f662a5a 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: xM0W/g3InXX0ODyponnArUjMXvl5/dqTa1OgXq8cKjz1mKJswpvql6G82kJ16KimzK2C/fn3AzZ1ErLWlbazjL0hjsfGESbE14WHFVP2T1ijZBGAFChKBlCSzcXdMKIdKeDZANcqEIFDyNAQ77DGr3VapPoijjgWfCDUMzFAS4PhSV6Kw+T6opRvIvc/lCuybenm1SvGRd+Pb7uG8YvscOzaR+TwHVyWt7tTj65OBW9UI34TvyUBJiz/RWPTvyLhZwextwBcde0ussdAJl1tlHdnMpoQHngGWYsCidtRKZ+K1FLrG1FnmNMNGGxJCO8P2WA7ABKfdKlCKowWNeqa9yOsJO1g7RLGEiw5MPoFxz1ReEKXiv++Sc18X19a7Hqi2S5v4IFUKkpy+ITGqTv9kHrJbWwDWfuEKoGR5xkVQNaBnf5rZ7gNmO3A87KhGk/REFFbwCy7gKCnbooIWYgDKKwG7Qtll6fh1ullEUpHIWwYyzKG6wvV8xAuhAGFW6TXCcTZOCOoWcLE6O7EflLhBM1bryvkvwxlG8YcE+RQ+bhPrR64+EwC10FK2rTS2h18WmjG1qLznkYyZ4BvJXszy+Os8Q0rARXk4vXx5i/q891rdX1WT81wOAjKNv9aFr4K5m0h7EYxp8z3chR4BoAuIMITdzqUqezXxnW2tHD0QvkHTLTI/oZtRFSpgsekVKTz52zw7QMx5Yj7gLkj1qt2EXjjIKrWt56UtWLyQg+QjVYumydqDziPDSg107tYkSkNBxHH/u/9l8Gw2qTzDm/+gI+T188z5kLE1LF4Map1OMjEFa9J3KurS7O+TzT4RPlVDvvv2vdPM5pONaCBUJuLlXHsSuPFxfq/5RY/42vqlvq9FX63xzEdmdysaClV2fNsWb2jIg1cu9s7Q9HWVEbW+nH7t2S1H6t1tu8na4cTDvW27ZH+iEEwTw/+RiNv9grmzvmi5mG3a/8rzfiJdFxBJaMlgIxF0NDXXd/OPg0E7DZf+KLUEvbsborbme8Qdu9xITdbOjWuyXAvlmYdpYjBWs3gBCoLP+CsoZ31JgToTB/5cxaONztizg10dlWNt9rbSUL1UI+xVD7KvqaSVLZF4AvaUcCkm0cQmjHasxbfV9FE09dmPyleJYLJHxruE+8zkBr4c30jlW5waxFigsyHTl0YuULdWhHf6qiZ7YIte2gxQ4+ar3SzUPkUdqKyKCA9URdeDQEU1Ne9Z9QpkiTHZhILa1a/IZFs2NhtPnSKl8uogwnhO40gIs5ZUXgxQtB8YduKivJh7Y6OaIs/JpqgvC/Ivszv/3w+ROrDAjW52z5cfa/MWljqcH4NmRXjElwMFNDI3g5kIODWPwhycfaaeukgQGro34vi3qHT554FjLuyyosKBK+EkpsnCbK3LWPainZT/o3GVp0Lz21maWyGERJ6o45+Jcdn8f1p2il/WaqLNHoAJTpnKwRqlFD8K4TmB0qUZHxqxNBPFAL0l4xrYQ18WHKa6Ddvq9jhtP0ZM0o= 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: 28 Jan 2025 06:36:58.4736 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9761c403-c996-42f9-ff7b-08dd3f662a5a 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: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7741 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 41ddb491601b..41aa24986a1f 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -1212,6 +1212,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", @@ -1236,6 +1237,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 Tue Jan 28 06:36:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13952083 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 AF8E31DDA09; Tue, 28 Jan 2025 06:37:08 +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=1738046230; cv=fail; b=iQ0UAkxoYYfyhDcvJYoYjbCfWdndLGi6IEYjmc5Hyr/GSlPZsiqr3dYICAx78SPOHcj4PfEIEohAEkoieTye1Xc4Ggg65gWww/HSjsBrWVFFBdNtyUtkM8JnOfsvTlhDdubesq9ZO9n+tMt+hBR4gd5ZbQBWTSqtdp0bEFye6Jg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738046230; c=relaxed/simple; bh=VCpnc25refq8mAgZdYq0pPnbJA0dv+a/V3fRi3qRJkQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DnqQw1IthDQcKz53itsYjbNEJiu0hx5RkOPyEAMkFEgSAb4FivrjKtlEWIKNjzRjuPKsmjONtCVVA4rJY9jk57mBHAqW5W9xw6TykJPpkl+7Y1guUuarYAN7l/+3WG5E5lHd0kBfTx3RJfsspbK87BPufMDTM69SVhKB2wAsnH0= 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=SqA5JH3C; 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="SqA5JH3C" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pCr720kDh3ho4hlnDqgi2T+5WF/Sx+xu61SordPymnXgFT5zACRiOctR94VHYrvJSnAofrzmG3QISYzj2H4Ilc/oAklBV7ynBLjlyQYxuzMDI9lO804AqnkKCYaRT0NW90wzIwTYXCE0OZoZIucLF1nyfYloKTcm/kQ+G7EmnsUWJMJtt15T3ndH88LGRl7BhIpIrCDDoeLBbZnyi/4BWSpk77eijFQEF57z4CtfRPey9WN6SUqJEwjE0zsHHV3ljt1zanmhHYFr01qM3m2TiVgFgu5HaRTNdxLaYKPq+Rjek1md3nNNjyZGAuJXeZKc29vyvaHsMnmYfmyvK1BG3g== 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=xAglG2jnzZ0rxt83YlgsmoDuBthCfKwFfhHdegjIQl4=; b=KGF4VJ9V3VMfDodjh92Ed9+HRwXL5GsNZJniGbQ3UjYI5K18yZrgB+6lUrDB2Asjb2Kw0rm5UvGEQD0/1jOzCJbSZ5yLUM/K+tQeGzj+/eNdPosau9qO0esyhfACzkq2ZKct28bUdIlKcWeVeJnyPUmnsnF3Qvqi8BWcq94qVAWOzLHA0vbhUkHPFv8u4Rqs/rcNG9a4THZN4yFW5Etgw2yxNEmQuYCQM3HwogQlfIj85HqSM648iuxPIdlfSELjfdNVNPzy5COCIJPFN+t6/8kLTdTSQwEreb/LXc1bR/wjh2CU+AQugXK/I7h+2PhxcJA4gA7n27Ir2TVXmFeTfw== 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=xAglG2jnzZ0rxt83YlgsmoDuBthCfKwFfhHdegjIQl4=; b=SqA5JH3C5Nn2QXi4S4CwdIRDlFekI1JaGyjINAq/J32tE5fyIYtda8GsDFdoGRGiy8WcRLE0+JzteC1X5IgFvwbiPD1eDESWaRP0KMafeSSY+vChvIj+KHzzuuAZ9jT3oG1F0zIecG7U2C+pI53XFAiFzAbnPiQTlqP+jFrpavo= Received: from BY3PR10CA0020.namprd10.prod.outlook.com (2603:10b6:a03:255::25) by PH0PR12MB8773.namprd12.prod.outlook.com (2603:10b6:510:28d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.22; Tue, 28 Jan 2025 06:37:02 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:255:cafe::6b) by BY3PR10CA0020.outlook.office365.com (2603:10b6:a03:255::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8377.23 via Frontend Transport; Tue, 28 Jan 2025 06:37:02 +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 SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Tue, 28 Jan 2025 06:37:02 +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; Tue, 28 Jan 2025 00:36:57 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH V3 6/6] soundwire: amd: add soundwire host wake interrupt enable/disable sequence Date: Tue, 28 Jan 2025 12:06:24 +0530 Message-ID: <20250128063624.1922470-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128063624.1922470-1-Vijendar.Mukunda@amd.com> References: <20250128063624.1922470-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDF:EE_|PH0PR12MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: e0dcb125-7809-457d-d334-08dd3f662c75 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: m+wng5vGjRbcg7QxXriA9hSSishirQSJEzyTdQE8ZQsntH7ZkYCUm690Wa5+8O/ogC8yR/VY87wyr2a8XGxlzXug1on6SjQUrr5arPMBRIzA/yjZzjQ+NOhg6q5Uuc0kv3RfzCQdtA7MMGVllWPADONCxyJTIRC2/sPPXldhFy1TaRkuDpFFnqz7SRnZCpKa5L3g9oZpCXPqbrPvlFTHH/SQlQQPgwy8NRZ3ngGa7UXyaBoCuyvVGvlwzMdEt9z6MZD88Anm3Dc1pvMDSk0e3+zUUp6LuGCNZJWcbn0crIj46wmHeJ7sknGxQSLhadlHYprEp7jfe8z6Pzbxop8dIwHwSiCby2//nmzb9+OdKq3LoYwgPM6UIz/lAEBYKzC5YJs8Xshn4tG1aIYD6bsRrVIx3UzQjg1sey0grCd3nKnGUTsN++tYBXIkkUsh6i2QU/gL7J2WVXgLZ6EZKPbiK0TtbkUkCFiRTrJnGDEhrr9pIeg28xZWHE4qX31yAU3MsXxfPqg4l7gMPjwpE4qd7saHEoZnZDciE2yIU4QVNheGJq3r57vA4/hBwKALT3jpTrnzBouvk0Cw2FNZ3ceF8UN2G86DhBzg1nGoB/bTZp0xzr4QzyZPmnNJIBIdxGJ2rbUs72F6YEqRrurknJ94suNrvvn2NeIeuuOQaSMZh3JFItWBa6q/nFCYLgxqHHvXywLm/KZK+ooh7XzDsOWft53gMlc8k8r5f3nN4KQ04Iz0TRmXBoCd2GmoUdxURaY6WeqL5v31XdGkpDiA9KdENTBHxYjvSxkXI6qBzTRAt2Va/KwHzs0/q5Iz0Avz9R0BMFO50mJND1jRghcS51xed2wJOgK2pibraNxPnXvaOam0WlrOo04uOeYWs6/IJeZPWD72CsiiTa1HaE1jEkDSuh0Jx7alh05nlY+S0HEvZrVN9pDYgK4u8DNfSusvdog+9eT41lSvQXYDQv3uOzvUamhwIAfu5vF9oUMFWKkFRKnfD0dqgb6iD0ZhtIe94hhgKz7Zdxyb7IPxWGp79jNtA/PjZ8dt1TUNFdPRyJV5DnlsxZs/6hdMqA/vUzLCF4aKhdZWdHXHYogN04EH5HXGlSUyS034LqoV71c5xS3LOGWfGdu7YsSV7M75NyKNrgp6raQAxiAW9qxrpsNc65BKaPAUaLoTFNH63CKx6n2vJUbavDLM344FM02B3eZdHnqNw0C+HeKoBBqmQdhcI92AtdZigsqQKE2/P8MscngPA2/gqbsomdqEt5Ezb6H777Lg3IVSijH6/2tW4Eqb/EKVDFNWVdHXg57Xz5OBVlkvrttpYZ/gnt+Eia1bcMCkpV86nfIxZ7qtnL9redX5uf1GOzZxEsQYm0jxsCh4zhKiyoXsdBhLWHOKCGDIlWvANakNeiSwtFtDmcgStcROCi5UgwBzljQBCwSm87LCt92nlm4hHRoqrkuiNaJeZfhvePzwBwft9cFpxbOjHzH29eb42jfnb6TozqUlPCegtF+pXgQ= 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)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 06:37:02.0049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0dcb125-7809-457d-d334-08dd3f662c75 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: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8773 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 41aa24986a1f..2be27df0a03a 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) { @@ -1183,11 +1211,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 @@ -1221,11 +1259,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; @@ -1266,8 +1314,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)