[alsa-devel] [PATCH 3/3] ASoC: codecs: adau1701: add support for pin muxing

Daniel Mack zonque at gmail.com
Fri Jun 21 09:28:13 CEST 2013


On 21.06.2013 09:24, Lars-Peter Clausen wrote:
> On 06/20/2013 07:29 PM, Daniel Mack wrote:
>> [...]
>>  static int adau1701_probe(struct snd_soc_codec *codec)
>>  {
>> -	int ret;
>> +	int ret, i;
>> +	unsigned int val;
>>  	struct i2c_client *client = to_i2c_client(codec->dev);
>>  	struct adau1701 *adau1701 = snd_soc_codec_get_drvdata(codec);
>>  
>> @@ -576,6 +584,19 @@ static int adau1701_probe(struct snd_soc_codec *codec)
>>  	regmap_write(adau1701->regmap, ADAU1701_DACSET, ADAU1701_DACSET_DACINIT);
>>  	regmap_write(adau1701->regmap, ADAU1701_DSPCTRL, ADAU1701_DSPCTRL_CR);
>>  
>> +	/* set up pin config */
>> +	val = 0;
>> +	for (i = 0; i < 6; i++)
>> +		val |= adau1701->pin_config[i] << (i * 4);
>> +
>> +	regmap_write(adau1701->regmap, ADAU1701_PINCONF_0, val);
>> +
>> +	val = 0;
>> +	for (i = 0; i < 6; i++)
>> +		val |= adau1701->pin_config[i + 6] << (i * 4);
>> +
>> +	regmap_write(adau1701->regmap, ADAU1701_PINCONF_1, val);
> 
> Will the config survive a reset?
> 

That will be synced back via regcache_sync(), no?



More information about the Alsa-devel mailing list