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

Lars-Peter Clausen lars at metafoo.de
Fri Jun 21 09:38:36 CEST 2013


On 06/21/2013 09:35 AM, Lars-Peter Clausen wrote:
> On 06/21/2013 09:28 AM, Daniel Mack wrote:
>> 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?
>>
> Oh, sorry I missed the regcache_sync(), but you still need to call
> regcache_mark_dirty() first, otherwise regcache_sync() won't do anything.

wait... the regcache_sync() is only in adau1761_probe(), but not in
adau1761_reset().


More information about the Alsa-devel mailing list