ar71xx: Add support for ath79_gpio_function_* on QCA955X
[openwrt.git] / target / linux / ar71xx / patches-4.1 / 634-MIPS-ath79-ar724x-clock-calculation-fixes.patch
1 --- a/arch/mips/ath79/clock.c
2 +++ b/arch/mips/ath79/clock.c
3 @@ -25,7 +25,7 @@
4  #include "common.h"
5  
6  #define AR71XX_BASE_FREQ       40000000
7 -#define AR724X_BASE_FREQ       5000000
8 +#define AR724X_BASE_FREQ       40000000
9  #define AR913X_BASE_FREQ       5000000
10  
11  struct clk {
12 @@ -99,8 +99,8 @@ static void __init ar724x_clocks_init(vo
13         div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_MASK);
14         freq = div * ref_rate;
15  
16 -       div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
17 -       freq *= div;
18 +       div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK) * 2;
19 +       freq /= div;
20  
21         cpu_rate = freq;
22