/src/sys/dev/clk/ |
clk.h | 1 /* $NetBSD: clk.h,v 1.3 2018/04/01 21:11:01 bouyer Exp $ */ 33 struct clk; 35 struct clk * clk_get(struct clk_domain *, const char *); 36 void clk_put(struct clk *); 37 u_int clk_get_rate(struct clk *); 38 int clk_set_rate(struct clk *, u_int); 39 u_int clk_round_rate(struct clk *, u_int); 40 int clk_enable(struct clk *); 41 int clk_disable(struct clk *); 42 int clk_set_parent(struct clk *, struct clk *) [all...] |
clk_backend.h | 34 #include <dev/clk/clk.h> 43 struct clk { struct 51 struct clk *(*get)(void *, const char *); 52 void (*put)(void *, struct clk *); 54 u_int (*get_rate)(void *, struct clk *); 55 int (*set_rate)(void *, struct clk *, u_int); 56 u_int (*round_rate)(void *, struct clk *, u_int); 57 int (*enable)(void *, struct clk *); 58 int (*disable)(void *, struct clk *); [all...] |
clk.c | 1 /* $NetBSD: clk.c,v 1.8 2024/06/12 06:23:56 rin Exp $ */ 30 __KERNEL_RCSID(0, "$NetBSD: clk.c,v 1.8 2024/06/12 06:23:56 rin Exp $"); 36 #include <dev/clk/clk.h> 37 #include <dev/clk/clk_backend.h> 58 CTLFLAG_PERMANENT, CTLTYPE_NODE, "clk", NULL, 91 struct clk *clk; local in function:clk_sysctl_rate_helper 95 clk = node.sysctl_data; 98 rate = clk_get_rate(clk); 107 struct clk *clk, *clk_parent; local in function:clk_sysctl_parent_helper 125 struct clk *clk, *clk_parent; local in function:clk_sysctl_parent_domain_helper [all...] |
/src/sys/external/bsd/drm2/include/linux/ |
clk.h | 1 /* $NetBSD: clk.h,v 1.3 2018/08/27 07:57:22 riastradh Exp $ */ 35 /* XXX Use FDT as a proxy for clk API until we have a clk flag. */ 43 #include <dev/clk/clk.h> 47 struct clk; 50 clk_get_rate(struct clk *clk)
|
/src/sys/dev/fdt/ |
fdt_clock.h | 33 #include <dev/clk/clk.h> 36 struct clk * (*decode)(device_t, int, const void *, size_t); 42 struct clk * fdtbus_clock_get(int, const char *); 43 struct clk * fdtbus_clock_get_index(int, u_int); 44 struct clk * fdtbus_clock_byname(const char *);
|
/src/sys/arch/arm/amlogic/ |
meson_clk_fixed_factor.c | 35 #include <dev/clk/clk_backend.h> 40 meson_clk_fixed_factor_get_parent_rate(struct clk *clkp) 42 struct clk *clkp_parent; 53 struct meson_clk_clk *clk) 55 struct meson_clk_fixed_factor *fixed_factor = &clk->u.fixed_factor; 56 struct clk *clkp = &clk->base; 58 KASSERT(clk->type == MESON_CLK_FIXED_FACTOR); 68 meson_clk_fixed_factor_set_parent_rate(struct clk *clkp, u_int rate) 70 struct clk *clkp_parent [all...] |
meson_clk.c | 40 #include <dev/clk/clk_backend.h> 105 static struct clk * 110 struct meson_clk_clk *clk; local in function:meson_clk_clock_decode 119 clk = &sc->sc_clks[clock_id]; 120 if (clk->type == MESON_CLK_UNKNOWN) 123 return &clk->base; 130 static struct clk * 134 struct meson_clk_clk *clk; local in function:meson_clk_clock_get 136 clk = meson_clk_clock_find(sc, name); 137 if (clk == NULL 152 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_get_rate 171 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_set_rate 193 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_round_rate 215 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_enable 236 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_disable 250 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_set_parent 262 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local in function:meson_clk_clock_get_parent 331 struct meson_clk_clk *clk; local in function:meson_clk_print [all...] |
meson_clk_fixed.c | 35 #include <dev/clk/clk_backend.h> 40 meson_clk_fixed_get_rate(struct meson_clk_softc *sc, struct meson_clk_clk *clk) 42 struct meson_clk_fixed *fixed = &clk->u.fixed; 44 KASSERT(clk->type == MESON_CLK_FIXED);
|
meson_clk_gate.c | 35 #include <dev/clk/clk_backend.h> 40 meson_clk_gate_enable(struct meson_clk_softc *sc, struct meson_clk_clk *clk, 43 struct meson_clk_gate *gate = &clk->u.gate; 47 KASSERT(clk->type == MESON_CLK_GATE); 66 meson_clk_gate_get_parent(struct meson_clk_softc *sc, struct meson_clk_clk *clk) 68 struct meson_clk_gate *gate = &clk->u.gate; 70 KASSERT(clk->type == MESON_CLK_GATE);
|
/src/sys/arch/arm/nxp/ |
imx_ccm_fixed_factor.c | 35 #include <dev/clk/clk_backend.h> 40 imx_ccm_fixed_factor_get_parent_rate(struct clk *clkp) 42 struct clk *clkp_parent; 53 struct imx_ccm_clk *clk) 55 struct imx_ccm_fixed_factor *fixed_factor = &clk->u.fixed_factor; 56 struct clk *clkp = &clk->base; 58 KASSERT(clk->type == IMX_CCM_FIXED_FACTOR); 68 imx_ccm_fixed_factor_set_parent_rate(struct clk *clkp, u_int rate) 70 struct clk *clkp_parent [all...] |
imx_ccm_extclk.c | 35 #include <dev/clk/clk_backend.h> 42 imx_ccm_extclk_enable(struct imx_ccm_softc *sc, struct imx_ccm_clk *clk, 45 struct clk *extclk; 47 KASSERT(clk->type == IMX_CCM_EXTCLK); 49 if ((extclk = fdtbus_clock_byname(clk->u.extclk)) == NULL) 57 struct imx_ccm_clk *clk) 59 struct clk *extclk; 61 KASSERT(clk->type == IMX_CCM_EXTCLK); 63 if ((extclk = fdtbus_clock_byname(clk->u.extclk)) == NULL) 71 struct imx_ccm_clk *clk, u_int rate [all...] |
imx_ccm.c | 39 #include <dev/clk/clk_backend.h> 43 static struct clk * 47 struct imx_ccm_clk *clk; local in function:imx_ccm_clock_decode 55 clk = &sc->sc_clks[i]; 56 if (clk->id == clock_id) 57 return &clk->base; 67 static struct clk * 71 struct imx_ccm_clk *clk; local in function:imx_ccm_clock_get 73 clk = imx_ccm_clock_find(sc, name); 74 if (clk == NULL 89 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_get_rate 108 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_set_rate 130 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_round_rate 152 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_enable 173 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_disable 187 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_set_parent 199 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local in function:imx_ccm_clock_get_parent 276 struct imx_ccm_clk *clk; local in function:imx_ccm_print [all...] |
imx_ccm_gate.c | 35 #include <dev/clk/clk_backend.h> 40 imx_ccm_gate_enable(struct imx_ccm_softc *sc, struct imx_ccm_clk *clk, 43 struct imx_ccm_gate *gate = &clk->u.gate; 46 KASSERT(clk->type == IMX_CCM_GATE); 48 val = CCM_READ(sc, clk->regidx, gate->reg); 53 CCM_WRITE(sc, clk->regidx, gate->reg, val); 60 struct imx_ccm_clk *clk) 62 struct imx_ccm_gate *gate = &clk->u.gate; 64 KASSERT(clk->type == IMX_CCM_GATE);
|
imx_ccm_fixed.c | 35 #include <dev/clk/clk_backend.h> 41 struct imx_ccm_clk *clk) 43 struct imx_ccm_fixed *fixed = &clk->u.fixed; 45 KASSERT(clk->type == IMX_CCM_FIXED);
|
imx_ccm_pll.c | 35 #include <dev/clk/clk_backend.h> 45 imx_ccm_pll_enable(struct imx_ccm_softc *sc, struct imx_ccm_clk *clk, 48 struct imx_ccm_pll *pll = &clk->u.pll; 51 KASSERT(clk->type == IMX_CCM_PLL); 58 val = CCM_READ(sc, clk->regidx, pll->reg); 63 CCM_WRITE(sc, clk->regidx, pll->reg, val); 70 struct imx_ccm_clk *clk) 72 struct imx_ccm_pll *pll= &clk->u.pll; 73 struct clk *clkp, *clkp_parent; 75 KASSERT(clk->type == IMX_CCM_PLL) [all...] |
/src/sys/arch/arm/sunxi/ |
sunxi_ccu_fixed_factor.c | 35 #include <dev/clk/clk_backend.h> 40 sunxi_ccu_fixed_factor_get_parent_rate(struct clk *clkp) 42 struct clk *clkp_parent; 53 struct sunxi_ccu_clk *clk) 55 struct sunxi_ccu_fixed_factor *fixed_factor = &clk->u.fixed_factor; 56 struct clk *clkp = &clk->base; 58 KASSERT(clk->type == SUNXI_CCU_FIXED_FACTOR); 68 sunxi_ccu_fixed_factor_set_parent_rate(struct clk *clkp, u_int rate) 70 struct clk *clkp_parent [all...] |
sunxi_ccu.c | 43 #include <dev/clk/clk_backend.h> 104 static struct clk * 109 struct sunxi_ccu_clk *clk; local in function:sunxi_ccu_clock_decode 118 clk = &sc->sc_clks[clock_id]; 119 if (clk->type == SUNXI_CCU_UNKNOWN) 122 return &clk->base; 129 static struct clk * 133 struct sunxi_ccu_clk *clk; local in function:sunxi_ccu_clock_get 135 clk = sunxi_ccu_clock_find(sc, name); 136 if (clk == NULL 151 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_get_rate 170 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_set_rate 192 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_round_rate 214 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_enable 235 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_disable 249 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_set_parent 261 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local in function:sunxi_ccu_clock_get_parent 341 struct sunxi_ccu_clk *clk; local in function:sunxi_ccu_print [all...] |
sunxi_ccu_gate.c | 35 #include <dev/clk/clk_backend.h> 40 sunxi_ccu_gate_enable(struct sunxi_ccu_softc *sc, struct sunxi_ccu_clk *clk, 43 struct sunxi_ccu_gate *gate = &clk->u.gate; 46 KASSERT(clk->type == SUNXI_CCU_GATE); 59 sunxi_ccu_gate_get_parent(struct sunxi_ccu_softc *sc, struct sunxi_ccu_clk *clk) 61 struct sunxi_ccu_gate *gate = &clk->u.gate; 63 KASSERT(clk->type == SUNXI_CCU_GATE);
|
/src/sys/arch/arm/ti/ |
ti_prcm.c | 39 #include <dev/clk/clk_backend.h> 46 static struct clk * 50 struct ti_prcm_clk *clk; local in function:ti_prcm_clock_get 52 clk = ti_prcm_clock_find(sc, name); 53 if (clk == NULL) 56 return &clk->base; 60 ti_prcm_clock_put(void *priv, struct clk *clk) 65 ti_prcm_clock_get_rate(void *priv, struct clk *clkp) 68 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp local in function:ti_prcm_clock_get_rate 87 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local in function:ti_prcm_clock_set_rate 109 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local in function:ti_prcm_clock_enable 130 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local in function:ti_prcm_clock_disable 144 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local in function:ti_prcm_clock_set_parent 156 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local in function:ti_prcm_clock_get_parent 266 struct clk *clk; local in function:ti_prcm_enable_hwmod [all...] |
/src/sys/arch/arm/rockchip/ |
rk_cru.c | 42 #include <dev/clk/clk_backend.h> 93 static struct clk * 97 struct rk_cru_clk *clk; local in function:rk_cru_clock_decode 105 clk = &sc->sc_clks[i]; 106 if (clk->id == clock_id) 107 return &clk->base; 117 static struct clk * 121 struct rk_cru_clk *clk; local in function:rk_cru_clock_get 123 clk = rk_cru_clock_find(sc, name); 124 if (clk == NULL 139 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_get_rate 159 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_set_rate 182 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_round_rate 205 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_enable 226 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_disable 239 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_set_parent 251 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local in function:rk_cru_clock_get_parent 340 struct rk_cru_clk *clk; local in function:rk_cru_print [all...] |
rk_cru_gate.c | 35 #include <dev/clk/clk_backend.h> 40 rk_cru_gate_enable(struct rk_cru_softc *sc, struct rk_cru_clk *clk, 43 struct rk_cru_gate *gate = &clk->u.gate; 45 KASSERT(clk->type == RK_CRU_GATE); 57 struct rk_cru_clk *clk) 59 struct rk_cru_gate *gate = &clk->u.gate; 61 KASSERT(clk->type == RK_CRU_GATE);
|
/src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/ |
nouveau_nvkm_subdev_clk_mcp77.c | 47 read_div(struct mcp77_clk *clk) 49 struct nvkm_device *device = clk->base.subdev.device; 54 read_pll(struct mcp77_clk *clk, u32 base) 56 struct nvkm_device *device = clk->base.subdev.device; 59 u32 ref = nvkm_clk_read(&clk->base, nv_clk_src_href); 88 struct mcp77_clk *clk = mcp77_clk(base); local in function:mcp77_clk_read 89 struct nvkm_subdev *subdev = &clk->base.subdev; 100 return nvkm_clk_read(&clk->base, nv_clk_src_href) * 4; 102 return nvkm_clk_read(&clk->base, nv_clk_src_href) * 2 / 3; 105 case 0x00000000: return nvkm_clk_read(&clk->base, nv_clk_src_hclkm2d3) 210 struct mcp77_clk *clk = mcp77_clk(base); local in function:mcp77_clk_calc 306 struct mcp77_clk *clk = mcp77_clk(base); local in function:mcp77_clk_prog 422 struct mcp77_clk *clk; local in function:mcp77_clk_new [all...] |
nouveau_nvkm_subdev_clk_base.c | 46 nvkm_clk_adjust(struct nvkm_clk *clk, bool adjust, 49 struct nvkm_bios *bios = clk->subdev.device->bios; 84 nvkm_cstate_valid(struct nvkm_clk *clk, struct nvkm_cstate *cstate, 87 const struct nvkm_domain *domain = clk->domains; 88 struct nvkm_volt *volt = clk->subdev.device->volt; 94 switch (clk->boost_mode) { 96 if (clk->base_khz && freq > clk->base_khz) 100 if (clk->boost_khz && freq > clk->boost_khz 305 struct nvkm_clk *clk = container_of(work, typeof(*clk), work); local in function:nvkm_pstate_work 595 struct nvkm_clk *clk = local in function:nvkm_clk_pwrsrc 614 struct nvkm_clk *clk = nvkm_clk(subdev); local in function:nvkm_clk_fini 625 struct nvkm_clk *clk = nvkm_clk(subdev); local in function:nvkm_clk_init 659 struct nvkm_clk *clk = nvkm_clk(subdev); local in function:nvkm_clk_dtor [all...] |
/src/sys/arch/hp300/hp300/ |
clock.c | 110 volatile struct clkreg *clk; local in function:hp300_calibrate_delay 115 clk = (volatile struct clkreg *)clkstd[0]; 124 clk->clk_cr2 = CLK_CR1; 125 clk->clk_cr1 = CLK_RESET; 133 __asm volatile(" movpw %0,%1@(5)" : : "d" (intvl), "a" (clk)); 136 clk->clk_cr2 = CLK_CR1; 137 clk->clk_cr1 = CLK_IENAB; 142 csr = clk->clk_sr; 148 "a" (clk), "d" (intvl)); 157 csr = clk->clk_sr 189 volatile struct clkreg *clk; local in function:cpu_initclocks 283 volatile struct clkreg *clk; local in function:statintr 311 volatile struct clkreg *clk; local in function:mc6840_counter [all...] |
/src/sys/arch/arm/altera/ |
cycv_clkmgr.c | 17 #include <dev/clk/clk_backend.h> 29 static struct clk *cycv_clkmgr_clock_decode(device_t, int, const void *, 36 static struct clk *cycv_clkmgr_clock_get(void *, const char *); 37 static void cycv_clkmgr_clock_put(void *, struct clk *); 38 static u_int cycv_clkmgr_clock_get_rate(void *, struct clk *); 39 static int cycv_clkmgr_clock_set_rate(void *, struct clk *, u_int); 40 static int cycv_clkmgr_clock_enable(void *, struct clk *); 41 static int cycv_clkmgr_clock_disable(void *, struct clk *); 42 static int cycv_clkmgr_clock_set_parent(void *, struct clk *, struct clk *); 227 struct cycv_clk *clk = &sc->sc_clocks[clkno]; local in function:cycv_clkmgr_clock_parse 423 struct cycv_clk *clk; local in function:cycv_clkmgr_clock_decode 455 struct cycv_clk *clk = (struct cycv_clk *) base_clk; local in function:cycv_clkmgr_clock_get_rate 520 struct cycv_clk *clk = (struct cycv_clk *) base_clk; local in function:cycv_clkmgr_clock_set 564 struct cycv_clk *clk = (struct cycv_clk *) base_clk; local in function:cycv_clkmgr_clock_get_parent [all...] |