Skip to content

Commit 651aabc

Browse files
ziyao233mmind
authored andcommitted
clk: rockchip: Add PLL flag ROCKCHIP_PLL_FIXED_MODE
RK3528 comes with a new PLL variant: its "PPLL", which mainly generates clocks for the PCIe controller, operates in normal mode only. Let's describe it with flag ROCKCHIP_PLL_FIXED_MODE and handle it in code. Signed-off-by: Yao Zi <ziyao@disroot.org> Link: https://lore.kernel.org/r/20250217061142.38480-7-ziyao@disroot.org Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 3688efd commit 651aabc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/clk/rockchip/clk-pll.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,12 @@ static int rockchip_rk3036_pll_set_params(struct rockchip_clk_pll *pll,
204204
rockchip_rk3036_pll_get_params(pll, &cur);
205205
cur.rate = 0;
206206

207-
cur_parent = pll_mux_ops->get_parent(&pll_mux->hw);
208-
if (cur_parent == PLL_MODE_NORM) {
209-
pll_mux_ops->set_parent(&pll_mux->hw, PLL_MODE_SLOW);
210-
rate_change_remuxed = 1;
207+
if (!(pll->flags & ROCKCHIP_PLL_FIXED_MODE)) {
208+
cur_parent = pll_mux_ops->get_parent(&pll_mux->hw);
209+
if (cur_parent == PLL_MODE_NORM) {
210+
pll_mux_ops->set_parent(&pll_mux->hw, PLL_MODE_SLOW);
211+
rate_change_remuxed = 1;
212+
}
211213
}
212214

213215
/* update pll values */

drivers/clk/rockchip/clk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ struct rockchip_pll_rate_table {
444444
* Flags:
445445
* ROCKCHIP_PLL_SYNC_RATE - check rate parameters to match against the
446446
* rate_table parameters and ajust them if necessary.
447+
* ROCKCHIP_PLL_FIXED_MODE - the pll operates in normal mode only
447448
*/
448449
struct rockchip_pll_clock {
449450
unsigned int id;
@@ -461,6 +462,7 @@ struct rockchip_pll_clock {
461462
};
462463

463464
#define ROCKCHIP_PLL_SYNC_RATE BIT(0)
465+
#define ROCKCHIP_PLL_FIXED_MODE BIT(1)
464466

465467
#define PLL(_type, _id, _name, _pnames, _flags, _con, _mode, _mshift, \
466468
_lshift, _pflags, _rtable) \

0 commit comments

Comments
 (0)