aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2025-05-30 16:10:19 +0200
committerMark Brown <broonie@kernel.org>2025-06-02 12:26:46 +0100
commit347c8d6db7c9d65d93ef226849b273823f54eaea (patch)
tree94c556bca59e2eef886ccd4ff562b3ebae48e631 /sound
parentASoC: Intel: avs: Fix deadlock when the failing IPC is SET_D0IX (diff)
downloadlinux-rng-347c8d6db7c9d65d93ef226849b273823f54eaea.tar.xz
linux-rng-347c8d6db7c9d65d93ef226849b273823f54eaea.zip
ASoC: Intel: avs: Fix PPLCxFMT calculation
HDAudio transfer types utilize SDxFMT for front-end (HOST) and PPLCxFMT for back-end (LINK) side when setting up the stream. BE's substream->runtime duplicates FE runtime so switch to using BE's hw_params to address incorrect format values on the LINK side when FE and BE formats differ. The problem is introduced with commit d070002a20fc ("ASoC: Intel: avs: HDA PCM BE operations") but the code has been shuffled around since then so direct 'Fixes:' tag does not apply. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20250530141025.2942936-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/avs/pcm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index 405cfc1ab0cb..d1acc636add7 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -450,9 +450,10 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn
static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
{
- struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_soc_pcm_runtime *be = snd_soc_substream_to_rtd(substream);
const struct snd_soc_pcm_stream *stream_info;
struct hdac_ext_stream *link_stream;
+ const struct snd_pcm_hw_params *p;
struct avs_dma_data *data;
unsigned int format_val;
unsigned int bits;
@@ -460,14 +461,15 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
data = snd_soc_dai_get_dma_data(dai, substream);
link_stream = data->link_stream;
+ p = &be->dpcm[substream->stream].hw_params;
if (link_stream->link_prepared)
return 0;
stream_info = snd_soc_dai_get_pcm_stream(dai, substream->stream);
- bits = snd_hdac_stream_format_bits(runtime->format, runtime->subformat,
+ bits = snd_hdac_stream_format_bits(params_format(p), params_subformat(p),
stream_info->sig_bits);
- format_val = snd_hdac_stream_format(runtime->channels, bits, runtime->rate);
+ format_val = snd_hdac_stream_format(params_channels(p), bits, params_rate(p));
snd_hdac_ext_stream_decouple(&data->adev->base.core, link_stream, true);
snd_hdac_ext_stream_reset(link_stream);