From patchwork Thu Dec 19 05:48:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13914500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2078.outbound.protection.outlook.com [40.107.100.78]) (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 3B38121882C; Thu, 19 Dec 2024 05:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734587513; cv=fail; b=VyN6nQ4cMLYFi9Q+bYHjc9OgWkGmZJrmoyBqYxAnQ0gRlu8X+7AXFkm2HQOOPopjatNcbtAC4uxfVz4WkeEYOgCgt81Mn7eq10A5QtIFTRTJZte/lyZMYeKc6w29gPTtvSruGNcbM1+OzghSVw6mEqNgdKAnrut3tDq+3jFqT98= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734587513; c=relaxed/simple; bh=jp0i3G4vkrmLXB2QNH1rP0c51KJsRozHriVIW2r5lus=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mRWIC885Lx4Ds6X+qpfr9775xaQLJDapSePvqU+QpOCcftxItw+7uNBjNy3+XdPHw85vNP09ZvpYmccqV2sP4GvZReQTB+Sk+feqMnTiRSshbaUfZ4GYFSncU1s1+rsX4O0FN1aDwD7xsVMorGU4ruRm7KXsgZsKyR1aPHgHWiA= 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=HEGB7JKb; arc=fail smtp.client-ip=40.107.100.78 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="HEGB7JKb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hW7c2jUkc+8MxUM9Qy7AKMDQCWUaadyvF62XxMvQf+olLCyFEkUZ1Hk5joQ/sDonxgUX6EnkwBeQ9dpk8aUMIi22J9+YA8PGC69Th+kp8yrgiH+aru07ThKKeZur4OH/iBJLRnY7ZyhbhN+KjiGREu6qchEe4Q0bC7B1YoeLFC72FY+D77g2jVsIQPfDCDA8ReWO8il8cet1ZZR0GSplD7nH1F8afaCcbMa4V7uySFItTwtPhQ+GFD5nmMMfd3LDFSnJmo7nxgGqG5RWeLYZCBPTD/u8Y9b1DOsQL1jySejy3nmz+ZsxYt4Rj5AauGP5tdRQ8UzjnzHH2nBUddHYqA== 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=TraM2FYo9IztrRMluX7qFCVgeINcrtGiWt4k6mE3Y14=; b=pB+o8O3ds/J/kekfrraaUhYZSC+MScjcZ65ewVxZj+XJYBM6jEQYu03HgVxEutFU5r5nybYTjxNV8FYubx876mdOJrb+SLsXc9xfQeogtL+CIf/jKTa2CW6JVYdLlWoOP0cnVrAWCa2OUl340swIys3L7UVs4O03gSK3vc3iwiCVNod9Zq4mtjDa9/PzmFt+SGtkU+xHDj5G/wz1GRPFi6QP2qUFydEOB1Ys9tPtLBNXhbWBk4vG/TJFURCoXxJ8sV22zrzjWPgBpNVy9dLBSvtc+B6RCF/F5Gbqv9vuh5QAnHfi76opTi6NRNY/bi9Yla0ftbv59Llo7T6I7L6/hQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (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=TraM2FYo9IztrRMluX7qFCVgeINcrtGiWt4k6mE3Y14=; b=HEGB7JKb8/xMZM6wpFB7rccNj2YQGXNB4/oraHNLNAsL2f/48FJpmV93E1hA1eOf8rutKapuGW2p5tiO3gkWxo3B0GWUU4+MOf4ze9vagCYUzqZFG5BP4O1XVg9+XVdMPhkDC0pUYa19ENl6HjC5aJ9I6QHNN7W/EIMvQcAmFog= Received: from CH5P222CA0006.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::27) by DM4PR12MB6541.namprd12.prod.outlook.com (2603:10b6:8:88::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Thu, 19 Dec 2024 05:51:47 +0000 Received: from CH1PEPF0000AD7D.namprd04.prod.outlook.com (2603:10b6:610:1ee:cafe::b2) by CH5P222CA0006.outlook.office365.com (2603:10b6:610:1ee::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.25 via Frontend Transport; Thu, 19 Dec 2024 05:51:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000AD7D.mail.protection.outlook.com (10.167.244.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8251.15 via Frontend Transport; Thu, 19 Dec 2024 05:51:46 +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, 18 Dec 2024 23:51:43 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 17/21] ASoC: amd: acp70: add soundwire host wake interrupt handling Date: Thu, 19 Dec 2024 11:18:53 +0530 Message-ID: <20241219054857.2070420-18-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241219054857.2070420-1-Vijendar.Mukunda@amd.com> References: <20241219054857.2070420-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: CH1PEPF0000AD7D:EE_|DM4PR12MB6541:EE_ X-MS-Office365-Filtering-Correlation-Id: 81897ee8-9161-421c-f5e8-08dd1ff13980 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: uNrrNtu2DYAsEU/Ru9cxzzigHZ96xIqKpVGpXTeEcn1uxoxaVMktdXScql3lb1cn+rJxTANS//1X+2X96HyqUC5+aVrNB9UpQmQKjw3Hq6HuFg+3TAtP5YymEAUv68eW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vVTzQse27RQjg1hb8u2XP01BxEZkvdtHcnJHQ7KLkHkmwePA7S2zxkiBC+3jqkswTlFKeP4jKmCXzuPhOVlZtrhKRON5Mdka4PtCuBLzXqUKAJkr4w9JN/bgByLc9iMG5ms71VIyEavodsH7x28zD5NmhYUuYVjDoRjLIc6VqxO/vx9UU1Y09OtBrilg+TbBfgvYKEwbOGY2Ywk5/EIe8KCLQfWltwg+WIQZRBz697HFL/JeBOxZ6YStww1TNy6nlm9vq4//kR/lc//sAUpd7H9Ht3lyrLYgh5KKj3efEd6RPxU2P+vG3wYSc= 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)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2024 05:51:46.8029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81897ee8-9161-421c-f5e8-08dd1ff13980 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: CH1PEPF0000AD7D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6541 When ACP is in D0 state and SoundWire manager instance is in D3 state, If SoundWire wake event is asserted, Soundwire host wake interrupt will be triggered for that SoundWire manager instance. In this case, ACP PCI driver should clear the host wake interrupt and queue up the runtime resume of the SoundWire manager instance. Add code to handle SoundWire host wake interrupt in ACP7.0 interrupt handler. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp70/acp70.h | 2 ++ sound/soc/amd/acp70/pci-acp70.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/sound/soc/amd/acp70/acp70.h b/sound/soc/amd/acp70/acp70.h index 1b5661a86352..9774db1ac537 100644 --- a/sound/soc/amd/acp70/acp70.h +++ b/sound/soc/amd/acp70/acp70.h @@ -60,6 +60,8 @@ #define ACP_SDW0_STAT BIT(21) #define ACP_SDW1_STAT BIT(2) +#define ACP_SDW0_HOST_WAKE_STAT BIT(24) +#define ACP_SDW1_HOST_WAKE_STAT BIT(25) #define ACP_SDW0_PME_STAT BIT(26) #define ACP_SDW1_PME_STAT BIT(27) #define ACP_ERROR_IRQ BIT(29) diff --git a/sound/soc/amd/acp70/pci-acp70.c b/sound/soc/amd/acp70/pci-acp70.c index 5e0f7bb68eb8..6884e8516a2c 100644 --- a/sound/soc/amd/acp70/pci-acp70.c +++ b/sound/soc/amd/acp70/pci-acp70.c @@ -169,6 +169,22 @@ static irqreturn_t acp70_irq_handler(int irq, void *dev_id) irq_flag = 1; } + if (ext_intr_stat1 & ACP_SDW0_HOST_WAKE_STAT) { + writel(ACP_SDW0_HOST_WAKE_STAT, adata->acp70_base + ACP_EXTERNAL_INTR_STAT1); + amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev); + if (amd_manager) + pm_request_resume(amd_manager->dev); + irq_flag = 1; + } + + if (ext_intr_stat1 & ACP_SDW1_HOST_WAKE_STAT) { + writel(ACP_SDW1_HOST_WAKE_STAT, adata->acp70_base + ACP_EXTERNAL_INTR_STAT1); + amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev); + if (amd_manager) + pm_request_resume(amd_manager->dev); + irq_flag = 1; + } + if (ext_intr_stat & BIT(PDM_DMA_STAT)) { ps_pdm_data = dev_get_drvdata(&adata->pdm_dev->dev); writel(BIT(PDM_DMA_STAT), adata->acp70_base + ACP_EXTERNAL_INTR_STAT);