diff options
author | Quentin Schulz <quentin.schulz@free-electrons.com> | 2017-05-15 04:36:17 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-05-17 05:50:35 -0400 |
commit | 61abce1312bf97eac62eef704260ce9a8f9b85f6 (patch) | |
tree | b23bb976d9e56cfd5634439dd480929c0cfa4085 /sound | |
parent | 2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff) |
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: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/atmel/atmel-classd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index 7ae46c2647d4..b7ef8c59b49a 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c | |||
@@ -301,6 +301,14 @@ static int atmel_classd_codec_probe(struct snd_soc_codec *codec) | |||
301 | return 0; | 301 | return 0; |
302 | } | 302 | } |
303 | 303 | ||
304 | static int atmel_classd_codec_resume(struct snd_soc_codec *codec) | ||
305 | { | ||
306 | struct snd_soc_card *card = snd_soc_codec_get_drvdata(codec); | ||
307 | struct atmel_classd *dd = snd_soc_card_get_drvdata(card); | ||
308 | |||
309 | return regcache_sync(dd->regmap); | ||
310 | } | ||
311 | |||
304 | static struct regmap *atmel_classd_codec_get_remap(struct device *dev) | 312 | static struct regmap *atmel_classd_codec_get_remap(struct device *dev) |
305 | { | 313 | { |
306 | return dev_get_regmap(dev, NULL); | 314 | return dev_get_regmap(dev, NULL); |
@@ -308,6 +316,7 @@ static struct regmap *atmel_classd_codec_get_remap(struct device *dev) | |||
308 | 316 | ||
309 | static struct snd_soc_codec_driver soc_codec_dev_classd = { | 317 | static struct snd_soc_codec_driver soc_codec_dev_classd = { |
310 | .probe = atmel_classd_codec_probe, | 318 | .probe = atmel_classd_codec_probe, |
319 | .resume = atmel_classd_codec_resume, | ||
311 | .get_regmap = atmel_classd_codec_get_remap, | 320 | .get_regmap = atmel_classd_codec_get_remap, |
312 | .component_driver = { | 321 | .component_driver = { |
313 | .controls = atmel_classd_snd_controls, | 322 | .controls = atmel_classd_snd_controls, |