Skip to contentSkip to conversation

ASoC: ak4642: Implement suspend callback

PATCH In review Peter Ujfalusi 2 participants 2 messages May 31, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: ak4642: 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.

---
Hi,

Changes since v1:
- take into use the suspend callback (set the suspend in soc_codec_dev_ak4642)

Regards,
Peter

 sound/soc/codecs/ak4642.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/codecs/ak4642.c +11 -2
index 4d8b9e49e8d6..cc941d66ec3d 100644
@@ -523,15 +523,23 @@ static struct snd_soc_dai_driver ak4642_dai = {
 	.symmetric_rates = 1,
 };
 
-static int ak4642_resume(struct snd_soc_codec *codec)
+static int ak4642_suspend(struct snd_soc_codec *codec)
 {
 	struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
 
+	regcache_cache_only(regmap, true);
 	regcache_mark_dirty(regmap);
-	regcache_sync(regmap);
 	return 0;
 }
 
+static int ak4642_resume(struct snd_soc_codec *codec)
+{
+	struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
+
+	regcache_cache_only(regmap, false);
+	regcache_sync(regmap);
+	return 0;
+}
 static int ak4642_probe(struct snd_soc_codec *codec)
 {
 	struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
@@ -544,6 +552,7 @@ static int ak4642_probe(struct snd_soc_codec *codec)
 
 static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
 	.probe			= ak4642_probe,
+	.suspend		= ak4642_suspend,
 	.resume			= ak4642_resume,
 	.set_bias_level		= ak4642_set_bias_level,
 	.controls		= ak4642_snd_controls,
Signature · 1 line
2.8.3
maintainer
#1 lore raw

Applied "ASoC: ak4642: Implement suspend callback" to the asoc tree

The patch

ASoC: ak4642: Implement suspend callback

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From a2ebd58627e9aa486fccbbdda6338675bdf3e267 Mon Sep 17 00:00:00 2001

From: Peter Ujfalusi <[email protected]>
Date: Tue, 31 May 2016 13:34:59 +0300
Subject: [PATCH] ASoC: ak4642: 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.

---
 sound/soc/codecs/ak4642.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/codecs/ak4642.c +11 -2
index 4d8b9e49e8d6..cc941d66ec3d 100644
@@ -523,15 +523,23 @@ static struct snd_soc_dai_driver ak4642_dai = {
 	.symmetric_rates = 1,
 };
 
-static int ak4642_resume(struct snd_soc_codec *codec)
+static int ak4642_suspend(struct snd_soc_codec *codec)
 {
 	struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
 
+	regcache_cache_only(regmap, true);
 	regcache_mark_dirty(regmap);
-	regcache_sync(regmap);
 	return 0;
 }
 
+static int ak4642_resume(struct snd_soc_codec *codec)
+{
+	struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
+
+	regcache_cache_only(regmap, false);
+	regcache_sync(regmap);
+	return 0;
+}
 static int ak4642_probe(struct snd_soc_codec *codec)
 {
 	struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
@@ -544,6 +552,7 @@ static int ak4642_probe(struct snd_soc_codec *codec)
 
 static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
 	.probe			= ak4642_probe,
+	.suspend		= ak4642_suspend,
 	.resume			= ak4642_resume,
 	.set_bias_level		= ak4642_set_bias_level,
 	.controls		= ak4642_snd_controls,
Signature · 1 line
2.8.1