Skip to contentSkip to conversation

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

PATCH In review Vijendar Mukunda 3 participants 30 messages Oct 30 – Nov 6

Subsystems (4)
lore
Share & tools
lore

Vijendar Mukunda

author maintainer
#0 lore raw

v4 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 v4:
- Patch 1: fix missing asoc_sdw_mc_dailink_exit_loop() cleanup on devm_kasprintf() failure in acp-sdw-sof-mach.c mc_probe() (new).
- Patch 2: fix missing asoc_sdw_mc_dailink_exit_loop() cleanup on both devm_kasprintf() failure paths in acp-sdw-legacy-mach.c mc_probe(); update commit message to reference the correct function name soc_card_dai_links_create() instead of sof_card_dai_links_create() (new).
- Patch 3: remove unused ACP63_SDW_MAX_CPU_DAIS define (new).
- Patch 5 (was 2): add comments above ACP7X_SW_AUDIO* define block and get_acp7x_cpu_pin_id() to document the dedicated per-port DMA layout and the port-to-use-case mapping.
- Patch 9 (was 6): replace misleading "No functional change" claim with an accurate description of the behavioural change for platforms where ignore_internal_dmic is true (dmic_num now stays zero at the gate rather than reaching the dmic_num > 0 block).

Changes in v3:
- Patch 3: update subject and changelog to accurately describe the new PDM controller selection infrastructure being added.
- 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 (16):
ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in

    mc_probe()

ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in
legacy SDW machine driver
ASoC: amd: sdw: remove unused ACP63_SDW_MAX_CPU_DAIS define
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-legacy-mach.c  |   8 +-
 sound/soc/amd/acp/acp-sdw-mach-common.c  |  48 ++++++
 sound/soc/amd/acp/acp-sdw-sof-mach.c     | 109 +++++++++++--
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 198 +++++++++++++++++++++++
 sound/soc/amd/acp/soc_amd_sdw_common.h   |  45 +++++-
 sound/soc/amd/mach-config.h              |   2 +
 sound/soc/sof/amd/pci-acp7x.c            |   2 +
 8 files changed, 396 insertions(+), 18 deletions(-)
 create mode 100644 sound/soc/amd/acp/amd-acp7x-acpi-match.c
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH v4 1/16 ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in mc_probe()

On devm_kasprintf() failure for the cfg-amp components string, mc_probe() returned -ENOMEM directly without calling asoc_sdw_mc_dailink_exit_loop(), leaving device references acquired during sof_card_dai_links_create() unreleased.

Call asoc_sdw_mc_dailink_exit_loop() before returning -ENOMEM to release those references, consistent with the cleanup already done in the devm_snd_soc_register_card() failure path.

Fixes cb8ea62e6402 ("ASoC: amd/sdw_utils: add sof based soundwire generic machine driver")
---
 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 ec3e1f5f1052..979048e42424 100644
@@ -425,8 +425,10 @@ static int mc_probe(struct platform_device *pdev)
 
 	card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
 					  " cfg-amp:%d", amp_num);
-	if (!card->components)
+	if (!card->components) {
+		asoc_sdw_mc_dailink_exit_loop(card);
 		return -ENOMEM;
+	}
 
 	/* Register the card */
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH v4 2/16 ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in legacy SDW machine driver

In reply to Vijendar Mukunda

On devm_kasprintf() failure for the cfg-amp and DMIC components strings in mc_probe(), the legacy SoundWire machine driver returned -ENOMEM directly without calling asoc_sdw_mc_dailink_exit_loop(), leaving device references acquired during soc_card_dai_links_create() unreleased.

Call asoc_sdw_mc_dailink_exit_loop() before returning -ENOMEM on both failure paths, consistent with the cleanup already done in the devm_snd_soc_register_card() failure path.

Fixes 2981d9b0789c ("ASoC: amd: acp: add soundwire machine driver for legacy stack")
---
 sound/soc/amd/acp/acp-sdw-legacy-mach.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/amd/acp/acp-sdw-legacy-mach.c +6 -2
index a8b62817b234..bd03789c7849 100644
@@ -590,15 +590,19 @@ static int mc_probe(struct platform_device *pdev)
 
 	card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
 					  " cfg-amp:%d", amp_num);
