Lines Matching +full:conf +full:- +full:clk
1 /*-
28 #include <sys/conf.h>
35 #include <dev/clk/clk_mux.h>
50 static int clknode_mux_init(struct clknode *clk, device_t dev);
51 static int clknode_mux_set_mux(struct clknode *clk, int idx);
71 clknode_mux_init(struct clknode *clk, device_t dev) in clknode_mux_init() argument
77 sc = clknode_get_softc(clk); in clknode_mux_init()
79 DEVICE_LOCK(clk); in clknode_mux_init()
80 rv = RD4(clk, sc->offset, ®); in clknode_mux_init()
81 DEVICE_UNLOCK(clk); in clknode_mux_init()
85 reg = (reg >> sc->shift) & sc->mask; in clknode_mux_init()
86 clknode_init_parent_idx(clk, reg); in clknode_mux_init()
91 clknode_mux_set_mux(struct clknode *clk, int idx) in clknode_mux_set_mux() argument
97 sc = clknode_get_softc(clk); in clknode_mux_set_mux()
99 DEVICE_LOCK(clk); in clknode_mux_set_mux()
100 rv = MD4(clk, sc->offset, sc->mask << sc->shift, in clknode_mux_set_mux()
101 (idx & sc->mask) << sc->shift); in clknode_mux_set_mux()
103 DEVICE_UNLOCK(clk); in clknode_mux_set_mux()
106 RD4(clk, sc->offset, ®); in clknode_mux_set_mux()
107 DEVICE_UNLOCK(clk); in clknode_mux_set_mux()
115 struct clknode *clk; in clknode_mux_register() local
118 clk = clknode_create(clkdom, &clknode_mux_class, &clkdef->clkdef); in clknode_mux_register()
119 if (clk == NULL) in clknode_mux_register()
122 sc = clknode_get_softc(clk); in clknode_mux_register()
123 sc->offset = clkdef->offset; in clknode_mux_register()
124 sc->shift = clkdef->shift; in clknode_mux_register()
125 sc->mask = (1 << clkdef->width) - 1; in clknode_mux_register()
126 sc->mux_flags = clkdef->mux_flags; in clknode_mux_register()
128 clknode_register(clkdom, clk); in clknode_mux_register()