From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Mark Brown <broonie@kernel.org>
Cc: "Cezary Rojewski" <cezary.rojewski@intel.com>,
linux-sound@vger.kernel.org,
"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Subject: [PATCH 02/20] ASoC: Intel: avs: Use topology information for endpoint numbers
Date: Mon, 7 Apr 2025 14:41:36 +0200 [thread overview]
Message-ID: <20250407124154.1713039-3-amadeuszx.slawinski@linux.intel.com> (raw)
In-Reply-To: <20250407124154.1713039-1-amadeuszx.slawinski@linux.intel.com>
Use DAI PCM ID from topology as Front End device endpoint number. This
allows devices to be more naturally enumerated starting from 0, like
most cards, instead of values like 1 or 2.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
sound/soc/intel/avs/avs.h | 2 +-
sound/soc/intel/avs/board_selection.c | 2 +-
sound/soc/intel/avs/pcm.c | 8 +++++---
sound/soc/intel/avs/probes.c | 2 +-
sound/soc/intel/avs/utils.h | 2 ++
5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/sound/soc/intel/avs/avs.h b/sound/soc/intel/avs/avs.h
index 585543f872fcc..71973918e027b 100644
--- a/sound/soc/intel/avs/avs.h
+++ b/sound/soc/intel/avs/avs.h
@@ -340,7 +340,7 @@ struct avs_soc_component {
extern const struct snd_soc_dai_ops avs_dai_fe_ops;
int avs_soc_component_register(struct device *dev, const char *name,
- const struct snd_soc_component_driver *drv,
+ struct snd_soc_component_driver *drv,
struct snd_soc_dai_driver *cpu_dais, int num_cpu_dais);
int avs_dmic_platform_register(struct avs_dev *adev, const char *name);
int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned long port_mask,
diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c
index d00addb24d40a..d021503149a39 100644
--- a/sound/soc/intel/avs/board_selection.c
+++ b/sound/soc/intel/avs/board_selection.c
@@ -23,7 +23,7 @@ static bool i2s_test;
module_param(i2s_test, bool, 0444);
MODULE_PARM_DESC(i2s_test, "Probe I2S test-board and skip all other I2S boards");
-static bool obsolete_card_names = IS_ENABLED(CONFIG_SND_SOC_INTEL_AVS_CARDNAME_OBSOLETE);
+bool obsolete_card_names = IS_ENABLED(CONFIG_SND_SOC_INTEL_AVS_CARDNAME_OBSOLETE);
module_param_named(obsolete_card_names, obsolete_card_names, bool, 0444);
MODULE_PARM_DESC(obsolete_card_names, "Use obsolete card names 0=no, 1=yes");
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index 7e077c97123bb..0f4e35dab7e48 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -1267,7 +1267,7 @@ static int avs_component_construct(struct snd_soc_component *component,
return 0;
}
-static const struct snd_soc_component_driver avs_component_driver = {
+static struct snd_soc_component_driver avs_component_driver = {
.name = "avs-pcm",
.probe = avs_component_probe,
.remove = avs_component_remove,
@@ -1282,7 +1282,7 @@ static const struct snd_soc_component_driver avs_component_driver = {
};
int avs_soc_component_register(struct device *dev, const char *name,
- const struct snd_soc_component_driver *drv,
+ struct snd_soc_component_driver *drv,
struct snd_soc_dai_driver *cpu_dais, int num_cpu_dais)
{
struct avs_soc_component *acomp;
@@ -1300,6 +1300,8 @@ int avs_soc_component_register(struct device *dev, const char *name,
acomp->base.name = name;
INIT_LIST_HEAD(&acomp->node);
+ drv->use_dai_pcm_id = !obsolete_card_names;
+
return snd_soc_add_component(&acomp->base, cpu_dais, num_cpu_dais);
}
@@ -1626,7 +1628,7 @@ static int avs_component_hda_open(struct snd_soc_component *component,
return 0;
}
-static const struct snd_soc_component_driver avs_hda_component_driver = {
+static struct snd_soc_component_driver avs_hda_component_driver = {
.name = "avs-hda-pcm",
.probe = avs_component_hda_probe,
.remove = avs_component_hda_remove,
diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
index f0b0109563038..a42736b9aa55b 100644
--- a/sound/soc/intel/avs/probes.c
+++ b/sound/soc/intel/avs/probes.c
@@ -284,7 +284,7 @@ static struct snd_soc_dai_driver probe_cpu_dais[] = {
},
};
-static const struct snd_soc_component_driver avs_probe_component_driver = {
+static struct snd_soc_component_driver avs_probe_component_driver = {
.name = "avs-probe-compr",
.compress_ops = &avs_probe_compress_ops,
.module_get_upon_open = 1, /* increment refcount when a stream is opened */
diff --git a/sound/soc/intel/avs/utils.h b/sound/soc/intel/avs/utils.h
index a7aa13a48cf3d..955a40d2c30c2 100644
--- a/sound/soc/intel/avs/utils.h
+++ b/sound/soc/intel/avs/utils.h
@@ -11,6 +11,8 @@
#include <sound/soc-acpi.h>
+extern bool obsolete_card_names;
+
struct avs_mach_pdata {
struct hda_codec *codec;
unsigned long *tdms;
--
2.34.1
next prev parent reply other threads:[~2025-04-07 12:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 12:41 [PATCH 00/20] ASoC: Intel: avs: Update machine board card names Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 01/20] ASoC: Intel: avs: boards: Add Kconfig option for obsolete " Amadeusz Sławiński
2025-04-07 12:41 ` Amadeusz Sławiński [this message]
2025-04-07 12:41 ` [PATCH 03/20] ASoC: Intel: avs: boards: Change da7219 card name Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 04/20] ASoC: Intel: avs: boards: Change DMIC " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 05/20] ASoC: Intel: avs: boards: Change es8336 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 06/20] ASoC: Intel: avs: boards: Change hdaudio " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 07/20] ASoC: Intel: avs: boards: Change sspX-loopback " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 08/20] ASoC: Intel: avs: boards: Change max98357a " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 09/20] ASoC: Intel: avs: boards: Change max98373 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 10/20] ASoC: Intel: avs: boards: Change max98927 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 11/20] ASoC: Intel: avs: boards: Change nau8825 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 12/20] ASoC: Intel: avs: boards: Change pcm3168a " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 13/20] ASoC: Intel: avs: boards: Change probe " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 14/20] ASoC: Intel: avs: boards: Change rt274 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 15/20] ASoC: Intel: avs: boards: Change rt286 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 16/20] ASoC: Intel: avs: boards: Change rt298 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 17/20] ASoC: Intel: avs: boards: Change rt5514 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 18/20] ASoC: Intel: avs: boards: Change rt5663 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 19/20] ASoC: Intel: avs: boards: Change rt5682 " Amadeusz Sławiński
2025-04-07 12:41 ` [PATCH 20/20] ASoC: Intel: avs: boards: Change ssm4567 " Amadeusz Sławiński
2025-04-07 12:46 ` [PATCH 00/20] ASoC: Intel: avs: Update machine board card names Jaroslav Kysela
2025-04-07 13:42 ` Cezary Rojewski
2025-04-08 12:49 ` Mark Brown
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=20250407124154.1713039-3-amadeuszx.slawinski@linux.intel.com \
--to=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.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