Skip to content

ASoC: SOF: amd: SoundWire support and fixes for ACP7.B/7.F - #5931

Closed
vijendarmukunda wants to merge 0 commit into
thesofproject:topic/sof-devfrom
vijendarmukunda:topic/sof-dev
Closed

vijendarmukunda wants to merge 0 commit into
thesofproject:topic/sof-devfrom
vijendarmukunda:topic/sof-dev

Conversation

@vijendarmukunda

@vijendarmukunda vijendarmukunda commented Sep 9, 2026 •

Copy link
Copy Markdown

This series adds SoundWire support for the ACP7.B and ACP7.F platforms
and fixes three pre-existing bugs in the ACP SOF driver.

Patches 1-3 are standalone bug fixes:

Patch 1 corrects the error-return path in amd_sof_acp7x_suspend() so
that an unrecognised PCI revision returns -EINVAL instead of silently
leaving ACP_CONTROL with a stale value.

Patch 2 fixes the teardown ordering in amd_sof_acp_remove(): free_irq()
is moved before amd_sof_sdw_exit() to prevent a use-after-free when an
IRQ fires after the SoundWire context has been freed.

Patch 3 fixes the equivalent ordering in the error unwind path of
amd_sof_acp_probe() for the same reason.

Patches 4-11 add SoundWire support for ACP7.B/7.F:

ACP7.B/7.F exposes four SoundWire manager instances (SDW0-SDW3),
compared to the two managers found on ACP63/ACP70/ACP71/ACP72.

Patch 4 scans the ACPI DSDT for PDM controller endpoints and propagates
the selection to the machine driver via mach->pdata.

Patch 5 populates the SoundWire descriptor fields in acp7x_chip_info so
the SOF core can enumerate the four managers.

Patch 6 enables the SND_SOC_SOF_AMD_SOUNDWIRE_LINK_BASELINE Kconfig
dependency for SND_SOC_SOF_AMD_ACP7X.

Patch 7 wires amd_sof_sdw_probe() and amd_sof_sdw_exit() into the
ACP7.B/7.F probe and remove paths with the correct IRQ ordering.

Patch 8 extends check_acp_sdw_enable_status() to read all four SW_EN
registers on ACP7.B/7.F for clock-stop detection.

Patch 9 adds the ACP7.B/7.F SoundWire IRQ handler, dispatching
per-manager data IRQs, host-wake and PME events, and error conditions
across all four managers.

Patch 10 enables the host-wake interrupt mask in acp_init() for each
ACP7.B/7.F manager that has SW_WAKE_EN set.

Patch 11 adds SoundWire PM callbacks for ACP7.B/7.F: a clock-stop fast
path through suspend/resume that preserves SoundWire bus state, and
separate runtime PM callbacks that clear PME state on runtime resume.

Patch 12 propagates the PCI subsystem Vendor and Device IDs so they may
be used as an SSID: the subsystem IDs are stored in acp_dev_data during
probe (both amd_sof_acp_probe() and amd_sof_acp7x_probe()) and forwarded
to mach_params in the SoundWire machine-select path.

@bhiregoudar

Copy link
Copy Markdown

test please.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are correctness issues in the updated selection/PM logic (stale sdw_en_stat on unknown revisions and overwriting existing mach->pdata used by ACP quirk flags).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds SoundWire support for AMD ACP7.B/7.F (4 manager instances) and fixes teardown / PM ordering issues in the AMD SOF ACP driver, including new ACPI scanning to propagate PDM endpoint selection to the machine driver.

Changes:

  • Extend ACP7x chip descriptor and Kconfig to enable SoundWire baseline support.
  • Add ACP7x-specific SoundWire IRQ handling (4 managers), wake/PME handling, and clock-stop aware suspend/resume paths.
  • Scan ACPI DSDT for PDM endpoint selection and pass the selection to the machine driver via mach->pdata.
File summaries
File Description
sound/soc/sof/amd/pci-acp7x.c Populate ACP7x SoundWire descriptor fields (max links, ACPI addr).
sound/soc/sof/amd/Kconfig Select SoundWire link baseline dependency for ACP7x SOF.
sound/soc/sof/amd/acp7x.h Add ACP7x SoundWire error/wake register table definitions.
sound/soc/sof/amd/acp.h Add ACP7x manager count, PDM selection constants, and per-manager wake flags in acp_dev_data.
sound/soc/sof/amd/acp.c Implement ACP7x SoundWire IRQ/wake/error handling, ACPI scanning for SoundWire/PDM, and PM callback updates including clock-stop path.
sound/soc/sof/amd/acp-dsp-offset.h Define ACP7x SoundWire register offsets/bitmasks.
sound/soc/sof/amd/acp-common.c Copy selected machine entry and attach PDM selection platform data for machine driver use.
sound/soc/amd/acp/soc_amd_sdw_common.h Define amd_pdm_pdata payload passed via mach->pdata.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sound/soc/sof/amd/acp-common.c
Comment thread sound/soc/sof/amd/acp.c
@bardliao

Copy link
Copy Markdown
Collaborator

@vijendarmukunda The change is all in the sound/soc/sof/amd directory. Please go ahead to submit it to mailing list.

@vijendarmukunda

Copy link
Copy Markdown
Author

@bardliao : Thanks will post the patch series to mailing list.

Comment thread sound/soc/sof/amd/acp.c
Comment thread sound/soc/sof/amd/acp.c
Comment thread sound/soc/sof/amd/acp.c
@vijendarmukunda

Copy link
Copy Markdown
Author

@ujfalusi : Please help to review. if you don't have further review comments, then i will post this patch series as v2 version to the mailing list.

Comment thread sound/soc/sof/amd/acp7x.h
#define WAKE_IRQ_HANDLED 1
#define WAKE_IRQ_NONE 0

/* ACP7X SoundWire IO structures */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment does not add much context.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These structures are being used in ACP7X IRQ handler for SoundWire IO interrupts.

Comment thread sound/soc/sof/amd/acp.c
ACP7X_SW_WAKE_EN_MASK << 3, 3 },
};

/* ACP7X SoundWire IO interrupt and wake helpers */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this comment helps to frame the code, 'ACP7X SoundWire IO interrupt and wake helpers' from here till the end of the file? Included acp_power_on()?

@vijendarmukunda vijendarmukunda Sep 18, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are included as part of IRQ handling patch and being invoked from acp7x irq handler code.

@vijendarmukunda

vijendarmukunda commented Sep 18, 2026 •

Copy link
Copy Markdown
Author

@ujfalusi:In this patch series except top commit, rest of the 11 commits are got merged into ASoC tree for-next branch. We will send the nit pick fixes as an incremental patch along with 12th patch.

@ujfalusi

Copy link
Copy Markdown
Collaborator

@ujfalusi:In this patch series except top commit, rest of the 11 commits are got merged into ASoC tree for-next branch. We will send the nit pick fixes as an incremental patch along with 12th patch.

@vijendarmukunda, that is great, congrats! Send the update as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants