summaryrefslogtreecommitdiff
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-04-14 10:08:08 +0000
committerAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-04-14 10:08:08 +0000
commit8ad3d2ca53512dbb09a96c97d59595dea182e45a (patch)
tree26bfb9084d0f64e69c8f513fdf011cd4d2175329 /sound/soc/codecs
parent25c1032ec1d776ed2f023d802ba269f5f1a0c12d (diff)
parent8f55ad4daf001b6ee8ddf672e14475a35403b258 (diff)
Merge tag 'v5.4.112' into 5.4-2.3.x-imx
This is the 5.4.112 stable release Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/wm8960.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index adb82301ff20..5ead3633f794 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -692,7 +692,13 @@ int wm8960_configure_pll(struct snd_soc_component *component, int freq_in,
best_freq_out = -EINVAL;
*sysclk_idx = *dac_idx = *bclk_idx = -1;
- for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
+ /*
+ * From Datasheet, the PLL performs best when f2 is between
+ * 90MHz and 100MHz, the desired sysclk output is 11.2896MHz
+ * or 12.288MHz, then sysclkdiv = 2 is the best choice.
+ * So search sysclk_divs from 2 to 1 other than from 1 to 2.
+ */
+ for (i = ARRAY_SIZE(sysclk_divs) - 1; i >= 0; --i) {
if (sysclk_divs[i] == -1)
continue;
for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) {