diff options
author | John Hsu <KCHSU0@nuvoton.com> | 2019-03-22 07:25:35 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-03-25 15:09:39 +0300 |
commit | 3a9ce0f1b2961f6c3ad2a49dcf85449784c18bb5 (patch) | |
tree | e1a5efb351713f3c8475e16e9b4a12d41eb5493c | |
parent | 008fe4e5382293e2da96a4dc75b95782a5f95be8 (diff) | |
download | linux-3a9ce0f1b2961f6c3ad2a49dcf85449784c18bb5.tar.xz |
ASoC: nau8810: fix the issue of 64 bits division
Do division with div_u64 for the PLL calculation.
These errors are fixed and list as follows:
1."__udivdi3" [sound/soc/codecs/snd-soc-nau8810.ko] undefined!
2."__aeabi_uldivmod" [sound/soc/codecs/snd-soc-nau8810.ko] undefined!
3. nau8810.c:(.text.nau8810_calc_pll+0xd8): undefined reference to
`__udivdi3'
Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/nau8810.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index 125e205e6687..dd82c65cfa7f 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -505,7 +505,8 @@ static int nau8810_calc_pll(unsigned int pll_in, f2_max = 0; scal_sel = ARRAY_SIZE(nau8810_mclk_scaler); for (i = 0; i < ARRAY_SIZE(nau8810_mclk_scaler); i++) { - f2 = 256ULL * fs * 4 * nau8810_mclk_scaler[i] / 10; + f2 = 256ULL * fs * 4 * nau8810_mclk_scaler[i]; + f2 = div_u64(f2, 10); if (f2 > NAU_PLL_FREQ_MIN && f2 < NAU_PLL_FREQ_MAX && f2_max < f2) { f2_max = f2; |