summaryrefslogtreecommitdiff
path: root/sound/soc/tegra
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2024-07-30 02:06:03 +0000
committerMark Brown <broonie@kernel.org>2024-08-01 14:54:52 +0100
commitd6db65bc62fd19915a9926e08b9cbcfbadd64291 (patch)
treeadadaf0512c48f7a1d0618e48f1f896744b8af9d /sound/soc/tegra
parent8156921e620827319460e8daa9831d731b0d75fd (diff)
ASoC: tegra: use snd_pcm_direction_name()
We already have snd_pcm_direction_name(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87ikwnk510.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r--sound/soc/tegra/tegra210_i2s.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/tegra/tegra210_i2s.c b/sound/soc/tegra/tegra210_i2s.c
index fe4fde844d86..e93ceb7afb4c 100644
--- a/sound/soc/tegra/tegra210_i2s.c
+++ b/sound/soc/tegra/tegra210_i2s.c
@@ -85,7 +85,7 @@ static int tegra210_i2s_set_clock_rate(struct device *dev,
}
static int tegra210_i2s_sw_reset(struct snd_soc_component *compnt,
- bool is_playback)
+ int stream)
{
struct device *dev = compnt->dev;
struct tegra210_i2s *i2s = dev_get_drvdata(dev);
@@ -95,7 +95,7 @@ static int tegra210_i2s_sw_reset(struct snd_soc_component *compnt,
unsigned int cif_ctrl, stream_ctrl, i2s_ctrl, val;
int err;
- if (is_playback) {
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
reset_reg = TEGRA210_I2S_RX_SOFT_RESET;
cif_reg = TEGRA210_I2S_RX_CIF_CTRL;
stream_reg = TEGRA210_I2S_RX_CTRL;
@@ -118,7 +118,7 @@ static int tegra210_i2s_sw_reset(struct snd_soc_component *compnt,
10, 10000);
if (err) {
dev_err(dev, "timeout: failed to reset I2S for %s\n",
- is_playback ? "playback" : "capture");
+ snd_pcm_direction_name(stream));
return err;
}
@@ -137,16 +137,16 @@ static int tegra210_i2s_init(struct snd_soc_dapm_widget *w,
struct device *dev = compnt->dev;
struct tegra210_i2s *i2s = dev_get_drvdata(dev);
unsigned int val, status_reg;
- bool is_playback;
+ int stream;
int err;
switch (w->reg) {
case TEGRA210_I2S_RX_ENABLE:
- is_playback = true;
+ stream = SNDRV_PCM_STREAM_PLAYBACK;
status_reg = TEGRA210_I2S_RX_STATUS;
break;
case TEGRA210_I2S_TX_ENABLE:
- is_playback = false;
+ stream = SNDRV_PCM_STREAM_CAPTURE;
status_reg = TEGRA210_I2S_TX_STATUS;
break;
default:
@@ -159,11 +159,11 @@ static int tegra210_i2s_init(struct snd_soc_dapm_widget *w,
10, 10000);
if (err) {
dev_err(dev, "timeout: previous I2S %s is still active\n",
- is_playback ? "playback" : "capture");
+ snd_pcm_direction_name(stream));
return err;
}
- return tegra210_i2s_sw_reset(compnt, is_playback);
+ return tegra210_i2s_sw_reset(compnt, stream);
}
static int __maybe_unused tegra210_i2s_runtime_suspend(struct device *dev)