Commit 36ad1a87 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: ti: use snd_soc_xxx_active()

We have snd_soc_dai/dai_stream/component_active() macro
This patch uses it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/87mu6a58i3.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent aaeb5fb5
...@@ -1577,7 +1577,7 @@ static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream, ...@@ -1577,7 +1577,7 @@ static void davinci_mcasp_shutdown(struct snd_pcm_substream *substream,
if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE) if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
return; return;
if (!cpu_dai->active) { if (!snd_soc_dai_active(cpu_dai)) {
mcasp->channels = 0; mcasp->channels = 0;
mcasp->max_format_width = 0; mcasp->max_format_width = 0;
} }
......
...@@ -95,7 +95,7 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream, ...@@ -95,7 +95,7 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,
mutex_lock(&dmic->mutex); mutex_lock(&dmic->mutex);
if (!dai->active) if (!snd_soc_dai_active(dai))
dmic->active = 1; dmic->active = 1;
else else
ret = -EBUSY; ret = -EBUSY;
...@@ -114,7 +114,7 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream, ...@@ -114,7 +114,7 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream,
cpu_latency_qos_remove_request(&dmic->pm_qos_req); cpu_latency_qos_remove_request(&dmic->pm_qos_req);
if (!dai->active) if (!snd_soc_dai_active(dai))
dmic->active = 0; dmic->active = 0;
mutex_unlock(&dmic->mutex); mutex_unlock(&dmic->mutex);
......
...@@ -786,7 +786,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream, ...@@ -786,7 +786,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
int err = 0; int err = 0;
if (!cpu_dai->active) if (!snd_soc_dai_active(cpu_dai))
err = omap_mcbsp_request(mcbsp); err = omap_mcbsp_request(mcbsp);
/* /*
...@@ -841,7 +841,7 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream, ...@@ -841,7 +841,7 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream,
mcbsp->latency[stream1] = 0; mcbsp->latency[stream1] = 0;
if (!cpu_dai->active) { if (!snd_soc_dai_active(cpu_dai)) {
omap_mcbsp_free(mcbsp); omap_mcbsp_free(mcbsp);
mcbsp->configured = 0; mcbsp->configured = 0;
} }
......
...@@ -253,7 +253,7 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream, ...@@ -253,7 +253,7 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
mutex_lock(&mcpdm->mutex); mutex_lock(&mcpdm->mutex);
if (!dai->active) if (!snd_soc_dai_active(dai))
omap_mcpdm_open_streams(mcpdm); omap_mcpdm_open_streams(mcpdm);
mutex_unlock(&mcpdm->mutex); mutex_unlock(&mcpdm->mutex);
...@@ -271,7 +271,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, ...@@ -271,7 +271,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream,
mutex_lock(&mcpdm->mutex); mutex_lock(&mcpdm->mutex);
if (!dai->active) { if (!snd_soc_dai_active(dai)) {
if (omap_mcpdm_active(mcpdm)) { if (omap_mcpdm_active(mcpdm)) {
omap_mcpdm_stop(mcpdm); omap_mcpdm_stop(mcpdm);
omap_mcpdm_close_streams(mcpdm); omap_mcpdm_close_streams(mcpdm);
...@@ -462,7 +462,7 @@ static int omap_mcpdm_suspend(struct snd_soc_component *component) ...@@ -462,7 +462,7 @@ static int omap_mcpdm_suspend(struct snd_soc_component *component)
{ {
struct omap_mcpdm *mcpdm = snd_soc_component_get_drvdata(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_stop(mcpdm);
omap_mcpdm_close_streams(mcpdm); omap_mcpdm_close_streams(mcpdm);
} }
...@@ -484,7 +484,7 @@ static int omap_mcpdm_resume(struct snd_soc_component *component) ...@@ -484,7 +484,7 @@ static int omap_mcpdm_resume(struct snd_soc_component *component)
while (mcpdm->pm_active_count--) while (mcpdm->pm_active_count--)
pm_runtime_get_sync(mcpdm->dev); pm_runtime_get_sync(mcpdm->dev);
if (component->active) { if (snd_soc_component_active(component)) {
omap_mcpdm_open_streams(mcpdm); omap_mcpdm_open_streams(mcpdm);
omap_mcpdm_start(mcpdm); omap_mcpdm_start(mcpdm);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment