Skip to contentSkip to conversation

ASoC: amd: acp: ACP7.B/7.F SoundWire machine driver support

PATCH Superseded Vijendar Mukunda 3 participants 21 messages Oct 23 – Oct 29

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Vijendar Mukunda

author maintainer
#0 lore raw

v3 cover ASoC: amd: acp: ACP7.B/7.F SoundWire machine driver support

This series adds SoundWire machine driver support for ACP7.B and ACP7.F platforms. It extends the existing AMD ACP SoundWire infrastructure with per-platform CPU pin ID lookup, PDM controller selection via ACPI and DMI quirks, DMIC DAI link and components string handling, PCI subsystem ID propagation, and ACPI machine tables for RT721/RT722/RT1320 codec configurations on both platforms.

Changes in v3:
- Patch 3: update subject and changelog to accurately describe the new PDM controller selection infrastructure being added, as pointed out by Sashiko review tool.
- Patch 5: fix commit subject prefix from "amd: acp7x:" to "amd: acp:" since the change is in the generic ACP SoundWire machine driver (acp-sdw-sof-mach.c), not the ACP7x-specific SOF driver.

Changes in v2:
- Patch 6: simplify the DMIC enable condition as suggested by Pierre:
evaluate the three-way boolean once and nest the ignore_internal_dmic check inside, avoiding the double-tested condition from v1.

Vijendar Mukunda (13):
ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver
ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support
ASoC: amd: acp: add PDM controller selection for ACP7.B/7.F SoundWire
machine driver
ASoC: amd: acp: log ASOC_SDW_ACP_DMIC1 quirk in SOF SoundWire machine
driver
ASoC: amd: acp: enable DMIC DAI link based on PDM controller selection
ASoC: amd: acp: move ignore_internal_dmic gate to DMIC enable
condition
ASoC: amd: acp: add DMIC components string for SOF SoundWire machine
driver
ASoC: amd: acp: set PCI subsystem ID for SOF SoundWire machine driver
ASoC: amd: acp: fix MODULE_AUTHOR missing closing angle bracket
ASoC: amd: acp: add ACPI machine tables for ACP7.F SoundWire
ASoC: SOF: amd: add alt_machines for ACP7.F SOF SoundWire
ASoC: amd: acp: add SoundWire machine table for ACP7.B platform
ASoC: SOF: amd: register SoundWire alt_machines for ACP7.B

 sound/soc/amd/acp/Makefile               |   2 +-
 sound/soc/amd/acp/acp-sdw-mach-common.c  |  36 +++++
 sound/soc/amd/acp/acp-sdw-sof-mach.c     | 103 ++++++++++--
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 198 +++++++++++++++++++++++
 sound/soc/amd/acp/soc_amd_sdw_common.h   |  32 ++++
 sound/soc/amd/mach-config.h              |   2 +
 sound/soc/sof/amd/pci-acp7x.c            |   2 +
 7 files changed, 361 insertions(+), 14 deletions(-)
 create mode 100644 sound/soc/amd/acp/amd-acp7x-acpi-match.c
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH v3 1/13 ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver

ACP7.B/7.F platforms expose four SoundWire managers, whereas earlier platforms use two. Add PCI revision constants and ACP7X_SDW_MAX_LINKS to soc_amd_sdw_common.h, and set max_sdw_links in mc_probe() based on PCI revision so the machine driver validates DAI links against the correct manager count.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c   | 10 +++++++++-
 sound/soc/amd/acp/soc_amd_sdw_common.h |  3 +++
 2 files changed, 12 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +9 -1
index ec3e1f5f1052c..ad8a024321dfa 100644
@@ -382,7 +382,15 @@ static int mc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	amd_ctx->acp_rev = mach->mach_params.subsystem_rev;
-	amd_ctx->max_sdw_links = ACP63_SDW_MAX_LINKS;
+	switch (amd_ctx->acp_rev) {
+	case ACP7B_PCI_REV:
+	case ACP7F_PCI_REV:
+		amd_ctx->max_sdw_links = ACP7X_SDW_MAX_LINKS;
+		break;
+	default:
+		amd_ctx->max_sdw_links = ACP63_SDW_MAX_LINKS;
+		break;
+	}
 	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
sound/soc/amd/acp/soc_amd_sdw_common.h +3 -0
index 034c9ab6e4ea6..5b9410eff56eb 100644
@@ -17,12 +17,15 @@
 
 #define ACP63_SDW_MAX_CPU_DAIS		8
 #define ACP63_SDW_MAX_LINKS		2
+#define ACP7X_SDW_MAX_LINKS		4
 
 #define AMD_SDW_MAX_GROUPS		9
 #define ACP63_PCI_REV			0x63
 #define ACP70_PCI_REV			0x70
 #define ACP71_PCI_REV			0x71
 #define ACP72_PCI_REV			0x72
+#define ACP7B_PCI_REV			0x7b
+#define ACP7F_PCI_REV			0x7f
 
 #define SOC_JACK_JDSRC(quirk)		((quirk) & GENMASK(3, 0))
 #define ASOC_SDW_FOUR_SPK		BIT(4)
Signature · 1 line
2.48.1
#2 lore raw

