Skip to content

Commit 5818ed3

Browse files
vijendarmukundavinodkoul
authored andcommitted
soundwire: amd: set ACP_PME_EN during runtime suspend sequence
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 <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20250207065841.4718-6-Vijendar.Mukunda@amd.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 829c3e1 commit 5818ed3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/soundwire/amd_manager.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev)
12111211
struct amd_sdw_manager *amd_manager = dev_get_drvdata(dev);
12121212
struct sdw_bus *bus = &amd_manager->bus;
12131213
int ret;
1214+
u32 val;
12141215

12151216
if (bus->prop.hw_disabled) {
12161217
dev_dbg(bus->dev, "SoundWire manager %d is disabled,\n",
@@ -1235,6 +1236,14 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev)
12351236
ret = amd_sdw_set_device_state(amd_manager, AMD_SDW_DEVICE_STATE_D3);
12361237
if (ret)
12371238
return ret;
1239+
if (amd_manager->wake_en_mask) {
1240+
val = readl(amd_manager->acp_mmio + ACP_PME_EN);
1241+
if (!val) {
1242+
writel(1, amd_manager->acp_mmio + ACP_PME_EN);
1243+
val = readl(amd_manager->acp_mmio + ACP_PME_EN);
1244+
dev_dbg(amd_manager->dev, "ACP_PME_EN:0x%x\n", val);
1245+
}
1246+
}
12381247
}
12391248
return 0;
12401249
}

drivers/soundwire/amd_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
#define AMD_SDW1_DEVICE_STATE_MASK GENMASK(3, 2)
200200
#define AMD_SDW_DEVICE_STATE_D0 0
201201
#define AMD_SDW_DEVICE_STATE_D3 3
202+
#define ACP_PME_EN 0x0001400
202203

203204
static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM] = {
204205
AMD_SDW_DEFAULT_CLK_FREQ,

0 commit comments

Comments
 (0)