ASoC: Intel: avs: hda: Constrain MSBs on startup

Front-end DAI links are marked as dynamic for the card thus the
__soc_pcm_open() function never gets to soc_pcm_apply_msb() step which
performs MSBs-constraint rule. Do that on link startup instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260902081814.1590883-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Cezary Rojewski 2026-09-02 10:18:14 +02:00 committed by Mark Brown
parent 681e91035d
commit 99f5566a1a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -15,6 +15,22 @@
#include "../../../codecs/hda.h"
#include "../utils.h"
static int avs_link_startup(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
const struct snd_soc_pcm_stream *stream_info;
struct snd_soc_dai *codec_dai;
codec_dai = snd_soc_rtd_to_codec(rtd, 0);
stream_info = snd_soc_dai_get_pcm_stream(codec_dai, substream->stream);
return snd_pcm_hw_constraint_msbits(substream->runtime, 0, 0, stream_info->sig_bits);
}
static const struct snd_soc_ops avs_link_ops = {
.startup = avs_link_startup,
};
static int avs_create_dai_links(struct device *dev, struct hda_codec *codec, int pcm_count,
struct snd_soc_dai_link **links)
{
@ -43,6 +59,7 @@ static int avs_create_dai_links(struct device *dev, struct hda_codec *codec, int
dl[i].platforms = platform;
dl[i].num_platforms = 1;
dl[i].ignore_pmdown_time = 1;
dl[i].ops = &avs_link_ops;
dl[i].codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL);
dl[i].cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL);