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

Commit f0ffaf18 authored by Kelvin Cheung's avatar Kelvin Cheung Committed by Stephen Boyd
Browse files

clk: Loongson1: Make use of GENMASK



Make use of GENMASK instead of open coding the equivalent operation,
and update the PLL formula.

Signed-off-by: default avatarKelvin Cheung <keguang.zhang@gmail.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent c99c7a9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ static unsigned long ls1x_pll_recalc_rate(struct clk_hw *hw,
	u32 pll, rate;
	u32 pll, rate;


	pll = __raw_readl(LS1X_CLK_PLL_FREQ);
	pll = __raw_readl(LS1X_CLK_PLL_FREQ);
	rate = 12 + (pll & 0x3f) + (((pll >> 8) & 0x3ff) >> 10);
	rate = 12 + (pll & GENMASK(5, 0));
	rate *= OSC;
	rate *= OSC;
	rate >>= 1;
	rate >>= 1;