summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/arizona.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2013-02-20 18:28:37 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-04 04:01:00 +0100
commit7604054e13897c2da3570e33a67ecb76462212d8 (patch)
tree2e4e1321d1cac02d6c22fdf16deaddba81b7f8e3 /sound/soc/codecs/arizona.c
parentASoC: arizona: Factor out check for enabled FLL (diff)
downloadlinux-7604054e13897c2da3570e33a67ecb76462212d8.tar.xz
linux-7604054e13897c2da3570e33a67ecb76462212d8.zip
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: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r--sound/soc/codecs/arizona.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 4640bccbfba2..a8821a819adc 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1090,6 +1090,20 @@ static bool arizona_is_enabled_fll(struct arizona_fll *fll)
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,
unsigned int Fref, unsigned int Fout)
{
@@ -1156,13 +1170,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
if (ret == 0)
arizona_fll_warn(fll, "Timed out waiting for lock\n");
} else {
- regmap_update_bits(arizona->regmap, fll->base + 1,
- 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);
+ arizona_disable_fll(fll);
}
fll->fref = Fref;