]> git.baikalelectronics.ru Git - kernel.git/commit
clk: sunxi: Fix M factor computation for APB1
authorStéphan Rafin <stephan@soliotek.com>
Thu, 3 Nov 2016 23:53:56 +0000 (00:53 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Fri, 4 Nov 2016 07:49:46 +0000 (08:49 +0100)
commit8be21f9382e918afbc5078575917a5d2aafcbd5c
tree88a09eba4e06228afa8ade78ab862ed106082f9d
parentf9013a6391010ca4c26297b4e73391491ec4327e
clk: sunxi: Fix M factor computation for APB1

commit 98fbbb5af81c ("clk: sunxi: factors: Consolidate get_factors
parameters into a struct") introduced a regression for m factor
computation in sun4i_get_apb1_factors function.

The old code reassigned the "parent_rate" parameter to the targeted
divisor value and was buggy for the returned frequency but not for the
computed factors. Now, returned frequency is good but m factor is
incorrectly computed (its max value 31 is always set resulting in a
significantly slower frequency than the requested one...)

This patch simply restores the original proper computation for m while
keeping the good changes for returned rate.

Fixes: 98fbbb5af81c ("clk: sunxi: factors: Consolidate get_factors parameters into a struct")
Signed-off-by: Stéphan Rafin <stephan@soliotek.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi/clk-sunxi.c