Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
drivers/clk/clk-tps68470.c
static int tps68470_clk_is_prepared(struct clk_hw *hw) { struct tps68470_clkdata *clkdata = to_tps68470_clkdata(hw); int val; if (regmap_read(clkdata->regmap, TPS68470_REG_PLLCTL, &val)) return 0; return val & TPS68470_PLL_EN_MASK; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-tps68470.c
static void tps68470_clk_unprepare(struct clk_hw *hw) { struct tps68470_clkdata *clkdata = to_tps68470_clkdata(hw); regmap_update_bits(clkdata->regmap, TPS68470_REG_PLLCTL, TPS68470_PLL_EN_MASK, 0); /* ... and then tri-state the clock outputs. */ regmap_write(clkdata->regmap, TPS68470_REG...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-tps68470.c
static unsigned long tps68470_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct tps68470_clkdata *clkdata = to_tps68470_clkdata(hw); return clkdata->rate; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-twl6040.c
static int twl6040_pdmclk_quirk_reset_clocks(struct twl6040_pdmclk *pdmclk) { int ret; ret = twl6040_pdmclk_reset_one_clock(pdmclk, TWL6040_REG_HPPLLCTL); if (ret) return ret; ret = twl6040_pdmclk_reset_one_clock(pdmclk, TWL6040_REG_LPPLLCTL); if (ret) return ret; return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-twl6040.c
static int twl6040_pdmclk_prepare(struct clk_hw *hw) { struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk, pdmclk_hw); int ret; ret = twl6040_power(pdmclk->twl6040, 1); if (ret) return ret; ret = twl6040_pdmclk_quirk_reset_clocks(pdmclk); if (ret) goto out_err; pdmclk...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-twl6040.c
static void twl6040_pdmclk_unprepare(struct clk_hw *hw) { struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk, pdmclk_hw); int ret; ret = twl6040_power(pdmclk->twl6040, 0); if (!ret) pdmclk->enabled = 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-twl6040.c
static unsigned long twl6040_pdmclk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct twl6040_pdmclk *pdmclk = container_of(hw, struct twl6040_pdmclk, pdmclk_hw); return twl6040_get_sysclk(pdmclk->twl6040); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static int vc5_mux_set_parent(struct clk_hw *hw, u8 index) { struct vc5_driver_data *vc5 = container_of(hw, struct vc5_driver_data, clk_mux); const u8 mask = VC5_PRIM_SRC_SHDN_EN_XTAL | VC5_PRIM_SRC_SHDN_EN_CLKIN; u8 src; if ((index > 1) || !vc5->clk_mux_ins) return -EINVAL; if (vc5->clk_mux_ins =...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static unsigned long vc5_fod_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct vc5_hw_data *hwdata = container_of(hw, struct vc5_hw_data, hw); struct vc5_driver_data *vc5 = hwdata->vc5; u32 f_in = parent_rate / 2; u32 div_int, div_frc; u8 od_int[2]; ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static int vc5_fod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct vc5_hw_data *hwdata = container_of(hw, struct vc5_hw_data, hw); struct vc5_driver_data *vc5 = hwdata->vc5; u8 data[14] = {hwdata->div_frc >> 22, hwdata->div_frc >> 14...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static int vc5_clk_out_prepare(struct clk_hw *hw) { struct vc5_out_data *hwdata = container_of(hw, struct vc5_out_data, hw); struct vc5_driver_data *vc5 = hwdata->vc5; const u8 mask = VC5_OUT_DIV_CONTROL_SELB_NORM | VC5_OUT_DIV_CONTROL_SEL_EXT | VC5_OUT_DIV_CONTROL_EN_FOD; unsigned int src; ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static void vc5_clk_out_unprepare(struct clk_hw *hw) { struct vc5_out_data *hwdata = container_of(hw, struct vc5_out_data, hw); struct vc5_driver_data *vc5 = hwdata->vc5; regmap_clear_bits(vc5->regmap, VC5_CLK_OUTPUT_CFG(hwdata->num, 1), VC5_CLK_OUTPUT_CFG1_EN_CLKBUF); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static int vc5_clk_out_set_parent(struct clk_hw *hw, u8 index) { struct vc5_out_data *hwdata = container_of(hw, struct vc5_out_data, hw); struct vc5_driver_data *vc5 = hwdata->vc5; const u8 mask = VC5_OUT_DIV_CONTROL_RESET | VC5_OUT_DIV_CONTROL_SELB_NORM | VC5_OUT_DIV_CONTROL_SEL_EXT | VC5_OUT_...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static struct clk_hw *vc5_of_clk_get(struct of_phandle_args *clkspec, void *data) { struct vc5_driver_data *vc5 = data; unsigned int idx = clkspec->args[0]; if (idx >= vc5->chip_info->clk_out_cnt) return ERR_PTR(-EINVAL); return &vc5->clk_out[idx].hw; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static int vc5_update_mode(struct device_node *np_output, struct vc5_out_data *clk_out) { u32 value; if (!of_property_read_u32(np_output, "idt,mode", &value)) { clk_out->clk_output_cfg0_mask |= VC5_CLK_OUTPUT_CFG0_CFG_MASK; switch (value) { case VC5_CLK_OUTPUT_CFG0_CFG_LVPEC...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static int vc5_get_output_config(struct i2c_client *client, struct vc5_out_data *clk_out) { struct device_node *np_output; char *child_name; int ret = 0; child_name = kasprintf(GFP_KERNEL, "OUT%d", clk_out->num + 1); if (!child_name) return -ENOMEM; np_output = of_get...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock5.c
static void vc5_remove(struct i2c_client *client) { struct vc5_driver_data *vc5 = i2c_get_clientdata(client); of_clk_del_provider(client->dev.of_node); if (vc5->chip_info->flags & VC5_HAS_INTERNAL_XTAL) clk_unregister_fixed_rate(vc5->pin_xin); }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static struct clk_hw *vc7_of_clk_get(struct of_phandle_args *clkspec, void *data) { struct vc7_driver_data *vc7 = data; unsigned int idx = clkspec->args[0]; if (idx >= vc7->chip_info->num_outputs) return ERR_PTR(-EINVAL); return &vc7->clk_out[idx].hw; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static int vc7_map_index_to_output(const enum vc7_model model, const unsigned int i) { switch (model) { case VC7_RC21008A: return RC21008A_index_to_output_mapping[i]; default: return i; } }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static int vc7_read_apll(struct vc7_driver_data *vc7) { int err; u32 val32; u16 val16; err = regmap_bulk_read(vc7->regmap, VC7_REG_XO_CNFG, (u32 *)&val32, VC7_REG_XO_CNFG_COUNT); if (err) { dev_err(&vc7->client->dev, "failed to read XO_CNFG\n"); return err; } vc7->clk_a...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static int vc7_read_fod(struct vc7_driver_data *vc7, unsigned int idx) { int err; u64 val; err = regmap_bulk_read(vc7->regmap, VC7_REG_FOD_INT_CNFG(idx), (u64 *)&val, VC7_REG_FOD_INT_CNFG_COUNT); if (err) { dev_err(&vc7->client->dev, "failed to read FOD%d\n", idx); return err;...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static int vc7_write_output(struct vc7_driver_data *vc7, unsigned int idx) { int err; unsigned int out_num; out_num = vc7_map_index_to_output(vc7->chip_info->model, idx); err = regmap_write_bits(vc7->regmap, VC7_REG_ODRV_EN(out_num), VC7_REG_OUT_DIS, vc7->clk_out[idx].out_dis); if...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static unsigned long vc7_calc_fod_1st_stage_rate(unsigned long parent_rate, u32 fod_1st_int, u64 fod_frac) { u64 numer, denom, hi, lo, divisor; numer = fod_frac; denom = BIT_ULL(VC7_FOD_DENOMINATOR_BITS); if (fo...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static unsigned long vc7_calc_fod_2nd_stage_rate(unsigned long parent_rate, u32 fod_1st_int, u32 fod_2nd_int, u64 fod_frac) { unsigned long fod_1st_stage_rate; fod_1st_...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static unsigned long vc7_iod_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct vc7_iod_data *iod = container_of(hw, struct vc7_iod_data, hw); struct vc7_driver_data *vc7 = iod->vc7; int err; unsigned long iod_rate; err = vc7_read_iod(vc7, iod->num); ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static long vc7_iod_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { struct vc7_iod_data *iod = container_of(hw, struct vc7_iod_data, hw); unsigned long iod_rate; pr_debug("%s - %s: requested rate: %lu, parent_rate: %lu\n", __func__, clk_h...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-versaclock7.c
static bool vc7_volatile_reg(struct device *dev, unsigned int reg) { if (reg == VC7_PAGE_ADDR) return false; return true; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-vt8500.c
static __init void vtwm_set_pmc_base(void) { struct device_node *np = of_find_compatible_node(NULL, NULL, "via,vt8500-pmc"); if (np) pmc_base = of_iomap(np, 0); else pmc_base = ioremap(LEGACY_PMC_BASE, 0x1000); of_node_put(np); if (!pmc_base) pr_err("%s:of_iomap(pmc) failed\n", __func__);...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-vt8500.c
static int vt8500_find_pll_bits(unsigned long rate, unsigned long parent_rate, u32 *multiplier, u32 *prediv) { unsigned long tclk; if ((rate < parent_rate * 4) || (rate > parent_rate * 62)) { pr_err("%s: requested rate out of range\n", __func__); *multiplier = 0; *prediv...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-vt8500.c
static int wm8850_find_pll_bits(unsigned long rate, unsigned long parent_rate, u32 *multiplier, u32 *divisor1, u32 *divisor2) { u32 mul; int div1, div2; unsigned long tclk, rate_err, best_err; best_err = (unsigned long)-1; for (div1 = 1; div1 >= 0; div1--) for (div2 = 3; ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-vt8500.c
static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) { u32 reg; struct clk_hw *hw; struct clk_pll *pll_clk; const char *clk_name = node->name; const char *parent_name; struct clk_init_data init; int rc; if (!pmc_base) vtwm_set_pmc_base(); rc = of_property_read_u32(node, ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-wm831x.c
static int wm831x_fll_prepare(struct clk_hw *hw) { struct wm831x_clk *clkdata = container_of(hw, struct wm831x_clk, fll_hw); struct wm831x *wm831x = clkdata->wm831x; int ret; ret = wm831x_set_bits(wm831x, WM831X_FLL_CONTROL_1, WM831X_FLL_ENA, WM831X_FLL_ENA); if (ret != 0) dev_cri...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-wm831x.c
static int wm831x_fll_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct wm831x_clk *clkdata = container_of(hw, struct wm831x_clk, fll_hw); struct wm831x *wm831x = clkdata->wm831x; int i; for (i = 0; i < ARRAY_SIZE(wm831x_fll_auto_rates); i++) ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-wm831x.c
static int wm831x_clkout_set_parent(struct clk_hw *hw, u8 parent) { struct wm831x_clk *clkdata = container_of(hw, struct wm831x_clk, clkout_hw); struct wm831x *wm831x = clkdata->wm831x; return wm831x_set_bits(wm831x, WM831X_CLOCK_CONTROL_1, WM831X_CLKOUT_SRC, parent << WM831X_CLKOUT_SRC...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static inline u32 xgene_clk_read(void __iomem *csr) { return readl_relaxed(csr); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static int xgene_clk_pll_is_enabled(struct clk_hw *hw) { struct xgene_clk_pll *pllclk = to_xgene_clk_pll(hw); u32 data; data = xgene_clk_read(pllclk->reg + pllclk->pll_offset); pr_debug("%s pll %s\n", clk_hw_get_name(hw), data & REGSPEC_RESET_F1_MASK ? "disabled" : "enabled"); return data & REGS...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static void xgene_pcppllclk_init(struct device_node *np) { xgene_pllclk_init(np, PLL_TYPE_PCP); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static void xgene_pmdclk_init(struct device_node *np) { const char *clk_name = np->full_name; void __iomem *csr_reg; struct resource res; struct clk *clk; u64 denom; u32 flags = 0; int rc; if (!of_device_is_available(np)) return; /* Parse the DTS register for resource */ rc = of_address_to_res...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static void xgene_clk_disable(struct clk_hw *hw) { struct xgene_clk *pclk = to_xgene_clk(hw); unsigned long flags = 0; u32 data; if (pclk->lock) spin_lock_irqsave(pclk->lock, flags); if (pclk->param.csr_reg) { pr_debug("%s clock disabled\n", clk_hw_get_name(hw)); data = xgene_clk_read(pclk->par...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static unsigned long xgene_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct xgene_clk *pclk = to_xgene_clk(hw); u32 data; if (pclk->param.divider_reg) { data = xgene_clk_read(pclk->param.divider_reg + pclk->param.reg_...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk-xgene.c
static struct clk *xgene_register_clk(struct device *dev, const char *name, const char *parent_name, struct xgene_dev_parameters *parameters, spinlock_t *lock) { struct xgene_clk *apmclk; struct clk *cl...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_pm_runtime_get(struct clk_core *core) { if (!core->rpm_enabled) return 0; return pm_runtime_resume_and_get(core->dev); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_pm_runtime_put(struct clk_core *core) { if (!core->rpm_enabled) return; pm_runtime_put_sync(core->dev); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_prepare_unlock(void) { WARN_ON_ONCE(prepare_owner != current); WARN_ON_ONCE(prepare_refcnt == 0); if (--prepare_refcnt) return; prepare_owner = NULL; mutex_unlock(&prepare_lock); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static bool clk_core_rate_is_protected(struct clk_core *core) { return core->protect_count; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static bool clk_core_is_enabled(struct clk_core *core) { bool ret = false; if (!core->ops->is_enabled) return core->enable_count; /* * Check if clock controller's device is runtime active before * calling .is_enabled callback. If not, assume that clock is * disabled, because we might be called from...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
const char *__clk_get_name(const struct clk *clk) { return !clk ? NULL : clk->core->name; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
unsigned int __clk_get_enable_count(struct clk *clk) { return !clk ? 0 : clk->core->enable_count; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
bool __clk_is_enabled(struct clk *clk) { if (!clk) return false; return clk_core_is_enabled(clk->core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_forward_rate_req(struct clk_core *core, const struct clk_rate_request *old_req, struct clk_core *parent, struct clk_rate_request *req, unsigned lo...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
struct clk *__clk_lookup(const char *name) { struct clk_core *core = clk_core_lookup(name); return !core ? NULL : core->hw->clk; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
void clk_hw_get_rate_range(struct clk_hw *hw, unsigned long *min_rate, unsigned long *max_rate) { clk_core_get_boundaries(hw->core, min_rate, max_rate); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
void clk_unprepare(struct clk *clk) { if (IS_ERR_OR_NULL(clk)) return; clk_core_unprepare_lock(clk->core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_core_prepare_lock(struct clk_core *core) { int ret; clk_prepare_lock(); ret = clk_core_prepare(core); clk_prepare_unlock(); return ret; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
int clk_prepare(struct clk *clk) { if (!clk) return 0; return clk_core_prepare_lock(clk->core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_disable(struct clk_core *core) { lockdep_assert_held(&enable_lock); if (!core) return; if (WARN(core->enable_count == 0, "%s already disabled\n", core->name)) return; if (WARN(core->enable_count == 1 && core->flags & CLK_IS_CRITICAL, "Disabling critical %s\n", core->n...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
int clk_enable(struct clk *clk) { if (!clk) return 0; return clk_core_enable_lock(clk->core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
bool clk_is_enabled_when_prepared(struct clk *clk) { return clk && !(clk->core->ops->enable && clk->core->ops->disable); }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_init_rate_req(struct clk_core *const core, struct clk_rate_request *req, unsigned long rate) { struct clk_core *parent; if (WARN_ON(!req)) return; memset(req, 0, sizeof(*req)); req->max_rate = ULONG_MAX; if (!co...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) { int ret; struct clk_rate_request req; clk_core_init_rate_req(hw->core, &req, rate); trace_clk_rate_request_start(&req); ret = clk_core_round_rate_nolock(hw->core, &req); if (ret) return 0; trace_clk_rate_request_done(&req); ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void __clk_recalc_accuracies(struct clk_core *core) { unsigned long parent_accuracy = 0; struct clk_core *child; lockdep_assert_held(&prepare_lock); if (core->parent) parent_accuracy = core->parent->accuracy; if (core->ops->recalc_accuracy) core->accuracy = core->ops->recalc_accuracy(core->h...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
unsigned long clk_get_rate(struct clk *clk) { unsigned long rate; if (!clk) return 0; clk_prepare_lock(); rate = clk_core_get_rate_recalc(clk->core); clk_prepare_unlock(); return rate; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_fetch_parent_index(struct clk_core *core, struct clk_core *parent) { int i; if (!parent) return -EINVAL; for (i = 0; i < core->num_parents; i++) { if (core->parents[i].core == parent) return i; /* Something else is here, so keep looking */ ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_update_orphan_status(struct clk_core *core, bool is_orphan) { struct clk_core *child; core->orphan = is_orphan; hlist_for_each_entry(child, &core->children, child_node) clk_core_update_orphan_status(child, is_orphan); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static struct clk_core *__clk_set_parent_before(struct clk_core *core, struct clk_core *parent) { unsigned long flags; struct clk_core *old_parent = core->parent; /* enable old_parent & parent if CLK_OPS_PARENT_ENABLE is set */ if (core->flags & CLK_OPS_PARENT_EN...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int __clk_set_parent(struct clk_core *core, struct clk_core *parent, u8 p_index) { unsigned long flags; int ret = 0; struct clk_core *old_parent; old_parent = __clk_set_parent_before(core, parent); trace_clk_set_parent(core, parent); if (parent && core->ops->set_parent)...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_calc_subtree(struct clk_core *core, unsigned long new_rate, struct clk_core *new_parent, u8 p_index) { struct clk_core *child; core->new_rate = new_rate; core->new_parent = new_parent; core->new_parent_index = p_index; core->new_child = NULL; if (new_parent && ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, unsigned long req_rate) { int ret, cnt; struct clk_rate_request req; lockdep_assert_held(&prepare_lock); if (!core) return 0; cnt = clk_core_rate_nuke_protect(core); if (cnt ...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
int clk_set_max_rate(struct clk *clk, unsigned long rate) { if (!clk) return 0; trace_clk_set_max_rate(clk->core, rate); return clk_set_rate_range(clk, clk->min_rate, rate); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
struct clk *clk_get_parent(struct clk *clk) { struct clk *parent; if (!clk) return NULL; clk_prepare_lock(); /* TODO: Create a per-user clk and change callers to call clk_put */ parent = !clk->core->parent ? NULL : clk->core->parent->hw->clk; clk_prepare_unlock(); return parent; }
[ 1, 1 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_reparent(struct clk_core *core, struct clk_core *new_parent) { clk_reparent(core, new_parent); __clk_recalc_accuracies(core); __clk_recalc_rates(core, true, POST_RATE_CHANGE); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent) { if (!hw) return; clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *parent) { return clk_core_set_parent_nolock(hw->core, parent->core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
int clk_set_parent(struct clk *clk, struct clk *parent) { int ret; if (!clk) return 0; clk_prepare_lock(); if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); ret = clk_core_set_parent_nolock(clk->core, parent ? parent->core : NULL); if (clk->exclusive_count) clk_core_rate_protect...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_core_set_phase_nolock(struct clk_core *core, int degrees) { int ret = -EINVAL; lockdep_assert_held(&prepare_lock); if (!core) return 0; if (clk_core_rate_is_protected(core)) return -EBUSY; trace_clk_set_phase(core, degrees); if (core->ops->set_phase) { ret = core->ops->set_p...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_core_get_phase(struct clk_core *core) { int ret; lockdep_assert_held(&prepare_lock); if (!core->ops->get_phase) return 0; ret = core->ops->get_phase(core->hw); if (ret >= 0) core->phase = ret; return ret; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_core_set_duty_cycle_nolock(struct clk_core *core, struct clk_duty *duty) { int ret; lockdep_assert_held(&prepare_lock); if (clk_core_rate_is_protected(core)) return -EBUSY; trace_clk_set_duty_cycle(core, duty); if (!core->ops->set_duty_cycle) ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_core_set_duty_cycle_parent_nolock(struct clk_core *core, struct clk_duty *duty) { int ret = 0; if (core->parent && core->flags & (CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT)) { ret = clk_core_set_duty_cycle_nolock(core->parent, duty); ...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_prepare_enable_get(void *data, u64 *val) { struct clk_core *core = data; *val = core->enable_count && core->prepare_count; return 0; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_flags_show(struct seq_file *s, void *data) { struct clk_core *core = s->private; unsigned long flags = core->flags; unsigned int i; for (i = 0; flags && i < ARRAY_SIZE(clk_flags); i++) { if (flags & clk_flags[i].flag) { seq_printf(s, "%s\n", clk_flags[i].name); flags &= ~clk_flag...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_duty_cycle_show(struct seq_file *s, void *data) { struct clk_core *core = s->private; struct clk_duty *duty = &core->duty; seq_printf(s, "%u/%u\n", duty->num, duty->den); return 0; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int __init clk_debug_init(void) { struct clk_core *core; #ifdef CLOCK_ALLOW_WRITE_DEBUGFS pr_warn("\n"); pr_warn( "********************************************************************\n"); pr_warn( "** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); pr_warn( "*...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_reparent_orphans_nolock(void) { struct clk_core *orphan; struct hlist_node *tmp2; hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) { struct clk_core *parent = __clk_init_parent(orphan); /* * We need to use __clk_set_parent_before() and _after() to * pr...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_cpy_name(const char **dst_p, const char *src, bool must_exist) { const char *dst; if (!src) { if (must_exist) return -EINVAL; return 0; } *dst_p = dst = kstrdup_const(src, GFP_KERNEL); if (!dst) return -ENOMEM; return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_free_parent_map(struct clk_core *core) { int i = core->num_parents; if (!core->num_parents) return; while (--i >= 0) { kfree_const(core->parents[i].name); kfree_const(core->parents[i].fw_name); } kfree(core->parents); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static struct device_node *dev_or_parent_of_node(struct device *dev) { struct device_node *np; if (!dev) return NULL; np = dev_of_node(dev); if (!np) np = dev_of_node(dev->parent); return np; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_nodrv_prepare_enable(struct clk_hw *hw) { return -ENXIO; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_nodrv_disable_unprepare(struct clk_hw *hw) { WARN_ON_ONCE(1); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static int clk_nodrv_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { return -ENXIO; }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void clk_core_evict_parent_cache(struct clk_core *core) { const struct hlist_head **lists; struct clk_core *root; lockdep_assert_held(&prepare_lock); for (lists = all_lists; *lists; lists++) hlist_for_each_entry(root, *lists, child_node) clk_core_evict_parent_cache_subtree(root, core); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
void clk_hw_unregister(struct clk_hw *hw) { clk_unregister(hw->clk); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
static void devm_clk_hw_unregister_cb(struct device *dev, void *res) { clk_hw_unregister(*(struct clk_hw **)res); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw) { struct clk *clk; struct clk **clkp; clkp = devres_alloc(devm_clk_unregister_cb, sizeof(*clkp), GFP_KERNEL); if (!clkp) return ERR_PTR(-ENOMEM); clk = clk_register(dev, hw); if (!IS_ERR(clk)) { *clkp = clk; devres_add(dev, c...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb) { struct clk_notifier *cn; int ret = -ENOENT; if (!clk || !nb) return -EINVAL; clk_prepare_lock(); list_for_each_entry(cn, &clk_notifier_list, node) { if (cn->clk == clk) { ret = srcu_notifier_chain_unregister(&cn->notifi...
[ 1, 1 ]
Linux Kernel
drivers/clk/clk.c
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data) { struct clk_onecell_data *clk_data = data; unsigned int idx = clkspec->args[0]; if (idx >= clk_data->clk_num) { pr_err("%s: invalid clock index %u\n", __func__, idx); return ERR_PTR(-EINVA...
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.c
static int of_parse_clkspec(const struct device_node *np, int index, const char *name, struct of_phandle_args *out_args) { int ret = -ENOENT; while (np) { /* * For named clocks, first look up the name in the * "clock-names" property. If it cann...
[ 0, 0 ]
Linux Kernel
drivers/clk/clk.c
int of_clk_parent_fill(struct device_node *np, const char **parents, unsigned int size) { unsigned int i = 0; while (i < size && (parents[i] = of_clk_get_parent_name(np, i)) != NULL) i++; return i; }
[ 1, 0 ]
Linux Kernel
drivers/clk/clk.h
static inline void __clk_put(struct clk *clk) {} #endif
[ 0, 0 ]
Linux Kernel
drivers/clk/clkdev.c
static void __clkdev_add(struct clk_lookup *cl) { mutex_lock(&clocks_mutex); list_add_tail(&cl->node, &clocks); mutex_unlock(&clocks_mutex); }
[ 0, 0 ]
Linux Kernel
drivers/clk/clkdev.c
void clkdev_add_table(struct clk_lookup *cl, size_t num) { mutex_lock(&clocks_mutex); while (num--) { cl->clk_hw = __clk_get_hw(cl->clk); list_add_tail(&cl->node, &clocks); cl++; } mutex_unlock(&clocks_mutex); }
[ 0, 0 ]