clk: tegra: Fix pllx dyn step calculation
authorRhyland Klein <rklein@nvidia.com>
Thu, 14 Jan 2016 19:24:35 +0000 (14:24 -0500)
committerThierry Reding <treding@nvidia.com>
Tue, 2 Feb 2016 14:49:24 +0000 (15:49 +0100)
The logic for calculating the input rate used when figuring out the
proper dynamic steps for pllx was incorrect. It is supposed to be
calculated using parent_rate / m but it was just using the parent rate
directly, therefore using the wrong step values.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/clk/tegra/clk-tegra210.c

index caae0dcc9cb5af94beb256af1a54b1c2edabfd8a..ffcb86a667d91b2d7a872619c4ee9c602c245975 100644 (file)
@@ -780,13 +780,13 @@ static void pllx_get_dyn_steps(struct clk_hw *hw, u32 *step_a, u32 *step_b)
 {
        unsigned long input_rate;
 
-       if (!IS_ERR_OR_NULL(hw->clk)) {
+       /* cf rate */
+       if (!IS_ERR_OR_NULL(hw->clk))
                input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
-               /* cf rate */
-               input_rate /= tegra_pll_get_fixed_mdiv(hw, input_rate);
-       } else {
+       else
                input_rate = 38400000;
-       }
+
+       input_rate /= tegra_pll_get_fixed_mdiv(hw, input_rate);
 
        switch (input_rate) {
        case 12000000: