Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
drivers/clk/clkdev.c
int clk_register_clkdev(struct clk *clk, const char *con_id, const char *dev_id) { struct clk_lookup *cl; if (IS_ERR(clk)) return PTR_ERR(clk); return do_clk_register_clkdev(__clk_get_hw(clk), &cl, con_id, dev_id); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static int clk_dummy_minimize_rate(struct clk_hw *hw, struct clk_rate_request *req) { if (req->min_rate > 0) req->rate = req->min_rate; return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_test_set_get_rate(struct kunit *test) { struct clk_dummy_context *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); unsigned long rate; KUNIT_ASSERT_EQ(test, clk_set_rate(clk, DUMMY_CLOCK_RATE_1), 0); rate = clk_get_rate(clk); KUNIT_ASSERT_GT(tes...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static int clk_uncached_test_init(struct kunit *test) { struct clk_dummy_context *ctx; int ret; ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; test->priv = ctx; ctx->rate = DUMMY_CLOCK_INIT_RATE; ctx->hw.init = CLK_HW_INIT_NO_PARENT("test-clk", &clk_dummy_rate_ops, ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_test_uncached_updated_rate_set_range(struct kunit *test) { struct clk_dummy_context *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); unsigned long rate; ctx->rate = DUMMY_CLOCK_RATE_1 + 1000; KUNIT_ASSERT_EQ( test, clk_set_rate_range(clk, DU...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static int clk_orphan_transparent_multiple_parent_mux_test_init(struct kunit *test) { struct clk_multiple_parent_ctx *ctx; const char *parents[2] = {"missing-parent", "proper-parent"}; int ret; ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; test->priv = ctx; ctx->par...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_test_orphan_transparent_multiple_parent_mux_set_range_set_parent_get_rate( struct kunit *test) { struct clk_multiple_parent_ctx *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); struct clk *parent; unsigned long rate; int ret; kunit_skip(test...
[ 0, 1 ]
Linux Kernel
drivers/clk/clk_test.c
static int clk_single_parent_mux_test_init(struct kunit *test) { struct clk_single_parent_ctx *ctx; int ret; ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; test->priv = ctx; ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE; ctx->parent_ctx.hw.init = CLK_HW_INIT_NO_...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_test_single_parent_mux_get_parent(struct kunit *test) { struct clk_single_parent_ctx *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); struct clk *parent = clk_hw_get_clk(&ctx->parent_ctx.hw, NULL); KUNIT_EXPECT_TRUE(test, clk_is_match(clk_get_parent...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_test_single_parent_mux_set_range_disjoint_parent_last(struct kunit *test) { struct clk_single_parent_ctx *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); struct clk *parent; int ret; kunit_skip(test, "This needs to be fixed in the core."); pare...
[ 0, 1 ]
Linux Kernel
drivers/clk/clk_test.c
static int clk_orphan_transparent_single_parent_mux_test_init(struct kunit *test) { struct clk_single_parent_ctx *ctx; struct clk_init_data init = {}; const char *const parents[] = {"orphan_parent"}; int ret; ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; test->priv =...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_orphan_two_level_root_last_test_exit(struct kunit *test) { struct clk_single_parent_two_lvl_ctx *ctx = test->priv; clk_hw_unregister(&ctx->hw); clk_hw_unregister(&ctx->parent_ctx.hw); clk_hw_unregister(&ctx->parent_parent_ctx.hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_orphan_two_level_root_last_test_get_rate(struct kunit *test) { struct clk_single_parent_two_lvl_ctx *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); unsigned long rate; rate = clk_get_rate(clk); KUNIT_EXPECT_EQ(test, rate, DUMMY_CLOCK_INIT_RATE); ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_range_test_set_range_invalid(struct kunit *test) { struct clk_dummy_context *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); KUNIT_EXPECT_LT( test, clk_set_rate_range(clk, DUMMY_CLOCK_RATE_1 + 1000, DUMMY_CLOCK_RATE_1), 0); clk_pu...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_range_test_multiple_disjoints_range(struct kunit *test) { struct clk_dummy_context *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *user1, *user2; user1 = clk_hw_get_clk(hw, NULL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, user1); user2 = clk_hw_get_clk(hw, NULL); KUNIT_ASSERT_NOT_E...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_range_test_set_range_round_rate_higher(struct kunit *test) { struct clk_dummy_context *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); long rate; KUNIT_ASSERT_EQ( test, clk_set_rate_range(clk, DUMMY_CLOCK_RATE_1, DUMMY_CLOCK_RATE_2), 0); ra...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_range_test_set_range_get_rate_raised(struct kunit *test) { struct clk_dummy_context *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); unsigned long rate; KUNIT_ASSERT_EQ(test, clk_set_rate(clk, DUMMY_CLOCK_RATE_1 - 1000), 0); KUNIT_ASSERT_EQ( ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static int clk_leaf_mux_set_rate_parent_test_init(struct kunit *test) { struct clk_leaf_mux_ctx *ctx; const char *top_parents[2] = {"parent-0", "parent-1"}; int ret; ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; test->priv = ctx; ctx->mux_ctx.parents_ctx[0].hw.init ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_leaf_mux_set_rate_parent_determine_rate(struct kunit *test) { struct clk_leaf_mux_ctx *ctx = test->priv; struct clk_hw *hw = &ctx->hw; struct clk *clk = clk_hw_get_clk(hw, NULL); struct clk_rate_request req; unsigned long rate; int ret; rate = clk_get_rate(clk); KUNIT_ASSERT_EQ(test, ra...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk_test.c
static void clk_mux_notifier_set_parent_test(struct kunit *test) { struct clk_mux_notifier_ctx *ctx = test->priv; struct clk_hw *hw = &ctx->mux_ctx.hw; struct clk *clk = clk_hw_get_clk(hw, NULL); struct clk *new_parent = clk_hw_get_clk(&ctx->mux_ctx.parents_ctx[1].hw, NULL); int ret; ret = clk_set_pa...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static unsigned long da8xx_cfgchip_div4p5_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { return parent_rate * 2 / 9; }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static int __init of_da8xx_tbclksync_init(struct device *dev, struct regmap *regmap) { return of_da8xx_cfgchip_gate_clk_init(dev, &da8xx_tbclksync_info, regmap); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static int __init da8xx_cfgchip_register_async1(struct device *dev, struct regmap *regmap) { struct da8xx_cfgchip_mux_clk *mux; mux = da8xx_cfgchip_mux_clk_register(dev, &da850_async1_info, regmap); if (IS_ERR(mux)) return PTR_ERR(mux); clk_hw_register_clkd...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static int __init of_da8xx_cfgchip_init_mux_clock( struct device *dev, const struct da8xx_cfgchip_mux_clk_info *info, struct regmap *regmap) { struct da8xx_cfgchip_mux_clk *mux; mux = da8xx_cfgchip_mux_clk_register(dev, info, regmap); if (IS_ERR(mux)) return PTR_ERR(mux); return devm_of_clk_add_h...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static int __init of_da850_async3_init(struct device *dev, struct regmap *regmap) { return of_da8xx_cfgchip_init_mux_clock(dev, &da850_async3_info, regmap); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static void da8xx_usb0_clk48_disable(struct clk_hw *hw) { struct da8xx_usb0_clk48 *usb0 = to_da8xx_usb0_clk48(hw); unsigned int val; val = CFGCHIP2_PHYPWRDN; regmap_write_bits(usb0->regmap, CFGCHIP(2), val, val); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static int da8xx_usb0_clk48_is_enabled(struct clk_hw *hw) { struct da8xx_usb0_clk48 *usb0 = to_da8xx_usb0_clk48(hw); unsigned int val; regmap_read(usb0->regmap, CFGCHIP(2), &val); return !!(val & CFGCHIP2_PHYCLKGD); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static long da8xx_usb0_clk48_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { return 48000000; }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static int da8xx_usb1_clk48_set_parent(struct clk_hw *hw, u8 index) { struct da8xx_usb1_clk48 *usb1 = to_da8xx_usb1_clk48(hw); return regmap_write_bits(usb1->regmap, CFGCHIP(2), CFGCHIP2_USB1PHYCLKMUX, index ? CFGCHIP2_USB1PHYCLKMUX : 0); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/da8xx-cfgchip.c
static struct da8xx_usb1_clk48 * da8xx_cfgchip_register_usb1_clk48(struct device *dev, struct regmap *regmap) { const char *const parent_names[] = {"usb0_clk48", "usb_refclkin"}; struct da8xx_usb1_clk48 *usb1; struct clk_init_data init; int ret; usb1 = devm_kzalloc(dev, sizeof(*usb1), GFP_KERNEL); if (!usb...
[ 1, 0 ]
Linux Kernel
drivers/clk/davinci/pll-da850.c
int da850_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip) { struct clk *clk; davinci_pll_clk_register(dev, &da850_pll1_info, "oscin", base, cfgchip); davinci_pll_sysclk_register(dev, &pll1_sysclk1, base); clk = davinci_pll_sysclk_register(dev, &pll1_sysclk2, bas...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/pll-dm355.c
int dm355_pll2_init(struct device *dev, void __iomem *base, struct regmap *cfgchip) { davinci_pll_clk_register(dev, &dm355_pll2_info, "oscin", base, cfgchip); davinci_pll_sysclk_register(dev, &pll2_sysclk1, base); davinci_pll_sysclkbp_clk_register(dev, "pll2_sysclkbp", base); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/pll.c
static struct clk *davinci_pll_div_register(struct device *dev, const char *name, const char *parent_name, void __iomem *reg, bool fixed, u32 fl...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/pll.c
struct clk *davinci_pll_auxclk_register(struct device *dev, const char *name, void __iomem *base) { return clk_register_gate(dev, name, OSCIN_CLK_NAME, 0, base + CKEN, CKEN_AUXEN_SHIFT, 0, NULL); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/pll.c
struct clk *davinci_pll_sysclkbp_clk_register(struct device *dev, const char *name, void __iomem *base) { return clk_register_divider(dev, name, OSCIN_CLK_NAME, 0, base + BPDIV, DIV_RATIO_SHIFT, D...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/pll.c
struct clk * davinci_pll_sysclk_register(struct device *dev, const struct davinci_pll_sysclk_info *info, void __iomem *base) { const struct clk_ops *divider_ops = &clk_divider_ops; struct clk_gate *gate; struct clk_divider *divider; struct clk *clk; u32 ...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/pll.c
static struct davinci_pll_platform_data * davinci_pll_get_pdata(struct device *dev) { struct davinci_pll_platform_data *pdata = dev_get_platdata(dev); if (!pdata) pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) return NULL; /* for device tree, we need to fill in the struct */ if (...
[ 1, 0 ]
Linux Kernel
drivers/clk/davinci/pll.c
static int davinci_pll_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct davinci_pll_platform_data *pdata; const struct of_device_id *of_id; davinci_pll_init pll_init = NULL; void __iomem *base; of_id = of_match_device(davinci_pll_of_match, dev); if (of_id) pll_init = of_...
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc-da850.c
static int of_da850_psc1_init(struct device *dev, void __iomem *base) { return of_davinci_psc_clk_init(dev, da850_psc1_info, 32, base); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc-dm365.c
int dm365_psc_init(struct device *dev, void __iomem *base) { return davinci_psc_register_clocks(dev, dm365_psc_info, 52, base); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc.c
static inline const char *best_dev_name(struct device *dev) { const char *compatible; if (!of_property_read_string(dev->of_node, "compatible", &compatible)) return compatible; return dev_name(dev); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc.c
static int davinci_lpsc_clk_enable(struct clk_hw *hw) { struct davinci_lpsc_clk *lpsc = to_davinci_lpsc_clk(hw); davinci_lpsc_config(lpsc, LPSC_STATE_ENABLE); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc.c
static void davinci_lpsc_clk_disable(struct clk_hw *hw) { struct davinci_lpsc_clk *lpsc = to_davinci_lpsc_clk(hw); davinci_lpsc_config(lpsc, LPSC_STATE_DISABLE); }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc.c
static int davinci_lpsc_clk_is_enabled(struct clk_hw *hw) { struct davinci_lpsc_clk *lpsc = to_davinci_lpsc_clk(hw); u32 mdstat; regmap_read(lpsc->regmap, MDSTAT(lpsc->md), &mdstat); return (mdstat & MDSTAT_MCKOUT) ? 1 : 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/davinci/psc.c
static int davinci_psc_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) { struct davinci_psc_data *psc = to_davinci_psc_data(rcdev); struct clk *clk = psc->clk_data.clks[id]; return davinci_lpsc_clk_reset(clk, false); }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3519.c
static int hi3519_clk_probe(struct platform_device *pdev) { struct hi3519_crg_data *crg; crg = devm_kmalloc(&pdev->dev, sizeof(*crg), GFP_KERNEL); if (!crg) return -ENOMEM; crg->rstc = hisi_reset_init(pdev); if (!crg->rstc) return -ENOMEM; crg->clk_data = hi3519_clk_register(pdev); if (IS_ERR(...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3559a.c
static void hi3559av100_calc_pll(u32 *frac_val, u32 *postdiv1_val, u32 *postdiv2_val, u32 *fbdiv_val, u32 *refdiv_val, u64 rate) { u64 rem; *postdiv1_val = 2; *postdiv2_val = 1; rate = rate * ((*postdiv1_val) * (*postdiv2_val)); *frac_val = ...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3559a.c
static int hi3559av100_shub_default_clk_set(void) { void __iomem *crg_base; unsigned int val; crg_base = ioremap(CRG_BASE_ADDR, SZ_4K); val = readl_relaxed(crg_base + 0x20); val |= (0x2 << 24); writel_relaxed(val, crg_base + 0x20); /* UART: 192M/8 */ val = readl_relaxed(crg_base + 0x1C); val |= (0x...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3559a.c
static void hi3559av100_shub_clk_unregister(struct platform_device *pdev) { struct hisi_crg_dev *crg = platform_get_drvdata(pdev); of_clk_del_provider(pdev->dev.of_node); hisi_clk_unregister_gate(hi3559av100_shub_gate_clks, ARRAY_SIZE(hi3559av100_shub_gate_clks), ...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3559a.c
static int __init hi3559av100_crg_init(void) { return platform_driver_register(&hi3559av100_crg_driver); }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3559a.c
static void __exit hi3559av100_crg_exit(void) { platform_driver_unregister(&hi3559av100_crg_driver); }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3620.c
static void __init hi3620_mmc_clk_init(struct device_node *node) { void __iomem *base; int i, num = ARRAY_SIZE(hi3620_mmc_clks); struct clk_onecell_data *clk_data; if (!node) { pr_err("failed to find pctrl node in DTS\n"); return; } base = of_iomap(node, 0); if (!base) { pr_err("failed to m...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3660-stub.c
static unsigned long hi3660_stub_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct hi3660_stub_clk *stub_clk = to_stub_clk(hw); stub_clk->rate = readl(freq_reg + (stub_clk->id << 2)) * MHZ; return stub_clk->rate; }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3660-stub.c
static int hi3660_stub_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct hi3660_stub_clk *stub_clk = to_stub_clk(hw); stub_clk->msg[0] = stub_clk->cmd; stub_clk->msg[1] = rate / MHZ; dev_dbg(stub_clk_chan.cl.dev, "set rate msg[0]=0x%x ...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3660-stub.c
static struct clk_hw *hi3660_stub_clk_hw_get(struct of_phandle_args *clkspec, void *data) { unsigned int idx = clkspec->args[0]; if (idx >= HI3660_CLK_STUB_NUM) { pr_err("%s: invalid index %u\n", __func__, idx); return ERR_PTR(-EINVAL); } return &hi3660_st...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3660-stub.c
static int __init hi3660_stub_clk_init(void) { return platform_driver_register(&hi3660_stub_clk_driver); }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3670.c
static void hi3670_clk_media1_init(struct device_node *np) { struct hisi_clock_data *clk_data; int nr = ARRAY_SIZE(hi3670_media1_gate_sep_clks) + ARRAY_SIZE(hi3670_media1_gate_clks) + ARRAY_SIZE(hi3670_media1_mux_clks) + ARRAY_SIZE(hi3670_media1_divider_clks); clk_data = hisi_c...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi3670.c
static int hi3670_clk_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = pdev->dev.of_node; void (*init_func)(struct device_node *np); init_func = of_device_get_match_data(dev); if (!init_func) return -ENODEV; init_func(np); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi6220-stub.c
static long hi6220_stub_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { struct hi6220_stub_clk *stub_clk = to_stub_clk(hw); unsigned long new_rate = rate / 1000; switch (stub_clk->id) { case HI6220_STUB_ACPU0: new_rate = hi6220_acpu...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hi6220-stub.c
static int __init hi6220_stub_clk_init(void) { return platform_driver_register(&hi6220_stub_clk_driver); }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hisi-phase.c
static int hisi_phase_regval_to_degrees(struct clk_hisi_phase *phase, u32 regval) { int i; for (i = 0; i < phase->phase_num; i++) if (phase->phase_regvals[i] == regval) return phase->phase_degrees[i]; return -EINVAL; }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk-hisi-phase.c
static int hisi_phase_degrees_to_regval(struct clk_hisi_phase *phase, int degrees) { int i; for (i = 0; i < phase->phase_num; i++) if (phase->phase_degrees[i] == degrees) return phase->phase_regvals[i]; return -EINVAL; }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk.c
struct hisi_clock_data *hisi_clk_init(struct device_node *np, int nr_clks) { struct hisi_clock_data *clk_data; struct clk **clk_table; void __iomem *base; base = of_iomap(np, 0); if (!base) { pr_err("%s: failed to map clock registers\n", __func__); goto err; } clk_data = kzalloc(sizeof(*clk_dat...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/clk.c
void hisi_clk_register_gate_sep(const struct hisi_gate_clock *clks, int nums, struct hisi_clock_data *data) { struct clk *clk; void __iomem *base = data->base; int i; for (i = 0; i < nums; i++) { clk = hisi_register_clkgate_sep(NULL, clks[i].name, clks[i].parent_name, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clkdivider-hi6220.c
static long hi6220_clkdiv_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) { struct hi6220_clk_divider *dclk = to_hi6220_clk_divider(hw); return divider_round_rate(hw, rate, prate, dclk->table, dclk->width, CLK_DIVIDER_ROUND_C...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/clkgate-separated.c
static int clkgate_separated_enable(struct clk_hw *hw) { struct clkgate_separated *sclk; unsigned long flags = 0; u32 reg; sclk = container_of(hw, struct clkgate_separated, hw); if (sclk->lock) spin_lock_irqsave(sclk->lock, flags); reg = BIT(sclk->bit_idx); writel_relaxed(reg, sclk->enable); readl...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/crg-hi3516cv300.c
static struct hisi_clock_data * hi3516cv300_clk_register(struct platform_device *pdev) { struct hisi_clock_data *clk_data; int ret; clk_data = hisi_clk_alloc(pdev, HI3516CV300_CRG_NR_CLKS); if (!clk_data) return ERR_PTR(-ENOMEM); ret = hisi_clk_register_fixed_rate(hi3516cv300_fixed_rate_clks, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/crg-hi3798cv200.c
static int hi3798cv200_crg_probe(struct platform_device *pdev) { struct hisi_crg_dev *crg; crg = devm_kmalloc(&pdev->dev, sizeof(*crg), GFP_KERNEL); if (!crg) return -ENOMEM; crg->funcs = of_device_get_match_data(&pdev->dev); if (!crg->funcs) return -ENOENT; crg->rstc = hisi_reset_init(pdev); ...
[ 1, 0 ]
Linux Kernel
drivers/clk/hisilicon/crg-hi3798cv200.c
static int hi3798cv200_crg_remove(struct platform_device *pdev) { struct hisi_crg_dev *crg = platform_get_drvdata(pdev); hisi_reset_exit(crg->rstc); crg->funcs->unregister_clks(pdev); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/reset.c
static int hisi_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) { struct hisi_reset_controller *rstc = to_hisi_reset_controller(rcdev); unsigned long flags; u32 offset, reg; u8 bit; offset = (id & HISI_RESET_OFFSET_MASK) >> HISI_RESET_OFFSET_SHIFT; bit = id ...
[ 0, 0 ]
Linux Kernel
drivers/clk/hisilicon/reset.h
static inline struct hisi_reset_controller * hisi_reset_init(struct platform_device *pdev) { return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/imgtec/clk-boston.c
static u32 ext_field(u32 val, u32 mask) { return (val & mask) >> (ffs(mask) - 1); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-busy.c
static unsigned long clk_busy_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct clk_busy_divider *busy = to_clk_busy_divider(hw); return busy->div_ops->recalc_rate(&busy->div.hw, parent_rate); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-busy.c
static int clk_busy_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_busy_divider *busy = to_clk_busy_divider(hw); int ret; ret = busy->div_ops->set_rate(&busy->div.hw, rate, parent_rate); if (!ret) ret = clk_busy_wait(bus...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-busy.c
struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name, void __iomem *reg, u8 shift, u8 width, void __iomem *busy_reg, u8 busy_shift) { struct clk_busy_divider *busy; struc...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-busy.c
static int clk_busy_mux_set_parent(struct clk_hw *hw, u8 index) { struct clk_busy_mux *busy = to_clk_busy_mux(hw); int ret; ret = busy->mux_ops->set_parent(&busy->mux.hw, index); if (!ret) ret = clk_busy_wait(busy->reg, busy->shift); return ret; }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-7ulp.c
static int pcc_gate_enable(struct clk_hw *hw) { struct clk_gate *gate = to_clk_gate(hw); unsigned long flags; u32 val; int ret; ret = clk_gate_ops.enable(hw); if (ret) return ret; spin_lock_irqsave(gate->lock, flags); val = readl(gate->reg); val |= SW_RST; writel(val, gate->reg); spin_unlo...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-7ulp.c
static int pcc_gate_is_enabled(struct clk_hw *hw) { return clk_gate_ops.is_enabled(hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-7ulp.c
struct clk_hw *imx7ulp_clk_hw_composite(const char *name, const char *const *parent_names, int num_parents, bool mux_present, bool rate_present, bool gate_present, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-7ulp.c
struct clk_hw *imx8ulp_clk_hw_composite(const char *name, const char *const *parent_names, int num_parents, bool mux_present, bool rate_present, bool gate_present, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-8m.c
static unsigned long imx8m_clk_composite_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct clk_divider *divider = to_clk_divider(hw); unsigned long prediv_rate; unsigned int prediv_value; unsigned int div_value; prediv_value = readl(divider->r...
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-8m.c
static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_divider *divider = to_clk_divider(hw); unsigned long flags; int prediv_value; int div_va...
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-93.c
static int imx93_clk_composite_wait_ready(struct clk_hw *hw, void __iomem *reg) { int ret; u32 val; ret = readl_poll_timeout_atomic(reg + STAT_OFFSET, val, !(val & BIT(CCM_BUSY_SHIFT)), 0, TIMEOUT_US); if (ret) pr_err("Slice[%s] b...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-93.c
static int imx93_clk_composite_gate_enable(struct clk_hw *hw) { imx93_clk_composite_gate_endisable(hw, 1); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-93.c
static void imx93_clk_composite_gate_disable(struct clk_hw *hw) { imx93_clk_composite_gate_endisable(hw, 0); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-93.c
static unsigned long imx93_clk_composite_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { return clk_divider_ops.recalc_rate(hw, parent_rate); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-93.c
static int imx93_clk_composite_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_divider *divider = to_clk_divider(hw); int value; unsigned long flags = 0; u32 val; in...
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-composite-93.c
static int imx93_clk_composite_mux_set_parent(struct clk_hw *hw, u8 index) { struct clk_mux *mux = to_clk_mux(hw); u32 val = clk_mux_index_to_val(mux->table, mux->flags, index); unsigned long flags = 0; u32 reg; int ret; if (mux->lock) spin_lock_irqsave(mux->lock, flags); reg = readl(mux->reg); r...
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-divider-gate.c
static int clk_divider_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { return clk_divider_ops.determine_rate(hw, req); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-divider-gate.c
static int clk_divider_gate_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_divider_gate *div_gate = to_clk_divider_gate(hw); struct clk_divider *div = to_clk_divider(hw); unsigned long flags; int value; u32 val; value = di...
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-divider-gate.c
static int clk_divider_is_enabled(struct clk_hw *hw) { struct clk_divider *div = to_clk_divider(hw); u32 val; val = readl(div->reg) >> div->shift; val &= clk_div_mask(div->width); return val ? 1 : 0; }
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-fixup-mux.c
static inline struct clk_fixup_mux *to_clk_fixup_mux(struct clk_hw *hw) { struct clk_mux *mux = to_clk_mux(hw); return container_of(mux, struct clk_fixup_mux, mux); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-frac-pll.c
static int clk_wait_ack(struct clk_frac_pll *pll) { u32 val; if (readl_relaxed(pll->base) & (PLL_PD_MASK | PLL_BYPASS_MASK)) return 0; /* Wait for the pll's divfi and divff to be reloaded */ return readl_poll_timeout(pll->base, val, val & PLL_NEWDIV_ACK, 0, PLL_FRAC_ACK_TIMEOUT...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-frac-pll.c
static void clk_pll_unprepare(struct clk_hw *hw) { struct clk_frac_pll *pll = to_clk_frac_pll(hw); u32 val; val = readl_relaxed(pll->base + PLL_CFG0); val |= PLL_PD_MASK; writel_relaxed(val, pll->base + PLL_CFG0); }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-frac-pll.c
static int clk_pll_is_prepared(struct clk_hw *hw) { struct clk_frac_pll *pll = to_clk_frac_pll(hw); u32 val; val = readl_relaxed(pll->base + PLL_CFG0); return (val & PLL_PD_MASK) ? 0 : 1; }
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-frac-pll.c
static unsigned long clk_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct clk_frac_pll *pll = to_clk_frac_pll(hw); u32 val, divff, divfi, divq; u64 temp64 = parent_rate; u64 rate; val = readl_relaxed(pll->base + PLL_CFG0); divq = (FIELD_GET(PL...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-frac-pll.c
static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_frac_pll *pll = to_clk_frac_pll(hw); u32 val, divfi, divff; u64 temp64; int ret; parent_rate *= 8; rate *= 2; divfi = rate / parent_rate; temp64 = parent_rate * divfi; ...
[ 1, 0 ]
Linux Kernel
drivers/clk/imx/clk-frac-pll.c
struct clk_hw *imx_clk_hw_frac_pll(const char *name, const char *parent_name, void __iomem *base) { struct clk_init_data init; struct clk_frac_pll *pll; struct clk_hw *hw; int ret; pll = kzalloc(sizeof(*pll), GFP_KERNEL); if (!pll) return ERR_PTR(-ENOMEM); init.na...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-fracn-gppll.c
static long clk_fracn_gppll_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) { struct clk_fracn_gppll *pll = to_clk_fracn_gppll(hw); const struct imx_fracn_gppll_rate_table *rate_table = pll->rate_table; int i; for (i = 0; i < pll->rate_count; i++) ...
[ 0, 0 ]
Linux Kernel
drivers/clk/imx/clk-fracn-gppll.c
static unsigned long clk_fracn_gppll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct clk_fracn_gppll *pll = to_clk_fracn_gppll(hw); const struct imx_fracn_gppll_rate_table *rate_table = pll->rate_table; u32 pll_numerator, pll_denominator, pll_div...
[ 1, 0 ]