diff mbox series

[079/113] ASoC: codecs: ak46xx: use snd_pcm_is_playback/capture()

Message ID 87y15bx0kp.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series [001/113] ALSA: add snd_pcm_is_playback/capture() macro | expand

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:41 a.m. UTC
We can use snd_pcm_is_playback/capture(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/ak4613.c | 4 ++--
 sound/soc/codecs/ak4619.c | 2 +-
 sound/soc/codecs/ak4641.c | 2 +-
 sound/soc/codecs/ak4642.c | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
index de9e431855559..3d73c659545d1 100644
--- a/sound/soc/codecs/ak4613.c
+++ b/sound/soc/codecs/ak4613.c
@@ -434,7 +434,7 @@  static void ak4613_hw_constraints(struct ak4613_priv *priv,
 	unsigned int mask;
 	unsigned int mode;
 	unsigned int fs;
-	int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+	int is_play = snd_pcm_is_playback(substream);
 	int sdti_num;
 	int i;
 
@@ -739,7 +739,7 @@  static int ak4613_dai_trigger(struct snd_pcm_substream *substream, int cmd,
 	    (cmd != SNDRV_PCM_TRIGGER_RESUME))
 		return 0;
 
-	if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+	if (!snd_pcm_is_playback(substream))
 		return  0;
 
 	priv->component = component;
diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c
index 8f2442482f725..1d63e5c447e1b 100644
--- a/sound/soc/codecs/ak4619.c
+++ b/sound/soc/codecs/ak4619.c
@@ -538,7 +538,7 @@  static int ak4619_dai_hw_params(struct snd_pcm_substream *substream,
 	unsigned int width;
 	unsigned int rate;
 	unsigned int fs;
-	bool is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+	bool is_play = snd_pcm_is_playback(substream);
 	u8 dai_ctrl = 0;
 	u8 clk_mode = 0;
 
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
index ec33e7d73c6c2..179d391083c57 100644
--- a/sound/soc/codecs/ak4641.c
+++ b/sound/soc/codecs/ak4641.c
@@ -344,7 +344,7 @@  static int ak4641_i2s_hw_params(struct snd_pcm_substream *substream,
 	snd_soc_component_update_bits(component, AK4641_MODE2, (0x3 << 5), mode2);
 
 	/* Update de-emphasis filter for the new rate */
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		ak4641->playback_fs = rate;
 		ak4641_set_deemph(component);
 	}
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index fe035d2fc9131..9cf3bc9387b13 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -277,7 +277,7 @@  static const struct reg_default ak4648_reg[] = {
 static int ak4642_dai_startup(struct snd_pcm_substream *substream,
 			      struct snd_soc_dai *dai)
 {
-	int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+	int is_play = snd_pcm_is_playback(substream);
 	struct snd_soc_component *component = dai->component;
 
 	if (is_play) {
@@ -320,7 +320,7 @@  static int ak4642_dai_startup(struct snd_pcm_substream *substream,
 static void ak4642_dai_shutdown(struct snd_pcm_substream *substream,
 			       struct snd_soc_dai *dai)
 {
-	int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+	int is_play = snd_pcm_is_playback(substream);
 	struct snd_soc_component *component = dai->component;
 
 	if (is_play) {