mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <vkoul@kernel.org>
Cc: <yung-chuan.liao@linux.intel.com>,
	<pierre-louis.bossart@linux.dev>, <Basavaraj.Hiregoudar@amd.com>,
	<Sunil-kumar.Dommati@amd.com>, <venkataprasad.potturu@amd.com>,
	<Syed.SabaKareem@amd.com>, <Mario.Limonciello@amd.com>,
	<Richard.Gong@amd.com>, <Poojitha.N@amd.com>,
	<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Vijendar Mukunda" <Vijendar.Mukunda@amd.com>
Subject: [PATCH v3 10/11] soundwire: amd: guard DAI PCM caps by acp_rev in register_dais()
Date: Sat, 7 Nov 2026 21:42:27 +0530	[thread overview]
Message-ID: <20261107161345.3411491-11-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20261107161345.3411491-1-Vijendar.Mukunda@amd.com>

Replace the bare stream->rates and stream->formats assignments in
amd_sdw_register_dais() with an explicit switch/case on acp_rev
covering ACP63, ACP70, ACP71, and ACP72. An unrecognised revision
now returns -EINVAL at DAI registration time rather than silently
inheriting capabilities that may not apply to future hardware.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 drivers/soundwire/amd_manager_common.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/soundwire/amd_manager_common.c b/drivers/soundwire/amd_manager_common.c
index 06aef9c03f18..4a414fc1b02d 100644
--- a/drivers/soundwire/amd_manager_common.c
+++ b/drivers/soundwire/amd_manager_common.c
@@ -403,8 +403,19 @@ static int amd_sdw_register_dais(struct amd_sdw_manager *amd_manager)
 
 		stream->channels_min = 2;
 		stream->channels_max = 2;
-		stream->rates = SNDRV_PCM_RATE_48000;
-		stream->formats = SNDRV_PCM_FMTBIT_S16_LE;
+		switch (amd_manager->acp_rev) {
+		case ACP63_PCI_REV_ID:
+		case ACP70_PCI_REV_ID:
+		case ACP71_PCI_REV_ID:
+		case ACP72_PCI_REV_ID:
+			stream->rates = SNDRV_PCM_RATE_48000;
+			stream->formats = SNDRV_PCM_FMTBIT_S16_LE;
+			break;
+		default:
+			dev_err(amd_manager->dev, "unexpected acp_rev 0x%x\n",
+				amd_manager->acp_rev);
+			return -EINVAL;
+		}
 
 		dais[i].ops = &amd_sdw_dai_ops;
 		dais[i].id = i;
-- 
2.53.0


  parent reply	other threads:[~2026-11-07 16:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 16:12 [PATCH v3 00/11] soundwire: amd: introduce hw_ops dispatch and split driver into revision-specific files Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 01/11] soundwire: amd: rename AMD_SDW_MAX_MANAGER_COUNT macro Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 02/11] soundwire: amd: allocate pdevinfo and sdw_pdata by ACP revision in probe Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 03/11] soundwire: amd: allocate sdw_amd_ctx pdev array dynamically Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 04/11] soundwire: amd: rename hardware backend symbols to amd_acp63_*() prefix Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 05/11] soundwire: amd: remove unused AMD_SDW_MAX_FREQ_NUM define Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 06/11] soundwire: amd: introduce struct amd_sdw_hw_ops dispatch framework Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 07/11] soundwire: amd: dispatch irq/work handlers to per-revision functions Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 08/11] soundwire: amd: populate hw_ops and wire all call sites through acp_*() helpers Vijendar Mukunda
2026-11-07 16:12 ` [PATCH v3 09/11] soundwire: amd: extract shared functions into amd_manager_common.c Vijendar Mukunda
2026-11-07 16:12 ` Vijendar Mukunda [this message]
2026-11-07 16:12 ` [PATCH v3 11/11] soundwire: amd: guard clock-stop register access by acp_rev Vijendar Mukunda

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=20261107161345.3411491-11-Vijendar.Mukunda@amd.com \
    --to=vijendar.mukunda@amd.com \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Poojitha.N@amd.com \
    --cc=Richard.Gong@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=Syed.SabaKareem@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=venkataprasad.potturu@amd.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.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®