mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 a2ebd58627 ("ASoC: ak4642: Implement suspend
callback") by Peter Ujfalusi <[email protected]>.
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
dcd2d1f786
commit
f9ae17ba97
1 changed files with 11 additions and 1 deletions
|
|
@ -437,15 +437,25 @@ static struct snd_soc_dai_driver ak4613_dai = {
|
|||
.symmetric_rates = 1,
|
||||
};
|
||||
|
||||
static int ak4613_suspend(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
|
||||
|
||||
regcache_cache_only(regmap, true);
|
||||
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_mark_dirty(regmap);
|
||||
regcache_cache_only(regmap, false);
|
||||
return regcache_sync(regmap);
|
||||
}
|
||||
|
||||
static struct snd_soc_codec_driver soc_codec_dev_ak4613 = {
|
||||
.suspend = ak4613_suspend,
|
||||
.resume = ak4613_resume,
|
||||
.set_bias_level = ak4613_set_bias_level,
|
||||
.controls = ak4613_snd_controls,
|
||||
|
|
|
|||
Loading…
Reference in a new issue