Skip to content

Commit d9bf944

Browse files
SamShih33bebarino
authored andcommitted
clk: mediatek: add pcw_chg_bit control for PLLs of MT7988
Introduce pcw_chg_bit member to struct mtk_pll_data and use it instead of the previously hardcoded PCW_CHG_MASK macro if set. This will needed for clocks on the MT7988 SoC. Signed-off-by: Sam Shih <[email protected]> Signed-off-by: Daniel Golle <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/3b9c65ddb08c8bedf790aacf29871af026b6f0b7.1702849494.git.daniel@makrotopia.org Signed-off-by: Stephen Boyd <[email protected]>
1 parent afd36e9 commit d9bf944

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/clk/mediatek/clk-pll.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define CON0_BASE_EN BIT(0)
2424
#define CON0_PWR_ON BIT(0)
2525
#define CON0_ISO_EN BIT(1)
26-
#define PCW_CHG_MASK BIT(31)
26+
#define PCW_CHG_BIT 31
2727

2828
#define AUDPLL_TUNER_EN BIT(31)
2929

@@ -114,7 +114,8 @@ static void mtk_pll_set_rate_regs(struct mtk_clk_pll *pll, u32 pcw,
114114
pll->data->pcw_shift);
115115
val |= pcw << pll->data->pcw_shift;
116116
writel(val, pll->pcw_addr);
117-
chg = readl(pll->pcw_chg_addr) | PCW_CHG_MASK;
117+
chg = readl(pll->pcw_chg_addr) |
118+
BIT(pll->data->pcw_chg_bit ? : PCW_CHG_BIT);
118119
writel(chg, pll->pcw_chg_addr);
119120
if (pll->tuner_addr)
120121
writel(val + 1, pll->tuner_addr);

drivers/clk/mediatek/clk-pll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct mtk_pll_data {
4848
const char *parent_name;
4949
u32 en_reg;
5050
u8 pll_en_bit; /* Assume 0, indicates BIT(0) by default */
51+
u8 pcw_chg_bit;
5152
};
5253

5354
/*

0 commit comments

Comments
 (0)