Skip to content

Commit ad66cb7

Browse files
committed
ASoC: SOF: Intel: hda-dai: use lowest N channels
The ch_mask in a link indicates the locations of the channels. However, the channels used in each stream are the lowest N channels. So convert ch_mask to GENMASK(hweight_long(ch_mask) - 1, 0). Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 91550db commit ad66cb7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/soc/sof/intel/hda-dai.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream,
509509
if (ch_maps->cpu == cpu_dai_id)
510510
ch_mask |= ch_maps->ch_mask;
511511
}
512+
/* Calculate how many bits are used, and set the lowest N bits to ch_mask */
513+
ch_mask = GENMASK(hweight_long(ch_mask) - 1, 0);
512514

513515
ret = hdac_bus_eml_sdw_map_stream_ch(sof_to_bus(sdev), link_id, cpu_dai->id,
514516
ch_mask,

0 commit comments

Comments
 (0)