Commit ebbd6703 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-pcm: use snd_pcm_direction_name()

We already have snd_pcm_direction_name(). Let's use it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h6c7k50t.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d6db65bc
...@@ -222,7 +222,7 @@ static void dpcm_create_debugfs_state(struct snd_soc_dpcm *dpcm, int stream) ...@@ -222,7 +222,7 @@ static void dpcm_create_debugfs_state(struct snd_soc_dpcm *dpcm, int stream)
char *name; char *name;
name = kasprintf(GFP_KERNEL, "%s:%s", dpcm->be->dai_link->name, name = kasprintf(GFP_KERNEL, "%s:%s", dpcm->be->dai_link->name,
stream ? "capture" : "playback"); snd_pcm_direction_name(stream));
if (name) { if (name) {
dpcm->debugfs_state = debugfs_create_dir( dpcm->debugfs_state = debugfs_create_dir(
name, dpcm->fe->debugfs_dpcm_root); name, dpcm->fe->debugfs_dpcm_root);
...@@ -1278,7 +1278,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe, ...@@ -1278,7 +1278,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe,
snd_soc_dpcm_stream_unlock_irq(fe, stream); snd_soc_dpcm_stream_unlock_irq(fe, stream);
dev_dbg(fe->dev, "connected new DPCM %s path %s %s %s\n", dev_dbg(fe->dev, "connected new DPCM %s path %s %s %s\n",
stream ? "capture" : "playback", fe->dai_link->name, snd_pcm_direction_name(stream), fe->dai_link->name,
stream ? "<-" : "->", be->dai_link->name); stream ? "<-" : "->", be->dai_link->name);
dpcm_create_debugfs_state(dpcm, stream); dpcm_create_debugfs_state(dpcm, stream);
...@@ -1306,7 +1306,7 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe, ...@@ -1306,7 +1306,7 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,
continue; continue;
dev_dbg(fe->dev, "reparent %s path %s %s %s\n", dev_dbg(fe->dev, "reparent %s path %s %s %s\n",
stream ? "capture" : "playback", snd_pcm_direction_name(stream),
dpcm->fe->dai_link->name, dpcm->fe->dai_link->name,
stream ? "<-" : "->", dpcm->be->dai_link->name); stream ? "<-" : "->", dpcm->be->dai_link->name);
...@@ -1327,14 +1327,14 @@ void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -1327,14 +1327,14 @@ void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
snd_soc_dpcm_stream_lock_irq(fe, stream); snd_soc_dpcm_stream_lock_irq(fe, stream);
for_each_dpcm_be_safe(fe, stream, dpcm, d) { for_each_dpcm_be_safe(fe, stream, dpcm, d) {
dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n", dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n",
stream ? "capture" : "playback", snd_pcm_direction_name(stream),
dpcm->be->dai_link->name); dpcm->be->dai_link->name);
if (dpcm->state != SND_SOC_DPCM_LINK_STATE_FREE) if (dpcm->state != SND_SOC_DPCM_LINK_STATE_FREE)
continue; continue;
dev_dbg(fe->dev, "freed DSP %s path %s %s %s\n", dev_dbg(fe->dev, "freed DSP %s path %s %s %s\n",
stream ? "capture" : "playback", fe->dai_link->name, snd_pcm_direction_name(stream), fe->dai_link->name,
stream ? "<-" : "->", dpcm->be->dai_link->name); stream ? "<-" : "->", dpcm->be->dai_link->name);
/* BEs still alive need new FE */ /* BEs still alive need new FE */
...@@ -1441,10 +1441,10 @@ int dpcm_path_get(struct snd_soc_pcm_runtime *fe, ...@@ -1441,10 +1441,10 @@ int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
if (paths > 0) if (paths > 0)
dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths, dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths,
stream ? "capture" : "playback"); snd_pcm_direction_name(stream));
else if (paths == 0) else if (paths == 0)
dev_dbg(fe->dev, "ASoC: %s no valid %s path\n", fe->dai_link->name, dev_dbg(fe->dev, "ASoC: %s no valid %s path\n", fe->dai_link->name,
stream ? "capture" : "playback"); snd_pcm_direction_name(stream));
return paths; return paths;
} }
...@@ -1487,7 +1487,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, ...@@ -1487,7 +1487,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
continue; continue;
dev_dbg(fe->dev, "ASoC: pruning %s BE %s for %s\n", dev_dbg(fe->dev, "ASoC: pruning %s BE %s for %s\n",
stream ? "capture" : "playback", snd_pcm_direction_name(stream),
dpcm->be->dai_link->name, fe->dai_link->name); dpcm->be->dai_link->name, fe->dai_link->name);
dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE); dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE);
...@@ -1605,7 +1605,7 @@ void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream, ...@@ -1605,7 +1605,7 @@ void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
if (be->dpcm[stream].users == 0) { if (be->dpcm[stream].users == 0) {
dev_err(be->dev, "ASoC: no users %s at close - state %d\n", dev_err(be->dev, "ASoC: no users %s at close - state %d\n",
stream ? "capture" : "playback", snd_pcm_direction_name(stream),
be->dpcm[stream].state); be->dpcm[stream].state);
continue; continue;
} }
...@@ -1645,7 +1645,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -1645,7 +1645,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
if (!be_substream) { if (!be_substream) {
dev_err(be->dev, "ASoC: no backend %s stream\n", dev_err(be->dev, "ASoC: no backend %s stream\n",
stream ? "capture" : "playback"); snd_pcm_direction_name(stream));
continue; continue;
} }
...@@ -1656,7 +1656,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -1656,7 +1656,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
/* first time the dpcm is open ? */ /* first time the dpcm is open ? */
if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) {
dev_err(be->dev, "ASoC: too many users %s at open %d\n", dev_err(be->dev, "ASoC: too many users %s at open %d\n",
stream ? "capture" : "playback", snd_pcm_direction_name(stream),
be->dpcm[stream].state); be->dpcm[stream].state);
continue; continue;
} }
...@@ -1669,7 +1669,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -1669,7 +1669,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
continue; continue;
dev_dbg(be->dev, "ASoC: open %s BE %s\n", dev_dbg(be->dev, "ASoC: open %s BE %s\n",
stream ? "capture" : "playback", be->dai_link->name); snd_pcm_direction_name(stream), be->dai_link->name);
be_substream->runtime = fe_substream->runtime; be_substream->runtime = fe_substream->runtime;
err = __soc_pcm_open(be, be_substream); err = __soc_pcm_open(be, be_substream);
...@@ -1677,7 +1677,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -1677,7 +1677,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
be->dpcm[stream].users--; be->dpcm[stream].users--;
if (be->dpcm[stream].users < 0) if (be->dpcm[stream].users < 0)
dev_err(be->dev, "ASoC: no users %s at unwind %d\n", dev_err(be->dev, "ASoC: no users %s at unwind %d\n",
stream ? "capture" : "playback", snd_pcm_direction_name(stream),
be->dpcm[stream].state); be->dpcm[stream].state);
be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
...@@ -2531,7 +2531,7 @@ static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -2531,7 +2531,7 @@ static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream)
int err; int err;
dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n", dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n",
stream ? "capture" : "playback", fe->dai_link->name); snd_pcm_direction_name(stream), fe->dai_link->name);
if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) { if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) {
/* call bespoke trigger - FE takes care of all BE triggers */ /* call bespoke trigger - FE takes care of all BE triggers */
...@@ -2565,7 +2565,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -2565,7 +2565,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
int ret = 0; int ret = 0;
dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n", dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n",
stream ? "capture" : "playback", fe->dai_link->name); snd_pcm_direction_name(stream), fe->dai_link->name);
/* Only start the BE if the FE is ready */ /* Only start the BE if the FE is ready */
if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_HW_FREE || if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_HW_FREE ||
......
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