diff mbox series

[V2,3/7] soundwire: amd: add conditional for check for device resume

Message ID 20250120101329.3713017-4-Vijendar.Mukunda@amd.com
State New
Headers show
Series [V2,1/7] soundwire: amd: change the soundwire wake enable/disable sequence | expand

Commit Message

Vijendar Mukunda Jan. 20, 2025, 10:13 a.m. UTC
Add a conditional check to resume SoundWire manager device, when the
SoundWire manager instance is in the suspended state.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 drivers/soundwire/amd_manager.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index 60be5805715e..6831b3729db5 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -850,7 +850,10 @@  static void amd_sdw_update_slave_status(u32 status_change_0to7, u32 status_chang
 static void amd_sdw_process_wake_event(struct amd_sdw_manager *amd_manager)
 {
 	dev_dbg(amd_manager->dev, "SoundWire Wake event reported\n");
-	pm_request_resume(amd_manager->dev);
+	if (pm_runtime_suspended(amd_manager->dev)) {
+		dev_dbg(amd_manager->dev, "Device is in suspend state\n");
+		pm_request_resume(amd_manager->dev);
+	}
 	writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance));
 	writel(0x00, amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_8TO11);
 }