Re: [PATCH v3 01/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver

sound/soc/amd/acp/soc_amd_sdw_common.h line 18

Quoted 8 lines
sound/soc/amd/acp/soc_amd_sdw_common.h +0 -0
index 034c9ab6e4ea6..5b9410eff56eb 100644
@@ -17,12 +17,15 @@
 
 #define ACP63_SDW_MAX_CPU_DAIS		8

do you still need this define? I was wondering why there's no ACP7X equivalent but I can't see anyone using this ACP63 definition?

Quoted 13 lines
sound/soc/amd/acp/soc_amd_sdw_common.h +3 -0
 #define ACP63_SDW_MAX_LINKS		2
+#define ACP7X_SDW_MAX_LINKS		4
 
 #define AMD_SDW_MAX_GROUPS		9
 #define ACP63_PCI_REV			0x63
 #define ACP70_PCI_REV			0x70
 #define ACP71_PCI_REV			0x71
 #define ACP72_PCI_REV			0x72
+#define ACP7B_PCI_REV			0x7b
+#define ACP7F_PCI_REV			0x7f
 
 #define SOC_JACK_JDSRC(quirk)		((quirk) & GENMASK(3, 0))
 #define ASOC_SDW_FOUR_SPK		BIT(4)
author maintainer
#3 lore raw

Re: [PATCH v3 01/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver

Quoted 9 lines · Pierre-Louis Bossart

sound/soc/amd/acp/soc_amd_sdw_common.h line 18

Quoted 7 lines
sound/soc/amd/acp/soc_amd_sdw_common.h +0 -0
index 034c9ab6e4ea6..5b9410eff56eb 100644
@@ -17,12 +17,15 @@
 
 #define ACP63_SDW_MAX_CPU_DAIS		8

do you still need this define? I was wondering why there's no ACP7X equivalent but I can't see anyone using this ACP63 definition?

You're right. |ACP63_SDW_MAX_CPU_DAIS| is currently unused. I'll remove the definition and send a supplemental patch.

Quoted 14 lines
Quoted 14 lines
sound/soc/amd/acp/soc_amd_sdw_common.h +3 -0
 #define ACP63_SDW_MAX_LINKS		2
+#define ACP7X_SDW_MAX_LINKS		4
 
 #define AMD_SDW_MAX_GROUPS		9
 #define ACP63_PCI_REV			0x63
 #define ACP70_PCI_REV			0x70
 #define ACP71_PCI_REV			0x71
 #define ACP72_PCI_REV			0x72
+#define ACP7B_PCI_REV			0x7b
+#define ACP7F_PCI_REV			0x7f
 
 #define SOC_JACK_JDSRC(quirk)		((quirk) & GENMASK(3, 0))
 #define ASOC_SDW_FOUR_SPK		BIT(4)
author maintainer
#4 lore raw

PATCH v3 2/13 ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support

In reply to Vijendar Mukunda

Add CPU pin ID lookup and SoundWire DAI link support for ACP7.B/7.F platforms with up to 4 SoundWire managers.

---
 sound/soc/amd/acp/acp-sdw-mach-common.c | 36 +++++++++++++++++++++++++
 sound/soc/amd/acp/acp-sdw-sof-mach.c    |  7 +++++
 sound/soc/amd/acp/soc_amd_sdw_common.h  | 26 ++++++++++++++++++
 3 files changed, 69 insertions(+)
sound/soc/amd/acp/acp-sdw-mach-common.c +36 -0
index e5f394dc2f4c0..ae6d026d8e0fa 100644
@@ -93,6 +93,42 @@ int get_acp70_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct dev
 }
 EXPORT_SYMBOL_NS_GPL(get_acp70_cpu_pin_id, "SND_SOC_AMD_SDW_MACH");
 
+int get_acp7x_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev)
+{
+	switch (sdw_link_id) {
+	case AMD_SDW0:
+	case AMD_SDW1:
+	case AMD_SDW2:
+	case AMD_SDW3:
+		switch (be_id) {
+		case SOC_SDW_JACK_OUT_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO0_TX;
+			break;
+		case SOC_SDW_JACK_IN_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO0_RX;
+			break;
+		case SOC_SDW_AMP_OUT_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO4_TX;
+			break;
+		case SOC_SDW_AMP_IN_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO4_RX;
+			break;
+		case SOC_SDW_DMIC_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO5_RX;
+			break;
+		default:
+			dev_err(dev, "Invalid be id:%d\n", be_id);
+			return -EINVAL;
+		}
+		break;
+	default:
+		return -EINVAL;
+	}
+	dev_dbg(dev, "sdw_link_id:%d, be_id:%d, cpu_pin_id:%d\n", sdw_link_id, be_id, *cpu_pin_id);
+	return 0;
+}
+EXPORT_SYMBOL_NS_GPL(get_acp7x_cpu_pin_id, "SND_SOC_AMD_SDW_MACH");
+
 MODULE_DESCRIPTION("AMD SoundWire Common Machine driver");
 MODULE_AUTHOR("Vijendar Mukunda <[email protected]>");
 MODULE_LICENSE("GPL");
sound/soc/amd/acp/acp-sdw-sof-mach.c +7 -0
index ad8a024321dfa..6855141293e34 100644
@@ -145,6 +145,13 @@ static int create_sdw_dailink(struct snd_soc_card *card,
 			if (ret)
 				return ret;
 			break;
+		case ACP7B_PCI_REV:
+		case ACP7F_PCI_REV:
+			ret = get_acp7x_cpu_pin_id(ffs(sof_end->link_mask) - 1,
+						   *be_id, &cpu_pin_id, dev);
+			if (ret)
+				return ret;
+			break;
 		default:
 			return -EINVAL;
 		}
sound/soc/amd/acp/soc_amd_sdw_common.h +26 -0
index 5b9410eff56eb..9e4c86bed3003 100644
@@ -34,6 +34,8 @@
 
 #define AMD_SDW0	0
 #define AMD_SDW1	1
+#define AMD_SDW2	2
+#define AMD_SDW3	3
 #define ACP63_SW0_AUDIO0_TX	0
 #define ACP63_SW0_AUDIO1_TX	1
 #define ACP63_SW0_AUDIO2_TX	2
@@ -55,6 +57,29 @@
 #define ACP70_SW_AUDIO1_RX	4
 #define ACP70_SW_AUDIO2_RX	5
 
+/* ACP7.B/7.F SoundWire CPU pin IDs */
+#define ACP7X_SW_AUDIO0_TX	0
+#define ACP7X_SW_AUDIO1_TX	1
+#define ACP7X_SW_AUDIO2_TX	2
+#define ACP7X_SW_AUDIO3_TX	3
+#define ACP7X_SW_AUDIO4_TX	4
+#define ACP7X_SW_AUDIO5_TX	5
+#define ACP7X_SW_AUDIO6_TX	6
+#define ACP7X_SW_AUDIO7_TX	7
+#define ACP7X_SW_AUDIO8_TX	8
+#define ACP7X_SW_AUDIO9_TX	9
+#define ACP7X_SW_AUDIO10_TX	10
+
+#define ACP7X_SW_AUDIO0_RX	11
+#define ACP7X_SW_AUDIO1_RX	12
+#define ACP7X_SW_AUDIO2_RX	13
+#define ACP7X_SW_AUDIO3_RX	14
+#define ACP7X_SW_AUDIO4_RX	15
+#define ACP7X_SW_AUDIO5_RX	16
+#define ACP7X_SW_AUDIO6_RX	17
+#define ACP7X_SW_AUDIO7_RX	18
+#define ACP7X_SW_AUDIO8_RX	19
+
 struct amd_mc_ctx {
 	unsigned int acp_rev;
 	unsigned int max_sdw_links;
@@ -62,5 +87,6 @@ struct amd_mc_ctx {
 
 int get_acp63_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev);
 int get_acp70_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev);
