• Home
  • Raw
  • Download

Lines Matching +full:reg +full:- +full:init

1 // SPDX-License-Identifier:	GPL-2.0
6 #include <linux/clk-provider.h>
9 #include "stratix10-clk.h"
25 val = readl(socfpgaclk->hw.reg); in clk_peri_c_clk_recalc_rate()
26 val &= GENMASK(SWCTRLBTCLKSEN_SHIFT - 1, 0); in clk_peri_c_clk_recalc_rate()
38 if (socfpgaclk->fixed_div) { in clk_peri_cnt_clk_recalc_rate()
39 div = socfpgaclk->fixed_div; in clk_peri_cnt_clk_recalc_rate()
41 if (socfpgaclk->hw.reg) in clk_peri_cnt_clk_recalc_rate()
42 div = ((readl(socfpgaclk->hw.reg) & 0x7ff) + 1); in clk_peri_cnt_clk_recalc_rate()
55 if (socfpgaclk->bypass_reg) { in clk_periclk_get_parent()
56 mask = (0x1 << socfpgaclk->bypass_shift); in clk_periclk_get_parent()
57 parent = ((readl(socfpgaclk->bypass_reg) & mask) >> in clk_periclk_get_parent()
58 socfpgaclk->bypass_shift); in clk_periclk_get_parent()
63 if (socfpgaclk->hw.reg) { in clk_periclk_get_parent()
64 clk_src = readl(socfpgaclk->hw.reg); in clk_periclk_get_parent()
82 void __iomem *reg) in s10_register_periph() argument
86 struct clk_init_data init; in s10_register_periph() local
87 const char *name = clks->name; in s10_register_periph()
88 const char *parent_name = clks->parent_name; in s10_register_periph()
94 periph_clk->hw.reg = reg + clks->offset; in s10_register_periph()
96 init.name = name; in s10_register_periph()
97 init.ops = &peri_c_clk_ops; in s10_register_periph()
98 init.flags = clks->flags; in s10_register_periph()
100 init.num_parents = clks->num_parents; in s10_register_periph()
101 init.parent_names = parent_name ? &parent_name : NULL; in s10_register_periph()
102 if (init.parent_names == NULL) in s10_register_periph()
103 init.parent_data = clks->parent_data; in s10_register_periph()
105 periph_clk->hw.hw.init = &init; in s10_register_periph()
107 clk = clk_register(NULL, &periph_clk->hw.hw); in s10_register_periph()
120 struct clk_init_data init; in s10_register_cnt_periph() local
121 const char *name = clks->name; in s10_register_cnt_periph()
122 const char *parent_name = clks->parent_name; in s10_register_cnt_periph()
128 if (clks->offset) in s10_register_cnt_periph()
129 periph_clk->hw.reg = regbase + clks->offset; in s10_register_cnt_periph()
131 periph_clk->hw.reg = NULL; in s10_register_cnt_periph()
133 if (clks->bypass_reg) in s10_register_cnt_periph()
134 periph_clk->bypass_reg = regbase + clks->bypass_reg; in s10_register_cnt_periph()
136 periph_clk->bypass_reg = NULL; in s10_register_cnt_periph()
137 periph_clk->bypass_shift = clks->bypass_shift; in s10_register_cnt_periph()
138 periph_clk->fixed_div = clks->fixed_divider; in s10_register_cnt_periph()
140 init.name = name; in s10_register_cnt_periph()
141 init.ops = &peri_cnt_clk_ops; in s10_register_cnt_periph()
142 init.flags = clks->flags; in s10_register_cnt_periph()
144 init.num_parents = clks->num_parents; in s10_register_cnt_periph()
145 init.parent_names = parent_name ? &parent_name : NULL; in s10_register_cnt_periph()
146 if (init.parent_names == NULL) in s10_register_cnt_periph()
147 init.parent_data = clks->parent_data; in s10_register_cnt_periph()
149 periph_clk->hw.hw.init = &init; in s10_register_cnt_periph()
151 clk = clk_register(NULL, &periph_clk->hw.hw); in s10_register_cnt_periph()