MLK-22489 clk: imx: pll14xx: avoid glitch when set rate
authorPeng Fan <peng.fan@nxp.com>
Tue, 20 Aug 2019 02:27:04 +0000 (10:27 +0800)
committerPeng Fan <peng.fan@nxp.com>
Mon, 26 Aug 2019 09:25:01 +0000 (17:25 +0800)
commit2411e1225375920f2f30093f32cac3bbbb7b8dbb
tree388a5921cc70f6799c049864003f29449ddae632
parentdb710e3ab8b6aca3bd589c7d2d4c45b2bc2b9ef3
MLK-22489 clk: imx: pll14xx: avoid glitch when set rate

According to PLL1443XA and PLL1416X spec,
"When BYPASS is 0 and RESETB is changed from 0 to 1, FOUT starts to
output unstable clock until lock time passes. PLL1416X/PLL1443XA may
generate a glitch at FOUT."

So set BYPASS when RESETB is changed from 0 to 1 to avoid glitch.
In the end of set rate, BYPASS will be cleared.

When prepare clock, also need to take care to avoid glitch. So
we also follow Spec to set BYPASS before RESETB changed from 0 to 1.
And add a check if the RESETB is already 0, directly return 0;

Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/imx/clk-pll14xx.c