+int get_acp7x_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev);
 
 #endif
Signature · 1 line
2.48.1
#5 lore raw

Re: [PATCH v3 02/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support

It'd be useful to comment/explain why this routine only relies on a subset of IDS...

Quoted 24 lines
sound/soc/amd/acp/acp-sdw-mach-common.c +24 -0
+int get_acp7x_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev)
+{
+	switch (sdw_link_id) {
+	case AMD_SDW0:
+	case AMD_SDW1:
+	case AMD_SDW2:
+	case AMD_SDW3:
+		switch (be_id) {
+		case SOC_SDW_JACK_OUT_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO0_TX;
+			break;
+		case SOC_SDW_JACK_IN_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO0_RX;
+			break;
+		case SOC_SDW_AMP_OUT_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO4_TX;
+			break;
+		case SOC_SDW_AMP_IN_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO4_RX;
+			break;
+		case SOC_SDW_DMIC_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO5_RX;
+			break;
+		default:

sound/soc/amd/acp/acp-sdw-mach-common.c int get_acp70_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct dev · line 129

Quoted 10 lines
sound/soc/amd/acp/acp-sdw-mach-common.c +10 -0
+			dev_err(dev, "Invalid be id:%d\n", be_id);
+			return -EINVAL;
+		}
+		break;
+	default:
+		return -EINVAL;
+	}
+	dev_dbg(dev, "sdw_link_id:%d, be_id:%d, cpu_pin_id:%d\n", sdw_link_id, be_id, *cpu_pin_id);
+	return 0;
+}

... defined here - I marked the NOT USED ones.

Quoted 12 lines
(quoted diff) +12 -0
+/* ACP7.B/7.F SoundWire CPU pin IDs */
+#define ACP7X_SW_AUDIO0_TX	0
+#define ACP7X_SW_AUDIO1_TX	1 << NOT USED
+#define ACP7X_SW_AUDIO2_TX	2 << NOT USED
+#define ACP7X_SW_AUDIO3_TX	3 << NOT USED
+#define ACP7X_SW_AUDIO4_TX	4 
+#define ACP7X_SW_AUDIO5_TX	5 << NOT USED
+#define ACP7X_SW_AUDIO6_TX	6 << NOT USED
+#define ACP7X_SW_AUDIO7_TX	7 << NOT USED
+#define ACP7X_SW_AUDIO8_TX	8 << NOT USED
+#define ACP7X_SW_AUDIO9_TX	9 << NOT USED
+#define ACP7X_SW_AUDIO10_TX	10 << NOT USED

Review

Quoted 10 lines
(quoted diff) +10 -0
+
+#define ACP7X_SW_AUDIO0_RX	11
+#define ACP7X_SW_AUDIO1_RX	12 << NOT USED
+#define ACP7X_SW_AUDIO2_RX	13 << NOT USED
+#define ACP7X_SW_AUDIO3_RX	14 << NOT USED
+#define ACP7X_SW_AUDIO4_RX	15
+#define ACP7X_SW_AUDIO5_RX	16
+#define ACP7X_SW_AUDIO6_RX	17 << NOT USED
+#define ACP7X_SW_AUDIO7_RX	18 << NOT USED
+#define ACP7X_SW_AUDIO8_RX	19 << NOT USED

The IDs are different from what was used for ACP70

author maintainer
#6 lore raw

Re: [PATCH v3 02/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support

Quoted 2 lines · Pierre-Louis Bossart

It'd be useful to comment/explain why this routine only relies on a subset of IDS...

On ACP7x, each SoundWire data port has a dedicated DMA channel mapped in hardware. This function selects only the ports required by the currently supported ACP7x machine topologies:

  AUDIO0_TX (0)  - headset/jack playback AUDIO4_TX (4)  - amplifier/speaker playback AUDIO0_RX (11) - headset/jack capture AUDIO4_RX (15) - amplifier/speaker capture (feedback) AUDIO5_RX (16) - DMIC capture

The remaining port IDs are defined for completeness to represent the hardware data port layout, but are not used by the currently supported machine topologies.

The ID numbering differs from ACP70 due to the hardware differences between ACP70 and ACP7x. ACP7x uses a flat ID space, with TX ports numbered 0-10 and RX ports numbered 11-21.

Will add comments above the define block and the function to clarify this in the next version.

Quoted 28 lines
Quoted 28 lines
sound/soc/amd/acp/acp-sdw-mach-common.c +27 -0
+int get_acp7x_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev)
+{
+	switch (sdw_link_id) {
+	case AMD_SDW0:
+	case AMD_SDW1:
+	case AMD_SDW2:
+	case AMD_SDW3:
+		switch (be_id) {
+		case SOC_SDW_JACK_OUT_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO0_TX;
+			break;
+		case SOC_SDW_JACK_IN_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO0_RX;
+			break;
+		case SOC_SDW_AMP_OUT_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO4_TX;
+			break;
+		case SOC_SDW_AMP_IN_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO4_RX;
+			break;
+		case SOC_SDW_DMIC_DAI_ID:
+			*cpu_pin_id = ACP7X_SW_AUDIO5_RX;
+			break;
+		default:
+			dev_err(dev, "Invalid be id:%d\n", be_id);
+			return -EINVAL;
+		}
Quoted 8 lines

sound/soc/amd/acp/acp-sdw-mach-common.c int get_acp70_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct dev · line 129

Quoted 7 lines
sound/soc/amd/acp/acp-sdw-mach-common.c +7 -0
+		break;
+	default:
+		return -EINVAL;
+	}
+	dev_dbg(dev, "sdw_link_id:%d, be_id:%d, cpu_pin_id:%d\n", sdw_link_id, be_id, *cpu_pin_id);
+	return 0;
+}

