Skip to content

Commit

Permalink
ASoC: tas2552: Fix PM sequencing
Browse files Browse the repository at this point in the history
In the pm suspend/resume it is better
to disable the GPIO after the regmap_cache
setting calls so that if the call is interrupted
the new reg values will be cached and set on resume.

Also add pm_runtime_put in the remove call.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Dan Murphy authored and Mark Brown committed Jul 21, 2014
1 parent 5df7f71 commit e295a4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sound/soc/codecs/tas2552.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ static int tas2552_runtime_suspend(struct device *dev)

tas2552_sw_shutdown(tas2552, 0);

if (tas2552->enable_gpio)
gpiod_set_value(tas2552->enable_gpio, 0);

regcache_cache_only(tas2552->regmap, true);
regcache_mark_dirty(tas2552->regmap);

if (tas2552->enable_gpio)
gpiod_set_value(tas2552->enable_gpio, 0);

return 0;
}

Expand Down Expand Up @@ -382,6 +382,8 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec)
{
struct tas2552_data *tas2552 = snd_soc_codec_get_drvdata(codec);

pm_runtime_put(codec->dev);

if (tas2552->enable_gpio)
gpiod_set_value(tas2552->enable_gpio, 0);

Expand Down

0 comments on commit e295a4a

Please sign in to comment.