Lines Matching full:clk
32 #include <dev/clk/clk.h>
35 #include <dev/clk/rockchip/rk_clk_composite.h>
68 printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg)
74 rk_clk_composite_read_4(struct clknode *clk, bus_addr_t addr, uint32_t *val) in rk_clk_composite_read_4() argument
78 sc = clknode_get_softc(clk); in rk_clk_composite_read_4()
82 CLKDEV_READ_4(clknode_get_device(clk), addr, val); in rk_clk_composite_read_4()
86 rk_clk_composite_write_4(struct clknode *clk, bus_addr_t addr, uint32_t val) in rk_clk_composite_write_4() argument
90 sc = clknode_get_softc(clk); in rk_clk_composite_write_4()
94 CLKDEV_WRITE_4(clknode_get_device(clk), addr, val); in rk_clk_composite_write_4()
98 rk_clk_composite_get_grf(struct clknode *clk) in rk_clk_composite_get_grf() argument
105 dev = clknode_get_device(clk); in rk_clk_composite_get_grf()
117 rk_clk_composite_init(struct clknode *clk, device_t dev) in rk_clk_composite_init() argument
122 sc = clknode_get_softc(clk); in rk_clk_composite_init()
124 sc->grf = rk_clk_composite_get_grf(clk); in rk_clk_composite_init()
127 clknode_get_name(clk)); in rk_clk_composite_init()
132 DEVICE_LOCK(clk); in rk_clk_composite_init()
133 READ4(clk, sc->muxdiv_offset, &val); in rk_clk_composite_init()
134 DEVICE_UNLOCK(clk); in rk_clk_composite_init()
139 clknode_init_parent_idx(clk, idx); in rk_clk_composite_init()
145 rk_clk_composite_set_mux(struct clknode *clk, int index) in rk_clk_composite_set_mux() argument
150 sc = clknode_get_softc(clk); in rk_clk_composite_set_mux()
156 DEVICE_LOCK(clk); in rk_clk_composite_set_mux()
160 WRITE4(clk, sc->muxdiv_offset, val); in rk_clk_composite_set_mux()
161 DEVICE_UNLOCK(clk); in rk_clk_composite_set_mux()
167 rk_clk_composite_recalc(struct clknode *clk, uint64_t *freq) in rk_clk_composite_recalc() argument
172 sc = clknode_get_softc(clk); in rk_clk_composite_recalc()
174 DEVICE_LOCK(clk); in rk_clk_composite_recalc()
176 READ4(clk, sc->muxdiv_offset, ®); in rk_clk_composite_recalc()
179 DEVICE_UNLOCK(clk); in rk_clk_composite_recalc()
223 rk_clk_composite_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, in rk_clk_composite_set_freq() argument
233 sc = clknode_get_softc(clk); in rk_clk_composite_set_freq()
235 p_names = clknode_get_parent_names(clk); in rk_clk_composite_set_freq()
237 p_idx != clknode_get_parents_num(clk); p_idx++) { in rk_clk_composite_set_freq()
270 p_idx = clknode_get_parent_idx(clk); in rk_clk_composite_set_freq()
274 clknode_set_parent_by_idx(clk, best_parent); in rk_clk_composite_set_freq()
281 DEVICE_LOCK(clk); in rk_clk_composite_set_freq()
285 WRITE4(clk, sc->muxdiv_offset, val); in rk_clk_composite_set_freq()
286 DEVICE_UNLOCK(clk); in rk_clk_composite_set_freq()
309 struct clknode *clk; in rk_clk_composite_register() local
312 clk = clknode_create(clkdom, &rk_clk_composite_clknode_class, in rk_clk_composite_register()
314 if (clk == NULL) in rk_clk_composite_register()
317 sc = clknode_get_softc(clk); in rk_clk_composite_register()
331 clknode_register(clkdom, clk); in rk_clk_composite_register()