summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/arizona.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r--sound/soc/codecs/arizona.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index e770945fa019..149e44f42f84 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1145,10 +1145,12 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
struct arizona_fll_cfg ref, sync;
int ret;
- if (fll->fref == Fref && fll->fout == Fout)
- return 0;
-
if (fll->ref_src < 0 || fll->ref_src == source) {
+ if (fll->sync_src == -1 &&
+ fll->ref_src == source && fll->ref_freq == Fref &&
+ fll->fout == Fout)
+ return 0;
+
if (Fout) {
ret = arizona_calc_fll(fll, &ref, Fref, Fout);
if (ret != 0)
@@ -1159,6 +1161,10 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
fll->ref_src = source;
fll->ref_freq = Fref;
} else {
+ if (fll->sync_src == source &&
+ fll->sync_freq == Fref && fll->fout == Fout)
+ return 0;
+
if (Fout) {
ret = arizona_calc_fll(fll, &ref, fll->ref_freq, Fout);
if (ret != 0)
@@ -1172,6 +1178,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
fll->sync_src = source;
fll->sync_freq = Fref;
}
+ fll->fout = Fout;
if (Fout) {
arizona_enable_fll(fll, &ref, &sync);
@@ -1179,9 +1186,6 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
arizona_disable_fll(fll);
}
- fll->fref = Fref;
- fll->fout = Fout;
-
return 0;
}
EXPORT_SYMBOL_GPL(arizona_set_fll);