Commit 8fa10a24 authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: SOF: Intel: hda-dai: set lowest N bits in ch_mask

We always use the lowest N channels of stream. So, set ch_mask to
GENMASK(params_channels(params) - 1, 0).
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-6-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e9c6b118
...@@ -441,7 +441,6 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -441,7 +441,6 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(cpu_dai, substream->stream); struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(cpu_dai, substream->stream);
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
const struct hda_dai_widget_dma_ops *ops; const struct hda_dai_widget_dma_ops *ops;
struct snd_soc_dai_link_ch_map *ch_maps;
struct hdac_ext_stream *hext_stream; struct hdac_ext_stream *hext_stream;
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
struct snd_sof_dev *sdev; struct snd_sof_dev *sdev;
...@@ -449,7 +448,6 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -449,7 +448,6 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream,
int cpu_dai_id; int cpu_dai_id;
int ch_mask; int ch_mask;
int ret; int ret;
int j;
ret = non_hda_dai_hw_params(substream, params, cpu_dai); ret = non_hda_dai_hw_params(substream, params, cpu_dai);
if (ret < 0) { if (ret < 0) {
...@@ -479,11 +477,7 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -479,11 +477,7 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream,
if (!cpu_dai_found) if (!cpu_dai_found)
return -ENODEV; return -ENODEV;
ch_mask = 0; ch_mask = GENMASK(params_channels(params) - 1, 0);
for_each_link_ch_maps(rtd->dai_link, j, ch_maps) {
if (ch_maps->cpu == cpu_dai_id)
ch_mask |= ch_maps->ch_mask;
}
ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id, cpu_dai->id, ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id, cpu_dai->id,
ch_mask, ch_mask,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment