Skip to content

Commit aee9ffa

Browse files
laura-naobebarino
authored andcommitted
clk: mediatek: clk-pll: Add set/clr regs for shared PLL enable control
On MT8196, there are set/clr registers to control a shared PLL enable register. These are intended to prevent different masters from manipulating the PLLs independently. Add the corresponding en_set_reg and en_clr_reg fields to the mtk_pll_data structure. Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Laura Nao <laura.nao@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 5e12137 commit aee9ffa

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/clk/mediatek/clk-pll.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ struct clk_hw *mtk_clk_register_pll_ops(struct mtk_clk_pll *pll,
308308
pll->en_addr = base + data->en_reg;
309309
else
310310
pll->en_addr = pll->base_addr + REG_CON0;
311+
if (data->en_set_reg)
312+
pll->en_set_addr = base + data->en_set_reg;
313+
if (data->en_clr_reg)
314+
pll->en_clr_addr = base + data->en_clr_reg;
311315
pll->hw.init = &init;
312316
pll->data = data;
313317

drivers/clk/mediatek/clk-pll.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ struct mtk_pll_data {
4747
const struct mtk_pll_div_table *div_table;
4848
const char *parent_name;
4949
u32 en_reg;
50+
u32 en_set_reg;
51+
u32 en_clr_reg;
5052
u8 pll_en_bit; /* Assume 0, indicates BIT(0) by default */
5153
u8 pcw_chg_bit;
5254
};
@@ -68,6 +70,8 @@ struct mtk_clk_pll {
6870
void __iomem *pcw_addr;
6971
void __iomem *pcw_chg_addr;
7072
void __iomem *en_addr;
73+
void __iomem *en_set_addr;
74+
void __iomem *en_clr_addr;
7175
const struct mtk_pll_data *data;
7276
};
7377

0 commit comments

Comments
 (0)