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)
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)
fll->sync_src = source;
fll->sync_freq = Fref;
}
+ fll->fout = Fout;
if (Fout) {
arizona_enable_fll(fll, &ref, &sync);
arizona_disable_fll(fll);
}
- fll->fref = Fref;
- fll->fout = Fout;
-
return 0;
}
EXPORT_SYMBOL_GPL(arizona_set_fll);