Skip to content

Commit

Permalink
ASoC: nau8810: fix the issue of 64 bits division
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Hsu authored and Mark Brown committed Mar 25, 2019
1 parent 008fe4e commit 3a9ce0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/codecs/nau8810.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3a9ce0f

Please sign in to comment.