summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2019-09-06 08:55:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:09:55 +0200
commit064fba888e77859b48189c11f2c9673e10c25b7e (patch)
treee3cf651a29ddccdcc7c42617a3f3fcf6071485b8 /sound
parent476eda2539bb05c126d28d02383b15ca91c60e1e (diff)
downloadlinux-stable-064fba888e77859b48189c11f2c9673e10c25b7e.tar.gz
linux-stable-064fba888e77859b48189c11f2c9673e10c25b7e.tar.bz2
linux-stable-064fba888e77859b48189c11f2c9673e10c25b7e.zip
ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set
[ Upstream commit 2ec42f3147e1610716f184b02e65d7f493eed925 ] Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for other purposes. Currently it is left empty with the dmaengine-pcm, in this case copy the pcm->id string as pcm->name. For example IGT is using this to find the HDMI PCM for testing audio on it. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reported-by: Arthur She <arthur.she@linaro.org> Link: https://lore.kernel.org/r/20190906055524.7393-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-generic-dmaengine-pcm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 30e791a53352..232df04ca586 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -313,6 +313,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i]))
pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE;
+
+ if (rtd->pcm->streams[i].pcm->name[0] == '\0') {
+ strncpy(rtd->pcm->streams[i].pcm->name,
+ rtd->pcm->streams[i].pcm->id,
+ sizeof(rtd->pcm->streams[i].pcm->name));
+ }
}
return 0;