Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
drivers/clk/clk-milbeaut.c
static int m10v_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; u32 write_en = BIT(fls(mux->mask) - 1); if (mux->lock) spin_lock_irqsave(mux->lock, flags); else __...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-milbeaut.c
static struct clk_hw *m10v_clk_hw_register_mux( struct device *dev, const char *name, const char *const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u32 mask, u8 clk_mux_flags, u32 *table, spinlock_t *lock) { struct clk_mux *mux; struct clk_hw *hw; struct clk_init_...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-milbeaut.c
static unsigned long m10v_clk_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct m10v_clk_divider *divider = to_m10v_div(hw); unsigned int val; val = readl(divider->reg) >> divider->shift; val &= clk_div_mask(divider->width); return ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-milbeaut.c
static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct m10v_clk_divider *divider = to_m10v_div(hw); int value; unsigned long flags = 0; u32 val; u32 write_en = BIT(divider->width - 1); value = divider_get_val(rat...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-milbeaut.c
static void m10v_reg_mux_pre(const struct m10v_clk_mux_factors *factors, struct clk_hw_onecell_data *clk_data, void __iomem *base) { struct clk_hw *hw; hw = m10v_clk_hw_register_mux( NULL, factors->name, factors->parent_names, factors->num_parents, ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-milbeaut.c
static void __init m10v_cc_init(struct device_node *np) { int id; void __iomem *base; const char *parent_name; struct clk_hw *hw; m10v_clk_data = kzalloc(struct_size(m10v_clk_data, hws, M10V_NUM_CLKS), GFP_KERNEL); if (!m10v_clk_data) return; base = of_iomap(np, 0); if (!base) { kfree(m...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-moxart.c
static void __init moxart_of_pll_clk_init(struct device_node *node) { void __iomem *base; struct clk_hw *hw; struct clk *ref_clk; unsigned int mul; const char *name = node->name; const char *parent_name; of_property_read_string(node, "clock-output-names", &name); parent_name = of_clk_get_parent_name(n...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-multiplier.c
static bool __is_best_rate(unsigned long rate, unsigned long new, unsigned long best, unsigned long flags) { if (flags & CLK_MULTIPLIER_ROUND_CLOSEST) return abs(rate - new) < abs(rate - best); return new >= rate &&new < best; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-multiplier.c
static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate, unsigned long *best_parent_rate, u8 width, unsigned long flags) { struct clk_multiplier *mult = to_clk_multiplier(hw); unsigned long orig_parent_rate = *best_parent_rate; unsigned...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-mux.c
static inline u32 clk_mux_readl(struct clk_mux *mux) { if (mux->flags & CLK_MUX_BIG_ENDIAN) return ioread32be(mux->reg); return readl(mux->reg); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-mux.c
static inline void clk_mux_writel(struct clk_mux *mux, u32 val) { if (mux->flags & CLK_MUX_BIG_ENDIAN) iowrite32be(val, mux->reg); else writel(val, mux->reg); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-mux.c
struct clk *clk_register_mux_table(struct device *dev, const char *name, const char *const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u32 mask, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nomadik.c
static void __init nomadik_src_init(void) { struct device_node *np; u32 val; np = of_find_matching_node(NULL, nomadik_src_match); if (!np) { pr_crit("no matching node for SRC, aborting clock init\n"); return; } src_base = of_iomap(np, 0); if (!src_base) { pr_err("%s: must have src parent node...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nomadik.c
static int pll_clk_enable(struct clk_hw *hw) { struct clk_pll *pll = to_pll(hw); u32 val; spin_lock(&src_lock); val = readl(src_base + SRC_PLLCR); if (pll->id == 1) { if (val & SRC_PLLCR_PLL1OVER) { val |= SRC_PLLCR_PLL1EN; writel(val, src_base + SRC_PLLCR); } } else if (pll->id == 2) ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nomadik.c
static int pll_clk_is_enabled(struct clk_hw *hw) { struct clk_pll *pll = to_pll(hw); u32 val; val = readl(src_base + SRC_PLLCR); if (pll->id == 1) { if (val & SRC_PLLCR_PLL1OVER) return !!(val & SRC_PLLCR_PLL1EN); } else if (pll->id == 2) { return !!(val & SRC_PLLCR_PLL2EN); } return 1; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nomadik.c
static unsigned long src_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { return parent_rate; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nomadik.c
static void __init of_nomadik_hclk_setup(struct device_node *np) { struct clk_hw *hw; const char *clk_name = np->name; const char *parent_name; if (!src_base) nomadik_src_init(); parent_name = of_clk_get_parent_name(np, 0); hw = clk_hw_register_divider( NULL, clk_name, parent_name, 0, src_base ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nomadik.c
static void __init of_nomadik_src_clk_setup(struct device_node *np) { struct clk_hw *hw; const char *clk_name = np->name; const char *parent_name; u32 clk_id; if (!src_base) nomadik_src_init(); if (of_property_read_u32(np, "clock-id", &clk_id)) { pr_err("%s: SRC clock \"%s\" missing clock-id prop...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-npcm7xx.c
static struct clk_hw *npcm7xx_clk_register_pll(void __iomem *pllcon, const char *name, const char *parent_name, unsigned long flags) { struct npcm7xx_clk_pll *pll; struct clk...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-nspire.c
static void __init nspire_ahbdiv_setup_cx(struct device_node *node) { nspire_ahbdiv_setup(node, nspire_clkinfo_cx); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-palmas.c
static int palmas_clks_is_prepared(struct clk_hw *hw) { struct palmas_clock_info *cinfo = to_palmas_clks_info(hw); int ret; u32 val; if (cinfo->ext_control_pin) return 1; ret = palmas_read(cinfo->palmas, PALMAS_RESOURCE_BASE, cinfo->clk_desc->control_reg, &val); if (ret < 0) { ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-palmas.c
static int palmas_clks_remove(struct platform_device *pdev) { of_clk_del_provider(pdev->dev.of_node); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-plldig.c
static int plldig_enable(struct clk_hw *hw) { struct clk_plldig *data = to_clk_plldig(hw); u32 val; val = readl(data->regs + PLLDIG_REG_PLLFM); val |= PLLDIG_SSCGBYP_ENABLE; writel(val, data->regs + PLLDIG_REG_PLLFM); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static void cg_out(struct clockgen *cg, u32 val, u32 __iomem *reg) { if (cg->info.flags & CG_LITTLE_ENDIAN) iowrite32(val, reg); else iowrite32be(val, reg); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static void __init p2041_init_periph(struct clockgen *cg) { u32 reg; reg = ioread32be(&cg->guts->rcwsr[7]); if (reg & RCWSR7_FM1_CLK_SEL) cg->fman[0] = cg->pll[CGA_PLL2].div[PLL_DIV2].clk; else cg->fman[0] = cg->pll[PLATFORM_PLL].div[PLL_DIV2].clk; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static void __init p5020_init_periph(struct clockgen *cg) { u32 reg; int div = PLL_DIV2; reg = ioread32be(&cg->guts->rcwsr[7]); if (reg & RCWSR7_HWA_ASYNC_DIV) div = PLL_DIV4; if (reg & RCWSR7_FM1_CLK_SEL) cg->fman[0] = cg->pll[CGA_PLL2].div[div].clk; else cg->fman[0] = cg->pll[PLATFORM_PLL]....
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static struct clk *__init create_mux_common( struct clockgen *cg, struct mux_hwclock *hwc, const struct clk_ops *ops, unsigned long min_rate, unsigned long max_rate, unsigned long pct80_rate, const char *fmt, int idx) { struct clk_init_data init = {}; struct clk *clk; const struct clockgen_pll_div *d...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static struct clk *__init create_one_cmux(struct clockgen *cg, int idx) { struct mux_hwclock *hwc; const struct clockgen_pll_div *div; unsigned long plat_rate, min_rate; u64 max_rate, pct80_rate; u32 clksel; hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); if (!hwc) return NULL; if (cg->info.flags & CG_VE...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static struct clk __init *input_clock(const char *name, struct clk *clk) { const char *input_name; input_name = __clk_get_name(clk); clk = clk_register_fixed_factor(NULL, name, input_name, 0, 1, 1); if (IS_ERR(clk)) pr_err("%s: Couldn't register %s: %ld\n", __func__, name, PTR_ERR(clk)); return clk; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static struct clk __init *input_clock_by_name(const char *name, const char *dtname) { struct clk *clk; clk = of_clk_get_by_name(clockgen.node, dtname); if (IS_ERR(clk)) return clk; return input_clock(name, clk); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static struct clk *__init create_sysclk(const char *name) { struct device_node *sysclk; struct clk *clk; clk = sysclk_from_fixed(clockgen.node, name); if (!IS_ERR(clk)) return clk; clk = input_clock_by_name(name, "sysclk"); if (!IS_ERR(clk)) return clk; clk = input_clock_by_index(name, 0); i...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static struct clk *__init create_coreclk(const char *name) { struct clk *clk; clk = input_clock_by_name(name, "coreclk"); if (!IS_ERR(clk)) return clk; if (WARN_ON(PTR_ERR(clk) == -EPROBE_DEFER)) return clk; return NULL; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-qoriq.c
static void __init create_plls(struct clockgen *cg) { int i; for (i = 0; i < ARRAY_SIZE(cg->pll); i++) create_one_pll(cg, i); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-renesas-pcie.c
static int rs9_regmap_i2c_write(void *context, unsigned int reg, unsigned int val) { struct i2c_client *i2c = context; const u8 data[3] = {reg, 1, val}; const int count = ARRAY_SIZE(data); int ret; ret = i2c_master_send(i2c, data, count); if (ret == count) return 0; e...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-renesas-pcie.c
static struct clk_hw *rs9_of_clk_get(struct of_phandle_args *clkspec, void *data) { struct rs9_driver_data *rs9 = data; unsigned int idx = clkspec->args[0]; return rs9->clk_dif[idx]; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-renesas-pcie.c
static int __maybe_unused rs9_resume(struct device *dev) { struct rs9_driver_data *rs9 = dev_get_drvdata(dev); int ret; regcache_cache_only(rs9->regmap, false); ret = regcache_sync(rs9->regmap); if (ret) dev_err(dev, "Failed to restore register map: %d\n", ret); return ret; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-rk808.c
static void rk808_clkout2_unprepare(struct clk_hw *hw) { rk808_clkout2_enable(hw, false); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-scmi.c
static int scmi_clk_atomic_enable(struct clk_hw *hw) { struct scmi_clk *clk = to_scmi_clk(hw); return scmi_proto_clk_ops->enable_atomic(clk->ph, clk->id); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-scmi.c
static void scmi_clk_atomic_disable(struct clk_hw *hw) { struct scmi_clk *clk = to_scmi_clk(hw); scmi_proto_clk_ops->disable_atomic(clk->ph, clk->id); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si514.c
static int si514_get_muldiv(struct clk_si514 *data, struct clk_si514_muldiv *settings) { int err; u8 reg[7]; err = regmap_bulk_read(data->regmap, SI514_REG_M_FRAC1, reg, ARRAY_SIZE(reg)); if (err) return err; settings->m_frac = reg[0] | reg[1] << 8 | reg[2] << 16 | (reg...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si514.c
static unsigned long si514_calc_rate(struct clk_si514_muldiv *settings) { u64 m = settings->m_frac | ((u64)settings->m_int << 29); u32 d = settings->hs_div * BIT(settings->ls_div_bits); return ((u32)(((m * FXO) + (FXO / 2)) >> 29)) / d; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si514.c
static void si514_remove(struct i2c_client *client) { of_clk_del_provider(client->dev.of_node); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_encode_44_32(struct regmap *regmap, unsigned int reg, u64 n_num, u32 n_den) { u8 r[10]; while (!(n_num & BIT_ULL(43)) && !(n_den & BIT(31))) { n_num <<= 1; n_den <<= 1; } /* 44 bits (6 bytes) numerator */ put_unaligned_le32(n_num, r); r[4] = (n_num ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_clk_get_selected_input(struct clk_si5341 *data) { int err; u32 val; err = regmap_read(data->regmap, SI5341_IN_SEL, &val); if (err < 0) return err; return (val & SI5341_IN_SEL_MASK) >> SI5341_IN_SEL_SHIFT; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static u8 si5341_clk_get_parent(struct clk_hw *hw) { struct clk_si5341 *data = to_clk_si5341(hw); int res = si5341_clk_get_selected_input(data); if (res < 0) return 0; return res; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static long si5341_synth_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { struct clk_si5341_synth *synth = to_clk_si5341_synth(hw); u64 f; f = synth->data->freq_vco; do_div(f, SI5341_SYNTH_N_MAX); if (rate < f) return f; f = sy...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_synth_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_si5341_synth *synth = to_clk_si5341_synth(hw); u64 n_num; u32 n_den; u32 r; u32 g; bool is_integer; n_num = synth->data->freq_vco; r = do_div(n_num, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static unsigned long si5341_output_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct clk_si5341_output *output = to_clk_si5341_output(hw); int err; u32 val; u32 r_divider; u8 r[3]; err = regmap_read(output->data->regmap, SI5341_OUT_CON...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_output_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_si5341_output *output = to_clk_si5341_output(hw); u32 r_div; int err; u8 r[3]; if (!rate) return -EINVAL; r_div = (parent_rate / rate) >> 1; if ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_output_reparent(struct clk_si5341_output *output, u8 index) { return regmap_update_bits(output->data->regmap, SI5341_OUT_MUX_SEL(output), 0x07, index); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_is_programmed_already(struct clk_si5341 *data) { int err; u8 r[4]; err = regmap_bulk_read(data->regmap, SI5341_PLL_M_DEN, r, ARRAY_SIZE(r)); if (err < 0) return err; return !!get_unaligned_le32(r); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static int si5341_finalize_defaults(struct clk_si5341 *data) { int res; u32 revision; res = regmap_write(data->regmap, SI5341_IO_VDD_SEL, data->iovdd_33 ? 1 : 0); if (res < 0) return res; res = regmap_read(data->regmap, SI5341_DEVICE_REV, &revision); if (res < 0) return res; dev_dbg(&data->i2c_...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static ssize_t input_present_show(struct device *dev, struct device_attribute *attr, char *buf) { struct clk_si5341 *data = dev_get_drvdata(dev); u32 status; int res = regmap_read(data->regmap, SI5341_STATUS, &status); if (res < 0) return res; res = !(status & SI5341_ST...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5341.c
static ssize_t input_present_sticky_show(struct device *dev, struct device_attribute *attr, char *buf) { struct clk_si5341 *data = dev_get_drvdata(dev); u32 status; int res = regmap_read(data->regmap, SI5341_STATUS_STICKY, &status)...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static inline int si5351_bulk_read(struct si5351_driver_data *drvdata, u8 reg, u8 count, u8 *buf) { return regmap_bulk_read(drvdata->regmap, reg, buf, count); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static inline int si5351_reg_write(struct si5351_driver_data *drvdata, u8 reg, u8 val) { return regmap_write(drvdata->regmap, reg, val); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static inline u8 si5351_msynth_params_address(int num) { if (num > 5) return SI5351_CLK6_PARAMETERS + (num - 6); return SI5351_CLK0_PARAMETERS + (SI5351_PARAMETERS_LENGTH * num); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static void si5351_write_parameters(struct si5351_driver_data *drvdata, u8 reg, struct si5351_parameters *params) { u8 buf[SI5351_PARAMETERS_LENGTH]; switch (reg) { case SI5351_CLK6_PARAMETERS: case SI5351_CLK7_PARAMETERS: buf[0] = params->p1 & 0xff; si5351_reg_write...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static long si5351_pll_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { struct si5351_hw_data *hwdata = container_of(hw, struct si5351_hw_data, hw); unsigned long rfrac, denom, a, b, c; unsigned long long lltmp; if (rate < SI5351_PLL_VCO_MIN) ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static int si5351_msynth_set_parent(struct clk_hw *hw, u8 index) { struct si5351_hw_data *hwdata = container_of(hw, struct si5351_hw_data, hw); return _si5351_msynth_reparent(hwdata->drvdata, hwdata->num, (index == 0) ? SI5351_MULTISYNTH_SRC_VCO0 ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static int si5351_msynth_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct si5351_hw_data *hwdata = container_of(hw, struct si5351_hw_data, hw); u8 reg = si5351_msynth_params_address(hwdata->num); int divby4 = 0; si5351_write_parameters(hwdata...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static int _si5351_clkout_set_drive_strength(struct si5351_driver_data *drvdata, int num, enum si5351_drive_strength drive) { u8 mask; if (num > 8) return -EINVAL; switch (drive) { case SI5351_DRIVE_2MA: mask = ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static int si5351_clkout_prepare(struct clk_hw *hw) { struct si5351_hw_data *hwdata = container_of(hw, struct si5351_hw_data, hw); struct si5351_platform_data *pdata = hwdata->drvdata->client->dev.platform_data; si5351_set_bits(hwdata->drvdata, SI5351_CLK0_CTRL + hwdata->num, SI5351_CLK_P...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static u8 si5351_clkout_get_parent(struct clk_hw *hw) { struct si5351_hw_data *hwdata = container_of(hw, struct si5351_hw_data, hw); int index = 0; unsigned char val; val = si5351_reg_read(hwdata->drvdata, SI5351_CLK0_CTRL + hwdata->num); switch (val & SI5351_CLK_INPUT_MASK) { case SI5351_CLK_INPUT_MULTIS...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-si5351.c
static int si5351_dt_parse(struct i2c_client *client, enum si5351_variant variant) { return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si544.c
static long si544_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { struct clk_si544 *data = to_clk_si544(hw); if (!is_valid_frequency(data, rate)) return -EINVAL; return rate; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si544.c
static unsigned long si544_max_delta(unsigned long rate) { u64 num = rate; num *= DELTA_M_FRAC_NUM; do_div(num, DELTA_M_FRAC_DEN); return num; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-si570.c
static int si570_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_si570 *data = to_clk_si570(hw); struct i2c_client *client = data->i2c_client; int err; if (rate < SI570_MIN_FREQ || rate > data->max_freq) { dev_err(&client->dev, "requested f...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-sparx5.c
static unsigned long s5_calc_params(unsigned long rate, unsigned long parent_rate, struct s5_pll_conf *conf) { if (parent_rate % rate) { struct s5_pll_conf alt1, alt2; int div; div = DIV_ROUND_CLOSEST_ULL(parent_rate, rate); s5_s...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-sparx5.c
static void s5_pll_disable(struct clk_hw *hw) { struct s5_hw_clk *pll = to_s5_pll(hw); u32 val = readl(pll->reg); val &= ~PLL_CLK_ENA; writel(val, pll->reg); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-sparx5.c
static unsigned long s5_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct s5_hw_clk *pll = to_s5_pll(hw); struct s5_pll_conf conf; u32 val; val = readl(pll->reg); if (val & PLL_CLK_ENA) { conf.div = FIELD_GET(PLL_DIV, val); conf.pre_div =...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static long clk_apb_mul_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) { struct clk_apb_mul *am = to_clk_apb_mul(hw); unsigned long mult = 1; if (readl(base + STM32F4_RCC_CFGR) & BIT(am->bit_idx)) mult = 2; if (clk_hw_get_flags(hw) & CLK_SET_RAT...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static int clk_apb_mul_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static int stm32f4_pll_is_enabled(struct clk_hw *hw) { return clk_gate_ops.is_enabled(hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static void stm32f4_pll_disable(struct clk_hw *hw) { clk_gate_ops.disable(hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static unsigned long stm32f4_pll_recalc(struct clk_hw *hw, unsigned long parent_rate) { struct clk_gate *gate = to_clk_gate(hw); struct stm32f4_pll *pll = to_stm32f4_pll(gate); unsigned long n; n = (readl(base + pll->offset) >> 6) & 0x1ff; return parent_rate * n; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static long stm32f4_pll_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) { struct clk_gate *gate = to_clk_gate(hw); struct stm32f4_pll *pll = to_stm32f4_pll(gate); unsigned long n; n = rate / *prate; if (n < pll->n_start) n = pll->n_start; els...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static inline void sofware_reset_backup_domain(void) { unsigned long val; val = readl(base + STM32F4_RCC_BDCR); writel(val | BIT(16), base + STM32F4_RCC_BDCR); writel(val & ~BIT(16), base + STM32F4_RCC_BDCR); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static int rgclk_enable(struct clk_hw *hw) { struct clk_gate *gate = to_clk_gate(hw); struct stm32_rgate *rgate = to_rgclk(gate); int bit_status; unsigned int timeout = RGATE_TIMEOUT; if (clk_gate_ops.is_enabled(hw)) return 0; disable_power_domain_write_protection(); clk_gate_ops.enable(hw); do...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static int rgclk_is_enabled(struct clk_hw *hw) { return clk_gate_ops.is_enabled(hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32f4.c
static struct clk_hw *stm32_register_aux_clk(const char *name, const char *const *parent_names, int num_parents, int offset_mux, u8 shift, u8 mask, int offset_gate, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32h7.c
static int ready_gate_clk_enable(struct clk_hw *hw) { struct clk_gate *gate = to_clk_gate(hw); struct stm32_ready_gate *rgate = to_ready_gate_clk(gate); int bit_status; unsigned int timeout = RGATE_TIMEOUT; if (clk_gate_ops.is_enabled(hw)) return 0; clk_gate_ops.enable(hw); do { bit_status = !(...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32h7.c
static struct clk_divider *_get_cdiv(void __iomem *reg, u8 shift, u8 width, u32 flags, spinlock_t *lock) { struct clk_divider *div; div = kzalloc(sizeof(*div), GFP_KERNEL); if (!div) return ERR_PTR(-ENOMEM); div->reg = reg; div->shift = shift; div->width = width;...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32h7.c
static void get_cfg_composite_div(const struct composite_clk_gcfg *gcfg, const struct composite_clk_cfg *cfg, struct composite_cfg *composite, spinlock_t *lock) { struct clk_mux *mux = NULL; struct clk_divider *di...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32h7.c
static void pll_disable(struct clk_hw *hw) { struct stm32_pll_obj *clk_elem = to_pll(hw); struct clk_hw *_hw = &clk_elem->rgate.gate.hw; __clk_hw_set_clk(_hw, hw); ready_gate_clk_ops.disable(_hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32h7.c
static unsigned long pll_fd_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct stm32_pll_obj *clk_elem = to_pll(hw); struct stm32_fractional_divider *fd = &clk_elem->div; unsigned long m, n; u32 val, mask; u64 rate, rate1 = 0; val = readl(fd->mreg); ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static struct clk_hw * _clk_hw_register_gate(struct device *dev, struct clk_hw_onecell_data *clk_data, void __iomem *base, spinlock_t *lock, const struct clock_config *cfg) { struct gate_cfg *gate_cfg = cfg->cfg; return clk_hw_register_gate(dev, cfg->name, cfg->parent_n...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static struct clk_hw *_clk_hw_register_divider_table( struct device *dev, struct clk_hw_onecell_data *clk_data, void __iomem *base, spinlock_t *lock, const struct clock_config *cfg) { struct div_cfg *div_cfg = cfg->cfg; return clk_hw_register_divider_table( dev, cfg->name, cfg->parent_name, cfg->fla...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static struct clk_hw *_get_stm32_gate(struct device *dev, void __iomem *base, const struct stm32_gate_cfg *cfg, spinlock_t *lock) { struct stm32_clk_mgate *mgate; struct clk_gate *gate; struct clk_hw *gate_hw; if (cfg->mgate) { mg...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static void mp1_mgate_clk_disable(struct clk_hw *hw) { struct clk_gate *gate = to_clk_gate(hw); struct stm32_clk_mgate *clk_mgate = to_clk_mgate(gate); clk_mgate->mgate->flag &= ~clk_mgate->mask; if (clk_mgate->mgate->flag == 0) mp1_gate_clk_disable(hw); }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static u8 clk_mmux_get_parent(struct clk_hw *hw) { return clk_mux_ops.get_parent(hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static int clk_mmux_set_parent(struct clk_hw *hw, u8 index) { struct clk_mux *mux = to_clk_mux(hw); struct stm32_clk_mmux *clk_mmux = to_clk_mmux(mux); struct clk_hw *hwp; int ret, n; ret = clk_mux_ops.set_parent(hw, index); if (ret) return ret; hwp = clk_hw_get_parent(hw); for (n = 0; n < clk_m...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static u8 pll_get_parent(struct clk_hw *hw) { struct stm32_pll_obj *clk_elem = to_pll(hw); struct clk_hw *mux_hw = &clk_elem->mux.hw; __clk_hw_set_clk(mux_hw, hw); return clk_mux_ops.get_parent(mux_hw); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct timer_cker *tim_ker = to_timer_cker(hw); u32 prescaler; unsigned int mult = 0; prescaler = readl_relaxed(tim_ker->apbdiv) & APB_DIV_MASK; if (prescaler < 2) return 1...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static int timer_ker_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct timer_cker *tim_ker = to_timer_cker(hw); unsigned long flags = 0; unsigned long factor = __bestmult(hw, rate, parent_rate); int ret = 0; spin_lock_irqsave(tim_ker->lock, fla...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static struct clk_hw *_clk_stm32_register_gate( struct device *dev, struct clk_hw_onecell_data *clk_data, void __iomem *base, spinlock_t *lock, const struct clock_config *cfg) { return clk_stm32_register_gate_ops(dev, cfg->name, cfg->parent_name, cfg->parent_data, cfg->fl...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static inline struct stm32_reset_data * to_stm32_reset_data(struct reset_controller_dev *rcdev) { return container_of(rcdev, struct stm32_reset_data, rcdev); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static int stm32_reset_update(struct reset_controller_dev *rcdev, unsigned long id, bool assert) { struct stm32_reset_data *data = to_stm32_reset_data(rcdev); int reg_width = sizeof(u32); int bank = id / (reg_width * BITS_PER_BYTE); int offset = id % (reg_width * BITS_PER_BYTE); ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static int stm32_rcc_init(struct device *dev, void __iomem *base, const struct of_device_id *match_data) { const struct of_device_id *match; int err; match = of_match_node(match_data, dev_of_node(dev)); if (!match) { dev_err(dev, "match data not found\n"); return -ENODEV; } ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-stm32mp1.c
static int stm32mp1_rcc_init(struct device *dev) { void __iomem *base; int ret; base = of_iomap(dev_of_node(dev), 0); if (!base) { pr_err("%pOFn: unable to map resource", dev_of_node(dev)); ret = -ENOMEM; goto out; } ret = stm32_rcc_init(dev, base, stm32mp1_match_data); out: if (ret) { ...
[ 0, 0 ]