From 60d2a5129d3b55fc55ab7d591a7cb947d7aa52bd Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Sat, 25 Jul 2020 05:22:34 +0100 Subject: [PATCH] Adjust for v5.7, "ASoC: soc-pcm: merge playback/cature_active into stream_active" perl -pi -e 's(->capture_active)(->stream_active\[SNDRV_PCM_STREAM_CAPTURE\])g' *.c perl -pi -e 's(->playback_active)(->stream_active\[SNDRV_PCM_STREAM_PLAYBACK\])g' *.c commit 0f6011fd79a2fb92cb80177fd6bdc8aac3a3cd93 Author: Kuninori Morimoto Date: Mon Feb 17 17:28:15 2020 +0900 ASoC: soc-pcm: merge playback/cature_active into stream_active DAI has playback_active and capture_active to care usage count. OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE. But because of this kind of implementation mismatch, ALSA SoC has many verbose code. To solve this issue, this patch merge playback_active/capture_active into stream_active[2]; --- ac101.c | 4 ++-- ac108.c | 6 +++--- seeed-voicecard.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ac101.c b/ac101.c index a4bcd62..26aa9e3 100644 --- a/ac101.c +++ b/ac101.c @@ -955,7 +955,7 @@ void ac101_aif_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai AC101_DBG("stream = %s, play: %d, capt: %d, active: %d\n", snd_pcm_stream_str(substream), - codec_dai->playback_active, codec_dai->capture_active, + codec_dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK], codec_dai->stream_active[SNDRV_PCM_STREAM_CAPTURE], codec_dai->active); if (!codec_dai->active) { @@ -1080,7 +1080,7 @@ int ac101_hw_params(struct snd_pcm_substream *substream, freq_out = _FREQ_24_576K; for (i = 0; i < ARRAY_SIZE(codec_aif1_fs); i++) { if (codec_aif1_fs[i].samp_rate == params_rate(params)) { - if (codec_dai->capture_active && dmic_used && codec_aif1_fs[i].samp_rate == 44100) { + if (codec_dai->stream_active[SNDRV_PCM_STREAM_CAPTURE] && dmic_used && codec_aif1_fs[i].samp_rate == 44100) { ac101_update_bits(codec, AIF_SR_CTRL, (0xf<dev, "%s() stream=%s play:%d capt:%d +++\n", __func__, snd_pcm_stream_str(substream), - dai->playback_active, dai->capture_active); + dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK], dai->stream_active[SNDRV_PCM_STREAM_CAPTURE]); if (ac10x->i2c101) { ret = ac101_hw_params(substream, params, dai); @@ -664,8 +664,8 @@ static int ac108_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_h } } - if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE && dai->playback_active) - || (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && dai->capture_active)) { + if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE && dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK]) + || (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && dai->stream_active[SNDRV_PCM_STREAM_CAPTURE])) { /* not configure hw_param twice */ /* return 0; */ } diff --git a/seeed-voicecard.c b/seeed-voicecard.c index 82e8893..e6508f5 100644 --- a/seeed-voicecard.c +++ b/seeed-voicecard.c @@ -202,7 +202,7 @@ static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd dev_dbg(rtd->card->dev, "%s() stream=%s cmd=%d play:%d, capt:%d\n", __FUNCTION__, snd_pcm_stream_str(substream), cmd, - dai->playback_active, dai->capture_active); + dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK], dai->stream_active[SNDRV_PCM_STREAM_CAPTURE]); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -224,7 +224,7 @@ static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* capture channel resync, if overrun */ - if (dai->capture_active && substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (dai->stream_active[SNDRV_PCM_STREAM_CAPTURE] && substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { break; }