Example #1
0
static int sta32x_cache_sync(struct snd_soc_codec *codec)
{
	struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec);
	unsigned int mute;
	int rc;

	/* mute during register sync */
	mute = snd_soc_read(codec, STA32X_MMUTE);
	snd_soc_write(codec, STA32X_MMUTE, mute | STA32X_MMUTE_MMUTE);
	sta32x_sync_coef_shadow(codec);
	rc = regcache_sync(sta32x->regmap);
	snd_soc_write(codec, STA32X_MMUTE, mute);
	return rc;
}
static int sta32x_cache_sync(struct snd_soc_codec *codec)
{
	unsigned int mute;
	int rc;

	if (!codec->cache_sync)
		return 0;

	/* mute during register sync */
	mute = snd_soc_read(codec, STA32X_MMUTE);
	snd_soc_write(codec, STA32X_MMUTE, mute | STA32X_MMUTE_MMUTE);
	sta32x_sync_coef_shadow(codec);
	rc = snd_soc_cache_sync(codec);
	snd_soc_write(codec, STA32X_MMUTE, mute);
	return rc;
}