From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <vkoul@kernel.org>
Cc: <broonie@kernel.org>, <alsa-devel@alsa-project.org>,
<yung-chuan.liao@linux.intel.com>,
<pierre-louis.bossart@linux.dev>, <Basavaraj.Hiregoudar@amd.com>,
<Sunil-kumar.Dommati@amd.com>, <venkataprasad.potturu@amd.com>,
<Syed.SabaKareem@amd.com>, <Mario.Limonciello@amd.com>,
<Richard.Gong@amd.com>, <Vijendar.Mukunda@amd.com>,
<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH V2 7/9] soundwire: amd: dispatch irq/work handlers to per-revision functions
Date: Tue, 13 Oct 2026 15:28:53 +0530 [thread overview]
Message-ID: <20261013100306.2921771-8-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20261013100306.2921771-1-Vijendar.Mukunda@amd.com>
Split the top-level interrupt and status-update work handlers into a
revision-specific implementation and a generic work_struct entry point.
amd_acp63_sdw_irq_thread() and amd_acp63_sdw_update_slave_status_work()
now hold the ACP6.3-family handler logic and take struct amd_sdw_manager *.
amd_sdw_irq_thread() and amd_sdw_update_slave_status_work() remain the
work_struct handlers registered with INIT_WORK(); each recovers the
manager via container_of() and switches on acp_rev, invoking the
corresponding amd_acp63_*() implementation for ACP6.3, ACP7.0, ACP7.1
and ACP7.2 and emitting dev_err() + return on an unexpected revision.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
drivers/soundwire/amd_manager.c | 44 ++++++++++++++++++++++++++++-----
1 file changed, 38 insertions(+), 6 deletions(-)
diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index c585f7d529c0..90bf5d4e5ba2 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -949,10 +949,8 @@ static int amd_sdw_register_dais(struct amd_sdw_manager *amd_manager)
dais, num_dais);
}
-static void amd_sdw_update_slave_status_work(struct work_struct *work)
+static void amd_acp63_sdw_update_slave_status_work(struct amd_sdw_manager *amd_manager)
{
- struct amd_sdw_manager *amd_manager =
- container_of(work, struct amd_sdw_manager, amd_sdw_work);
int retry_count = 0;
if (amd_manager->status[0] == SDW_SLAVE_ATTACHED) {
@@ -985,6 +983,24 @@ static void amd_sdw_update_slave_status_work(struct work_struct *work)
}
}
+static void amd_sdw_update_slave_status_work(struct work_struct *work)
+{
+ struct amd_sdw_manager *amd_manager =
+ container_of(work, struct amd_sdw_manager, amd_sdw_work);
+
+ switch (amd_manager->acp_rev) {
+ case ACP63_PCI_REV_ID:
+ case ACP70_PCI_REV_ID:
+ case ACP71_PCI_REV_ID:
+ case ACP72_PCI_REV_ID:
+ amd_acp63_sdw_update_slave_status_work(amd_manager);
+ break;
+ default:
+ dev_err(amd_manager->dev, "unexpected acp_rev 0x%x\n", amd_manager->acp_rev);
+ return;
+ }
+}
+
static void amd_sdw_update_slave_status(u32 status_change_0to7, u32 status_change_8to11,
struct amd_sdw_manager *amd_manager)
{
@@ -1016,10 +1032,8 @@ static void amd_acp63_sdw_process_wake_event(struct amd_sdw_manager *amd_manager
writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance));
}
-static void amd_sdw_irq_thread(struct work_struct *work)
+static void amd_acp63_sdw_irq_thread(struct amd_sdw_manager *amd_manager)
{
- struct amd_sdw_manager *amd_manager =
- container_of(work, struct amd_sdw_manager, amd_sdw_irq_thread);
u32 status_change_8to11;
u32 status_change_0to7;
@@ -1048,6 +1062,24 @@ static void amd_sdw_irq_thread(struct work_struct *work)
writel(0x00, amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_0TO7);
}
+static void amd_sdw_irq_thread(struct work_struct *work)
+{
+ struct amd_sdw_manager *amd_manager =
+ container_of(work, struct amd_sdw_manager, amd_sdw_irq_thread);
+
+ switch (amd_manager->acp_rev) {
+ case ACP63_PCI_REV_ID:
+ case ACP70_PCI_REV_ID:
+ case ACP71_PCI_REV_ID:
+ case ACP72_PCI_REV_ID:
+ amd_acp63_sdw_irq_thread(amd_manager);
+ break;
+ default:
+ dev_err(amd_manager->dev, "unexpected acp_rev 0x%x\n", amd_manager->acp_rev);
+ return;
+ }
+}
+
int amd_sdw_manager_start(struct amd_sdw_manager *amd_manager)
{
struct sdw_master_prop *prop;
--
2.48.1
next prev parent reply other threads:[~2026-10-13 10:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 9:58 [PATCH V2 0/9] soundwire: amd: introduce hw_ops dispatch and split driver into revision-specific files Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 1/9] soundwire: amd: rename AMD_SDW_MAX_MANAGER_COUNT macro Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 2/9] soundwire: amd: allocate pdevinfo and sdw_pdata by ACP revision in probe Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 3/9] soundwire: amd: allocate sdw_amd_ctx pdev array dynamically Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 4/9] soundwire: amd: rename hardware backend symbols to amd_acp63_*() prefix Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 5/9] soundwire: amd: remove unused AMD_SDW_MAX_FREQ_NUM define Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 6/9] soundwire: amd: introduce struct amd_sdw_hw_ops dispatch framework Vijendar Mukunda
2026-10-13 9:58 ` Vijendar Mukunda [this message]
2026-10-13 9:58 ` [PATCH V2 8/9] soundwire: amd: populate hw_ops and wire all call sites through acp_*() helpers Vijendar Mukunda
2026-10-13 9:58 ` [PATCH V2 9/9] soundwire: amd: extract shared functions into amd_manager_common.c Vijendar Mukunda
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=20261013100306.2921771-8-Vijendar.Mukunda@amd.com \
--to=vijendar.mukunda@amd.com \
--cc=Basavaraj.Hiregoudar@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=Richard.Gong@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Syed.SabaKareem@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=pierre-louis.bossart@linux.dev \
--cc=venkataprasad.potturu@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®