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

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Tue May 12 00:47:48 CEST 2020


On Mon, 2020-05-11 at 14:56 +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at 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



More information about the Alsa-devel mailing list