... defined here - I marked the NOT USED ones.

Please refer above comment explanation.

Quoted 16 lines
Quoted 16 lines
(quoted diff) +15 -0
+/* ACP7.B/7.F SoundWire CPU pin IDs */
+#define ACP7X_SW_AUDIO0_TX	0
+#define ACP7X_SW_AUDIO1_TX	1 << NOT USED
+#define ACP7X_SW_AUDIO2_TX	2 << NOT USED
+#define ACP7X_SW_AUDIO3_TX	3 << NOT USED
+#define ACP7X_SW_AUDIO4_TX	4 
+#define ACP7X_SW_AUDIO5_TX	5 << NOT USED
+#define ACP7X_SW_AUDIO6_TX	6 << NOT USED
+#define ACP7X_SW_AUDIO7_TX	7 << NOT USED
+#define ACP7X_SW_AUDIO8_TX	8 << NOT USED
+#define ACP7X_SW_AUDIO9_TX	9 << NOT USED
+#define ACP7X_SW_AUDIO10_TX	10 << NOT USED
+
+#define ACP7X_SW_AUDIO0_RX	11
+#define ACP7X_SW_AUDIO1_RX	12 << NOT USED
Quoted 8 lines

Review

Quoted 7 lines
(quoted diff) +7 -0
+#define ACP7X_SW_AUDIO2_RX	13 << NOT USED
+#define ACP7X_SW_AUDIO3_RX	14 << NOT USED
+#define ACP7X_SW_AUDIO4_RX	15
+#define ACP7X_SW_AUDIO5_RX	16
+#define ACP7X_SW_AUDIO6_RX	17 << NOT USED
+#define ACP7X_SW_AUDIO7_RX	18 << NOT USED
+#define ACP7X_SW_AUDIO8_RX	19 << NOT USED

The IDs are different from what was used for ACP70

ACP7x hardware exposes 11 TX and 11 RX data ports, mapped to 8 TX and 8 RX DMA channels. The CPU pin IDs use linear numbering, with TX ports numbered 0-10 and RX ports numbered 11-21.

The ID mapping differs from ACP70 due to the hardware differences between ACP70 and ACP7x. All port IDs are defined here to represent the ACP7x hardware data port layout.

#7 lore raw

Re: [PATCH v3 02/13] ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support

Quoted 17 lines · Mukunda,Vijendar
Quoted 2 lines · Pierre-Louis Bossart

It'd be useful to comment/explain why this routine only relies on a subset of IDS...

On ACP7x, each SoundWire data port has a dedicated DMA channel mapped in hardware. This function selects only the ports required by the currently supported ACP7x machine topologies:

  AUDIO0_TX (0)  - headset/jack playback AUDIO4_TX (4)  - amplifier/speaker playback AUDIO0_RX (11) - headset/jack capture AUDIO4_RX (15) - amplifier/speaker capture (feedback) AUDIO5_RX (16) - DMIC capture

The remaining port IDs are defined for completeness to represent the hardware data port layout, but are not used by the currently supported machine topologies.

Quoted 6 lines

The ID numbering differs from ACP70 due to the hardware differences between ACP70 and ACP7x. ACP7x uses a flat ID space, with TX ports numbered 0-10 and RX ports numbered 11-21.

Will add comments above the define block and the function to clarify this in the next version.

sounds good, thank you.

author maintainer
#8 lore raw

PATCH v3 3/13 ASoC: amd: acp: add PDM controller selection for ACP7.B/7.F SoundWire machine driver

In reply to Vijendar Mukunda

Add ASOC_SDW_ACP_DMIC1 quirk bit (BIT(6)) and pdm_sel field to amd_mc_ctx to support per-controller DMIC DAI selection on ACP7.B/7.F platforms.

In mc_probe(), read the active PDM controller from mach->pdata (populated via ACPI acp-audio-ep-port _DSD). When ACPI does not set pdm_sel, derive it from the quirk bits after dmi_check_system() and quirk_override are applied: ASOC_SDW_ACP_DMIC1 selects DMIC1; ASOC_SDW_ACP_DMIC selects DMIC0. Since only one PDM controller is active at a time, DMIC1 is checked first.

In create_dmic_dailinks(), select the SOF CPU DAI name based on
pdm_sel: "acp-sof-dmic1" for ACP7X_PDM_DMIC1, "acp-sof-dmic0" otherwise on ACP7.B/7.F; all other platforms use "acp-sof-dmic".

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c   | 44 +++++++++++++++++++++++++-
 sound/soc/amd/acp/soc_amd_sdw_common.h |  3 ++
 2 files changed, 46 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +43 -1
index 6855141293e34..afc5ac679ce37 100644
@@ -265,11 +265,31 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
 				struct snd_soc_dai_link **dai_links, int *be_id, int no_pcm)
 {
 	struct device *dev = card->dev;
+	struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);
+	struct amd_mc_ctx *amd_ctx = (struct amd_mc_ctx *)ctx->private;
+	const char *cpu_dai_name;
 	int ret;
 
+	/*
+	 * For ACP7.B/7.F platforms the PDM controller is selected from ACPI
+	 * acp-audio-ep-port and stored in amd_ctx->pdm_sel. Use the
+	 * matching SOF DAI name ("acp-sof-dmic0" or "acp-sof-dmic1").
+	 * All other platforms use the generic "acp-sof-dmic" DAI.
+	 */
+	switch (amd_ctx->acp_rev) {
+	case ACP7B_PCI_REV:
+	case ACP7F_PCI_REV:
+		cpu_dai_name = (amd_ctx->pdm_sel == ACP7X_PDM_DMIC1) ?
+				"acp-sof-dmic1" : "acp-sof-dmic0";
+		break;
+	default:
+		cpu_dai_name = "acp-sof-dmic";
+		break;
+	}
+
 	ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "acp-dmic-codec",
 					    0, 1, // DMIC only supports capture
