[alsa-devel] [PATCH] ASoC: dapm - Refactor widget IO functions in preparation for platform widgets.

Takashi Iwai tiwai at suse.de
Fri Jun 10 14:11:10 CEST 2011


At Thu, 9 Jun 2011 19:10:49 +0100,
Liam Girdwood wrote:
> 
> Currently widget IO is tightly coupled to the CODEC drivers. Future platform DSP
> devices have mixer components that can alter power usage and hence require full
> DAPM support.
> 
> This provides a generic widget IO operation wrapper in preparation for
> future patches that implement platform driver DAPM.
> 
> Signed-off-by: Liam Girdwood <lrg at ti.com>
> ---
>  sound/soc/soc-dapm.c |   55 ++++++++++++++++++++++++++++++++++++++++++++-----
>  1 files changed, 49 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index 34106bc..7b7af9f 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -124,6 +124,49 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
>  	return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL);
>  }
>  
> +static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg)
> +{
> +	if (w->codec)
> +		return snd_soc_read(w->codec, reg);
> +	return 0;
> +}
> +
> +static int soc_widget_write(struct snd_soc_dapm_widget *w,int reg, int val)

Missing space after comma.

> +{
> +	if (w->codec)
> +		return snd_soc_write(w->codec, reg, val);
> +	return 0;
> +}
> +
> +int soc_widget_update_bits(struct snd_soc_dapm_widget *w, unsigned short reg,
> +				unsigned int mask, unsigned int value)

Do you want to expose this and soc_widget_test_bits()?
Or just forgotten static?


Takashi


More information about the Alsa-devel mailing list