All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <vkoul@kernel.org>
Cc: <alsa-devel@alsa-project.org>,
	<pierre-louis.bossart@linux.intel.com>,
	<Basavaraj.Hiregoudar@amd.com>, <Sunil-kumar.Dommati@amd.com>,
	<Mario.Limonciello@amd.com>,
	<amadeuszx.slawinski@linux.intel.com>,
	<Mastan.Katragadda@amd.com>, <Arungopal.kondaveeti@amd.com>,
	<claudiu.beznea@microchip.com>,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Sanyog Kale <sanyog.r.kale@intel.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: [PATCH V7 7/8] soundwire: amd: handle SoundWire wake enable interrupt
Date: Fri, 10 Mar 2023 21:55:53 +0530	[thread overview]
Message-ID: <20230310162554.699766-8-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20230310162554.699766-1-Vijendar.Mukunda@amd.com>

Add wake enable interrupt support for both the SoundWire manager
instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Mastan Katragadda <Mastan.Katragadda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/lkml/20230227154801.50319-8-Vijendar.Mukunda@amd.com
---
 drivers/soundwire/amd_manager.c | 10 ++++++++++
 drivers/soundwire/amd_manager.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index 5811a408ef93..fe9f5ae84a23 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -869,6 +869,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);
+	acp_reg_writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance));
+	acp_reg_writel(0x00, amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_8TO11);
+}
+
 static void amd_sdw_irq_thread(struct work_struct *work)
 {
 	struct amd_sdw_manager *amd_manager =
@@ -880,6 +887,9 @@ static void amd_sdw_irq_thread(struct work_struct *work)
 	status_change_0to7 = acp_reg_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",
 		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) {
 		amd_sdw_read_and_process_ping_status(amd_manager);
 	} else {
diff --git a/drivers/soundwire/amd_manager.h b/drivers/soundwire/amd_manager.h
index 65bc79d8f7c9..cc1a14731fd4 100644
--- a/drivers/soundwire/amd_manager.h
+++ b/drivers/soundwire/amd_manager.h
@@ -189,6 +189,7 @@
 #define AMD_SDW_CLK_STOP_DONE				1
 #define AMD_SDW_CLK_RESUME_REQ				2
 #define AMD_SDW_CLK_RESUME_DONE				3
+#define AMD_SDW_WAKE_STAT_MASK				BIT(16)
 
 enum amd_sdw_cmd_type {
 	AMD_SDW_CMD_PING = 0,
-- 
2.34.1


  parent reply	other threads:[~2023-03-10 16:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230310162554.699766-1-Vijendar.Mukunda@amd.com>
2023-03-10 16:25 ` [PATCH V7 1/8] soundwire: export sdw_compute_slave_ports() function Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` Vijendar Mukunda
2023-03-10 16:25 ` [PATCH V7 2/8] soundwire: amd: Add support for AMD Manager driver Vijendar Mukunda
2023-03-10 16:45   ` Pierre-Louis Bossart
2023-03-10 16:25 ` Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` [PATCH V7 3/8] soundwire: amd: register SoundWire manager dai ops Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` Vijendar Mukunda
2023-03-10 16:25 ` [PATCH V7 4/8] soundwire: amd: enable build for AMD SoundWire manager driver Vijendar Mukunda
2023-03-10 16:25 ` Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` [PATCH V7 5/8] soundwire: amd: add SoundWire manager interrupt handling Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` Vijendar Mukunda
2023-03-10 16:25 ` [PATCH V7 6/8] soundwire: amd: add runtime pm ops for AMD SoundWire manager driver Vijendar Mukunda
2023-03-10 16:25 ` Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` [PATCH V7 7/8] soundwire: amd: handle SoundWire wake enable interrupt Vijendar Mukunda via Alsa-devel
2023-03-10 16:25 ` Vijendar Mukunda [this message]
2023-03-10 16:25 ` [PATCH V7 8/8] soundwire: amd: add pm_prepare callback and pm ops support Vijendar Mukunda
2023-03-10 16:46   ` Pierre-Louis Bossart
2023-03-10 16:25 ` Vijendar Mukunda via Alsa-devel
2023-03-10 16:54 ` [PATCH V7 0/8] Add SoundWire support for AMD platforms Pierre-Louis Bossart
2023-03-14  5:16   ` Mukunda,Vijendar via Alsa-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230310162554.699766-8-Vijendar.Mukunda@amd.com \
    --to=vijendar.mukunda@amd.com \
    --cc=Arungopal.kondaveeti@amd.com \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Mastan.Katragadda@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.