All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH v2 18/21] ASoC: ti: use snd_soc_xxx_active()
Date: 14 May 2020 17:43:06 +0900	[thread overview]
Message-ID: <87lflu7vqd.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87blmq9alx.wl-kuninori.morimoto.gx@renesas.com>


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

We have snd_soc_dai/dai_stream/component_active() macro
This patch uses it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
	- adjust to latest patch-set

 sound/soc/ti/davinci-mcasp.c | 2 +-
 sound/soc/ti/omap-dmic.c     | 4 ++--
 sound/soc/ti/omap-mcbsp.c    | 4 ++--
 sound/soc/ti/omap-mcpdm.c    | 8 ++++----
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 734ffe925c4d..f3a99f016557 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -1577,7 +1577,7 @@ static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream,
 	if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
 		return;
 
-	if (!cpu_dai->active) {
+	if (!snd_soc_dai_active(cpu_dai)) {
 		mcasp->channels = 0;
 		mcasp->max_format_width = 0;
 	}
diff --git a/sound/soc/ti/omap-dmic.c b/sound/soc/ti/omap-dmic.c
index 913579c43e9d..01abf1be5d78 100644
--- a/sound/soc/ti/omap-dmic.c
+++ b/sound/soc/ti/omap-dmic.c
@@ -95,7 +95,7 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,
 
 	mutex_lock(&dmic->mutex);
 
-	if (!dai->active)
+	if (!snd_soc_dai_active(dai))
 		dmic->active = 1;
 	else
 		ret = -EBUSY;
@@ -114,7 +114,7 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream,
 
 	cpu_latency_qos_remove_request(&dmic->pm_qos_req);
 
-	if (!dai->active)
+	if (!snd_soc_dai_active(dai))
 		dmic->active = 0;
 
 	mutex_unlock(&dmic->mutex);
diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
index 0348963f4df7..a9785d4916b7 100644
--- a/sound/soc/ti/omap-mcbsp.c
+++ b/sound/soc/ti/omap-mcbsp.c
@@ -788,7 +788,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
 	struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
 	int err = 0;
 
-	if (!cpu_dai->active)
+	if (!snd_soc_dai_active(cpu_dai))
 		err = omap_mcbsp_request(mcbsp);
 
 	/*
@@ -843,7 +843,7 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream,
 
 	mcbsp->latency[stream1] = 0;
 
-	if (!cpu_dai->active) {
+	if (!snd_soc_dai_active(cpu_dai)) {
 		omap_mcbsp_free(mcbsp);
 		mcbsp->configured = 0;
 	}
diff --git a/sound/soc/ti/omap-mcpdm.c b/sound/soc/ti/omap-mcpdm.c
index f2dbadea33bb..d482b62f314a 100644
--- a/sound/soc/ti/omap-mcpdm.c
+++ b/sound/soc/ti/omap-mcpdm.c
@@ -253,7 +253,7 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
 
 	mutex_lock(&mcpdm->mutex);
 
-	if (!dai->active)
+	if (!snd_soc_dai_active(dai))
 		omap_mcpdm_open_streams(mcpdm);
 
 	mutex_unlock(&mcpdm->mutex);
@@ -271,7 +271,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream,
 
 	mutex_lock(&mcpdm->mutex);
 
-	if (!dai->active) {
+	if (!snd_soc_dai_active(dai)) {
 		if (omap_mcpdm_active(mcpdm)) {
 			omap_mcpdm_stop(mcpdm);
 			omap_mcpdm_close_streams(mcpdm);
@@ -462,7 +462,7 @@ static int omap_mcpdm_suspend(struct snd_soc_component *component)
 {
 	struct omap_mcpdm *mcpdm = snd_soc_component_get_drvdata(component);
 
-	if (component->active) {
+	if (snd_soc_component_active(component)) {
 		omap_mcpdm_stop(mcpdm);
 		omap_mcpdm_close_streams(mcpdm);
 	}
@@ -484,7 +484,7 @@ static int omap_mcpdm_resume(struct snd_soc_component *component)
 		while (mcpdm->pm_active_count--)
 			pm_runtime_get_sync(mcpdm->dev);
 
-		if (component->active) {
+		if (snd_soc_component_active(component)) {
 			omap_mcpdm_open_streams(mcpdm);
 			omap_mcpdm_start(mcpdm);
 		}
-- 
2.17.1


  parent reply	other threads:[~2020-05-14  8:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14  8:36 [PATCH v2 00/21] ASoC: cleanup DAI/Component activity Kuninori Morimoto
2020-05-14  8:37 ` [PATCH v2 01/21] ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro Kuninori Morimoto
2020-05-14 10:41   ` Mark Brown
2020-05-14 23:35     ` Kuninori Morimoto
2020-05-14  8:37 ` [PATCH v2 02/21] ASoC: soc-dai: add snd_soc_dai_action() Kuninori Morimoto
2020-05-14  8:38 ` [PATCH v2 03/21] ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate() Kuninori Morimoto
2020-05-14  8:39 ` [PATCH v2 04/21] ASoC: soc-dai: add snd_soc_dai_active() Kuninori Morimoto
2020-05-14  8:39 ` [PATCH v2 05/21] ASoC: soc-component: add snd_soc_component_active() Kuninori Morimoto
2020-05-14  8:40 ` [PATCH v2 06/21] ASoC: soc-dai: add snd_soc_dai_stream_active() Kuninori Morimoto
2020-05-14  8:40 ` [PATCH v2 07/21] ASoC: use snd_soc_xxx_active() Kuninori Morimoto
2020-05-14  8:41 ` [PATCH v2 08/21] ASoC: atomel: " Kuninori Morimoto
2020-05-14  8:41 ` [PATCH v2 09/21] ASoC: bcm: " Kuninori Morimoto
2020-05-14  8:41 ` [PATCH v2 10/21] ASoC: cirrus: " Kuninori Morimoto
2020-05-14  8:41 ` [PATCH v2 11/21] ASoC: codecs: " Kuninori Morimoto
2020-05-14  8:42 ` [PATCH v2 12/21] ASoC: fsl: " Kuninori Morimoto
2020-05-14  8:42 ` [PATCH v2 13/21] ASoC: intel: " Kuninori Morimoto
2020-05-14  8:42 ` [PATCH v2 14/21] ASoC: jz4740: " Kuninori Morimoto
2020-05-14  8:42 ` [PATCH v2 15/21] ASoC: mediatek: " Kuninori Morimoto
2020-05-14  8:42 ` [PATCH v2 16/21] ASoC: meson: " Kuninori Morimoto
2020-05-14  8:42 ` [PATCH v2 17/21] ASoC: pxa: " Kuninori Morimoto
2020-05-14  8:43 ` Kuninori Morimoto [this message]
2020-05-14  9:08   ` [PATCH v2 18/21] ASoC: ti: " Peter Ujfalusi
2020-05-14  8:43 ` [PATCH v2 19/21] ASoC: uniphier: " Kuninori Morimoto
2020-05-14  8:43 ` [PATCH v2 20/21] ASoC: dwc: " Kuninori Morimoto
2020-05-14  8:43 ` [PATCH v2 21/21] ASoC: cleanup dai / component active code Kuninori Morimoto
2020-05-14 17:26 ` [PATCH v2 00/21] ASoC: cleanup DAI/Component activity Ranjani Sridharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lflu7vqd.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.