diff options
author | Mark Brown <broonie@kernel.org> | 2023-05-30 17:43:11 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-05-30 17:43:11 +0100 |
commit | f2d4aa7e97eb60f426b92b95da712a6b3c18dc9a (patch) | |
tree | 2171bd8cc8d8e965a2f631622555ced2965ee539 /sound/soc/sof | |
parent | b07693bfb5498196791fb605b00257cb6405f716 (diff) | |
parent | 0f7b6a433097808e7f3e82f837ccc1353f070e4a (diff) | |
download | linux-stable-f2d4aa7e97eb60f426b92b95da712a6b3c18dc9a.tar.gz linux-stable-f2d4aa7e97eb60f426b92b95da712a6b3c18dc9a.tar.bz2 linux-stable-f2d4aa7e97eb60f426b92b95da712a6b3c18dc9a.zip |
ASoC: topology: allow for partial dailink stream_name
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
The topology file and the machine driver rely on common definitions
for the dailink stream_name. To avoid any backwards-compatibility
problems, the machine driver stream names are set in stone and cannot
be modified.
This is problematic when we try to name some of the topology widgets
after the stream_name, since the widget name is limited to 44
characters
tools/include/uapi/sound/asound.h:#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
Existing examples include "Analog Playback and Capture" for HDaudio
dailinks, which leaves less than 20 chars to identify widgets/controls
with a meaningful name.
Since the 44-char limit is part of the UAPI definitions, we assumed
there is no way to increase it.
This patchset suggests instead a partial match which allows topology
files to use a shorter stream_name, which in turn allows for
self-explanatory widget names that comply with the 44-char limit.
This should not break any existing setup but with the introduction of
a partial match new dailinks should be named carefully to avoid
confusions between e.g. 'link1' and 'link10'. The last patch fixes
such an issue in the 'nocodec' test topology used by Intel.
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/intel/hda.c | 6 | ||||
-rw-r--r-- | sound/soc/sof/intel/hda.h | 4 | ||||
-rw-r--r-- | sound/soc/sof/topology.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 3153e21f100a..835c2568dd60 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1562,7 +1562,11 @@ void hda_set_mach_params(struct snd_soc_acpi_mach *mach, mach_params = &mach->mach_params; mach_params->platform = dev_name(sdev->dev); - mach_params->num_dai_drivers = desc->ops->num_drv; + if (IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC_DEBUG_SUPPORT) && + sof_debug_check_flag(SOF_DBG_FORCE_NOCODEC)) + mach_params->num_dai_drivers = SOF_SKL_NUM_DAIS_NOCODEC; + else + mach_params->num_dai_drivers = desc->ops->num_drv; mach_params->dai_drivers = desc->ops->drv; } diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 65832a38bffa..5b3dad2dadf4 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -414,10 +414,12 @@ (HDA_DSP_BDL_SIZE / sizeof(struct sof_intel_dsp_bdl)) /* Number of DAIs */ +#define SOF_SKL_NUM_DAIS_NOCODEC 8 + #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) #define SOF_SKL_NUM_DAIS 15 #else -#define SOF_SKL_NUM_DAIS 8 +#define SOF_SKL_NUM_DAIS SOF_SKL_NUM_DAIS_NOCODEC #endif /* Intel HD Audio SRAM Window 0*/ diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index d3d536b0a8f5..b572c809581d 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1073,7 +1073,7 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp, list_for_each_entry(rtd, &card->rtd_list, list) { /* does stream match DAI link ? */ if (!rtd->dai_link->stream_name || - strcmp(w->sname, rtd->dai_link->stream_name)) + !strstr(rtd->dai_link->stream_name, w->sname)) continue; for_each_rtd_cpu_dais(rtd, i, cpu_dai) { |