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>
This commit is contained in:
Peter Ujfalusi 2015-06-04 16:04:19 +03:00 committed by Mark Brown
parent e3606aa496
commit dd6e305340
1 changed files with 3 additions and 5 deletions

View File

@ -118,14 +118,12 @@ static const struct snd_soc_dapm_route tas2552_audio_map[] = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown)
{ {
u8 cfg1_reg; u8 cfg1_reg = 0;
if (!tas_data->codec) if (!tas_data->codec)
return; return;
if (sw_shutdown) if (sw_shutdown)
cfg1_reg = 0;
else
cfg1_reg = TAS2552_SWS; cfg1_reg = TAS2552_SWS;
snd_soc_update_bits(tas_data->codec, TAS2552_CFG_1, TAS2552_SWS, snd_soc_update_bits(tas_data->codec, TAS2552_CFG_1, TAS2552_SWS,
@ -270,7 +268,7 @@ static int tas2552_runtime_suspend(struct device *dev)
{ {
struct tas2552_data *tas2552 = dev_get_drvdata(dev); struct tas2552_data *tas2552 = dev_get_drvdata(dev);
tas2552_sw_shutdown(tas2552, 0); tas2552_sw_shutdown(tas2552, 1);
regcache_cache_only(tas2552->regmap, true); regcache_cache_only(tas2552->regmap, true);
regcache_mark_dirty(tas2552->regmap); regcache_mark_dirty(tas2552->regmap);
@ -288,7 +286,7 @@ static int tas2552_runtime_resume(struct device *dev)
if (tas2552->enable_gpio) if (tas2552->enable_gpio)
gpiod_set_value(tas2552->enable_gpio, 1); gpiod_set_value(tas2552->enable_gpio, 1);
tas2552_sw_shutdown(tas2552, 1); tas2552_sw_shutdown(tas2552, 0);
regcache_cache_only(tas2552->regmap, false); regcache_cache_only(tas2552->regmap, false);
regcache_sync(tas2552->regmap); regcache_sync(tas2552->regmap);