clk: pxa: fix core frequency reporting unit
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sun, 12 Jul 2015 20:49:53 +0000 (22:49 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 28 Jul 2015 18:59:14 +0000 (11:59 -0700)
Legacy drivers which are not yet ported, such as cpufreq-pxa[23]xx, rely
on pxaXXx_get_clk_frequency_khz() to find the CPU core frequency.

This reporting was broken because the expected unit is kHz and not
Hz. Fix the reporting for pxa25x, pxa27x and pxa3xx.

Fixes: fe7710fae477 ("clk: add pxa25x clock drivers")
Fixes: d40670dc6169 ("clk: add pxa27x clock drivers")
Fixes: 9bbb8a338fb2 ("clk: pxa: add pxa3xx clock driver")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/pxa/clk-pxa25x.c
drivers/clk/pxa/clk-pxa27x.c
drivers/clk/pxa/clk-pxa3xx.c

index 6cd88d963a7ffbaa531b84f0a919b5aeef8f989d..542e45ef5087b5736e2111cfca08eb42ed7b24a3 100644 (file)
@@ -79,7 +79,7 @@ unsigned int pxa25x_get_clk_frequency_khz(int info)
                        clks[3] / 1000000, (clks[3] % 1000000) / 10000);
        }
 
-       return (unsigned int)clks[0];
+       return (unsigned int)clks[0] / KHz;
 }
 
 static unsigned long clk_pxa25x_memory_get_rate(struct clk_hw *hw,
index 9a31b77eed23511545f453022d9263db08b7add8..5b82d30baf9f36e9506544e554f1e79cf2b1b511 100644 (file)
@@ -80,7 +80,7 @@ unsigned int pxa27x_get_clk_frequency_khz(int info)
                pr_info("System bus clock: %ld.%02ldMHz\n",
                        clks[4] / 1000000, (clks[4] % 1000000) / 10000);
        }
-       return (unsigned int)clks[0];
+       return (unsigned int)clks[0] / KHz;
 }
 
 bool pxa27x_is_ppll_disabled(void)
index 4b93a1efb36d11fa7171735d29bac283e4bb6d97..c677b9ab53673b1f06b6fb0e2ed4eeeeba584f4a 100644 (file)
@@ -78,7 +78,7 @@ unsigned int pxa3xx_get_clk_frequency_khz(int info)
                pr_info("System bus clock: %ld.%02ldMHz\n",
                        clks[4] / 1000000, (clks[4] % 1000000) / 10000);
        }
-       return (unsigned int)clks[0];
+       return (unsigned int)clks[0] / KHz;
 }
 
 static unsigned long clk_pxa3xx_ac97_get_rate(struct clk_hw *hw,