-	if (!card->components)
+	if (!card->components) {
+		asoc_sdw_mc_dailink_exit_loop(card);
 		return -ENOMEM;
+	}
 	if (soc_sdw_quirk & ASOC_SDW_ACP_DMIC) {
 		card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
 						  "%s mic:acp-dmic cfg-mics:%d",
 						  card->components,
 						  1);
-		if (!card->components)
+		if (!card->components) {
+			asoc_sdw_mc_dailink_exit_loop(card);
 			return -ENOMEM;
+		}
 	}
 
 	/* Register the card */
Signature · 1 line
2.53.0
author maintainer
#3 lore raw

PATCH v4 3/16 ASoC: amd: sdw: remove unused ACP63_SDW_MAX_CPU_DAIS define

In reply to Vijendar Mukunda

ACP63_SDW_MAX_CPU_DAIS is defined but never referenced anywhere in the tree. Remove it.

---
 sound/soc/amd/acp/soc_amd_sdw_common.h | 1 -
 1 file changed, 1 deletion(-)
sound/soc/amd/acp/soc_amd_sdw_common.h +0 -1
index 034c9ab6e4ea..0ae85165573d 100644
@@ -15,7 +15,6 @@
 #include <sound/soc_sdw_utils.h>
 #include "acp-mach-common.h"
 
-#define ACP63_SDW_MAX_CPU_DAIS		8
 #define ACP63_SDW_MAX_LINKS		2
 
 #define AMD_SDW_MAX_GROUPS		9
Signature · 1 line
2.53.0
author maintainer
#4 lore raw

PATCH v4 4/16 ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver

In reply to Vijendar Mukunda

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 979048e42424..46c3815a777f 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 0ae85165573d..c98d70a0d6ce 100644
@@ -16,12 +16,15 @@
 #include "acp-mach-common.h"
 
 #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.53.0
author maintainer
#5 lore raw

PATCH v4 5/16 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 | 48 +++++++++++++++++++++++++
 sound/soc/amd/acp/acp-sdw-sof-mach.c    |  7 ++++
 sound/soc/amd/acp/soc_amd_sdw_common.h  | 38 ++++++++++++++++++++
 3 files changed, 93 insertions(+)
sound/soc/amd/acp/acp-sdw-mach-common.c +48 -0
index e5f394dc2f4c..40184674dc80 100644
@@ -93,6 +93,54 @@ 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");
 
+/*
+ * On ACP7x, each SoundWire data port has a dedicated DMA channel
+ * hardwired 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 to reflect the full hardware
+ * data port layout.
+ */
+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 46c3815a777f..97b2e224492f 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 +38 -0
index c98d70a0d6ce..c979adf4e978 100644
@@ -33,6 +33,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
@@ -54,6 +56,41 @@
 #define ACP70_SW_AUDIO1_RX	4
 #define ACP70_SW_AUDIO2_RX	5
 
+/*
+ * ACP7.B/7.F SoundWire CPU pin IDs.
+ *
+ * ACP7x hardware exposes 11 TX and 11 RX data ports per SoundWire
+ * instance, each with a dedicated DMA channel hardwired in hardware.
+ * The CPU pin IDs use a flat linear numbering shared across all four
+ * SoundWire links (SW0-SW3): TX ports are numbered 0-10 and RX ports
+ * are numbered 11-21. All port IDs are defined here to represent the
+ * ACP7x hardware data port layout. The ID numbering differs from
+ * ACP70 due to hardware differences between ACP70 and ACP7x.
+ */
+#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
+#define ACP7X_SW_AUDIO9_RX	20
+#define ACP7X_SW_AUDIO10_RX	21
+
 struct amd_mc_ctx {
 	unsigned int acp_rev;
 	unsigned int max_sdw_links;
@@ -61,5 +98,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.53.0
author maintainer
#6 lore raw

PATCH v4 6/16 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 97b2e224492f..34a71f7a8c54 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 c979adf4e978..07837a2cfa54 100644
@@ -29,6 +29,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
@@ -94,6 +95,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.53.0
#7 lore raw

Re: [PATCH v4 06/16] ASoC: amd: acp: add PDM controller selection for ACP7.B/7.F SoundWire machine driver

Quoted 10 lines · 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.

nit-pick: it'd be useful to explain the mapping between PDM controllers and PDM microphones. Is this one controller:2mics?

Also does anything prevent DMIC and DMIC1 from being active simultaneously?

Quoted 112 lines

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 97b2e224492f..34a71f7a8c54 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 c979adf4e978..07837a2cfa54 100644
@@ -29,6 +29,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
@@ -94,6 +95,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);
author maintainer
#8 lore raw

Re: [PATCH v4 06/16] ASoC: amd: acp: add PDM controller selection for ACP7.B/7.F SoundWire machine driver

Quoted 11 lines · Pierre-Louis Bossart
Quoted 10 lines · 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.

Quoted 5 lines

nit-pick: it'd be useful to explain the mapping between PDM controllers and PDM microphones. Is this one controller:2mics?

Also does anything prevent DMIC and DMIC1 from being active simultaneously?

Yes, each PDM controller supports two microphones, i.e. a 2-channel DMIC configuration. PDM0 and PDM1 are alternative controllers, with the OEM/platform configuration determining which controller is used. Only one PDM controller is selected for a given platform, so DMIC and DMIC1 are not expected to be active simultaneously.

Will add a comment in the code to clarify this and post a supplemental patch.

Quoted 112 lines
Quoted 112 lines

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 97b2e224492f..34a71f7a8c54 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 c979adf4e978..07837a2cfa54 100644
@@ -29,6 +29,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
@@ -94,6 +95,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);
author maintainer
#9 lore raw

PATCH v4 7/16 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 34a71f7a8c54..18603e552dee 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.53.0
author maintainer
#10 lore raw

PATCH v4 8/16 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 18603e552dee..9024e789d746 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.53.0
author maintainer
#11 lore raw

PATCH v4 9/16 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.

For platforms where ignore_internal_dmic is true, the behaviour changes from emitting a dev_warn inside the dmic_num > 0 block to silent suppression at the gate where dmic_num stays zero. This is
intentional: ignoring the ACP DMIC in favour of a SoundWire DMIC codec is expected behaviour, not a warning condition.

---
 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 9024e789d746..3366f668d819 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.53.0
author maintainer
#12 lore raw

PATCH v4 10/16 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.

Call asoc_sdw_mc_dailink_exit_loop() before returning -ENOMEM on devm_kasprintf() failure to release device references acquired during sof_card_dai_links_create().

---
 sound/soc/amd/acp/acp-sdw-sof-mach.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-sdw-sof-mach.c +14 -1
