diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-06-04 09:04:19 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-04 12:50:03 -0400 |
commit | dd6e3053405c2fe7baa36e4fe2a12083f508abfc (patch) | |
tree | 5fa79778ae3dc2efae59273bfad572184271aa9b | |
parent | e3606aa496c98595cb206ac8fed9bc8152ffe34e (diff) |
ASoC: tas2552: Simplify and reverse the functionality of tas2552_sw_shutdown
The function name and parameters of:
tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown)
implies that if sw_shutdown is 1 we should be entering to the software
shutdown mode.
The code can be simplified as well within the function.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/tas2552.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 2d52a397161d..61419e2f833b 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c | |||
@@ -118,14 +118,12 @@ static const struct snd_soc_dapm_route tas2552_audio_map[] = { | |||
118 | #ifdef CONFIG_PM | 118 | #ifdef CONFIG_PM |
119 | static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) | 119 | static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) |
120 | { | 120 | { |
121 | u8 cfg1_reg; | 121 | u8 cfg1_reg = 0; |
122 | 122 | ||
123 | if (!tas_data->codec) | 123 | if (!tas_data->codec) |
124 | return; | 124 | return; |
125 | 125 | ||
126 | if (sw_shutdown) | 126 | if (sw_shutdown) |
127 | cfg1_reg = 0; | ||
128 | else | ||
129 | cfg1_reg = TAS2552_SWS; | 127 | cfg1_reg = TAS2552_SWS; |
130 | 128 | ||
131 | snd_soc_update_bits(tas_data->codec, TAS2552_CFG_1, TAS2552_SWS, | 129 | snd_soc_update_bits(tas_data->codec, TAS2552_CFG_1, TAS2552_SWS, |
@@ -270,7 +268,7 @@ static int tas2552_runtime_suspend(struct device *dev) | |||
270 | { | 268 | { |
271 | struct tas2552_data *tas2552 = dev_get_drvdata(dev); | 269 | struct tas2552_data *tas2552 = dev_get_drvdata(dev); |
272 | 270 | ||
273 | tas2552_sw_shutdown(tas2552, 0); | 271 | tas2552_sw_shutdown(tas2552, 1); |
274 | 272 | ||
275 | regcache_cache_only(tas2552->regmap, true); | 273 | regcache_cache_only(tas2552->regmap, true); |
276 | regcache_mark_dirty(tas2552->regmap); | 274 | regcache_mark_dirty(tas2552->regmap); |
@@ -288,7 +286,7 @@ static int tas2552_runtime_resume(struct device *dev) | |||
288 | if (tas2552->enable_gpio) | 286 | if (tas2552->enable_gpio) |
289 | gpiod_set_value(tas2552->enable_gpio, 1); | 287 | gpiod_set_value(tas2552->enable_gpio, 1); |
290 | 288 | ||
291 | tas2552_sw_shutdown(tas2552, 1); | 289 | tas2552_sw_shutdown(tas2552, 0); |
292 | 290 | ||
293 | regcache_cache_only(tas2552->regmap, false); | 291 | regcache_cache_only(tas2552->regmap, false); |
294 | regcache_sync(tas2552->regmap); | 292 | regcache_sync(tas2552->regmap); |