mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: fixca <jaehoon1744@dankook.ac.kr>
To: broonie@kernel.org, Vijendar.Mukunda@amd.com, shumingf@realtek.com
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jaehoon Kim <jaehoon1744@dankook.ac.kr>,
	"Claude Fable 5.2" <noreply@anthropic.com>
Subject: [PATCH RFC 2/2] ASoC: amd: acp70: Add rt713 + rt1320 SoundWire machine for LG gram 16Z95U
Date: Tue, 10 Nov 2026 21:54:29 +0900	[thread overview]
Message-ID: <20261110125459.3924-3-jaehoon1744@gmail.com> (raw)
In-Reply-To: <20261110125459.3924-1-jaehoon1744@gmail.com>

From: Jaehoon Kim <jaehoon1744@dankook.ac.kr>

The LG gram 16 (16Z95U) uses an RT713 jack codec on SoundWire link 0
and a single stereo RT1320 amplifier on link 1. There is no matching
entry in snd_soc_acpi_amd_acp70_sdw_machines[], so no machine device
is registered even once the SoundWire path is selected.

Add two machine entries:

 - rt713 (jack + DMIC endpoints) on link 0 and rt1320 on link 1, used
   when the RT713 exposes a SmartMic SDCA function (rt712-vb check).
   On this machine the internal microphones are routed through the
   RT713 SmartMic function; the ACP PDM controller is not used.
 - a fallback with only the rt713 jack endpoint and rt1320.

Tested on LG gram 16Z95U-GS59K with kernel 7.2.14. The "amd-soundwire"
card is created with these PCMs:

  SDW0-PIN0-PLAYBACK-SimpleJack  rt712-sdca-aif1
  SDW0-PIN3-CAPTURE-SimpleJack   rt712-sdca-aif1
  SDW0-PIN5-CAPTURE-SmartMic     rt712-sdca-aif3
  SDW1-PIN1-PLAYBACK-SmartAmp    rt1320-aif1

Headphone playback and internal microphone capture work with the
stock alsa-ucm-conf (1.2.16.1) HiFi profile; headset microphone
capture was not tested. Speaker playback through the RT1320 is still
silent although the stream starts without errors; that is being
followed up separately.

Signed-off-by: Jaehoon Kim <jaehoon1744@dankook.ac.kr>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---
 sound/soc/amd/acp/amd-acp70-acpi-match.c | 85 ++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/sound/soc/amd/acp/amd-acp70-acpi-match.c b/sound/soc/amd/acp/amd-acp70-acpi-match.c
index ccd0115..2a6d829 100644
--- a/sound/soc/amd/acp/amd-acp70-acpi-match.c
+++ b/sound/soc/amd/acp/amd-acp70-acpi-match.c
@@ -553,6 +553,80 @@ static const struct snd_soc_acpi_link_adr acp70_rt722_l0_rt1320_l1[] = {
 	{}
 };
 
+/*
+ * LG gram 16 16Z95U: rt713 (UAJ + SmartMic) on link 0 and a single
+ * rt1320 SmartAmp on link 1.
+ */
+static const struct snd_soc_acpi_endpoint rt713_vb_endpoints[] = {
+	{ /* Jack Playback/Capture Endpoint (AIF1) */
+		.num = 0,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{ /* DMIC Capture Endpoint (AIF3, SmartMic function) */
+		.num = 1,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+};
+
+static const struct snd_soc_acpi_adr_device rt713_vb_0_single_adr[] = {
+	{
+		.adr = 0x000030025D071301ull,
+		.num_endpoints = ARRAY_SIZE(rt713_vb_endpoints),
+		.endpoints = rt713_vb_endpoints,
+		.name_prefix = "rt713"
+	}
+};
+
+static const struct snd_soc_acpi_adr_device rt713_0_single_adr[] = {
+	{
+		.adr = 0x000030025D071301ull,
+		.num_endpoints = 1,
+		.endpoints = &single_endpoint,
+		.name_prefix = "rt713"
+	}
+};
+
+static const struct snd_soc_acpi_adr_device rt1320_1_u1_single_adr[] = {
+	{
+		.adr = 0x000131025D132001ull,
+		.num_endpoints = 1,
+		.endpoints = &single_endpoint,
+		.name_prefix = "rt1320-1"
+	}
+};
+
+static const struct snd_soc_acpi_link_adr acp70_rt713_vb_l0_rt1320_l1[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(rt713_vb_0_single_adr),
+		.adr_d = rt713_vb_0_single_adr,
+	},
+	{
+		.mask = BIT(1),
+		.num_adr = ARRAY_SIZE(rt1320_1_u1_single_adr),
+		.adr_d = rt1320_1_u1_single_adr,
+	},
+	{}
+};
+
+static const struct snd_soc_acpi_link_adr acp70_rt713_l0_rt1320_l1[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(rt713_0_single_adr),
+		.adr_d = rt713_0_single_adr,
+	},
+	{
+		.mask = BIT(1),
+		.num_adr = ARRAY_SIZE(rt1320_1_u1_single_adr),
+		.adr_d = rt1320_1_u1_single_adr,
+	},
+	{}
+};
+
 static const struct snd_soc_acpi_adr_device tas2783_2_adr[] = {
 	{
 		/* left */
@@ -714,6 +788,17 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sdw_machines[] = {
 		.links = acp70_rt722_l0_rt1320_l1,
 		.drv_name = "amd_sdw",
 	},
+	{
+		.link_mask = BIT(0) | BIT(1),
+		.links = acp70_rt713_vb_l0_rt1320_l1,
+		.machine_check = snd_soc_acpi_amd_sdca_is_device_rt712_vb,
+		.drv_name = "amd_sdw",
+	},
+	{
+		.link_mask = BIT(0) | BIT(1),
+		.links = acp70_rt713_l0_rt1320_l1,
+		.drv_name = "amd_sdw",
+	},
 	{
 		.link_mask = BIT(0) | BIT(1),
 		.links = acp70_4_in_1_sdca,
-- 
2.43.0


      parent reply	other threads:[~2026-11-10 12:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 12:54 [PATCH RFC 0/2] ASoC: amd: SoundWire audio for LG gram 16Z95U (rt713 + rt1320), speaker still silent fixca
2026-11-10 12:54 ` [PATCH RFC 1/2] ASoC: amd: acp: Add ACP70 ACPI flag override for LG gram 16Z95U fixca
2026-11-10 12:54 ` fixca [this message]

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20261110125459.3924-3-jaehoon1744@gmail.com \
    --to=jaehoon1744@dankook.ac.kr \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=noreply@anthropic.com \
    --cc=shumingf@realtek.com \
    /path/to/YOUR_REPLY

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

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

all inboxes | Powered by JetHome®