@@ -182,7 +182,7 @@ static int tegra20_ac97_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
case SNDRV_PCM_TRIGGER_RESUME:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
tegra20_ac97_start_playback(ac97);
else
tegra20_ac97_start_capture(ac97);
@@ -190,7 +190,7 @@ static int tegra20_ac97_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
tegra20_ac97_stop_playback(ac97);
else
tegra20_ac97_stop_capture(ac97);
@@ -232,7 +232,7 @@ static int tegra20_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
case SNDRV_PCM_TRIGGER_RESUME:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
tegra20_i2s_start_playback(i2s);
else
tegra20_i2s_start_capture(i2s);
@@ -240,7 +240,7 @@ static int tegra20_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
tegra20_i2s_stop_playback(i2s);
else
tegra20_i2s_stop_capture(i2s);
@@ -299,7 +299,7 @@ static int tegra_admaif_hw_params(struct snd_pcm_substream *substream,
cif_conf.client_ch = channels;
cif_conf.audio_ch = channels;
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_substream_is_playback(substream)) {
path = ADMAIF_TX_PATH;
reg = CH_TX_REG(TEGRA_ADMAIF_CH_ACIF_TX_CTRL, dai->id);
} else {
@@ -673,12 +673,12 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream,
srate = params_rate(params);
/* For playback I2S RX-CIF and for capture TX-CIF is used */
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
path = I2S_RX_PATH;
else
path = I2S_TX_PATH;
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_substream_is_playback(substream)) {
unsigned int max_th;
/* FIFO threshold in terms of frames */
@@ -188,7 +188,7 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
cif_conf.truncate = 0;
cif_conf.mono_conv = 0;
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_substream_is_playback(substream)) {
cif_conf.direction = TEGRA30_AUDIOCIF_DIRECTION_RX;
reg = TEGRA30_I2S_CIF_RX_CTRL;
} else {
@@ -244,7 +244,7 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
case SNDRV_PCM_TRIGGER_RESUME:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
tegra30_i2s_start_playback(i2s);
else
tegra30_i2s_start_capture(i2s);
@@ -252,7 +252,7 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_substream_is_playback(substream))
tegra30_i2s_stop_playback(i2s);
else
tegra30_i2s_stop_capture(i2s);
@@ -164,7 +164,7 @@ int tegra_pcm_hw_params(struct snd_soc_component *component,
return ret;
}
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_substream_is_playback(substream)) {
slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
slave_config.dst_addr = dmap->addr;
slave_config.dst_maxburst = 8;
We can use snd_[sub]stream_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- sound/soc/tegra/tegra20_ac97.c | 4 ++-- sound/soc/tegra/tegra20_i2s.c | 4 ++-- sound/soc/tegra/tegra210_admaif.c | 2 +- sound/soc/tegra/tegra210_i2s.c | 4 ++-- sound/soc/tegra/tegra30_i2s.c | 6 +++--- sound/soc/tegra/tegra_pcm.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-)