mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-23 22:25:40 +08:00
ASoC: ak4642: Implement suspend callback
Add the suspend callback to accompany the existing resume operation. With the suspend/resume callbacks the regmap (regcache) state handling can follow the recommended sequence. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
1a695a905c
commit
a2ebd58627
@ -523,15 +523,23 @@ static struct snd_soc_dai_driver ak4642_dai = {
|
|||||||
.symmetric_rates = 1,
|
.symmetric_rates = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int ak4642_suspend(struct snd_soc_codec *codec)
|
||||||
|
{
|
||||||
|
struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
|
||||||
|
|
||||||
|
regcache_cache_only(regmap, true);
|
||||||
|
regcache_mark_dirty(regmap);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int ak4642_resume(struct snd_soc_codec *codec)
|
static int ak4642_resume(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
|
struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
|
||||||
|
|
||||||
regcache_mark_dirty(regmap);
|
regcache_cache_only(regmap, false);
|
||||||
regcache_sync(regmap);
|
regcache_sync(regmap);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ak4642_probe(struct snd_soc_codec *codec)
|
static int ak4642_probe(struct snd_soc_codec *codec)
|
||||||
{
|
{
|
||||||
struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
|
struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
|
||||||
@ -544,6 +552,7 @@ static int ak4642_probe(struct snd_soc_codec *codec)
|
|||||||
|
|
||||||
static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
|
static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
|
||||||
.probe = ak4642_probe,
|
.probe = ak4642_probe,
|
||||||
|
.suspend = ak4642_suspend,
|
||||||
.resume = ak4642_resume,
|
.resume = ak4642_resume,
|
||||||
.set_bias_level = ak4642_set_bias_level,
|
.set_bias_level = ak4642_set_bias_level,
|
||||||
.controls = ak4642_snd_controls,
|
.controls = ak4642_snd_controls,
|
||||||
|
Loading…
Reference in New Issue
Block a user