clk: imx: fracn-gppll: support integer pll
authorPeng Fan <peng.fan@nxp.com>
Mon, 3 Apr 2023 09:52:56 +0000 (17:52 +0800)
committerAbel Vesa <abel.vesa@linaro.org>
Sun, 9 Apr 2023 13:48:54 +0000 (16:48 +0300)
commit56b8d0bf3ea8b0db8543e04a6b97348a543405ab
tree4f2d14f0206602d823192ed13fc107a02a4d9d1d
parent4435467b15b069e5a6f50ca9a9260e86b74dbc13
clk: imx: fracn-gppll: support integer pll

The fracn gppll could be configured in FRAC or INTEGER mode during
hardware design. The current driver only support FRAC mode, while
this patch introduces INTEGER support. When the PLL is INTEGER pll,
there is no mfn, mfd, the calculation is as below:
 Fvco_clk = (Fref / DIV[RDIV] ) * DIV[MFI]
 Fclko_odiv = Fvco_clk / DIV[ODIV]

In this patch, we reuse the FRAC pll logic with some condition check to
simplify the driver

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230403095300.3386988-4-peng.fan@oss.nxp.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
drivers/clk/imx/clk-fracn-gppll.c
drivers/clk/imx/clk.h