mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
ASoC: compress: Set reasonable compress id string
For dynamic compress rtd, the codec_dai may not have any actual meaning(like snd-soc-dummy-dai), so compress id can just use the value of dai_link->stream_name. But for others, its codec_dai has actual meaning, so compress id can include codec_dai name. Signed-off-by: Peng Donglin <dolinux.peng@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7a0cf42edd
commit
aeb6fa0f15
1 changed files with 6 additions and 10 deletions
|
@ -737,9 +737,6 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check client and interface hw capabilities */
|
/* check client and interface hw capabilities */
|
||||||
snprintf(new_name, sizeof(new_name), "%s %s-%d",
|
|
||||||
rtd->dai_link->stream_name, codec_dai->name, num);
|
|
||||||
|
|
||||||
if (codec_dai->driver->playback.channels_min)
|
if (codec_dai->driver->playback.channels_min)
|
||||||
playback = 1;
|
playback = 1;
|
||||||
if (codec_dai->driver->capture.channels_min)
|
if (codec_dai->driver->capture.channels_min)
|
||||||
|
@ -758,7 +755,7 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playback)
|
if (playback)
|
||||||
direction = SND_COMPRESS_PLAYBACK;
|
direction = SND_COMPRESS_PLAYBACK;
|
||||||
else
|
else
|
||||||
direction = SND_COMPRESS_CAPTURE;
|
direction = SND_COMPRESS_CAPTURE;
|
||||||
|
@ -794,19 +791,18 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
|
||||||
else if (rtd->dai_link->dpcm_capture)
|
else if (rtd->dai_link->dpcm_capture)
|
||||||
be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
|
be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
|
||||||
memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
|
memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
|
||||||
} else
|
} else {
|
||||||
|
snprintf(new_name, sizeof(new_name), "%s %s-%d",
|
||||||
|
rtd->dai_link->stream_name, codec_dai->name, num);
|
||||||
|
|
||||||
memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops));
|
memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops));
|
||||||
|
}
|
||||||
|
|
||||||
/* Add copy callback for not memory mapped DSPs */
|
/* Add copy callback for not memory mapped DSPs */
|
||||||
if (platform->driver->compr_ops && platform->driver->compr_ops->copy)
|
if (platform->driver->compr_ops && platform->driver->compr_ops->copy)
|
||||||
compr->ops->copy = soc_compr_copy;
|
compr->ops->copy = soc_compr_copy;
|
||||||
|
|
||||||
mutex_init(&compr->lock);
|
mutex_init(&compr->lock);
|
||||||
|
|
||||||
snprintf(new_name, sizeof(new_name), "%s %s-%d",
|
|
||||||
rtd->dai_link->stream_name,
|
|
||||||
rtd->codec_dai->name, num);
|
|
||||||
|
|
||||||
ret = snd_compress_new(rtd->card->snd_card, num, direction,
|
ret = snd_compress_new(rtd->card->snd_card, num, direction,
|
||||||
new_name, compr);
|
new_name, compr);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Reference in a new issue