index 3366f668d819..664b9e960cf7 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);
@@ -491,6 +491,19 @@ static int mc_probe(struct platform_device *pdev)
 		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) {
+			asoc_sdw_mc_dailink_exit_loop(card);
+			return -ENOMEM;
+		}
+	}
+
 	/* Register the card */
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret) {
Signature · 1 line
2.53.0
author maintainer
#13 lore raw

PATCH v4 11/16 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 664b9e960cf7..11cd0feaa16c 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.53.0
author maintainer
#14 lore raw

PATCH v4 12/16 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 11cd0feaa16c..1d7487c87265 100644
@@ -548,7 +548,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.53.0
author maintainer
#15 lore raw

PATCH v4 13/16 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 ab5f9dc871a6..42e2bd34da06 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 02ce044bcbf7..321af4682fd3 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.53.0
#16 lore raw

Re: [PATCH v4 13/16] ASoC: amd: acp: add ACPI machine tables for ACP7.F SoundWire

Quoted 12 lines · 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.

[...]

Quoted 7 lines
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +7 -0
+static const struct snd_soc_acpi_adr_device rt721_l0_single_adr[] = {
+	{
+		.adr = 0x000030025d072101ull,
+		.num_endpoints = ARRAY_SIZE(jack_dmic_endpoints),
+		.endpoints = jack_dmic_endpoints,
+		.name_prefix = "rt721"
+	}

sound/soc/amd/acp/amd-acp7x-acpi-match.c line 76

Quoted 10 lines
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +10 -0
+};
+
+static const struct snd_soc_acpi_adr_device rt721_l0_only[] = {
+	{
+		.adr = 0x000030025d072101ull,
+		.num_endpoints = ARRAY_SIZE(jack_amp_dmic_endpoints),
+		.endpoints = jack_amp_dmic_endpoints,
+		.name_prefix = "rt721"
+	}
+};

nit-pick: The naming conventions aren't self-explanatory and don't match the explanations above. The difference between l0_single_adr and l0_only are related to the endpoints used, and they don't match what's used for rt722 below.

[...]> +static const struct snd_soc_acpi_adr_device rt722_l0_single_adr[] = {

Quoted 7 lines
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +7 -0
+	{
+		.adr = 0x000030025d072201ull,
+		.num_endpoints = ARRAY_SIZE(jack_amp_dmic_endpoints),
+		.endpoints = jack_amp_dmic_endpoints,
+		.name_prefix = "rt722"
+	}
+};
author maintainer
#17 lore raw

Re: [PATCH v4 13/16] ASoC: amd: acp: add ACPI machine tables for ACP7.F SoundWire

Quoted 28 lines · Pierre-Louis Bossart
Quoted 12 lines · 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.

[...]

Quoted 13 lines
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +13 -0
+static const struct snd_soc_acpi_adr_device rt721_l0_single_adr[] = {
+	{
+		.adr = 0x000030025d072101ull,
+		.num_endpoints = ARRAY_SIZE(jack_dmic_endpoints),
+		.endpoints = jack_dmic_endpoints,
+		.name_prefix = "rt721"
+	}
+};
+
+static const struct snd_soc_acpi_adr_device rt721_l0_only[] = {
+	{
+		.adr = 0x000030025d072101ull,
+		.num_endpoints = ARRAY_SIZE(jack_amp_dmic_endpoints),
Quoted 8 lines

sound/soc/amd/acp/amd-acp7x-acpi-match.c line 76

Quoted 4 lines
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +4 -0
+		.endpoints = jack_amp_dmic_endpoints,
+		.name_prefix = "rt721"
+	}
+};

nit-pick: The naming conventions aren't self-explanatory and don't match the explanations above. The difference between l0_single_adr and l0_only are related to the endpoints used, and they don't match what's used for rt722 below.

Agreed. The naming is inconsistent. Will fix the naming to make the usage clearer and post a supplemental patch.

Quoted 10 lines

[...]> +static const struct snd_soc_acpi_adr_device rt722_l0_single_adr[] = {

Quoted 7 lines
sound/soc/amd/acp/amd-acp7x-acpi-match.c new file +7 -0
+	{
+		.adr = 0x000030025d072201ull,
+		.num_endpoints = ARRAY_SIZE(jack_amp_dmic_endpoints),
+		.endpoints = jack_amp_dmic_endpoints,
+		.name_prefix = "rt722"
+	}
+};
author maintainer
#18 lore raw

PATCH v4 14/16 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 5a21ab8ebb4b..2999dc6d72a6 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.53.0
author maintainer
#19 lore raw

PATCH v4 15/16 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 2f5e060ec79b..830c59966a35 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 321af4682fd3..09ea9f525955 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.53.0
author maintainer
#20 lore raw

PATCH v4 16/16 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 2999dc6d72a6..6aa16d1a12b9 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.53.0
reviewer Reviewed-by on the v4 series
#21 lore raw
In reply to Vijendar Mukunda
Quoted 60 lines · Vijendar Mukunda

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 v4:
- Patch 1: fix missing asoc_sdw_mc_dailink_exit_loop() cleanup on devm_kasprintf() failure in acp-sdw-sof-mach.c mc_probe() (new).
- Patch 2: fix missing asoc_sdw_mc_dailink_exit_loop() cleanup on both devm_kasprintf() failure paths in acp-sdw-legacy-mach.c mc_probe(); update commit message to reference the correct function name soc_card_dai_links_create() instead of sof_card_dai_links_create() (new).
- Patch 3: remove unused ACP63_SDW_MAX_CPU_DAIS define (new).
- Patch 5 (was 2): add comments above ACP7X_SW_AUDIO* define block and get_acp7x_cpu_pin_id() to document the dedicated per-port DMA layout and the port-to-use-case mapping.
- Patch 9 (was 6): replace misleading "No functional change" claim with an accurate description of the behavioural change for platforms where ignore_internal_dmic is true (dmic_num now stays zero at the gate rather than reaching the dmic_num > 0 block).

Changes in v3:
- Patch 3: update subject and changelog to accurately describe the new PDM controller selection infrastructure being added.
- 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 (16):
ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in

    mc_probe()

ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in
legacy SDW machine driver
ASoC: amd: sdw: remove unused ACP63_SDW_MAX_CPU_DAIS define
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

Quoted 10 lines
 sound/soc/amd/acp/Makefile               |   2 +-
 sound/soc/amd/acp/acp-sdw-legacy-mach.c  |   8 +-
 sound/soc/amd/acp/acp-sdw-mach-common.c  |  48 ++++++
 sound/soc/amd/acp/acp-sdw-sof-mach.c     | 109 +++++++++++--
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 198 +++++++++++++++++++++++
 sound/soc/amd/acp/soc_amd_sdw_common.h   |  45 +++++-
 sound/soc/amd/mach-config.h              |   2 +
 sound/soc/sof/amd/pci-acp7x.c            |   2 +
 8 files changed, 396 insertions(+), 18 deletions(-)
 create mode 100644 sound/soc/amd/acp/amd-acp7x-acpi-match.c

For the patchset:

I added two nit-pick comments on naming and DMIC0/DMIC1 explanations, in case you respin a v5.

author maintainer
#22 lore raw
Quoted 71 lines · Pierre-Louis Bossart
Quoted 60 lines · Vijendar Mukunda

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 v4:
- Patch 1: fix missing asoc_sdw_mc_dailink_exit_loop() cleanup on devm_kasprintf() failure in acp-sdw-sof-mach.c mc_probe() (new).
- Patch 2: fix missing asoc_sdw_mc_dailink_exit_loop() cleanup on both devm_kasprintf() failure paths in acp-sdw-legacy-mach.c mc_probe(); update commit message to reference the correct function name soc_card_dai_links_create() instead of sof_card_dai_links_create() (new).
- Patch 3: remove unused ACP63_SDW_MAX_CPU_DAIS define (new).
- Patch 5 (was 2): add comments above ACP7X_SW_AUDIO* define block and get_acp7x_cpu_pin_id() to document the dedicated per-port DMA layout and the port-to-use-case mapping.
- Patch 9 (was 6): replace misleading "No functional change" claim with an accurate description of the behavioural change for platforms where ignore_internal_dmic is true (dmic_num now stays zero at the gate rather than reaching the dmic_num > 0 block).

Changes in v3:
- Patch 3: update subject and changelog to accurately describe the new PDM controller selection infrastructure being added.
- 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 (16):
ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in

    mc_probe()

ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in
legacy SDW machine driver
ASoC: amd: sdw: remove unused ACP63_SDW_MAX_CPU_DAIS define
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

Quoted 10 lines
 sound/soc/amd/acp/Makefile               |   2 +-
 sound/soc/amd/acp/acp-sdw-legacy-mach.c  |   8 +-
 sound/soc/amd/acp/acp-sdw-mach-common.c  |  48 ++++++
 sound/soc/amd/acp/acp-sdw-sof-mach.c     | 109 +++++++++++--
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 198 +++++++++++++++++++++++
 sound/soc/amd/acp/soc_amd_sdw_common.h   |  45 +++++-
 sound/soc/amd/mach-config.h              |   2 +
 sound/soc/sof/amd/pci-acp7x.c            |   2 +
 8 files changed, 396 insertions(+), 18 deletions(-)
 create mode 100644 sound/soc/amd/acp/amd-acp7x-acpi-match.c
Quoted 6 lines

For the patchset:

I added two nit-pick comments on naming and DMIC0/DMIC1 explanations, in case you respin a v5.

Thanks for the review. Will address the naming and DMIC0/DMIC1 clarification comments with supplemental patches.

author maintainer
#23 lore raw

cover ASoC: amd: acp: supplement patches for ACP7.B/7.F SoundWire machine driver series

In reply to Vijendar Mukunda

These two patches address nit-picks raised in review of the ACP7.B/7.F SoundWire machine driver series posted at:

https://lore.kernel.org/all/[email protected]/

Patch 1 renames three static adr_device arrays in amd-acp7x-acpi-match.c to reflect their endpoint set rather than their structural role, making the distinction between jack+dmic (combo with RT1320) and jack+amp+dmic (standalone) self-explanatory.

Patch 2 adds a block comment above the ASOC_SDW_ACP_DMIC and ASOC_SDW_ACP_DMIC1 quirk bit definitions to document the dual-PDM- controller hardware model of ACP7.B/7.F, and annotates each bit with its role. ASOC_SDW_ACP_DMIC is a generic DMIC-enable flag on all ACP platforms; on ACP7.B/7.F it additionally identifies the PDM0 controller. ASOC_SDW_ACP_DMIC1 is ACP7.B/7.F-specific for PDM1. BIOS wires exactly one controller per platform.

Vijendar Mukunda (2):
ASoC: amd: acp: fix adr_device naming in ACP7.x ACPI match table
ASoC: amd: acp: document PDM controller topology for ACP7.B/7.F

 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 22 +++++++++++-----------
 sound/soc/amd/acp/soc_amd_sdw_common.h   | 11 +++++++++--
 2 files changed, 20 insertions(+), 13 deletions(-)
Signature · 1 line
2.53.0
author maintainer
#24 lore raw

PATCH 1/2 ASoC: amd: acp: fix adr_device naming in ACP7.x ACPI match table

Rename the three rt721/rt722 adr_device arrays to encode their endpoint set rather than their structural role:

  rt721_l0_single_adr  -> rt721_l0_jack_dmic_adr
  rt721_l0_only        -> rt721_l0_jack_amp_dmic_adr
  rt722_l0_single_adr  -> rt722_l0_jack_amp_dmic_adr

The old names (_single_adr vs _only) did not indicate which endpoint set each entry uses. The new names make it immediately clear that rt721_l0_jack_dmic_adr carries jack+dmic endpoints (used in combo configs where RT1320 provides amplification) while both *_jack_amp_dmic_adr variants carry the full jack+amp+dmic set for standalone configurations. Update all four call sites accordingly.

---
 sound/soc/amd/acp/amd-acp7x-acpi-match.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
sound/soc/amd/acp/amd-acp7x-acpi-match.c +11 -11
index 830c59966a35..bf11ceb7478b 100644
@@ -57,7 +57,7 @@ static const struct snd_soc_acpi_endpoint jack_amp_dmic_endpoints[] = {
 	},
 };
 
