Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/clk/ti/clkt_dflt.c | int omap2_dflt_clk_is_enabled(struct clk_hw *hw) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
u32 v;
v = ti_clk_ll_ops->clk_readl(&clk->enable_reg);
if (clk->flags & INVERT_ENABLE)
v ^= BIT(clk->enable_bit);
v &= BIT(clk->enable_bit);
return v ? 1 : 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/clkt_dpll.c |
static unsigned long _dpll_compute_new_rate(unsigned long parent_rate,
unsigned int m, unsigned int n) {
unsigned long long num;
num = (unsigned long long)parent_rate * m;
do_div(num, n);
return num;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/clkt_dpll.c | static int _dpll_test_mult(int *m, int n, unsigned long *new_rate,
unsigned long target_rate,
unsigned long parent_rate) {
int r = 0, carry = 0;
if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL)
carry = 1;
*m = (*m / DPLL_SCALE_FACTOR) + carry;
/*
* ... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/clkt_dpll.c | static int _omap2_dpll_is_in_bypass(u32 v) {
u8 mask, val;
mask = ti_clk_get_features()->dpll_bypass_vals;
while (mask) {
val = __ffs(mask);
mask ^= (1 << val);
if (v == val)
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/clkt_dpll.c | unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk) {
u64 dpll_clk;
u32 dpll_mult, dpll_div, v;
struct dpll_data *dd;
dd = clk->dpll_data;
if (!dd)
return 0;
v = ti_clk_ll_ops->clk_readl(&dd->control_reg);
v &= dd->enable_mask;
v >>= __ffs(dd->enable_mask);
if (_omap2_dpll_is_in_bypass(v... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/clkt_iclk.c | void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk) {
u32 v;
struct clk_omap_reg r;
memcpy(&r, &clk->enable_reg, sizeof(r));
r.offset ^= (CM_AUTOIDLE ^ CM_ICLKEN);
v = ti_clk_ll_ops->clk_readl(&r);
v &= ~(1 << clk->enable_bit);
ti_clk_ll_ops->clk_writel(v, &r);
} | [
1,
1
] |
Linux Kernel | drivers/clk/ti/clockdomain.c | int omap2_init_clk_clkdm(struct clk_hw *hw) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
struct clockdomain *clkdm;
const char *clk_name;
if (!clk->clkdm_name)
return 0;
clk_name = __clk_get_name(hw->clk);
clkdm = ti_clk_ll_ops->clkdm_lookup(clk->clkdm_name);
if (clkdm) {
pr_debug("clock: as... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/clockdomain.c | void __init ti_dt_clockdomains_setup(void) {
struct device_node *np;
for_each_matching_node(np, ti_clkdm_match_table) {
of_ti_clockdomain_setup(np);
}
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/composite.c |
static unsigned long ti_composite_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
return ti_clk_divider_ops.recalc_rate(hw, parent_rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/composite.c | int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
int type) {
unsigned int num_parents;
const char **parent_names;
struct component_clk *clk;
num_parents = of_clk_get_parent_count(node);
if (!num_parents) {
pr_err("component-clock %pOFn must hav... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/divider.c |
static unsigned int _get_val(struct clk_omap_divider *divider, u8 div) {
if (divider->flags & CLK_DIVIDER_ONE_BASED)
return div;
if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
return __ffs(div);
if (divider->table)
return _get_table_val(divider->table, div);
return div - 1;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/divider.c | static unsigned long ti_clk_divider_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_omap_divider *divider = to_clk_omap_divider(hw);
unsigned int div, val;
val = ti_clk_ll_ops->clk_readl(÷r->reg) >> divider->shift;
val &= divider->mas... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/divider.c | static int clk_divider_save_context(struct clk_hw *hw) {
struct clk_omap_divider *divider = to_clk_omap_divider(hw);
u32 val;
val = ti_clk_ll_ops->clk_readl(÷r->reg) >> divider->shift;
divider->context = val & divider->mask;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/divider.c | static int __init ti_clk_get_div_table(struct device_node *node,
struct clk_omap_divider *div) {
struct clk_div_table *table;
const __be32 *divspec;
u32 val;
u32 num_div;
u32 valid_div;
int i;
divspec = of_get_property(node, "ti,dividers", &num_div);
if (!divspec... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/divider.c |
static int __init ti_clk_divider_populate(struct device_node *node,
struct clk_omap_divider *div,
u32 *flags) {
u32 val;
int ret;
ret = ti_clk_get_reg_addr(node, 0, &div->reg);
if (ret)
return ret;
if (!of_property_read... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/divider.c |
static void __init of_ti_composite_divider_clk_setup(struct device_node *node) {
struct clk_omap_divider *div;
u32 tmp;
div = kzalloc(sizeof(*div), GFP_KERNEL);
if (!div)
return;
if (ti_clk_divider_populate(node, div, &tmp))
goto cleanup;
if (!ti_clk_add_component(node, &div->hw, CLK_COMPONENT_T... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll.c |
static void __init of_ti_omap3_core_dpll_setup(struct device_node *node) {
const struct dpll_data dd = {
.idlest_mask = 0x1,
.enable_mask = 0x7,
.autoidle_mask = 0x7,
.mult_mask = 0x7ff << 16,
.div1_mask = 0x7f << 8,
.max_multiplier = 2047,
.max_divider = 128,
.min_div... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll.c |
static void __init of_ti_am3_core_dpll_setup(struct device_node *node) {
const struct dpll_data dd = {
.idlest_mask = 0x1,
.enable_mask = 0x7,
.mult_mask = 0x7ff << 8,
.div1_mask = 0x7f,
.max_multiplier = 2047,
.max_divider = 128,
.min_divider = 1,
.max_rate = 10000000... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | static int _omap3_noncore_dpll_lock(struct clk_hw_omap *clk) {
const struct dpll_data *dd;
u8 ai;
u8 state = 1;
int r = 0;
pr_debug("clock: locking DPLL %s\n", clk_hw_get_name(&clk->hw));
dd = clk->dpll_data;
state <<= __ffs(dd->idlest_mask);
if ((ti_clk_ll_ops->clk_readl(&dd->idlest_reg) & dd->idles... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | static void _lookup_dco(struct clk_hw_omap *clk, u8 *dco, u16 m, u8 n) {
unsigned long fint, clkinp;
clkinp = clk_hw_get_rate(clk_hw_get_parent(&clk->hw));
fint = (clkinp / n) * m;
if (fint < 1000000000)
*dco = 2;
else
*dco = 4;
} | [
0,
1
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | static void _lookup_sddiv(struct clk_hw_omap *clk, u8 *sd_div, u16 m, u8 n) {
unsigned long clkinp, sd;
int mod1, mod2;
clkinp = clk_hw_get_rate(clk_hw_get_parent(&clk->hw));
/*
* target sigma-delta to near 250MHz
* sd = ceil[(m/(n+1)) * (clkinp_MHz / 250)]
*/
clkinp /= 100000; /* shift from MHz to... | [
0,
1
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
return omap2_get_dpll_rate(clk);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | int omap3_noncore_dpll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
struct dpll_data *dd;
if (!req->rate)
return -EINVAL;
dd = clk->dpll_data;
if (!dd)
return -EINVAL;
if (clk_hw_get_rate(dd->... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | int omap3_noncore_dpll_set_rate_and_parent(struct clk_hw *hw,
unsigned long rate,
unsigned long parent_rate,
u8 index) {
int ret;
if (!hw || !rate)
return -EINVAL;
if (index)
... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | static struct clk_hw_omap *omap3_find_clkoutx2_dpll(struct clk_hw *hw) {
struct clk_hw_omap *pclk = NULL;
do {
do {
hw = clk_hw_get_parent(hw);
} while (hw && (!omap2_clk_is_hw_omap(hw)));
if (!hw)
break;
pclk = to_clk_hw_omap(hw);
} while (pclk && !pclk->dpll_data);
/* clk does no... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
unsigned long parent_rate) {
const struct dpll_data *dd;
unsigned long rate;
u32 v;
struct clk_hw_omap *pclk = NULL;
if (!parent_rate)
return 0;
pclk = omap3_find_clkoutx2_dpll(hw);
if (!pclk)
return 0;
... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | int omap3_noncore_dpll_save_context(struct clk_hw *hw) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
struct dpll_data *dd;
u32 v;
dd = clk->dpll_data;
v = ti_clk_ll_ops->clk_readl(&dd->control_reg);
clk->context = (v & dd->enable_mask) >> __ffs(dd->enable_mask);
if (clk->context == DPLL_LOCKED) {
... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/dpll3xxx.c | int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate, u8 index) {
if (ti_clk_get_features()->flags & TI_CLK_DPLL4_DENY_REPROGRAM) {
pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on "
"3430ES1.\... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll44xx.c | unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
u32 v;
unsigned long rate;
struct dpll_data *dd;
if (!clk || !clk->dpll_data)
return 0;
dd = clk->dpll_data;
rate = omap2_g... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/dpll44xx.c | long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
unsigned long target_rate,
unsigned long *parent_rate) {
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
struct dpll_data *dd;
long r;
if (!clk || !clk->dpll_data)
return -EINVAL;
... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c |
static void ti_fapll_set_bypass(struct fapll_data *fd) {
u32 v = readl_relaxed(fd->base);
if (fd->bypass_bit_inverted)
v &= ~FAPLL_MAIN_BP;
else
v |= FAPLL_MAIN_BP;
writel_relaxed(v, fd->base);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c |
static int ti_fapll_enable(struct clk_hw *hw) {
struct fapll_data *fd = to_fapll(hw);
u32 v = readl_relaxed(fd->base);
v |= FAPLL_MAIN_PLLEN;
writel_relaxed(v, fd->base);
ti_fapll_wait_lock(fd);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c |
static u8 ti_fapll_get_parent(struct clk_hw *hw) {
struct fapll_data *fd = to_fapll(hw);
if (ti_fapll_clock_is_bypass(fd))
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c |
static long ti_fapll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
u32 pre_div_p, mult_n;
int error;
if (!rate)
return -EINVAL;
error = ti_fapll_set_div_mult(rate, *parent_rate, &pre_div_p, &mult_n);
if (error)
return error;
rate ... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c |
static int ti_fapll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct fapll_data *fd = to_fapll(hw);
u32 pre_div_p, mult_n, v;
int error;
if (!rate)
return -EINVAL;
error = ti_fapll_set_div_mult(rate, parent_rate, &pre_div_p, &mult_n);
if... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c | static unsigned long ti_fapll_synth_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct fapll_synth *synth = to_synth(hw);
u32 synth_div_m;
u64 rate;
if (!synth->div)
return 32768;
/*
* PLL in bypass sets the synths in bypass mode too. Th... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/fapll.c | static long ti_fapll_synth_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct fapll_synth *synth = to_synth(hw);
struct fapll_data *fd = synth->fd;
unsigned long r;
if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate)
return -EI... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/fixed-factor.c | static void __init of_ti_fixed_factor_clk_setup(struct device_node *node) {
struct clk *clk;
const char *clk_name = ti_dt_clk_name(node);
const char *parent_name;
u32 div, mult;
u32 flags = 0;
if (of_property_read_u32(node, "ti,clock-div", &div)) {
pr_err("%pOFn must have a clock-div property\n", node)... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/gate.c |
static void __init
of_ti_composite_no_wait_gate_clk_setup(struct device_node *node) {
_of_ti_composite_gate_clk_setup(node, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/gate.c |
static void __init of_ti_composite_gate_clk_setup(struct device_node *node) {
_of_ti_composite_gate_clk_setup(node, &clkhwops_wait);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/gate.c |
static void __init of_ti_hsdiv_gate_clk_setup(struct device_node *node) {
_of_ti_gate_clk_setup(node, &omap_gate_clk_hsdiv_restore_ops, &clkhwops_wait);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/gate.c |
static void __init of_ti_dss_gate_clk_setup(struct device_node *node) {
_of_ti_gate_clk_setup(node, &omap_gate_clk_ops,
&clkhwops_omap3430es2_dss_usbhost_wait);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/interface.c |
static struct clk *_register_interface(struct device_node *node,
const char *name,
const char *parent_name,
struct clk_omap_reg *reg, u8 bit_idx,
const struct clk_... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/interface.c |
static void __init of_ti_interface_clk_setup(struct device_node *node) {
_of_ti_interface_clk_setup(node, &clkhwops_iclk_wait);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/interface.c |
static void __init of_ti_dss_interface_clk_setup(struct device_node *node) {
_of_ti_interface_clk_setup(node, &clkhwops_omap3430es2_iclk_dss_usbhost_wait);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ti/mux.c |
static int ti_clk_mux_set_parent(struct clk_hw *hw, u8 index) {
struct clk_omap_mux *mux = to_clk_omap_mux(hw);
u32 val;
if (mux->table) {
index = mux->table[index];
} else {
if (mux->flags & CLK_MUX_INDEX_BIT)
index = (1 << ffs(index));
if (mux->flags & CLK_MUX_INDEX_ONE)
index++;
... | [
1,
0
] |
Linux Kernel | drivers/clk/ti/mux.c | static void of_mux_clk_setup(struct device_node *node) {
struct clk *clk;
struct clk_omap_reg reg;
unsigned int num_parents;
const char **parent_names;
const char *name;
u8 clk_mux_flags = 0;
u32 mask = 0;
u32 shift = 0;
s32 latch = -EINVAL;
u32 flags = CLK_SET_RATE_NO_REPARENT;
num_parents = of_... | [
0,
0
] |
Linux Kernel | drivers/clk/ti/mux.c |
struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup) {
struct clk_omap_mux *mux;
int num_parents;
if (!setup)
return NULL;
mux = kzalloc(sizeof(*mux), GFP_KERNEL);
if (!mux)
return ERR_PTR(-ENOMEM);
mux->shift = setup->bit_shift;
mux->latch = -EINVAL;
mux->reg.index = setup->... | [
0,
0
] |
Linux Kernel | drivers/clk/uniphier/clk-uniphier-core.c |
static struct clk_hw *
uniphier_clk_register(struct device *dev, struct regmap *regmap,
const struct uniphier_clk_data *data) {
switch (data->type) {
case UNIPHIER_CLK_TYPE_CPUGEAR:
return uniphier_clk_register_cpugear(dev, regmap, data->name,
&dat... | [
0,
0
] |
Linux Kernel | drivers/clk/uniphier/clk-uniphier-core.c |
static int uniphier_clk_remove(struct platform_device *pdev) {
of_clk_del_provider(pdev->dev.of_node);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/uniphier/clk-uniphier-gate.c |
static void uniphier_clk_gate_disable(struct clk_hw *hw) {
if (uniphier_clk_gate_endisable(hw, 0) < 0)
pr_warn("failed to disable clk\n");
} | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcc.c |
static void clk_prcc_pclk_disable(struct clk_hw *hw) {
struct clk_prcc *clk = to_clk_prcc(hw);
writel(clk->cg_sel, (clk->base + PRCC_PCKDIS));
clk->is_enabled = 0;
} | [
1,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcc.c |
static void clk_prcc_kclk_disable(struct clk_hw *hw) {
struct clk_prcc *clk = to_clk_prcc(hw);
writel(clk->cg_sel, (clk->base + PRCC_KCKDIS));
clk->is_enabled = 0;
} | [
1,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcc.c |
struct clk *clk_reg_prcc_pclk(const char *name, const char *parent_name,
resource_size_t phy_base, u32 cg_sel,
unsigned long flags) {
return clk_reg_prcc(name, parent_name, phy_base, cg_sel, flags,
&clk_prcc_pclk_ops);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcc.c |
struct clk *clk_reg_prcc_kclk(const char *name, const char *parent_name,
resource_size_t phy_base, u32 cg_sel,
unsigned long flags) {
return clk_reg_prcc(name, parent_name, phy_base, cg_sel, flags,
&clk_prcc_kclk_ops);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcmu.c |
static int clk_prcmu_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_prcmu *clk = to_clk_prcmu(hw);
return prcmu_set_clock_rate(clk->cg_sel, rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcmu.c |
static int clk_prcmu_opp_prepare(struct clk_hw *hw) {
int err;
struct clk_prcmu *clk = to_clk_prcmu(hw);
if (!clk->opp_requested) {
err = prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP,
(char *)clk_hw_get_name(hw), 100);
if (err) {
pr_err("clk_prcmu: %s fail req AP... | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcmu.c |
struct clk_hw *clk_reg_prcmu_rate(const char *name, const char *parent_name,
u8 cg_sel, unsigned long flags) {
return clk_reg_prcmu(name, parent_name, cg_sel, 0, flags,
&clk_prcmu_rate_ops);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcmu.c |
struct clk_hw *clk_reg_prcmu_opp_volt_scalable(const char *name,
const char *parent_name,
u8 cg_sel, unsigned long rate,
unsigned long flags) {
return clk_reg_prcmu(name, paren... | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-prcmu.c | static int clk_prcmu_clkout_prepare(struct clk_hw *hw) {
struct clk_prcmu_clkout *clk = to_clk_prcmu_clkout(hw);
return prcmu_config_clkout(clk->clkout_id, clk->source, clk->divider);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-sysctrl.c | static int clk_sysctrl_prepare(struct clk_hw *hw) {
int ret;
struct clk_sysctrl *clk = to_clk_sysctrl(hw);
ret =
ab8500_sysctrl_write(clk->reg_sel[0], clk->reg_mask[0], clk->reg_bits[0]);
if (!ret && clk->enable_delay_us)
usleep_range(clk->enable_delay_us,
clk->enable_delay_us + (cl... | [
1,
0
] |
Linux Kernel | drivers/clk/ux500/clk-sysctrl.c |
static int clk_sysctrl_set_parent(struct clk_hw *hw, u8 index) {
struct clk_sysctrl *clk = to_clk_sysctrl(hw);
u8 old_index = clk->parent_index;
int ret = 0;
if (clk->reg_sel[old_index]) {
ret =
ab8500_sysctrl_clear(clk->reg_sel[old_index], clk->reg_mask[old_index]);
if (ret)
return ret;... | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-sysctrl.c |
struct clk *clk_reg_sysctrl_gate(struct device *dev, const char *name,
const char *parent_name, u16 reg_sel,
u8 reg_mask, u8 reg_bits,
unsigned long enable_delay_us,
unsigned long flags) ... | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/clk-sysctrl.c |
struct clk *clk_reg_sysctrl_gate_fixed_rate(
struct device *dev, const char *name, const char *parent_name, u16 reg_sel,
u8 reg_mask, u8 reg_bits, unsigned long rate, unsigned long enable_delay_us,
unsigned long flags) {
const char **parent_names = (parent_name ? &parent_name : NULL);
u8 num_parents = ... | [
0,
0
] |
Linux Kernel | drivers/clk/ux500/reset-prcc.c | static int u8500_prcc_reset(struct reset_controller_dev *rcdev,
unsigned long id) {
struct u8500_prcc_reset *ur = to_u8500_prcc_reset(rcdev);
void __iomem *base = u8500_prcc_reset_base(ur, id);
unsigned int bit = id % PRCC_PERIPHS_PER_CLUSTER;
pr_debug("PRCC cycle reset id %lu, bit ... | [
1,
0
] |
Linux Kernel | drivers/clk/ux500/reset-prcc.c |
static int u8500_prcc_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id) {
struct u8500_prcc_reset *ur = to_u8500_prcc_reset(rcdev);
void __iomem *base = u8500_prcc_reset_base(ur, id);
unsigned int bit = id % PRCC_PERIPHS_PER_CLUSTER;
pr_debug("PRCC assert re... | [
1,
0
] |
Linux Kernel | drivers/clk/ux500/reset-prcc.c |
static int u8500_prcc_reset_deassert(struct reset_controller_dev *rcdev,
unsigned long id) {
struct u8500_prcc_reset *ur = to_u8500_prcc_reset(rcdev);
void __iomem *base = u8500_prcc_reset_base(ur, id);
unsigned int bit = id % PRCC_PERIPHS_PER_CLUSTER;
pr_debug("PRCC deass... | [
1,
0
] |
Linux Kernel | drivers/clk/ux500/u8500_of_clk.c |
static struct clk_hw *ux500_clkout_get(struct of_phandle_args *clkspec,
void *data) {
u32 id, source, divider;
struct clk_hw *clkout;
if (clkspec->args_count != 3)
return ERR_PTR(-EINVAL);
id = clkspec->args[0];
source = clkspec->args[1];
divider = clkspec->args... | [
0,
0
] |
Linux Kernel | drivers/clk/versatile/clk-impd1.c |
static int integrator_impd1_clk_probe(struct platform_device *pdev) {
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct device_node *child;
int ret = 0;
for_each_available_child_of_node(np, child) {
ret = integrator_impd1_clk_spawn(dev, np, child);
if (ret) {
of_no... | [
0,
0
] |
Linux Kernel | drivers/clk/versatile/clk-sp810.c | static void __init clk_sp810_of_setup(struct device_node *node) {
struct clk_sp810 *sp810 = kzalloc(sizeof(*sp810), GFP_KERNEL);
const char *parent_names[2];
int num = ARRAY_SIZE(parent_names);
char name[12];
struct clk_init_data init;
static int instance;
int i;
bool deprecated;
if (!sp810)
retu... | [
1,
0
] |
Linux Kernel | drivers/clk/versatile/clk-versatile.c | static void __init cm_osc_setup(struct device_node *np,
const struct clk_icst_desc *desc) {
struct clk *clk;
const char *clk_name = np->name;
const char *parent_name;
if (!cm_base) {
struct device_node *parent;
parent = of_get_parent(np);
if (!parent) {
pr_er... | [
0,
0
] |
Linux Kernel | drivers/clk/versatile/clk-vexpress-osc.c |
static long vexpress_osc_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct vexpress_osc *osc = to_vexpress_osc(hw);
if (osc->rate_min && rate < osc->rate_min)
rate = osc->rate_min;
if (osc->rate_max && rate > osc->rate_max)
rate =... | [
0,
0
] |
Linux Kernel | drivers/clk/versatile/icst.c |
unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) {
u64 dividend = p->ref * 2 * (u64)(vco.v + 8);
u32 divisor = (vco.r + 2) * p->s2div[vco.s];
do_div(dividend, divisor);
return (unsigned long)dividend;
} | [
0,
0
] |
Linux Kernel | drivers/clk/versatile/icst.c | struct icst_vco icst_hz_to_vco(const struct icst_params *p,
unsigned long freq) {
struct icst_vco vco = {.s = 1, .v = p->vd_max, .r = p->rd_max};
unsigned long f;
unsigned int i = 0, rd, best = (unsigned int)-1;
do {
f = freq * p->s2div[p->idx2s[i]];
if (f > p->vco_min &... | [
1,
0
] |
Linux Kernel | drivers/clk/visconti/clkc.c |
struct visconti_clk_provider *visconti_init_clk(struct device *dev,
struct regmap *regmap,
unsigned long nr_clks) {
struct visconti_clk_provider *ctx;
int i;
ctx = devm_kzalloc(dev, struct_size(ctx, clk_data.hws, nr_... | [
0,
0
] |
Linux Kernel | drivers/clk/visconti/pll.c |
static inline struct visconti_pll *to_visconti_pll(struct clk_hw *hw) {
return container_of(hw, struct visconti_pll, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/visconti/pll.c | static unsigned long
visconti_get_pll_rate_from_data(struct visconti_pll *pll,
const struct visconti_pll_rate_table *rate) {
const struct visconti_pll_rate_table *rate_table = pll->rate_table;
int i;
for (i = 0; i < pll->rate_count; i++)
if (memcmp(&rate_table[i].dacen, &rate-... | [
1,
0
] |
Linux Kernel | drivers/clk/visconti/pll.c |
static struct clk_hw *
visconti_register_pll(struct visconti_pll_provider *ctx, const char *name,
const char *parent_name, int offset,
const struct visconti_pll_rate_table *rate_table,
spinlock_t *lock) {
struct clk_init_data init;
struct visconti_p... | [
1,
0
] |
Linux Kernel | drivers/clk/visconti/reset.c |
static inline struct visconti_reset *
to_visconti_reset(struct reset_controller_dev *rcdev) {
return container_of(rcdev, struct visconti_reset, rcdev);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu-pll.c |
static int lgm_pll_is_enabled(struct clk_hw *hw) {
struct lgm_clk_pll *pll = to_lgm_clk_pll(hw);
unsigned int ret;
ret = lgm_get_clk_val(pll->membase, pll->reg, 0, 1);
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu.c |
static struct clk_hw *
lgm_clk_register_divider(struct lgm_clk_provider *ctx,
const struct lgm_clk_branch *list) {
unsigned long cflags = list->div_flags;
struct device *dev = ctx->dev;
struct lgm_clk_divider *div;
struct clk_init_data init = {};
u8 shift = list->div_shift;
u8 widt... | [
1,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu.c |
static struct clk_hw *
lgm_clk_register_fixed_factor(struct lgm_clk_provider *ctx,
const struct lgm_clk_branch *list) {
struct clk_hw *hw;
hw = clk_hw_register_fixed_factor(ctx->dev, list->name,
list->parent_data[0].name, list->flags,
... | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu.c |
static void lgm_clk_gate_disable(struct clk_hw *hw) {
struct lgm_clk_gate *gate = to_lgm_clk_gate(hw);
unsigned int reg;
reg = GATE_HW_REG_DIS(gate->reg);
lgm_set_clk_val(gate->membase, reg, gate->shift, 1, 1);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu.c |
static int lgm_clk_gate_is_enabled(struct clk_hw *hw) {
struct lgm_clk_gate *gate = to_lgm_clk_gate(hw);
unsigned int reg, ret;
reg = GATE_HW_REG_STAT(gate->reg);
ret = lgm_get_clk_val(gate->membase, reg, gate->shift, 1);
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu.c |
static unsigned long lgm_clk_ddiv_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw);
unsigned int div0, div1, exdiv;
u64 prate;
div0 =
lgm_get_clk_val(ddiv->membase, ddiv->reg, ddiv->shift0, ddiv->wid... | [
1,
0
] |
Linux Kernel | drivers/clk/x86/clk-cgu.c |
static void lgm_clk_ddiv_disable(struct clk_hw *hw) {
struct lgm_clk_ddiv *ddiv = to_lgm_clk_ddiv(hw);
lgm_set_clk_val(ddiv->membase, ddiv->reg, ddiv->shift_gate, ddiv->width_gate,
0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-lpss-atom.c |
int __init lpss_atom_clk_init(void) {
return platform_driver_register(&lpss_atom_clk_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-pmc-atom.c | static inline int plt_reg_to_enabled(int reg) {
switch (reg & PMC_MASK_CLK_CTL) {
case PMC_CLK_CTL_GATED_ON_D3:
case PMC_CLK_CTL_FORCE_ON:
return 1;
case PMC_CLK_CTL_FORCE_OFF:
case PMC_CLK_CTL_RESERVED:
default:
return 0; /* disabled */
}
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-pmc-atom.c |
static void plt_clk_disable(struct clk_hw *hw) {
struct clk_plt *clk = to_clk_plt(hw);
plt_clk_reg_update(clk, PMC_MASK_CLK_CTL, PMC_CLK_CTL_FORCE_OFF);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-pmc-atom.c |
static int plt_clk_is_enabled(struct clk_hw *hw) {
struct clk_plt *clk = to_clk_plt(hw);
u32 value;
value = readl(clk->reg);
return plt_reg_to_enabled(value);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-pmc-atom.c |
static void plt_clk_unregister_fixed_rate(struct clk_plt_fixed *pclk) {
clkdev_drop(pclk->lookup);
clk_hw_unregister_fixed_rate(pclk->clk);
} | [
0,
0
] |
Linux Kernel | drivers/clk/x86/clk-pmc-atom.c |
static const char **plt_clk_register_parents(struct platform_device *pdev,
struct clk_plt_data *data,
const struct pmc_clk *clks) {
const char **parent_names;
unsigned int i;
int err;
int nparents = 0;
data->nparents =... | [
1,
0
] |
Linux Kernel | drivers/clk/x86/clk-pmc-atom.c |
static void plt_clk_unregister_parents(struct clk_plt_data *data) {
plt_clk_unregister_fixed_rate_loop(data, data->nparents);
} | [
0,
0
] |
Linux Kernel | drivers/clk/xilinx/clk-xlnx-clock-wizard.c | static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
int err;
u32 value;
unsigned long flags = 0;
struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
void __iomem *div_addr = divider->base + divider->offset;
if... | [
1,
0
] |
Linux Kernel | drivers/clk/xilinx/clk-xlnx-clock-wizard.c |
static struct clk *clk_wzrd_register_divider(
struct device *dev, const char *name, const char *parent_name,
unsigned long flags, void __iomem *base, u16 offset, u8 shift, u8 width,
u8 clk_divider_flags, const struct clk_div_table *table, spinlock_t *lock) {
struct clk_wzrd_divider *div;
struct clk_hw ... | [
1,
0
] |
Linux Kernel | drivers/clk/xilinx/clk-xlnx-clock-wizard.c |
static int __maybe_unused clk_wzrd_resume(struct device *dev) {
int ret;
struct clk_wzrd *clk_wzrd = dev_get_drvdata(dev);
ret = clk_prepare_enable(clk_wzrd->axi_clk);
if (ret) {
dev_err(dev, "unable to enable s_axi_aclk\n");
return ret;
}
clk_wzrd->suspended = false;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/xilinx/clk-xlnx-clock-wizard.c |
static int clk_wzrd_remove(struct platform_device *pdev) {
int i;
struct clk_wzrd *clk_wzrd = platform_get_drvdata(pdev);
of_clk_del_provider(pdev->dev.of_node);
for (i = 0; i < WZRD_NUM_OUTPUTS; i++)
clk_unregister(clk_wzrd->clkout[i]);
for (i = 0; i < wzrd_clk_int_max; i++)
clk_unregister(clk_wzr... | [
0,
0
] |
Linux Kernel | drivers/clk/xilinx/xlnx_vcu.c |
static long xvcu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct vcu_pll *pll = to_vcu_pll(hw);
unsigned int feedback_div;
rate = clamp_t(unsigned long, rate, pll->fvco_min, pll->fvco_max);
feedback_div = DIV_ROUND_CLOSEST_ULL(rate, *... | [
0,
0
] |
Linux Kernel | drivers/clk/xilinx/xlnx_vcu.c |
static unsigned long xvcu_pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct vcu_pll *pll = to_vcu_pll(hw);
void __iomem *base = pll->reg_base;
unsigned int div;
u32 vcu_pll_ctrl;
vcu_pll_ctrl = xvcu_read(base, VCU_PLL_CTRL);
div = FIELD_GET(VC... | [
0,
0
] |
Linux Kernel | drivers/clk/xilinx/xlnx_vcu.c |
static int xvcu_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct vcu_pll *pll = to_vcu_pll(hw);
return xvcu_pll_set_div(pll, rate / parent_rate);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.