Commit 4d5d75ce authored by Shengjiu Wang's avatar Shengjiu Wang Committed by Mark Brown

ASoC: ak5558: change function name to ak5558_reset

Change function name to ak5558_reset to match devicetree property
"reset-gpios".
Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1618382024-31725-2-git-send-email-shengjiu.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0b93bbc9
...@@ -318,21 +318,12 @@ static struct snd_soc_dai_driver ak5552_dai = { ...@@ -318,21 +318,12 @@ static struct snd_soc_dai_driver ak5552_dai = {
.ops = &ak5558_dai_ops, .ops = &ak5558_dai_ops,
}; };
static void ak5558_power_off(struct ak5558_priv *ak5558) static void ak5558_reset(struct ak5558_priv *ak5558, bool active)
{ {
if (!ak5558->reset_gpiod) if (!ak5558->reset_gpiod)
return; return;
gpiod_set_value_cansleep(ak5558->reset_gpiod, 1); gpiod_set_value_cansleep(ak5558->reset_gpiod, active);
usleep_range(1000, 2000);
}
static void ak5558_power_on(struct ak5558_priv *ak5558)
{
if (!ak5558->reset_gpiod)
return;
gpiod_set_value_cansleep(ak5558->reset_gpiod, 0);
usleep_range(1000, 2000); usleep_range(1000, 2000);
} }
...@@ -340,7 +331,7 @@ static int ak5558_probe(struct snd_soc_component *component) ...@@ -340,7 +331,7 @@ static int ak5558_probe(struct snd_soc_component *component)
{ {
struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component);
ak5558_power_on(ak5558); ak5558_reset(ak5558, false);
return ak5558_set_mcki(component); return ak5558_set_mcki(component);
} }
...@@ -348,7 +339,7 @@ static void ak5558_remove(struct snd_soc_component *component) ...@@ -348,7 +339,7 @@ static void ak5558_remove(struct snd_soc_component *component)
{ {
struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component);
ak5558_power_off(ak5558); ak5558_reset(ak5558, true);
} }
static int __maybe_unused ak5558_runtime_suspend(struct device *dev) static int __maybe_unused ak5558_runtime_suspend(struct device *dev)
...@@ -356,7 +347,7 @@ static int __maybe_unused ak5558_runtime_suspend(struct device *dev) ...@@ -356,7 +347,7 @@ static int __maybe_unused ak5558_runtime_suspend(struct device *dev)
struct ak5558_priv *ak5558 = dev_get_drvdata(dev); struct ak5558_priv *ak5558 = dev_get_drvdata(dev);
regcache_cache_only(ak5558->regmap, true); regcache_cache_only(ak5558->regmap, true);
ak5558_power_off(ak5558); ak5558_reset(ak5558, true);
regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies),
ak5558->supplies); ak5558->supplies);
...@@ -375,8 +366,8 @@ static int __maybe_unused ak5558_runtime_resume(struct device *dev) ...@@ -375,8 +366,8 @@ static int __maybe_unused ak5558_runtime_resume(struct device *dev)
return ret; return ret;
} }
ak5558_power_off(ak5558); ak5558_reset(ak5558, true);
ak5558_power_on(ak5558); ak5558_reset(ak5558, false);
regcache_cache_only(ak5558->regmap, false); regcache_cache_only(ak5558->regmap, false);
regcache_mark_dirty(ak5558->regmap); regcache_mark_dirty(ak5558->regmap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment