Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ac95330b authored by Stéphan Rafin's avatar Stéphan Rafin Committed by Maxime Ripard
Browse files

clk: sunxi: Fix M factor computation for APB1



commit cfa63688 ("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: cfa63688 ("clk: sunxi: factors: Consolidate get_factors parameters into a struct")
Signed-off-by: default avatarStéphan Rafin <stephan@soliotek.com>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
parent a17b9e4c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment