Skip to content

Commit 4a450ed

Browse files
BotchedRPRkrzk
authored andcommitted
clk: samsung: clk-pll: Add support for pll_{0717x, 0718x, 0732x}
These PLLs are found in the Exynos990 SoC. The PLLs are similar to pll0822x. pll0717x and pll0718x are an exception, and they use the mdiv mask from 1718X (that is, one bit smaller). Apart from that, the masks/shifts are identical to those of 0822x. Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org> Link: https://lore.kernel.org/r/20241209-exynos990-cmu-v4-2-57f07080f9e4@mentallysanemainliners.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 5feae3e commit 4a450ed

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

drivers/clk/samsung/clk-pll.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,10 @@ static const struct clk_ops samsung_pll36xx_clk_min_ops = {
430430
#define PLL0822X_LOCK_STAT_SHIFT (29)
431431
#define PLL0822X_ENABLE_SHIFT (31)
432432

433-
/* PLL1418x is similar to PLL0822x, except that MDIV is one bit smaller */
433+
/*
434+
* PLL1418x, PLL0717x and PLL0718x are similar
435+
* to PLL0822x, except that MDIV is one bit smaller
436+
*/
434437
#define PLL1418X_MDIV_MASK (0x1FF)
435438

436439
static unsigned long samsung_pll0822x_recalc_rate(struct clk_hw *hw,
@@ -441,10 +444,14 @@ static unsigned long samsung_pll0822x_recalc_rate(struct clk_hw *hw,
441444
u64 fvco = parent_rate;
442445

443446
pll_con3 = readl_relaxed(pll->con_reg);
444-
if (pll->type != pll_1418x)
447+
448+
if (pll->type != pll_1418x &&
449+
pll->type != pll_0717x &&
450+
pll->type != pll_0718x)
445451
mdiv = (pll_con3 >> PLL0822X_MDIV_SHIFT) & PLL0822X_MDIV_MASK;
446452
else
447453
mdiv = (pll_con3 >> PLL0822X_MDIV_SHIFT) & PLL1418X_MDIV_MASK;
454+
448455
pdiv = (pll_con3 >> PLL0822X_PDIV_SHIFT) & PLL0822X_PDIV_MASK;
449456
sdiv = (pll_con3 >> PLL0822X_SDIV_SHIFT) & PLL0822X_SDIV_MASK;
450457

@@ -1377,6 +1384,9 @@ static void __init _samsung_clk_register_pll(struct samsung_clk_provider *ctx,
13771384
case pll_0516x:
13781385
case pll_0517x:
13791386
case pll_0518x:
1387+
case pll_0717x:
1388+
case pll_0718x:
1389+
case pll_0732x:
13801390
pll->enable_offs = PLL0822X_ENABLE_SHIFT;
13811391
pll->lock_offs = PLL0822X_LOCK_STAT_SHIFT;
13821392
if (!pll->rate_table)

drivers/clk/samsung/clk-pll.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ enum samsung_pll_type {
4545
pll_531x,
4646
pll_1051x,
4747
pll_1052x,
48+
pll_0717x,
49+
pll_0718x,
50+
pll_0732x,
4851
};
4952

5053
#define PLL_RATE(_fin, _m, _p, _s, _k, _ks) \

0 commit comments

Comments
 (0)