@@ -198,7 +198,7 @@ static unsigned int hda_calc_stream_format(struct snd_sof_dev *sdev,
unsigned int format_val;
unsigned int bits;
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(substream))
link_bps = codec_dai->driver->playback.sig_bits;
else
link_bps = codec_dai->driver->capture.sig_bits;
@@ -123,7 +123,7 @@ int hda_link_dma_cleanup(struct snd_pcm_substream *substream, struct hdac_ext_st
if (!hlink)
return -EINVAL;
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_pcm_is_playback(substream)) {
stream_tag = hdac_stream(hext_stream)->stream_tag;
snd_hdac_ext_bus_link_clear_stream_id(hlink, stream_tag);
}
@@ -174,7 +174,7 @@ static int hda_link_dma_hw_params(struct snd_pcm_substream *substream,
hstream = &hext_stream->hstream;
stream_tag = hstream->stream_tag;
- if (hext_stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(hext_stream->hstream.direction))
snd_hdac_ext_bus_link_set_stream_id(hlink, stream_tag);
/* set the hdac_stream in the codec dai */
@@ -542,7 +542,7 @@ static bool hda_dsp_d0i3_streaming_applicable(struct snd_sof_dev *sdev)
if (!spcm->stream[dir].d0i3_compatible)
return false;
- if (dir == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(dir))
playback_active = true;
}
}
@@ -262,7 +262,7 @@ int hda_cl_cleanup(struct device *dev, struct snd_dma_buffer *dmab,
int sd_offset = SOF_STREAM_SD_OFFSET(hstream);
int ret = 0;
- if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(hstream->direction))
ret = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_DISABLE, 0);
else
snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset,
@@ -237,11 +237,11 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
* All playback streams are DMI L1 capable, capture streams need
* pause push/release to be disabled
*/
- if (hda_always_enable_dmi_l1 && direction == SNDRV_PCM_STREAM_CAPTURE)
+ if (hda_always_enable_dmi_l1 && snd_pcm_is_capture(direction))
runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
if (hda_always_enable_dmi_l1 ||
- direction == SNDRV_PCM_STREAM_PLAYBACK ||
+ snd_pcm_is_playback(direction) ||
spcm->stream[substream->stream].d0i3_compatible)
flags |= SOF_HDA_STREAM_DMI_L1_COMPATIBLE;
@@ -33,7 +33,7 @@ EXPORT_SYMBOL_NS(sof_hda_position_quirk, SND_SOC_SOF_INTEL_HDA_COMMON);
static inline const char *hda_hstream_direction_str(struct hdac_stream *hstream)
{
- if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(hstream->direction))
return "Playback";
else
return "Capture";
@@ -667,7 +667,7 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev,
SOF_HDA_CL_DMA_SD_INT_MASK);
/* read FIFO size */
- if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_pcm_is_playback(hstream->direction)) {
hstream->fifo_size =
snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR,
sd_offset +
@@ -1030,7 +1030,7 @@ snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream,
* is not accurate enough, its update may be completed
* earlier than the data written to DDR.
*/
- if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_pcm_is_playback(direction)) {
pos = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR,
AZX_REG_VS_SDXDPIB_XBASE +
(AZX_REG_VS_SDXDPIB_XINTERVAL *
We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- sound/soc/sof/intel/hda-dai-ops.c | 2 +- sound/soc/sof/intel/hda-dai.c | 4 ++-- sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/intel/hda-pcm.c | 4 ++-- sound/soc/sof/intel/hda-stream.c | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-)