Commit de1e6eed authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: arizona: Improve suppression of noop FLL updates

Previously updates that only changes FLL source would be missed, this
patch corrects this. We also ensures that both REFCLK and SYNCCLK
frequency changes are considered, in preparation for future updates.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 35722815
...@@ -1145,10 +1145,12 @@ int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -1145,10 +1145,12 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
struct arizona_fll_cfg ref, sync; struct arizona_fll_cfg ref, sync;
int ret; int ret;
if (fll->fref == Fref && fll->fout == Fout)
return 0;
if (fll->ref_src < 0 || fll->ref_src == source) { 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) { if (Fout) {
ret = arizona_calc_fll(fll, &ref, Fref, Fout); ret = arizona_calc_fll(fll, &ref, Fref, Fout);
if (ret != 0) if (ret != 0)
...@@ -1159,6 +1161,10 @@ int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -1159,6 +1161,10 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
fll->ref_src = source; fll->ref_src = source;
fll->ref_freq = Fref; fll->ref_freq = Fref;
} else { } else {
if (fll->sync_src == source &&
fll->sync_freq == Fref && fll->fout == Fout)
return 0;
if (Fout) { if (Fout) {
ret = arizona_calc_fll(fll, &ref, fll->ref_freq, Fout); ret = arizona_calc_fll(fll, &ref, fll->ref_freq, Fout);
if (ret != 0) if (ret != 0)
...@@ -1172,6 +1178,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -1172,6 +1178,7 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
fll->sync_src = source; fll->sync_src = source;
fll->sync_freq = Fref; fll->sync_freq = Fref;
} }
fll->fout = Fout;
if (Fout) { if (Fout) {
arizona_enable_fll(fll, &ref, &sync); arizona_enable_fll(fll, &ref, &sync);
...@@ -1179,9 +1186,6 @@ int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -1179,9 +1186,6 @@ int arizona_set_fll(struct arizona_fll *fll, int source,
arizona_disable_fll(fll); arizona_disable_fll(fll);
} }
fll->fref = Fref;
fll->fout = Fout;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(arizona_set_fll); EXPORT_SYMBOL_GPL(arizona_set_fll);
......
...@@ -198,9 +198,8 @@ struct arizona_fll { ...@@ -198,9 +198,8 @@ struct arizona_fll {
unsigned int base; unsigned int base;
unsigned int vco_mult; unsigned int vco_mult;
struct completion ok; struct completion ok;
unsigned int fref;
unsigned int fout;
unsigned int fout;
int sync_src; int sync_src;
unsigned int sync_freq; unsigned int sync_freq;
int ref_src; int ref_src;
......
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