diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2016-06-16 08:34:31 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-17 07:36:09 -0400 |
commit | f9ae17ba97e0fd134f7c0108c70e708313a07063 (patch) | |
tree | ea55dcc97776d6b921cb3e3d2bd85c2be03185c1 | |
parent | dcd2d1f78664fdc75eadaaf65257834e24383d01 (diff) |
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 a2ebd58627e9aa48 ("ASoC: ak4642: Implement suspend
callback") by Peter Ujfalusi <peter.ujfalusi@ti.com>.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/ak4613.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index 5013d2ba0c10..97798d250f08 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c | |||
@@ -437,15 +437,25 @@ static struct snd_soc_dai_driver ak4613_dai = { | |||
437 | .symmetric_rates = 1, | 437 | .symmetric_rates = 1, |
438 | }; | 438 | }; |
439 | 439 | ||
440 | static int ak4613_resume(struct snd_soc_codec *codec) | 440 | static int ak4613_suspend(struct snd_soc_codec *codec) |
441 | { | 441 | { |
442 | struct regmap *regmap = dev_get_regmap(codec->dev, NULL); | 442 | struct regmap *regmap = dev_get_regmap(codec->dev, NULL); |
443 | 443 | ||
444 | regcache_cache_only(regmap, true); | ||
444 | regcache_mark_dirty(regmap); | 445 | regcache_mark_dirty(regmap); |
446 | return 0; | ||
447 | } | ||
448 | |||
449 | static int ak4613_resume(struct snd_soc_codec *codec) | ||
450 | { | ||
451 | struct regmap *regmap = dev_get_regmap(codec->dev, NULL); | ||
452 | |||
453 | regcache_cache_only(regmap, false); | ||
445 | return regcache_sync(regmap); | 454 | return regcache_sync(regmap); |
446 | } | 455 | } |
447 | 456 | ||
448 | static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { | 457 | static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { |
458 | .suspend = ak4613_suspend, | ||
449 | .resume = ak4613_resume, | 459 | .resume = ak4613_resume, |
450 | .set_bias_level = ak4613_set_bias_level, | 460 | .set_bias_level = ak4613_set_bias_level, |
451 | .controls = ak4613_snd_controls, | 461 | .controls = ak4613_snd_controls, |