Lines Matching +full:conf +full:- +full:clk
1 /*-
28 #include <sys/conf.h>
35 #include <dev/clk/clk_gate.h>
50 static int clknode_gate_init(struct clknode *clk, device_t dev);
51 static int clknode_gate_set_gate(struct clknode *clk, bool enable);
52 static int clknode_gate_get_gate(struct clknode *clk, bool *enable);
73 clknode_gate_init(struct clknode *clk, device_t dev) in clknode_gate_init() argument
76 clknode_init_parent_idx(clk, 0); in clknode_gate_init()
81 clknode_gate_set_gate(struct clknode *clk, bool enable) in clknode_gate_set_gate() argument
87 sc = clknode_get_softc(clk); in clknode_gate_set_gate()
88 DEVICE_LOCK(clk); in clknode_gate_set_gate()
89 rv = MD4(clk, sc->offset, sc->mask << sc->shift, in clknode_gate_set_gate()
90 (enable ? sc->on_value : sc->off_value) << sc->shift); in clknode_gate_set_gate()
92 DEVICE_UNLOCK(clk); in clknode_gate_set_gate()
95 RD4(clk, sc->offset, ®); in clknode_gate_set_gate()
96 DEVICE_UNLOCK(clk); in clknode_gate_set_gate()
101 clknode_gate_get_gate(struct clknode *clk, bool *enabled) in clknode_gate_get_gate() argument
107 sc = clknode_get_softc(clk); in clknode_gate_get_gate()
108 DEVICE_LOCK(clk); in clknode_gate_get_gate()
109 rv = RD4(clk, sc->offset, ®); in clknode_gate_get_gate()
110 DEVICE_UNLOCK(clk); in clknode_gate_get_gate()
113 reg = (reg >> sc->shift) & sc->mask; in clknode_gate_get_gate()
114 *enabled = reg == sc->on_value; in clknode_gate_get_gate()
121 struct clknode *clk; in clknode_gate_register() local
124 clk = clknode_create(clkdom, &clknode_gate_class, &clkdef->clkdef); in clknode_gate_register()
125 if (clk == NULL) in clknode_gate_register()
128 sc = clknode_get_softc(clk); in clknode_gate_register()
129 sc->offset = clkdef->offset; in clknode_gate_register()
130 sc->shift = clkdef->shift; in clknode_gate_register()
131 sc->mask = clkdef->mask; in clknode_gate_register()
132 sc->on_value = clkdef->on_value; in clknode_gate_register()
133 sc->off_value = clkdef->off_value; in clknode_gate_register()
134 sc->gate_flags = clkdef->gate_flags; in clknode_gate_register()
136 clknode_register(clkdom, clk); in clknode_gate_register()