Skip to content

Commit 093c3fa

Browse files
jbrun3tsuperna9999
authored andcommitted
clk: meson: axg: add hifi pll clock
Add the hifi pll to the axg clock controller. This clock maybe used as an input of the axg audio clock controller. It uses the same settings table as the gp0 pll but has a frac parameter allowing more precision. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
1 parent a4fb7df commit 093c3fa

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

drivers/clk/meson/axg.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,59 @@ static struct clk_regmap axg_gp0_pll = {
245245
},
246246
};
247247

248+
const struct reg_sequence axg_hifi_init_regs[] = {
249+
{ .reg = HHI_HIFI_PLL_CNTL1, .def = 0xc084b000 },
250+
{ .reg = HHI_HIFI_PLL_CNTL2, .def = 0xb75020be },
251+
{ .reg = HHI_HIFI_PLL_CNTL3, .def = 0x0a6a3a88 },
252+
{ .reg = HHI_HIFI_PLL_CNTL4, .def = 0xc000004d },
253+
{ .reg = HHI_HIFI_PLL_CNTL5, .def = 0x00058000 },
254+
{ .reg = HHI_HIFI_PLL_CNTL, .def = 0x40010250 },
255+
};
256+
257+
static struct clk_regmap axg_hifi_pll = {
258+
.data = &(struct meson_clk_pll_data){
259+
.m = {
260+
.reg_off = HHI_HIFI_PLL_CNTL,
261+
.shift = 0,
262+
.width = 9,
263+
},
264+
.n = {
265+
.reg_off = HHI_HIFI_PLL_CNTL,
266+
.shift = 9,
267+
.width = 5,
268+
},
269+
.od = {
270+
.reg_off = HHI_HIFI_PLL_CNTL,
271+
.shift = 16,
272+
.width = 2,
273+
},
274+
.frac = {
275+
.reg_off = HHI_HIFI_PLL_CNTL5,
276+
.shift = 0,
277+
.width = 13,
278+
},
279+
.l = {
280+
.reg_off = HHI_HIFI_PLL_CNTL,
281+
.shift = 31,
282+
.width = 1,
283+
},
284+
.rst = {
285+
.reg_off = HHI_HIFI_PLL_CNTL,
286+
.shift = 29,
287+
.width = 1,
288+
},
289+
.table = axg_gp0_pll_rate_table,
290+
.init_regs = axg_hifi_init_regs,
291+
.init_count = ARRAY_SIZE(axg_hifi_init_regs),
292+
.flags = CLK_MESON_PLL_ROUND_CLOSEST,
293+
},
294+
.hw.init = &(struct clk_init_data){
295+
.name = "hifi_pll",
296+
.ops = &meson_clk_pll_ops,
297+
.parent_names = (const char *[]){ "xtal" },
298+
.num_parents = 1,
299+
},
300+
};
248301

249302
static struct clk_fixed_factor axg_fclk_div2 = {
250303
.mult = 1,
@@ -767,6 +820,7 @@ static struct clk_hw_onecell_data axg_hw_onecell_data = {
767820
[CLKID_MPLL1_DIV] = &axg_mpll1_div.hw,
768821
[CLKID_MPLL2_DIV] = &axg_mpll2_div.hw,
769822
[CLKID_MPLL3_DIV] = &axg_mpll3_div.hw,
823+
[CLKID_HIFI_PLL] = &axg_hifi_pll.hw,
770824
[NR_CLKS] = NULL,
771825
},
772826
.num = NR_CLKS,
@@ -838,6 +892,7 @@ static struct clk_regmap *const axg_clk_regmaps[] = {
838892
&axg_fixed_pll,
839893
&axg_sys_pll,
840894
&axg_gp0_pll,
895+
&axg_hifi_pll,
841896
};
842897

843898
static const struct of_device_id clkc_match_table[] = {

drivers/clk/meson/axg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
#define CLKID_MPLL2_DIV 67
123123
#define CLKID_MPLL3_DIV 68
124124

125-
#define NR_CLKS 69
125+
#define NR_CLKS 70
126126

127127
/* include the CLKIDs that have been made part of the DT binding */
128128
#include <dt-bindings/clock/axg-clkc.h>

0 commit comments

Comments
 (0)