-static const struct snd_soc_acpi_adr_device rt721_l0_single_adr[] = {
+static const struct snd_soc_acpi_adr_device rt721_l0_jack_dmic_adr[] = {
 	{
 		.adr = 0x000030025d072101ull,
 		.num_endpoints = ARRAY_SIZE(jack_dmic_endpoints),
@@ -66,7 +66,7 @@ static const struct snd_soc_acpi_adr_device rt721_l0_single_adr[] = {
 	}
 };
 
-static const struct snd_soc_acpi_adr_device rt721_l0_only[] = {
+static const struct snd_soc_acpi_adr_device rt721_l0_jack_amp_dmic_adr[] = {
 	{
 		.adr = 0x000030025d072101ull,
 		.num_endpoints = ARRAY_SIZE(jack_amp_dmic_endpoints),
@@ -78,13 +78,13 @@ static const struct snd_soc_acpi_adr_device rt721_l0_only[] = {
 static const struct snd_soc_acpi_link_adr acp7x_rt721_only[] = {
 	{
 		.mask = BIT(0),
-		.num_adr = ARRAY_SIZE(rt721_l0_only),
-		.adr_d = rt721_l0_only,
+		.num_adr = ARRAY_SIZE(rt721_l0_jack_amp_dmic_adr),
+		.adr_d = rt721_l0_jack_amp_dmic_adr,
 	},
 	{}
 };
 
-static const struct snd_soc_acpi_adr_device rt722_l0_single_adr[] = {
+static const struct snd_soc_acpi_adr_device rt722_l0_jack_amp_dmic_adr[] = {
 	{
 		.adr = 0x000030025d072201ull,
 		.num_endpoints = ARRAY_SIZE(jack_amp_dmic_endpoints),
@@ -96,8 +96,8 @@ static const struct snd_soc_acpi_adr_device rt722_l0_single_adr[] = {
 static const struct snd_soc_acpi_link_adr acp7x_rt722_only[] = {
 	{
 		.mask = BIT(0),
-		.num_adr = ARRAY_SIZE(rt722_l0_single_adr),
-		.adr_d = rt722_l0_single_adr,
+		.num_adr = ARRAY_SIZE(rt722_l0_jack_amp_dmic_adr),
+		.adr_d = rt722_l0_jack_amp_dmic_adr,
 	},
 	{}
 };
@@ -123,8 +123,8 @@ static const struct snd_soc_acpi_adr_device rt1320_l3_single_adr[] = {
 static const struct snd_soc_acpi_link_adr acp7x_rt721_l0_rt1320_l1[] = {
 	{
 		.mask = BIT(0),
-		.num_adr = ARRAY_SIZE(rt721_l0_single_adr),
-		.adr_d = rt721_l0_single_adr,
+		.num_adr = ARRAY_SIZE(rt721_l0_jack_dmic_adr),
+		.adr_d = rt721_l0_jack_dmic_adr,
 	},
 	{
 		.mask = BIT(1),
@@ -137,8 +137,8 @@ static const struct snd_soc_acpi_link_adr acp7x_rt721_l0_rt1320_l1[] = {
 static const struct snd_soc_acpi_link_adr acp7x_rt721_l0_rt1320_l3[] = {
 	{
 		.mask = BIT(0),
-		.num_adr = ARRAY_SIZE(rt721_l0_single_adr),
-		.adr_d = rt721_l0_single_adr,
+		.num_adr = ARRAY_SIZE(rt721_l0_jack_dmic_adr),
+		.adr_d = rt721_l0_jack_dmic_adr,
 	},
 	{
 		.mask = BIT(3),
Signature · 1 line
2.53.0
author maintainer
#25 lore raw

PATCH 2/2 ASoC: amd: acp: document PDM controller topology for ACP7.B/7.F

In reply to Vijendar Mukunda

Add a block comment above the ASOC_SDW_ACP_DMIC / ASOC_SDW_ACP_DMIC1 quirk bits and annotate each bit with its role.

ASOC_SDW_ACP_DMIC (BIT(5)) is a generic DMIC-enable flag used across all ACP platforms; on ACP7.B/7.F it additionally identifies the PDM0 controller. ASOC_SDW_ACP_DMIC1 (BIT(6)) selects the PDM1 controller and is ACP7.B/7.F-specific. Both ACP7.B/7.F controllers support a 2-channel stereo capture path, and BIOS wires exactly one per platform.

---
 sound/soc/amd/acp/soc_amd_sdw_common.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
sound/soc/amd/acp/soc_amd_sdw_common.h +9 -2
index 07837a2cfa54..21b059b74626 100644
@@ -28,8 +28,15 @@
 
 #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 */
+/*
+ * ASOC_SDW_ACP_DMIC is a generic DMIC-enable flag used across all ACP
+ * platforms. On ACP7.B/7.F it additionally identifies the PDM0 controller;
+ * ASOC_SDW_ACP_DMIC1 selects PDM1 on ACP7.B/7.F instead. Both ACP7.B/7.F
+ * controllers support a 2-channel stereo capture path, and BIOS wires exactly
+ * one per platform.
+ */
+#define ASOC_SDW_ACP_DMIC		BIT(5)	/* enable DMIC; PDM0 on ACP7.B/7.F */
+#define ASOC_SDW_ACP_DMIC1		BIT(6)	/* PDM1 / DMIC1, ACP7.B/7.F only */
 #define ASOC_SDW_CODEC_SPKR		BIT(15)
 
 #define AMD_SDW0	0
Signature · 1 line
2.53.0
maintainer
#26 lore raw

Re: [PATCH 0/2] ASoC: amd: acp: supplement patches for ACP7.B/7.F SoundWire machine driver series

In reply to Vijendar Mukunda
Quoted 2 lines · Vijendar Mukunda

These two patches address nit-picks raised in review of the ACP7.B/7.F SoundWire machine driver series posted at:

Please don't send new patches in reply to old patches or serieses, this makes it harder for both people and tools to understand what is going on - it can bury things in mailboxes and make it difficult to keep track of what current patches are, both for the new patches and the old ones.

This has really confused my tooling :(

author maintainer
#27 lore raw

Re: [PATCH 0/2] ASoC: amd: acp: supplement patches for ACP7.B/7.F SoundWire machine driver series

Quoted 9 lines · Mark Brown
Quoted 2 lines · Vijendar Mukunda

These two patches address nit-picks raised in review of the ACP7.B/7.F SoundWire machine driver series posted at:

Please don't send new patches in reply to old patches or serieses, this makes it harder for both people and tools to understand what is going on - it can bury things in mailboxes and make it difficult to keep track of what current patches are, both for the new patches and the old ones.

This has really confused my tooling :(

Understood, and apologies for the confusion.
Since the original series is still under review, I sent the supplemental patch as a reply to it instead of starting a separate series with a dependency.
Going forward, I will post such changes as a new series and clearly mention any dependencies.

maintainer
#28 lore raw

Re: [PATCH 0/2] ASoC: amd: acp: supplement patches for ACP7.B/7.F SoundWire machine driver series

Quoted 10 lines · Mukunda,Vijendar
Quoted 1 line · Mark Brown

This has really confused my tooling :(

Understood, and apologies for the confusion.
Since the original series is still under review, I sent the supplemental patch as a reply to it instead of starting a separate series with a dependency.
Going forward, I will post such changes as a new series and clearly mention any dependencies.

If you want to add something to an existing series post a new version of it. It is not sustainable to manage a mess of interdependencies between in flight serieses.

maintainer
#29 lore raw
In reply to Vijendar Mukunda
Quoted 10 lines · Vijendar Mukunda

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5

Thanks!

[01/16] ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in mc_probe()

        https://git.kernel.org/broonie/sound/c/007f91d0fdb8
[02/16] ASoC: amd: acp: fix missing cleanup on devm_kasprintf() failure in legacy SDW machine driver
        https://git.kernel.org/broonie/sound/c/2f107878e7a2
[03/16] ASoC: amd: sdw: remove unused ACP63_SDW_MAX_CPU_DAIS define
        https://git.kernel.org/broonie/sound/c/be810ddf1be9
[04/16] ASoC: amd: acp: add ACP7.B/7.F SoundWire link count for machine driver
        https://git.kernel.org/broonie/sound/c/7de8faa0fb6e
[05/16] ASoC: amd: acp: add ACP7.B/7.F SoundWire DAI link support
        https://git.kernel.org/broonie/sound/c/b6fd467a4be0
[06/16] ASoC: amd: acp: add PDM controller selection for ACP7.B/7.F SoundWire machine driver
        https://git.kernel.org/broonie/sound/c/f6a58ddb3284
[07/16] ASoC: amd: acp: log ASOC_SDW_ACP_DMIC1 quirk in SOF SoundWire machine driver
        https://git.kernel.org/broonie/sound/c/5b597730d199
[08/16] ASoC: amd: acp: enable DMIC DAI link based on PDM controller selection
        https://git.kernel.org/broonie/sound/c/eb5a7c98ca1b
[09/16] ASoC: amd: acp: move ignore_internal_dmic gate to DMIC enable condition
        https://git.kernel.org/broonie/sound/c/5ad81cbb83bd
[10/16] ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver
        https://git.kernel.org/broonie/sound/c/2ced313a0605
[11/16] ASoC: amd: acp: set PCI subsystem ID for SOF SoundWire machine driver
        https://git.kernel.org/broonie/sound/c/90a52a8f23fa
[12/16] ASoC: amd: acp: fix MODULE_AUTHOR missing closing angle bracket
        https://git.kernel.org/broonie/sound/c/faa5a77479ad
[13/16] ASoC: amd: acp: add ACPI machine tables for ACP7.F SoundWire
        https://git.kernel.org/broonie/sound/c/48b1ff3a75d9
[14/16] ASoC: SOF: amd: add alt_machines for ACP7.F SOF SoundWire
        https://git.kernel.org/broonie/sound/c/c9ff86300abe
[15/16] ASoC: amd: acp: add SoundWire machine table for ACP7.B platform
        https://git.kernel.org/broonie/sound/c/e6f48837d135
[16/16] ASoC: SOF: amd: register SoundWire alt_machines for ACP7.B
        https://git.kernel.org/broonie/sound/c/4384043e78be

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark