Skip to content

Commit

Permalink
ASoC: atmel-classd: sync regcache when resuming
Browse files Browse the repository at this point in the history
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: Quentin Schulz <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
QSchulz authored and broonie committed May 17, 2017
1 parent 2ea659a commit 61abce1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/soc/atmel/atmel-classd.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,22 @@ 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);
}

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,
Expand Down

0 comments on commit 61abce1

Please sign in to comment.