ASoC: rockchip: mdais: Skip DAIs which have no channel mapping

There is no need to start DAIs which have no channel mapping.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ia6be32d474845b9ecb443c38b6801e9836e8a77a
This commit is contained in:
Sugar Zhang 2023-02-16 15:30:31 +08:00 committed by Tao Huang
parent a93d8eea59
commit 5ba3ec652a
1 changed files with 10 additions and 0 deletions

View File

@ -80,9 +80,19 @@ static int rockchip_mdais_trigger(struct snd_pcm_substream *substream,
{
struct rk_mdais_dev *mdais = to_info(dai);
struct snd_soc_dai *child;
unsigned int *channel_maps;
int ret = 0, i = 0;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
channel_maps = mdais->playback_channel_maps;
else
channel_maps = mdais->capture_channel_maps;
for (i = 0; i < mdais->num_dais; i++) {
/* skip DAIs which have no channel mapping */
if (!channel_maps[i])
continue;
child = mdais->dais[i].dai;
if (child->driver->ops && child->driver->ops->trigger) {
ret = child->driver->ops->trigger(substream,