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

Liam Girdwood lrg at ti.com
Fri Jun 10 16:44:30 CEST 2011


On 10/06/11 13:11, Takashi Iwai wrote:
> 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.

Thanks, didn't see that.

> 
>> +{
>> +	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?
> 

The original intention was that they may have been used by the ABE but this seems unlikely now.

I'll make them static for V2 and remove test_bits since it's not used.

Liam



More information about the Alsa-devel mailing list