diff mbox series

[080/113] ASoC: codecs: jz47xx: use snd_pcm_is_playback/capture()

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

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:42 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/jz4725b.c | 2 +-
 sound/soc/codecs/jz4760.c  | 8 ++++----
 sound/soc/codecs/jz4770.c  | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c
index 39cebaa167beb..7add57e5c4bac 100644
--- a/sound/soc/codecs/jz4725b.c
+++ b/sound/soc/codecs/jz4725b.c
@@ -476,7 +476,7 @@  static int jz4725b_codec_hw_params(struct snd_pcm_substream *substream,
 	if (rate == ARRAY_SIZE(jz4725b_codec_sample_rates))
 		return -EINVAL;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		regmap_update_bits(icdc->regmap,
 				   JZ4725B_CODEC_REG_CR2,
 				   REG_CR2_DAC_ADWL_MASK,
diff --git a/sound/soc/codecs/jz4760.c b/sound/soc/codecs/jz4760.c
index 6217e611259fe..f39bb0dc93e02 100644
--- a/sound/soc/codecs/jz4760.c
+++ b/sound/soc/codecs/jz4760.c
@@ -205,7 +205,7 @@  static int jz4760_codec_startup(struct snd_pcm_substream *substream,
 	 * DMA transfer going during playback when all audible outputs have
 	 * been disabled.
 	 */
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		ret = snd_soc_dapm_force_enable_pin(dapm, "SYSCLK");
 	return ret;
 }
@@ -216,7 +216,7 @@  static void jz4760_codec_shutdown(struct snd_pcm_substream *substream,
 	struct snd_soc_component *codec = dai->component;
 	struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec);
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		snd_soc_dapm_disable_pin(dapm, "SYSCLK");
 }
 
@@ -231,7 +231,7 @@  static int jz4760_codec_pcm_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+		if (!snd_pcm_is_playback(substream))
 			snd_soc_component_force_bias_level(codec, SND_SOC_BIAS_ON);
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
@@ -693,7 +693,7 @@  static int jz4760_codec_hw_params(struct snd_pcm_substream *substream,
 	if (rate == ARRAY_SIZE(jz4760_codec_sample_rates))
 		return -EINVAL;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_AICR,
 				   REG_AICR_DAC_ADWL_MASK,
 				   FIELD_PREP(REG_AICR_DAC_ADWL_MASK, bit_width));
diff --git a/sound/soc/codecs/jz4770.c b/sound/soc/codecs/jz4770.c
index acb9eaa7ea1c5..740b4e926c76c 100644
--- a/sound/soc/codecs/jz4770.c
+++ b/sound/soc/codecs/jz4770.c
@@ -224,7 +224,7 @@  static int jz4770_codec_startup(struct snd_pcm_substream *substream,
 	 * DMA transfer going during playback when all audible outputs have
 	 * been disabled.
 	 */
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		snd_soc_dapm_force_enable_pin(dapm, "SYSCLK");
 
 	return 0;
@@ -236,7 +236,7 @@  static void jz4770_codec_shutdown(struct snd_pcm_substream *substream,
 	struct snd_soc_component *codec = dai->component;
 	struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec);
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		snd_soc_dapm_disable_pin(dapm, "SYSCLK");
 }
 
@@ -251,7 +251,7 @@  static int jz4770_codec_pcm_trigger(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+		if (!snd_pcm_is_playback(substream))
 			snd_soc_component_force_bias_level(codec,
 							   SND_SOC_BIAS_ON);
 		break;
@@ -730,7 +730,7 @@  static int jz4770_codec_hw_params(struct snd_pcm_substream *substream,
 	if (rate == ARRAY_SIZE(jz4770_codec_sample_rates))
 		return -EINVAL;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		regmap_update_bits(codec->regmap, JZ4770_CODEC_REG_AICR_DAC,
 				   REG_AICR_DAC_ADWL_MASK,
 				   bit_width << REG_AICR_DAC_ADWL_OFFSET);