Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61abce13 authored by Quentin Schulz's avatar Quentin Schulz Committed by Mark Brown
Browse files

ASoC: atmel-classd: sync regcache when resuming



The PM functions used in this driver are the ones defined in
sounc/soc/soc-core.c.

When suspending (using snd_soc_suspend), the regcache is marked dirty
but is never synced on resume.

Sync regcache on resume of Atmel ClassD device.

Signed-off-by: default avatarQuentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea659a9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -301,6 +301,14 @@ static int atmel_classd_codec_probe(struct snd_soc_codec *codec)
	return 0;
}

static int atmel_classd_codec_resume(struct snd_soc_codec *codec)
{
	struct snd_soc_card *card = snd_soc_codec_get_drvdata(codec);
	struct atmel_classd *dd = snd_soc_card_get_drvdata(card);

	return regcache_sync(dd->regmap);
}

static struct regmap *atmel_classd_codec_get_remap(struct device *dev)
{
	return dev_get_regmap(dev, NULL);
@@ -308,6 +316,7 @@ static struct regmap *atmel_classd_codec_get_remap(struct device *dev)

static struct snd_soc_codec_driver soc_codec_dev_classd = {
	.probe		= atmel_classd_codec_probe,
	.resume		= atmel_classd_codec_resume,
	.get_regmap	= atmel_classd_codec_get_remap,
	.component_driver = {
		.controls		= atmel_classd_snd_controls,