lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241219054857.2070420-18-Vijendar.Mukunda@amd.com>
Date: Thu, 19 Dec 2024 11:18:53 +0530
From: Vijendar Mukunda <Vijendar.Mukunda@....com>
To: <broonie@...nel.org>
CC: <alsa-devel@...a-project.org>, <lgirdwood@...il.com>, <perex@...ex.cz>,
	<tiwai@...e.com>, <Basavaraj.Hiregoudar@....com>,
	<Sunil-kumar.Dommati@....com>, <venkataprasad.potturu@....com>,
	<Mario.Limonciello@....com>, <linux-sound@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, Vijendar Mukunda <Vijendar.Mukunda@....com>
Subject: [PATCH 17/21] ASoC: amd: acp70: add soundwire host wake interrupt handling

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 <Vijendar.Mukunda@....com>
---
 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);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