diff options
author | Charles Keepax | 2013-02-20 17:28:39 +0000 |
---|---|---|
committer | Mark Brown | 2013-03-04 11:01:00 +0800 |
commit | de1e6eedddeab2fa417c38c231d896198f903129 (patch) | |
tree | 59933f1f239b0a90c55f5ded309b8449470db622 /sound/soc | |
parent | 357228153b4a158bdeb05f1c46ee13ef60a675a6 (diff) |
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: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/arizona.c | 16 | ||||
-rw-r--r-- | sound/soc/codecs/arizona.h | 3 |
2 files changed, 11 insertions, 8 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); diff --git a/sound/soc/codecs/arizona.h b/sound/soc/codecs/arizona.h index 37766b547b9d..bedf12a527e5 100644 --- a/sound/soc/codecs/arizona.h +++ b/sound/soc/codecs/arizona.h @@ -198,9 +198,8 @@ struct arizona_fll { unsigned int base; unsigned int vco_mult; struct completion ok; - unsigned int fref; - unsigned int fout; + unsigned int fout; int sync_src; unsigned int sync_freq; int ref_src; |