diff mbox series

[03/17] ASoC: soc-dai: add snd_soc_component_activity()

Message ID 871rnr9fq5.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series ASoC: cleanup DAI/Component activity | expand

Commit Message

Kuninori Morimoto May 11, 2020, 5:56 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc-component.h | 1 +
 sound/soc/soc-pcm.c           | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Pierre-Louis Bossart May 11, 2020, 7:07 p.m. UTC | #1
On 5/11/20 12:56 AM, Kuninori Morimoto wrote:
> 
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>   include/sound/soc-component.h | 1 +
>   sound/soc/soc-pcm.c           | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
> index 864983b09846..29b0c2c1d2db 100644
> --- a/include/sound/soc-component.h
> +++ b/include/sound/soc-component.h
> @@ -358,6 +358,7 @@ int snd_soc_component_stream_event(struct snd_soc_component *component,
>   				   int event);
>   int snd_soc_component_set_bias_level(struct snd_soc_component *component,
>   				     enum snd_soc_bias_level level);
> +#define snd_soc_component_activity(component)	((component)->active)

this patch would need to be added as patch2, before 
snd_soc_component_activity() is used to avoid breaking bisection

>   
>   #ifdef CONFIG_REGMAP
>   void snd_soc_component_init_regmap(struct snd_soc_component *component,
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index e923e3746fec..420595356111 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -267,7 +267,7 @@ static void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
>   	for_each_rtd_dais(rtd, i, dai) {
>   		dai->stream_active[stream] += action;
>   		dai->active += action;
> -		dai->component->active += action;
> +		snd_soc_component_activity(dai->component) += action;
>   	}
>   }
>   
>
Ranjani Sridharan May 11, 2020, 10:47 p.m. UTC | #2
On Mon, 2020-05-11 at 14:56 +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  include/sound/soc-component.h | 1 +
>  sound/soc/soc-pcm.c           | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/sound/soc-component.h b/include/sound/soc-
> component.h
> index 864983b09846..29b0c2c1d2db 100644
> --- a/include/sound/soc-component.h
> +++ b/include/sound/soc-component.h
> @@ -358,6 +358,7 @@ int snd_soc_component_stream_event(struct
> snd_soc_component *component,
>  				   int event);
>  int snd_soc_component_set_bias_level(struct snd_soc_component
> *component,
>  				     enum snd_soc_bias_level level);
> +#define snd_soc_component_activity(component)	((component)-
> >active)
>  
>  #ifdef CONFIG_REGMAP
>  void snd_soc_component_init_regmap(struct snd_soc_component
> *component,
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index e923e3746fec..420595356111 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -267,7 +267,7 @@ static void snd_soc_runtime_action(struct
> snd_soc_pcm_runtime *rtd,
>  	for_each_rtd_dais(rtd, i, dai) {
>  		dai->stream_active[stream] += action;
>  		dai->active += action;
> -		dai->component->active += action;
> +		snd_soc_component_activity(dai->component) += action;

This is not very easy to comprehend. Maybe we could introduce another
macro for updating the usage count for the component and use that
instead? something like, snd_soc_component_update_usage_count(dai-
>component, action)?
Thanks,
Ranjani
diff mbox series

Patch

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 864983b09846..29b0c2c1d2db 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -358,6 +358,7 @@  int snd_soc_component_stream_event(struct snd_soc_component *component,
 				   int event);
 int snd_soc_component_set_bias_level(struct snd_soc_component *component,
 				     enum snd_soc_bias_level level);
+#define snd_soc_component_activity(component)	((component)->active)
 
 #ifdef CONFIG_REGMAP
 void snd_soc_component_init_regmap(struct snd_soc_component *component,
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index e923e3746fec..420595356111 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -267,7 +267,7 @@  static void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
 	for_each_rtd_dais(rtd, i, dai) {
 		dai->stream_active[stream] += action;
 		dai->active += action;
-		dai->component->active += action;
+		snd_soc_component_activity(dai->component) += action;
 	}
 }