| /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 95 clk = node.sysctl_data; 98 rate = clk_get_rate(clk); 107 struct clk *clk, *clk_parent; local 125 struct clk *clk, *clk_parent; local [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 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 136 clk = meson_clk_clock_find(sc, name); 137 if (clk == NULL 152 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 171 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 193 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 215 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 236 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 250 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 262 struct meson_clk_clk *clk = (struct meson_clk_clk *)clkp; local 331 struct meson_clk_clk *clk; local [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 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 73 clk = imx_ccm_clock_find(sc, name); 74 if (clk == NULL 89 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 108 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 130 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 152 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 173 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 187 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 199 struct imx_ccm_clk *clk = (struct imx_ccm_clk *)clkp; local 276 struct imx_ccm_clk *clk; local [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 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 135 clk = sunxi_ccu_clock_find(sc, name); 136 if (clk == NULL 151 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 170 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 192 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 214 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 235 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 249 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 261 struct sunxi_ccu_clk *clk = (struct sunxi_ccu_clk *)clkp; local 341 struct sunxi_ccu_clk *clk; local [all...] |
| /src/sys/arch/arm/ti/ |
| ti_comp_clock.c | 39 #include <dev/clk/clk_backend.h> 46 static struct clk *ti_comp_clock_decode(device_t, int, const void *, size_t); 52 static struct clk *ti_comp_clock_get(void *, const char *); 53 static void ti_comp_clock_put(void *, struct clk *); 54 static u_int ti_comp_clock_get_rate(void *, struct clk *); 55 static int ti_comp_clock_enable(void *, struct clk *); 56 static int ti_comp_clock_disable(void *, struct clk *); 57 static struct clk *ti_comp_clock_get_parent(void *, struct clk *); 58 static int ti_comp_clock_set_parent(void *, struct clk *, struct clk *) [all...] |
| ti_prcm.c | 39 #include <dev/clk/clk_backend.h> 46 static struct clk * 50 struct ti_prcm_clk *clk; local 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 87 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local 109 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local 130 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local 144 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local 156 struct ti_prcm_clk *clk = (struct ti_prcm_clk *)clkp; local 266 struct clk *clk; local [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 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 123 clk = rk_cru_clock_find(sc, name); 124 if (clk == NULL 139 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 159 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 182 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 205 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 226 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 239 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 251 struct rk_cru_clk *clk = (struct rk_cru_clk *)clkp; local 340 struct rk_cru_clk *clk; local [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 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 306 struct mcp77_clk *clk = mcp77_clk(base); local 422 struct mcp77_clk *clk; local [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 595 struct nvkm_clk *clk = local 614 struct nvkm_clk *clk = nvkm_clk(subdev); local 625 struct nvkm_clk *clk = nvkm_clk(subdev); local 659 struct nvkm_clk *clk = nvkm_clk(subdev); local [all...] |
| /src/sys/arch/hp300/hp300/ |
| clock.c | 109 volatile struct clkreg *clk; local 114 clk = (volatile struct clkreg *)clkstd[0]; 127 clk->clk_cr2 = CLK_CR1; 128 clk->clk_cr1 = CLK_RESET; 136 __asm volatile(" movpw %0,%1@(5)" : : "d" (intvl), "a" (clk)); 139 clk->clk_cr2 = CLK_CR1; 140 clk->clk_cr1 = CLK_IENAB; 145 csr = clk->clk_sr; 151 "a" (clk), "d" (intvl)); 160 csr = clk->clk_sr 192 volatile struct clkreg *clk; local 286 volatile struct clkreg *clk; local 314 volatile struct clkreg *clk; local [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 423 struct cycv_clk *clk; local 455 struct cycv_clk *clk = (struct cycv_clk *) base_clk; local 520 struct cycv_clk *clk = (struct cycv_clk *) base_clk; local 564 struct cycv_clk *clk = (struct cycv_clk *) base_clk; local [all...] |