summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhanh Le <khanh.le.xr@renesas.com>2026-09-17 03:02:42 +0000
committerMark Brown <broonie@kernel.org>2026-09-17 16:58:03 +0100
commitd5212d2d50f36a132568534ca637b56ae50f3f02 (patch)
tree277a17e259319525f1afe0ae6c3a7564660b3114
parent36929e623f9af0b23c2dc70856af93ab0212d8bf (diff)
downloadlinux-next-d5212d2d50f36a132568534ca637b56ae50f3f02.tar.gz
linux-next-d5212d2d50f36a132568534ca637b56ae50f3f02.zip
ASoC: ak4619: Add suspend and resume callbacks
After resuming from S2R, the register cache is out of sync with the hardware. Implement suspend and resume callbacks to properly restore the configuration of the codec on resume. Signed-off-by: Khanh Le <khanh.le.xr@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87a4pgzijx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/ak4619.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c
index d9c9f6b20028..5252b30669d4 100644
--- a/sound/soc/codecs/ak4619.c
+++ b/sound/soc/codecs/ak4619.c
@@ -799,7 +799,26 @@ static const struct snd_soc_dai_ops ak4619_dai_ops = {
.num_auto_selectable_formats = ARRAY_SIZE(ak4619_dai_formats),
};
+static int ak4619_suspend(struct snd_soc_component *component)
+{
+ struct regmap *regmap = dev_get_regmap(component->dev, NULL);
+
+ regcache_cache_only(regmap, true);
+ regcache_mark_dirty(regmap);
+ return 0;
+}
+
+static int ak4619_resume(struct snd_soc_component *component)
+{
+ struct regmap *regmap = dev_get_regmap(component->dev, NULL);
+
+ regcache_cache_only(regmap, false);
+ return regcache_sync(regmap);
+}
+
static const struct snd_soc_component_driver soc_component_dev_ak4619 = {
+ .suspend = ak4619_suspend,
+ .resume = ak4619_resume,
.set_bias_level = ak4619_set_bias_level,
.controls = ak4619_snd_controls,
.num_controls = ARRAY_SIZE(ak4619_snd_controls),