ASoC: sta32x: Write the register default value to cache for reserved registers
Chip documentation explicitly requires that the reset values of reserved register bits are left untouched. codec->hw_read is broken now. Here we use below trick to avoid writing to reserved registers while resume. Write the register default value to cache for reserved registers, so the write to the these registers are suppressed by the cache restore code when it skips writes of default registers. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
f0bbc2b55f
commit
edf413f689
|
@ -756,21 +756,19 @@ static int sta32x_probe(struct snd_soc_codec *codec)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* preserve reset values of reserved register bits */
|
/* Chip documentation explicitly requires that the reset values
|
||||||
snd_soc_cache_write(codec, STA32X_CONFC,
|
* of reserved register bits are left untouched.
|
||||||
codec->hw_read(codec, STA32X_CONFC));
|
* Write the register default value to cache for reserved registers,
|
||||||
snd_soc_cache_write(codec, STA32X_CONFE,
|
* so the write to the these registers are suppressed by the cache
|
||||||
codec->hw_read(codec, STA32X_CONFE));
|
* restore code when it skips writes of default registers.
|
||||||
snd_soc_cache_write(codec, STA32X_CONFF,
|
*/
|
||||||
codec->hw_read(codec, STA32X_CONFF));
|
snd_soc_cache_write(codec, STA32X_CONFC, 0xc2);
|
||||||
snd_soc_cache_write(codec, STA32X_MMUTE,
|
snd_soc_cache_write(codec, STA32X_CONFE, 0xc2);
|
||||||
codec->hw_read(codec, STA32X_MMUTE));
|
snd_soc_cache_write(codec, STA32X_CONFF, 0x5c);
|
||||||
snd_soc_cache_write(codec, STA32X_AUTO1,
|
snd_soc_cache_write(codec, STA32X_MMUTE, 0x10);
|
||||||
codec->hw_read(codec, STA32X_AUTO1));
|
snd_soc_cache_write(codec, STA32X_AUTO1, 0x60);
|
||||||
snd_soc_cache_write(codec, STA32X_AUTO3,
|
snd_soc_cache_write(codec, STA32X_AUTO3, 0x00);
|
||||||
codec->hw_read(codec, STA32X_AUTO3));
|
snd_soc_cache_write(codec, STA32X_C3CFG, 0x40);
|
||||||
snd_soc_cache_write(codec, STA32X_C3CFG,
|
|
||||||
codec->hw_read(codec, STA32X_C3CFG));
|
|
||||||
|
|
||||||
/* FIXME enable thermal warning adjustment and recovery */
|
/* FIXME enable thermal warning adjustment and recovery */
|
||||||
snd_soc_update_bits(codec, STA32X_CONFA,
|
snd_soc_update_bits(codec, STA32X_CONFA,
|
||||||
|
|
Loading…
Reference in a new issue