Commit 66c87883 authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Vinod Koul

soundwire: amd: handle SoundWire wake enable interrupt

Add wake enable interrupt support for both the SoundWire manager
instances.
Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: default avatarMastan Katragadda <Mastan.Katragadda@amd.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/lkml/20230227154801.50319-8-Vijendar.Mukunda@amd.com
Link: https://lore.kernel.org/r/20230321050901.115439-8-Vijendar.Mukunda@amd.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 81ff58ff
...@@ -831,6 +831,13 @@ static void amd_sdw_update_slave_status(u32 status_change_0to7, u32 status_chang ...@@ -831,6 +831,13 @@ 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)
{
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);
}
static void amd_sdw_irq_thread(struct work_struct *work) static void amd_sdw_irq_thread(struct work_struct *work)
{ {
struct amd_sdw_manager *amd_manager = struct amd_sdw_manager *amd_manager =
...@@ -842,6 +849,9 @@ static void amd_sdw_irq_thread(struct work_struct *work) ...@@ -842,6 +849,9 @@ static void amd_sdw_irq_thread(struct work_struct *work)
status_change_0to7 = readl(amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_0TO7); status_change_0to7 = readl(amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_0TO7);
dev_dbg(amd_manager->dev, "[SDW%d] SDW INT: 0to7=0x%x, 8to11=0x%x\n", dev_dbg(amd_manager->dev, "[SDW%d] SDW INT: 0to7=0x%x, 8to11=0x%x\n",
amd_manager->instance, status_change_0to7, status_change_8to11); amd_manager->instance, status_change_0to7, status_change_8to11);
if (status_change_8to11 & AMD_SDW_WAKE_STAT_MASK)
return amd_sdw_process_wake_event(amd_manager);
if (status_change_8to11 & AMD_SDW_PREQ_INTR_STAT) { if (status_change_8to11 & AMD_SDW_PREQ_INTR_STAT) {
amd_sdw_read_and_process_ping_status(amd_manager); amd_sdw_read_and_process_ping_status(amd_manager);
} else { } else {
......
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
#define AMD_SDW_CLK_STOP_DONE 1 #define AMD_SDW_CLK_STOP_DONE 1
#define AMD_SDW_CLK_RESUME_REQ 2 #define AMD_SDW_CLK_RESUME_REQ 2
#define AMD_SDW_CLK_RESUME_DONE 3 #define AMD_SDW_CLK_RESUME_DONE 3
#define AMD_SDW_WAKE_STAT_MASK BIT(16)
static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM] = { static u32 amd_sdw_freq_tbl[AMD_SDW_MAX_FREQ_NUM] = {
AMD_SDW_DEFAULT_CLK_FREQ, AMD_SDW_DEFAULT_CLK_FREQ,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment