Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Corey Smith <corsmith@gmail.com>
To: corsmith@gmail.com, Vijendar.Mukunda@amd.com,
	venkataprasad.potturu@amd.com
Cc: linux-sound@vger.kernel.org
Subject: [PATCH 11/11] soundwire: amd: provide defaults for the bus clock properties
Date: Tue, 27 Oct 2026 22:05:52 -0400	[thread overview]
Message-ID: <20261028020552.35278-12-corsmith@gmail.com> (raw)
In-Reply-To: <20261028020552.35278-1-corsmith@gmail.com>

The manager clock configuration was moved from hard-coded values to the
MIPI DisCo properties (max clock frequency, default frame rate and
default row size).  Rembrandt (ACP6x) firmware does not describe those
properties on the SoundWire link nodes, so sdw_master_read_prop()
leaves them zeroed and amd_sdw_clk_init_ctrl() aborts the manager
start-up with -EINVAL.  On the HP Dragonfly Pro ONE this makes the
whole snd-pci-ps probe fail with error -22 and no SoundWire device is
created.

Restore the legacy defaults when the firmware does not provide them:
a 12 MHz bus clock, a 48 kHz frame rate and the 50 x 10 frame shape.
Platforms whose firmware does describe the properties are unaffected.

Assisted-by: LLM
Signed-off-by: Corey Smith <corsmith@gmail.com>
---
 drivers/soundwire/amd_manager.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index 697ec93..d451428 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -25,6 +25,12 @@
 
 #define DRV_NAME "amd_sdw_manager"
 
+/*
+ * Frame rate used when firmware does not describe the MIPI DisCo clock
+ * properties on the SoundWire link nodes.
+ */
+#define AMD_SDW_DEFAULT_FRAME_RATE	48000
+
 #define to_amd_sdw(b)	container_of(b, struct amd_sdw_manager, bus)
 
 static int amd_sdw_clk_init_ctrl(struct amd_sdw_manager *amd_manager)
@@ -752,8 +758,27 @@ static int sdw_master_read_amd_prop(struct sdw_bus *bus)
 
 static int amd_prop_read(struct sdw_bus *bus)
 {
+	struct sdw_master_prop *prop = &bus->prop;
+
 	sdw_master_read_prop(bus);
 	sdw_master_read_amd_prop(bus);
+
+	/*
+	 * Some platforms, Rembrandt (ACP6x) in particular, do not describe
+	 * the MIPI DisCo clock properties on the SoundWire link nodes.  The
+	 * values read by sdw_master_read_prop() then stay zeroed and
+	 * amd_sdw_clk_init_ctrl() fails with -EINVAL.  Restore the defaults
+	 * the driver used before the clock configuration was moved to
+	 * firmware: a 12 MHz bus clock, a 48 kHz frame rate and the 50 x 10
+	 * frame shape.
+	 */
+	if (!prop->max_clk_freq)
+		prop->max_clk_freq = AMD_SDW_DEFAULT_CLK_FREQ;
+	if (!prop->default_frame_rate)
+		prop->default_frame_rate = AMD_SDW_DEFAULT_FRAME_RATE;
+	if (!prop->default_row)
+		prop->default_row = AMD_SDW_DEFAULT_ROWS;
+
 	return 0;
 }
 

  parent reply	other threads:[~2026-10-28  2:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  2:05 [PATCH 0/11] ASoC/soundwire: AMD ACP6x (Rembrandt) SoundWire speaker support Corey Smith
2026-10-28  2:05 ` [PATCH 1/11] soundwire: amd: add ACP6x PCI revision ids Corey Smith
2026-10-28  2:05 ` [PATCH 2/11] soundwire: amd: support ACP6x SoundWire managers Corey Smith
2026-10-28  2:05 ` [PATCH 3/11] ASoC: amd: ps: add ACP6x PCI revision ids Corey Smith
2026-10-28  2:15   ` sashiko-bot
2026-10-28  2:05 ` [PATCH 4/11] ASoC: amd: ps: support ACP6x in the SoundWire DMA driver Corey Smith
2026-10-28  2:05 ` [PATCH 5/11] ASoC: amd: acp: add ACP6x (Rembrandt) SoundWire machine table Corey Smith
2026-10-28  2:05 ` [PATCH 6/11] ASoC: amd: acp-config: route HP Dragonfly Pro ONE through the ACP6x SDW stack Corey Smith
2026-10-28  2:05 ` [PATCH 7/11] ASoC: amd: ps: probe the ACP6x SoundWire stack Corey Smith
2026-10-28  2:20   ` sashiko-bot
2026-10-28  2:05 ` [PATCH 8/11] ASoC: amd: acp: add ACP6x SoundWire quirks and machine support Corey Smith
2026-10-28  2:22   ` sashiko-bot
2026-10-28  2:05 ` [PATCH 9/11] soundwire: amd: accept the legacy mipi-sdw-master-list property Corey Smith
2026-10-28  2:05 ` [PATCH 10/11] ASoC: amd: ps: harden the ACP interrupt path for ACP6x Corey Smith
2026-10-28  2:21   ` sashiko-bot
2026-10-28  2:05 ` Corey Smith [this message]
2026-10-29  6:58 ` [PATCH 0/11] ASoC/soundwire: AMD ACP6x (Rembrandt) SoundWire speaker support Mukunda,Vijendar

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=20261028020552.35278-12-corsmith@gmail.com \
    --to=corsmith@gmail.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=venkataprasad.potturu@amd.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