clk: imx: disable the pfd when set pfdv2 clock rate
authorJacky Bai <ping.bai@nxp.com>
Tue, 14 Sep 2021 06:52:05 +0000 (14:52 +0800)
committerAbel Vesa <abel.vesa@nxp.com>
Thu, 30 Sep 2021 13:22:56 +0000 (16:22 +0300)
commitae8a10d697cd771fb6d28d55c78d1a75b4a4152e
tree822df297b7db776249ab2710409191c4215f76c2
parent75c6f1a0191a8d0c5c8e9cc5d33daa47d88783e1
clk: imx: disable the pfd when set pfdv2 clock rate

It is possible that a PFD is enabled in HW but not in SW. That
means the enable count & prepare count of the PFD clock is '0',
so the 'CLK_SET_RATE' flag can do nothing when the rate is changed
while the PFD is hw enabled. In order to safely change the pfd
rate, we can disable the PFD directly if it is hw enabled but not
used by SW end user.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/20210914065208.3582128-7-ping.bai@nxp.com
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
drivers/clk/imx/clk-pfdv2.c