@@ -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,
@@ -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));
@@ -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);
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(-)