]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: pistachio: Fix PLL rate calculation in integer mode
authorZdenko Pulitika <zdenko.pulitika@imgtec.com>
Wed, 26 Aug 2015 16:11:39 +0000 (17:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Sep 2015 17:10:47 +0000 (10:10 -0700)
commit73cf8cac24ec72354266a2b57578921118841576
tree679cef4acfb2d5aae76f4197eda07adce6a307a0
parentac4c4c4ffc96cd271043204fc9f6ba9afe8355ed
clk: pistachio: Fix PLL rate calculation in integer mode

commit 7937c6c57e0da7bffa7b10bac23f230c77523e35 upstream.

.recalc_rate callback for the fractional PLL doesn't take operating
mode into account when calculating PLL rate. This results in
the incorrect PLL rates when PLL is operating in integer mode.

Operating mode of fractional PLL is based on the value of the
fractional divider. Currently it assumes that the PLL will always
be configured in fractional mode which may not be
the case. This may result in the wrong output frequency.

Also vco was calculated based on the current operating mode which
makes no sense because .set_rate is setting operating mode. Instead,
vco should be calculated using PLL settings that are about to be set.

Fixes: 43049b0c83f17("CLK: Pistachio: Add PLL driver")
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Zdenko Pulitika <zdenko.pulitika@imgtec.com>
Signed-off-by: Govindraj Raja <govindraj.raja@imgtec.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/pistachio/clk-pll.c