-					    "acp-sof-dmic", platform_component->name,
+					    cpu_dai_name, platform_component->name,
 					    "dmic-codec", "dmic-hifi", no_pcm,
 					    asoc_sdw_dmic_init, NULL);
 	if (ret)
@@ -378,6 +398,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
 static int mc_probe(struct platform_device *pdev)
 {
 	struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
+	struct amd_pdm_pdata *pdm_pdata;
 	struct snd_soc_card *card;
 	struct amd_mc_ctx *amd_ctx;
 	struct asoc_sdw_mc_private *ctx;
@@ -398,6 +419,10 @@ static int mc_probe(struct platform_device *pdev)
 		amd_ctx->max_sdw_links = ACP63_SDW_MAX_LINKS;
 		break;
 	}
+	if (mach->pdata) {
+		pdm_pdata = mach->pdata;
+		amd_ctx->pdm_sel = pdm_pdata->pdm_sel;
+	}
 	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;
@@ -419,6 +444,23 @@ static int mc_probe(struct platform_device *pdev)
 		sof_sdw_quirk = quirk_override;
 	}
 
+	/*
+	 * If ACPI did not set pdm_sel (no acp-audio-ep-port in _DSD), derive
+	 * it from the quirk bits. ACPI takes priority: quirks are only
+	 * consulted when pdm_sel is still zero. PDM controller selection is
+	 * only meaningful on ACP7B/7F platforms.
+	 * ASOC_SDW_ACP_DMIC selects DMIC0 (default); ASOC_SDW_ACP_DMIC1
+	 * overrides to DMIC1.
+	 */
+	if (!amd_ctx->pdm_sel &&
+	    (amd_ctx->acp_rev == ACP7B_PCI_REV ||
+	     amd_ctx->acp_rev == ACP7F_PCI_REV)) {
+		if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC1)
+			amd_ctx->pdm_sel = ACP7X_PDM_DMIC1;
+		else if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC)
+			amd_ctx->pdm_sel = ACP7X_PDM_DMIC0;
+	}
+
 	log_quirks(&pdev->dev);
 
 	ctx->mc_quirk = sof_sdw_quirk;
sound/soc/amd/acp/soc_amd_sdw_common.h +3 -0
index 9e4c86bed3003..86c8e38a19bb1 100644
@@ -30,6 +30,7 @@
 #define SOC_JACK_JDSRC(quirk)		((quirk) & GENMASK(3, 0))
 #define ASOC_SDW_FOUR_SPK		BIT(4)
 #define ASOC_SDW_ACP_DMIC		BIT(5)
+#define ASOC_SDW_ACP_DMIC1		BIT(6)	/* select DMIC1 controller for ACP7.B/7.F */
 #define ASOC_SDW_CODEC_SPKR		BIT(15)
 
 #define AMD_SDW0	0
@@ -83,6 +84,8 @@
 struct amd_mc_ctx {
 	unsigned int acp_rev;
 	unsigned int max_sdw_links;
+	/* PDM controller selection, copied from amd_pdm_pdata at probe time */
+	unsigned int pdm_sel;
 };
 
 int get_acp63_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev);
Signature · 1 line
2.48.1
author maintainer
#9 lore raw

PATCH v3 4/13 ASoC: amd: acp: log ASOC_SDW_ACP_DMIC1 quirk in SOF SoundWire machine driver

In reply to Vijendar Mukunda

Add ASOC_SDW_ACP_DMIC1 to log_quirks() so the active PDM controller selection is visible in boot-time diagnostics alongside the other ACP quirk bits.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/amd/acp/acp-sdw-sof-mach.c +2 -0
index afc5ac679ce37..40df873ec024e 100644
@@ -28,6 +28,8 @@ static void log_quirks(struct device *dev)
 			SOC_JACK_JDSRC(sof_sdw_quirk));
 	if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC)
 		dev_dbg(dev, "quirk SOC_SDW_ACP_DMIC enabled\n");
+	if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC1)
+		dev_dbg(dev, "quirk ASOC_SDW_ACP_DMIC1 enabled\n");
 }
 
 static int sof_sdw_quirk_cb(const struct dmi_system_id *id)
Signature · 1 line
2.48.1
author maintainer
#10 lore raw

PATCH v3 5/13 ASoC: amd: acp: enable DMIC DAI link based on PDM controller selection

In reply to Vijendar Mukunda

Extend the DMIC DAI link enable condition in sof_card_dai_links_create() to also check amd_ctx->pdm_sel. On ACP7.B/7.F platforms the PDM controller is selected via ACPI rather than a DMI quirk, so ASOC_SDW_ACP_DMIC may not be set. Enabling the DMIC link when amd_ctx->pdm_sel is non-zero ensures the link is created whenever a valid PDM controller has been identified from ACPI _DSD.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +3 -1
index 40df873ec024e..6848b966c6eb4 100644
@@ -308,6 +308,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
 	struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev);
 	int sdw_be_num = 0, dmic_num = 0;
 	struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);
+	struct amd_mc_ctx *amd_ctx = (struct amd_mc_ctx *)ctx->private;
 	struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params;
 	struct snd_soc_aux_dev *sof_aux;
 	struct snd_soc_codec_conf *codec_conf;
@@ -350,7 +351,8 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
 	sdw_be_num = ret;
 
 	/* enable dmic */
-	if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach_params->dmic_num)
+	if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach_params->dmic_num ||
+	    amd_ctx->pdm_sel)
 		dmic_num = 1;
 
 	dev_dbg(dev, "sdw %d, dmic %d", sdw_be_num, dmic_num);
Signature · 1 line
2.48.1
author maintainer
#11 lore raw

PATCH v3 6/13 ASoC: amd: acp: move ignore_internal_dmic gate to DMIC enable condition

In reply to Vijendar Mukunda

Move the ignore_internal_dmic check from inside the dmic_num > 0 block to the DMIC enable condition itself. This eliminates the dead if/else inside the dmic_num > 0 block - when dmic_num is set, create_dmic_dailinks() is always called. Demote the suppression message from dev_warn to dev_dbg since ignoring the ACP DMIC in favour of a SoundWire DMIC codec is expected behaviour, not a warning condition.

No functional change for platforms without a SoundWire DMIC codec.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +9 -9
index 6848b966c6eb4..5c201d0b3bef9 100644
@@ -352,8 +352,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
 
 	/* enable dmic */
 	if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach_params->dmic_num ||
-	    amd_ctx->pdm_sel)
-		dmic_num = 1;
+	    amd_ctx->pdm_sel) {
+		if (ctx->ignore_internal_dmic)
+			dev_dbg(dev, "ACP DMIC suppressed by SoundWire DMIC\n");
+		else
+			dmic_num = 1;
+	}
 
 	dev_dbg(dev, "sdw %d, dmic %d", sdw_be_num, dmic_num);
 
@@ -384,13 +388,9 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
 
 	/* dmic */
 	if (dmic_num > 0) {
-		if (ctx->ignore_internal_dmic) {
-			dev_warn(dev, "Ignoring ACP DMIC\n");
-		} else {
-			ret = create_dmic_dailinks(card, &dai_links, &be_id, 1);
-			if (ret)
-				return ret;
-		}
+		ret = create_dmic_dailinks(card, &dai_links, &be_id, 1);
+		if (ret)
+			return ret;
 	}
 
 	WARN_ON(codec_conf != card->codec_conf + card->num_configs);
Signature · 1 line
2.48.1
author maintainer
#12 lore raw

PATCH v3 7/13 ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver

In reply to Vijendar Mukunda

Append "mic:acp-dmic cfg-mics:N" to card->components in mc_probe() when a DMIC DAI link will be registered, keeping the components string consistent with what sof_card_dai_links_create() actually creates.

Gate on the same three-way condition used in sof_card_dai_links_create() (ASOC_SDW_ACP_DMIC quirk, mach_params->dmic_num, or amd_ctx->pdm_sel) and suppress when ctx->ignore_internal_dmic is set. Use mach_params->dmic_num for the mic count when platform-reported; fall back to 1 for quirk and pdm_sel paths.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +12 -1
index 5c201d0b3bef9..4c171e52410a6 100644
@@ -406,7 +406,7 @@ static int mc_probe(struct platform_device *pdev)
 	struct snd_soc_card *card;
 	struct amd_mc_ctx *amd_ctx;
 	struct asoc_sdw_mc_private *ctx;
-	int amp_num = 0, i;
+	int amp_num = 0, i, dmic_num;
 	int ret;
 
 	amd_ctx = devm_kzalloc(&pdev->dev, sizeof(*amd_ctx), GFP_KERNEL);
@@ -489,6 +489,17 @@ static int mc_probe(struct platform_device *pdev)
 	if (!card->components)
 		return -ENOMEM;
 
+	if ((sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach->mach_params.dmic_num ||
+	     amd_ctx->pdm_sel) && !ctx->ignore_internal_dmic) {
+		dmic_num = mach->mach_params.dmic_num ? mach->mach_params.dmic_num : 1;
+		card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+						  "%s mic:acp-dmic cfg-mics:%d",
+						  card->components,
+						  dmic_num);
+		if (!card->components)
+			return -ENOMEM;
+	}
+
 	/* Register the card */
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret) {
Signature · 1 line
2.48.1
#13 lore raw

Re: [PATCH v3 07/13] ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] ASoC: amd: acp: missing asoc_sdw_mc_dailink_exit_loop() in mc_probe() --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ASoC: amd: acp: missing asoc_sdw_mc_dailink_exit_loop() in mc_probe() --

commit 418fccdf2ffaf02e2c03c094859e73443fbe31c7
Author: Vijendar Mukunda <[email protected]>

ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver

This commit appends the DMIC component and mic count string to card->components in mc_probe() when a DMIC DAI link is created by sof_card_dai_links_create().

Quoted 4 lines
sound/soc/amd/acp/acp-sdw-sof-mach.c +0 -0
index 5c201d0b3bef9..4c171e52410a6 100644

[ ... ]

Quoted 4 lines
sound/soc/amd/acp/acp-sdw-sof-mach.c +0 -0
@@ -489,6 +489,17 @@ static int mc_probe(struct platform_device *pdev)
 	if (!card->components)
 		return -ENOMEM;
 

sound/soc/amd/acp/acp-sdw-sof-mach.c static int mc_probe(struct platform_device *pdev) · line 501

Quoted 10 lines
sound/soc/amd/acp/acp-sdw-sof-mach.c +10 -0
+	if ((sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach->mach_params.dmic_num ||
+	     amd_ctx->pdm_sel) && !ctx->ignore_internal_dmic) {
+		dmic_num = mach->mach_params.dmic_num ? mach->mach_params.dmic_num : 1;
+		card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+						  "%s mic:acp-dmic cfg-mics:%d",
+						  card->components,
+						  dmic_num);
+		if (!card->components)
+			return -ENOMEM;
+	}

[Severity: Medium]
If devm_kasprintf() fails here (as well as in the preceding allocation for cfg-amp), does returning -ENOMEM directly leak the SoundWire codec device references and software nodes initialized during sof_card_dai_links_create()?

Earlier in sound/soc/amd/acp/acp-sdw-sof-mach.c:mc_probe(), sof_card_dai_links_create() invokes the endpoint .init callbacks via create_sdw_dailinks() -> create_sdw_dailink(), such as sound/soc/sdw_utils/soc_sdw_rt711.c:asoc_sdw_rt711_init():

	sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, dai_links->codecs[0].name);
	if (!sdw_dev)
		return -EPROBE_DEFER;

	ret = rt711_add_codec_device_props(sdw_dev, ctx->mc_quirk);
	if (ret < 0) {
		put_device(sdw_dev);
		return ret;
	}
	ctx->headset_codec_dev = sdw_dev;

When devm_snd_soc_register_card() fails right below in mc_probe(), it cleans these up with asoc_sdw_mc_dailink_exit_loop(card):

	ret = devm_snd_soc_register_card(&pdev->dev, card);
	if (ret) {
		dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed %d\n", ret);
		asoc_sdw_mc_dailink_exit_loop(card);
		return ret;
	}

Should the devm_kasprintf() failure path also call asoc_sdw_mc_dailink_exit_loop(card) before returning -ENOMEM?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
author maintainer
#14 lore raw

Re: [PATCH v3 07/13] ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver

Quoted 66 lines · On 10/23/26 12:40, [email protected] wrote:

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ASoC: amd: acp: missing asoc_sdw_mc_dailink_exit_loop() in mc_probe() --

commit 418fccdf2ffaf02e2c03c094859e73443fbe31c7
Author: Vijendar Mukunda <[email protected]>

ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver

This commit appends the DMIC component and mic count string to card->components in mc_probe() when a DMIC DAI link is created by sof_card_dai_links_create().

Quoted 4 lines
sound/soc/amd/acp/acp-sdw-sof-mach.c +0 -0
index 5c201d0b3bef9..4c171e52410a6 100644

[ ... ]

Quoted 4 lines
sound/soc/amd/acp/acp-sdw-sof-mach.c +0 -0
@@ -489,6 +489,17 @@ static int mc_probe(struct platform_device *pdev)
       if (!card->components)
               return -ENOMEM;
 

sound/soc/amd/acp/acp-sdw-sof-mach.c static int mc_probe(struct platform_device *pdev) · line 501

Quoted 10 lines
sound/soc/amd/acp/acp-sdw-sof-mach.c +10 -0
+     if ((sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach->mach_params.dmic_num ||
+          amd_ctx->pdm_sel) && !ctx->ignore_internal_dmic) {
+             dmic_num = mach->mach_params.dmic_num ? mach->mach_params.dmic_num : 1;
+             card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+                                               "%s mic:acp-dmic cfg-mics:%d",
+                                               card->components,
+                                               dmic_num);
+             if (!card->components)
+                     return -ENOMEM;
+     }

[Severity: Medium]
If devm_kasprintf() fails here (as well as in the preceding allocation for cfg-amp), does returning -ENOMEM directly leak the SoundWire codec device references and software nodes initialized during sof_card_dai_links_create()?

Earlier in sound/soc/amd/acp/acp-sdw-sof-mach.c:mc_probe(), sof_card_dai_links_create() invokes the endpoint .init callbacks via create_sdw_dailinks() -> create_sdw_dailink(), such as sound/soc/sdw_utils/soc_sdw_rt711.c:asoc_sdw_rt711_init():

         sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, dai_links->codecs[0].name);
         if (!sdw_dev)
                 return -EPROBE_DEFER;

         ret = rt711_add_codec_device_props(sdw_dev, ctx->mc_quirk);
         if (ret < 0) {
                 put_device(sdw_dev);
                 return ret;
         }
         ctx->headset_codec_dev = sdw_dev;

When devm_snd_soc_register_card() fails right below in mc_probe(), it cleans these up with asoc_sdw_mc_dailink_exit_loop(card):

         ret = devm_snd_soc_register_card(&pdev->dev, card);
         if (ret) {
                 dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed %d\n", ret);
                 asoc_sdw_mc_dailink_exit_loop(card);
                 return ret;
         }
Quoted 2 lines

Should the devm_kasprintf() failure path also call asoc_sdw_mc_dailink_exit_loop(card) before returning -ENOMEM?

Thanks for catching this.  On a devm_kasprintf() failure, the -ENOMEM path skips asoc_sdw_mc_dailink_exit_loop(card), leaving device references acquired during sof_card_dai_links_create() unreleased. This is a pre-existing issue, as the cfg-amp path immediately above has the same missing cleanup. This change follows the existing pattern in the file. We will address both the cfg-amp and DMIC error paths together in an incremental patch.

Quoted 3 lines

--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7

author maintainer
#15 lore raw

PATCH v3 8/13 ASoC: amd: acp: set PCI subsystem ID for SOF SoundWire machine driver

In reply to Vijendar Mukunda

Call snd_soc_card_set_pci_ssid() when subsystem_id_set is indicated in the machine params, propagating the PCI subsystem vendor and device IDs to the ALSA card for correct device identification on ACP SoundWire platforms.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 5 +++++
 1 file changed, 5 insertions(+)
sound/soc/amd/acp/acp-sdw-sof-mach.c +5 -0
index 4c171e52410a6..1013f60b2818a 100644
@@ -440,6 +440,11 @@ static int mc_probe(struct platform_device *pdev)
 
 	snd_soc_card_set_drvdata(card, ctx);
 
+	if (mach->mach_params.subsystem_id_set)
+		snd_soc_card_set_pci_ssid(card,
+					  mach->mach_params.subsystem_vendor,
+					  mach->mach_params.subsystem_device);
+
 	dmi_check_system(sof_sdw_quirk_table);
 
 	if (quirk_override != -1) {
Signature · 1 line
2.48.1
author maintainer
#16 lore raw

PATCH v3 9/13 ASoC: amd: acp: fix MODULE_AUTHOR missing closing angle bracket

In reply to Vijendar Mukunda

The MODULE_AUTHOR macro call was missing the closing '>' for the email address angle bracket notation.

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +1 -1
index 1013f60b2818a..01e640f0ada72 100644
@@ -544,7 +544,7 @@ static struct platform_driver sof_sdw_driver = {
 module_platform_driver(sof_sdw_driver);
 
 MODULE_DESCRIPTION("ASoC AMD SoundWire Generic Machine driver");
-MODULE_AUTHOR("Vijendar Mukunda <[email protected]");
+MODULE_AUTHOR("Vijendar Mukunda <[email protected]>");
 MODULE_LICENSE("GPL");
 MODULE_IMPORT_NS("SND_SOC_SDW_UTILS");
 MODULE_IMPORT_NS("SND_SOC_AMD_SDW_MACH");
Signature · 1 line
2.48.1
author maintainer
#17 lore raw

PATCH v3 10/13 ASoC: amd: acp: add ACPI machine tables for ACP7.F SoundWire

In reply to Vijendar Mukunda

Add amd-acp7x-acpi-match.c with four snd_soc_acpi_mach entries for ACP7.F SoundWire configurations:
- RT721 + RT1320 on SoundWire links L0+L3
(jack+dmic on RT721, spk on RT1320)
- RT721 + RT1320 on SoundWire links L0+L1
(jack+dmic on RT721, spk on RT1320)
- Standalone RT721 on L0 (jack, amp and dmic endpoints)
- Standalone RT722 on L0 (jack, amp and dmic endpoints)

RT721+RT1320 combo configurations use jack_dmic_endpoints for RT721, skipping the internal amp since RT1320 provides amplification on a dedicated SoundWire link.

ACP7.B machine table will be added in a follow-up patch.

---
 sound/soc/amd/acp/Makefile               |   2 +-
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 186 +++++++++++++++++++++++
 sound/soc/amd/mach-config.h              |   1 +
 3 files changed, 188 insertions(+), 1 deletion(-)
 create mode 100644 sound/soc/amd/acp/amd-acp7x-acpi-match.c
sound/soc/amd/acp/Makefile +1 -1
index ab5f9dc871a67..42e2bd34da060 100644
@@ -23,7 +23,7 @@ snd-acp70-y := acp70.o
 snd-acp-mach-y     := acp-mach-common.o
 snd-acp-legacy-mach-y     := acp-legacy-mach.o acp3x-es83xx/acp3x-es83xx.o
 snd-acp-sof-mach-y     := acp-sof-mach.o
-snd-soc-acpi-amd-match-y := amd-acp63-acpi-match.o amd-acp70-acpi-match.o
+snd-soc-acpi-amd-match-y := amd-acp63-acpi-match.o amd-acp70-acpi-match.o amd-acp7x-acpi-match.o
 snd-soc-acpi-amd-match-$(CONFIG_SND_SOC_ACPI_AMD_SDCA_QUIRKS) += soc-acpi-amd-sdca-quirks.o
 snd-acp-sdw-mach-y     := acp-sdw-mach-common.o
 snd-acp-sdw-sof-mach-y += acp-sdw-sof-mach.o
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +186 -0

186 lines not on this page · raw message

sound/soc/amd/mach-config.h +1 -0
index 02ce044bcbf72..321af4682fd30 100644
@@ -30,6 +30,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sdw_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sof_sdw_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7b_sof_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7f_sof_machines[];
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7f_sof_sdw_machines[];
 
 struct config_entry {
 	u32 flags;
Signature · 1 line
2.48.1
author maintainer
#18 lore raw

PATCH v3 11/13 ASoC: SOF: amd: add alt_machines for ACP7.F SOF SoundWire

In reply to Vijendar Mukunda

Register snd_soc_acpi_amd_acp7f_sof_sdw_machines as alt_machines in the ACP7.F SOF device descriptor so that the SOF core selects the SoundWire machine driver when ADR devices are detected on ACP7.F platforms.

---
 sound/soc/sof/amd/pci-acp7x.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/sof/amd/pci-acp7x.c +1 -0
index 5a21ab8ebb4b9..2999dc6d72a63 100644
@@ -89,6 +89,7 @@ static const struct sof_amd_acp_desc acp7f_chip_info = {
 
 static const struct sof_dev_desc acp7f_desc = {
 	.machines		= snd_soc_acpi_amd_acp7f_sof_machines,
+	.alt_machines		= snd_soc_acpi_amd_acp7f_sof_sdw_machines,
 	.resindex_lpe_base	= 0,
 	.resindex_pcicfg_base	= -1,
 	.resindex_imr_base	= -1,
Signature · 1 line
2.48.1
author maintainer
#19 lore raw

PATCH v3 12/13 ASoC: amd: acp: add SoundWire machine table for ACP7.B platform

In reply to Vijendar Mukunda

Add snd_soc_acpi_amd_acp7b_sof_sdw_machines with one entry for the RT721 (L0: jack + DMIC) + RT1320 (L3: speaker) SoundWire configuration on ACP7.B. Export the table for use by the SOF descriptor.

---
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 12 ++++++++++++
 sound/soc/amd/mach-config.h              |  1 +
 2 files changed, 13 insertions(+)
sound/soc/amd/acp/amd-acp7x-acpi-match.c +12 -0
index 2f5e060ec79b4..830c59966a356 100644
@@ -148,6 +148,18 @@ static const struct snd_soc_acpi_link_adr acp7x_rt721_l0_rt1320_l3[] = {
 	{}
 };
 
+struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7b_sof_sdw_machines[] = {
+	{
+		.link_mask = BIT(0) | BIT(3),
+		.links = acp7x_rt721_l0_rt1320_l3,
+		.drv_name = "amd_sof_sdw",
+		.sof_tplg_filename = "sof-acp7b-rt721-l0-rt1320-l3.tplg",
+		.fw_filename = "sof-acp7b.ri",
+	},
+	{},
+};
+EXPORT_SYMBOL(snd_soc_acpi_amd_acp7b_sof_sdw_machines);
+
 struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7f_sof_sdw_machines[] = {
 	{
 		.link_mask = BIT(0) | BIT(3),
sound/soc/amd/mach-config.h +1 -0
index 321af4682fd30..09ea9f5259557 100644
@@ -29,6 +29,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sof_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sdw_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sof_sdw_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7b_sof_machines[];
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7b_sof_sdw_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7f_sof_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp7f_sof_sdw_machines[];
 
Signature · 1 line
2.48.1
author maintainer
#20 lore raw

PATCH v3 13/13 ASoC: SOF: amd: register SoundWire alt_machines for ACP7.B

In reply to Vijendar Mukunda

Register snd_soc_acpi_amd_acp7b_sof_sdw_machines as alt_machines in the ACP7.B SOF device descriptor so that the SOF core selects the SoundWire machine driver when ADR devices are detected on ACP7.B platforms.

---
 sound/soc/sof/amd/pci-acp7x.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/sof/amd/pci-acp7x.c +1 -0
index 2999dc6d72a63..6aa16d1a12b95 100644
@@ -47,6 +47,7 @@ static const struct sof_amd_acp_desc acp7b_chip_info = {
 
 static const struct sof_dev_desc acp7b_desc = {
 	.machines		= snd_soc_acpi_amd_acp7b_sof_machines,
+	.alt_machines		= snd_soc_acpi_amd_acp7b_sof_sdw_machines,
 	.resindex_lpe_base	= 0,
 	.resindex_pcicfg_base	= -1,
 	.resindex_imr_base	= -1,
Signature · 1 line
2.48.1