diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2014-05-16 16:55:21 +0300 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-16 19:57:15 +0100 |
commit | 46b0e97dcfdbb179b9992b6aec3eabb6095d8745 (patch) | |
tree | df1ecbce702b2b9350b65916afb8847598aac92c /sound/soc/codecs/max98090.c | |
parent | 25b4ab430f8e166c9b63f4db28e7e812d5a59396 (diff) | |
download | lwn-46b0e97dcfdbb179b9992b6aec3eabb6095d8745.tar.gz lwn-46b0e97dcfdbb179b9992b6aec3eabb6095d8745.zip |
ASoC: max98090: Reset codec on resume
Make sure we reset codec and clear any IRQs on resume. This matches
the init sequence in probe.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rw-r--r-- | sound/soc/codecs/max98090.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index be86094817eb..2888f632564a 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2392,9 +2392,32 @@ static int max98090_runtime_suspend(struct device *dev) } #endif +#ifdef CONFIG_PM +static int max98090_resume(struct device *dev) +{ + struct max98090_priv *max98090 = dev_get_drvdata(dev); + unsigned int status; + + max98090_reset(max98090); + + /* clear IRQ status */ + regmap_read(max98090->regmap, M98090_REG_DEVICE_STATUS, &status); + + regcache_sync(max98090->regmap); + + return 0; +} + +static int max98090_suspend(struct device *dev) +{ + return 0; +} +#endif + static const struct dev_pm_ops max98090_pm = { SET_RUNTIME_PM_OPS(max98090_runtime_suspend, max98090_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(max98090_suspend, max98090_resume) }; static const struct i2c_device_id max98090_i2c_id[] = { |