Commit 7604054e authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: arizona: Factor out FLL disable

In preparation for additional features on the FLL this patch factors out
the code for disabling an FLL into a seperate function.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d122d6c9
...@@ -1090,6 +1090,20 @@ static bool arizona_is_enabled_fll(struct arizona_fll *fll) ...@@ -1090,6 +1090,20 @@ static bool arizona_is_enabled_fll(struct arizona_fll *fll)
return reg & ARIZONA_FLL1_ENA; return reg & ARIZONA_FLL1_ENA;
} }
static void arizona_disable_fll(struct arizona_fll *fll)
{
struct arizona *arizona = fll->arizona;
bool change;
regmap_update_bits_check(arizona->regmap, fll->base + 1,
ARIZONA_FLL1_ENA, 0, &change);
regmap_update_bits(arizona->regmap, fll->base + 0x11,
ARIZONA_FLL1_SYNC_ENA, 0);
if (change)
pm_runtime_put_autosuspend(arizona->dev);
}
int arizona_set_fll(struct arizona_fll *fll, int source, int arizona_set_fll(struct arizona_fll *fll, int source,
unsigned int Fref, unsigned int Fout) unsigned int Fref, unsigned int Fout)
{ {
...@@ -1156,13 +1170,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -1156,13 +1170,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
if (ret == 0) if (ret == 0)
arizona_fll_warn(fll, "Timed out waiting for lock\n"); arizona_fll_warn(fll, "Timed out waiting for lock\n");
} else { } else {
regmap_update_bits(arizona->regmap, fll->base + 1, arizona_disable_fll(fll);
ARIZONA_FLL1_ENA, 0);
regmap_update_bits(arizona->regmap, fll->base + 0x11,
ARIZONA_FLL1_SYNC_ENA, 0);
if (ena)
pm_runtime_put_autosuspend(arizona->dev);
} }
fll->fref = Fref; fll->fref = Fref;
......
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