From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org
Cc: tiwai@suse.com, perex@perex.cz,
amadeuszx.slawinski@linux.intel.com, linux-sound@vger.kernel.org,
hdegoede@redhat.com, Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 09/12] ASoC: Intel: avs: Dynamically assign ops for non-HDAudio DAIs
Date: Fri, 4 Apr 2025 11:49:50 +0200 [thread overview]
Message-ID: <20250404094953.3657679-10-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20250404094953.3657679-1-cezary.rojewski@intel.com>
Provide dynamic selection mechanism of DAI operations for the
non-HDAudio DAIs so that both LunarLake+ platforms and their
predecessors are supported.
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
sound/soc/intel/avs/pcm.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index d7d3c696be28..7e17df580a6e 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -502,7 +502,6 @@ static const struct snd_soc_dai_ops avs_dai_hda_be_ops = {
.trigger = avs_dai_hda_be_trigger,
};
-__maybe_unused
static const struct snd_soc_dai_ops avs_dai_i2shda_be_ops = {
.startup = avs_dai_i2shda_be_startup,
.shutdown = avs_dai_althda_be_shutdown,
@@ -512,7 +511,6 @@ static const struct snd_soc_dai_ops avs_dai_i2shda_be_ops = {
.trigger = avs_dai_hda_be_trigger,
};
-__maybe_unused
static const struct snd_soc_dai_ops avs_dai_dmichda_be_ops = {
.startup = avs_dai_dmichda_be_startup,
.shutdown = avs_dai_althda_be_shutdown,
@@ -1359,7 +1357,6 @@ int avs_soc_component_register(struct device *dev, const char *name,
static struct snd_soc_dai_driver dmic_cpu_dais[] = {
{
.name = "DMIC Pin",
- .ops = &avs_dai_nonhda_be_ops,
.capture = {
.stream_name = "DMIC Rx",
.channels_min = 1,
@@ -1370,7 +1367,6 @@ static struct snd_soc_dai_driver dmic_cpu_dais[] = {
},
{
.name = "DMIC WoV Pin",
- .ops = &avs_dai_nonhda_be_ops,
.capture = {
.stream_name = "DMIC WoV Rx",
.channels_min = 1,
@@ -1383,12 +1379,20 @@ static struct snd_soc_dai_driver dmic_cpu_dais[] = {
int avs_dmic_platform_register(struct avs_dev *adev, const char *name)
{
+ const struct snd_soc_dai_ops *ops;
+
+ if (avs_platattr_test(adev, ALTHDA))
+ ops = &avs_dai_dmichda_be_ops;
+ else
+ ops = &avs_dai_nonhda_be_ops;
+
+ dmic_cpu_dais[0].ops = ops;
+ dmic_cpu_dais[1].ops = ops;
return avs_soc_component_register(adev->dev, name, &avs_component_driver, dmic_cpu_dais,
ARRAY_SIZE(dmic_cpu_dais));
}
static const struct snd_soc_dai_driver i2s_dai_template = {
- .ops = &avs_dai_nonhda_be_ops,
.playback = {
.channels_min = 1,
.channels_max = 8,
@@ -1421,10 +1425,15 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
unsigned long *tdms)
{
struct snd_soc_dai_driver *cpus, *dai;
+ const struct snd_soc_dai_ops *ops;
size_t ssp_count, cpu_count;
int i, j;
ssp_count = adev->hw_cfg.i2s_caps.ctrl_count;
+ if (avs_platattr_test(adev, ALTHDA))
+ ops = &avs_dai_i2shda_be_ops;
+ else
+ ops = &avs_dai_nonhda_be_ops;
cpu_count = 0;
for_each_set_bit(i, &port_mask, ssp_count)
@@ -1452,6 +1461,7 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
if (!dai->name || !dai->playback.stream_name || !dai->capture.stream_name)
return -ENOMEM;
+ dai->ops = ops;
dai++;
}
}
@@ -1472,6 +1482,7 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
if (!dai->name || !dai->playback.stream_name || !dai->capture.stream_name)
return -ENOMEM;
+ dai->ops = ops;
dai++;
}
}
--
2.25.1
next prev parent reply other threads:[~2025-04-04 9:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 9:49 [PATCH 00/12] ASoC: Intel: avs: Add support for MTL-FCL platforms Cezary Rojewski
2025-04-04 9:49 ` [PATCH 01/12] ALSA: hda: Allow to fetch hlink by ID Cezary Rojewski
2025-04-04 9:49 ` [PATCH 02/12] ASoC: Intel: avs: Ignore Vendor-space manipulation for ACE Cezary Rojewski
2025-04-04 9:49 ` [PATCH 03/12] ASoC: Intel: avs: Read HW capabilities when possible Cezary Rojewski
2025-04-04 9:49 ` [PATCH 04/12] ASoC: Intel: avs: Relocate DSP status registers Cezary Rojewski
2025-04-04 9:49 ` [PATCH 05/12] ASoC: Intel: avs: MTL-based platforms support Cezary Rojewski
2025-04-04 9:49 ` [PATCH 06/12] ASoC: Intel: avs: LNL-based " Cezary Rojewski
2025-04-04 9:49 ` [PATCH 07/12] ASoC: Intel: avs: PTL-based " Cezary Rojewski
2025-04-04 9:49 ` [PATCH 08/12] ASoC: Intel: avs: PCM operations for LNL-based platforms Cezary Rojewski
2025-04-04 9:49 ` Cezary Rojewski [this message]
2025-04-04 9:49 ` [PATCH 10/12] ASoC: Intel: avs: Conditionally add DMA config when creating Copier Cezary Rojewski
2025-04-04 9:49 ` [PATCH 11/12] ASoC: Intel: avs: Add boards definitions for ACE platforms Cezary Rojewski
2025-04-04 9:49 ` [PATCH 12/12] ALSA: hda: Select avs-driver by default on FCL Cezary Rojewski
2025-04-04 12:52 ` [PATCH 00/12] ASoC: Intel: avs: Add support for MTL-FCL platforms Girdwood, Liam R
2025-04-04 13:09 ` Cezary Rojewski
2025-04-04 13:28 ` Girdwood, Liam R
2025-04-07 8:04 ` Cezary Rojewski
2025-04-07 9:36 ` Girdwood, Liam R
2025-04-07 9:45 ` Cezary Rojewski
2025-04-07 10:15 ` Girdwood, Liam R
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=20250404094953.3657679-10-cezary.rojewski@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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