Commit f9ae17ba authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown

ASoC: ak4613: Implement suspend callback

Add the suspend callback to accompany the existing resume operation.
With the suspend/resume callbacks the regmap (regcache) state handling
can follow the recommended sequence.

Based on commit a2ebd586 ("ASoC: ak4642: Implement suspend
callback") by Peter Ujfalusi <peter.ujfalusi@ti.com>.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent dcd2d1f7
...@@ -437,15 +437,25 @@ static struct snd_soc_dai_driver ak4613_dai = { ...@@ -437,15 +437,25 @@ static struct snd_soc_dai_driver ak4613_dai = {
.symmetric_rates = 1, .symmetric_rates = 1,
}; };
static int ak4613_resume(struct snd_soc_codec *codec) static int ak4613_suspend(struct snd_soc_codec *codec)
{ {
struct regmap *regmap = dev_get_regmap(codec->dev, NULL); struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
regcache_cache_only(regmap, true);
regcache_mark_dirty(regmap); regcache_mark_dirty(regmap);
return 0;
}
static int ak4613_resume(struct snd_soc_codec *codec)
{
struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
regcache_cache_only(regmap, false);
return regcache_sync(regmap); return regcache_sync(regmap);
} }
static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { static struct snd_soc_codec_driver soc_codec_dev_ak4613 = {
.suspend = ak4613_suspend,
.resume = ak4613_resume, .resume = ak4613_resume,
.set_bias_level = ak4613_set_bias_level, .set_bias_level = ak4613_set_bias_level,
.controls = ak4613_snd_controls, .controls = ak4613_snd_controls,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment