Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/clk/mmp/clk-of-mmp2.c |
static void mmp2_clk_reset_init(struct device_node *np,
struct mmp2_clk_unit *pxa_unit) {
struct mmp_clk_reset_cell *cells;
int i, nr_resets;
nr_resets = ARRAY_SIZE(apbc_gate_clks);
cells = kcalloc(nr_resets, sizeof(*cells), GFP_KERNEL);
if (!cells)
return;
for (i = 0;... | [
1,
0
] |
Linux Kernel | drivers/clk/mmp/clk-of-pxa168.c |
static void pxa168_apb_periph_clk_init(struct pxa168_clk_unit *pxa_unit) {
struct mmp_clk_unit *unit = &pxa_unit->unit;
mmp_register_mux_clks(unit, apbc_mux_clks, pxa_unit->apbc_base,
ARRAY_SIZE(apbc_mux_clks));
mmp_register_gate_clks(unit, apbc_gate_clks, pxa_unit->apbc_base,
... | [
0,
0
] |
Linux Kernel | drivers/clk/mmp/clk.c |
void mmp_clk_init(struct device_node *np, struct mmp_clk_unit *unit,
int nr_clks) {
struct clk **clk_table;
clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL);
if (!clk_table)
return;
unit->clk_table = clk_table;
unit->nr_clks = nr_clks;
unit->clk_data.clks = clk_table;
... | [
1,
0
] |
Linux Kernel | drivers/clk/mmp/reset.c |
static int mmp_clk_reset_deassert(struct reset_controller_dev *rcdev,
unsigned long id) {
struct mmp_clk_reset_unit *unit = rcdev_to_unit(rcdev);
struct mmp_clk_reset_cell *cell;
unsigned long flags = 0;
u32 val;
cell = &unit->cells[id];
if (cell->lock)
spin_lock_irqs... | [
1,
0
] |
Linux Kernel | drivers/clk/mmp/reset.h | static inline void mmp_clk_reset_register(struct device_node *np,
struct mmp_clk_reset_cell *cells,
int nr_resets) {} | [
0,
0
] |
Linux Kernel | drivers/clk/mstar/clk-msc313-cpupll.c |
static u32 msc313_cpupll_reg_read32(struct msc313_cpupll *cpupll,
unsigned int reg) {
u32 value;
value = ioread16(cpupll->base + reg + 4) << 16;
value |= ioread16(cpupll->base + reg);
return value;
} | [
1,
0
] |
Linux Kernel | drivers/clk/mstar/clk-msc313-cpupll.c |
static void msc313_cpupll_reg_write32(struct msc313_cpupll *cpupll,
unsigned int reg, u32 value) {
u16 l = value & 0xffff, h = (value >> 16) & 0xffff;
iowrite16(l, cpupll->base + reg);
iowrite16(h, cpupll->base + reg + 4);
} | [
1,
0
] |
Linux Kernel | drivers/clk/mstar/clk-msc313-cpupll.c | static long msc313_cpupll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
u32 reg = msc313_cpupll_regforfrequecy(rate, *parent_rate);
long rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate);
for (; rounded >= rate && reg > 0; reg--)
... | [
1,
0
] |
Linux Kernel | drivers/clk/mstar/clk-msc313-cpupll.c |
static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct msc313_cpupll *cpupll = to_cpupll(hw);
u32 reg = msc313_cpupll_regforfrequecy(rate, parent_rate);
msc313_cpupll_setfreq(cpupll, reg);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/mstar/clk-msc313-cpupll.c | static int msc313_cpupll_probe(struct platform_device *pdev) {
struct clk_init_data clk_init = {};
struct clk_parent_data cpupll_parent = {.index = 0};
struct device *dev = &pdev->dev;
struct msc313_cpupll *cpupll;
int ret;
cpupll = devm_kzalloc(&pdev->dev, sizeof(*cpupll), GFP_KERNEL);
if (!cpupll)
... | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/ap-cpu-clk.c |
static long ap_cpu_clk_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
int divider = *parent_rate / rate;
divider = min(divider, APN806_MAX_DIVIDER);
return *parent_rate / divider;
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/ap806-system-controller.c |
static int ap806_clock_probe(struct platform_device *pdev) {
return ap806_syscon_common_probe(pdev, pdev->dev.of_node->parent);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-370.c |
static void __init a370_clk_init(struct device_node *np) {
struct device_node *cgnp =
of_find_compatible_node(NULL, NULL, "marvell,armada-370-gating-clock");
mvebu_coreclk_setup(np, &a370_coreclks);
if (cgnp) {
mvebu_clk_gating_setup(cgnp, a370_gating_desc);
of_node_put(cgnp);
}
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-375.c |
static void __init armada_375_get_clk_ratio(void __iomem *sar, int id,
int *mult, int *div) {
u32 opt = ((readl(sar) >> SAR1_A375_CPU_DDR_L2_FREQ_OPT) &
SAR1_A375_CPU_DDR_L2_FREQ_OPT_MASK);
switch (id) {
case A375_CPU_TO_L2:
*mult = armada_375_cpu_l2_... | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-37xx-periph.c |
static bool armada_3700_pm_dvfs_is_enabled(struct regmap *base) {
unsigned int val, reg = ARMADA_37XX_NB_DYN_MOD;
if (IS_ERR(base))
return false;
regmap_read(base, reg, &val);
return !!(val & BIT(ARMADA_37XX_NB_DFS_EN));
} | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-37xx-tbg.c |
static int armada_3700_tbg_clock_probe(struct platform_device *pdev) {
struct device_node *np = pdev->dev.of_node;
struct clk_hw_onecell_data *hw_tbg_data;
struct device *dev = &pdev->dev;
const char *parent_name;
struct resource *res;
struct clk *parent;
void __iomem *reg;
int i;
hw_tbg_data = dev... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-38x.c |
static u32 __init armada_38x_get_tclk_freq(void __iomem *sar) {
u8 tclk_freq_select;
tclk_freq_select =
((readl(sar) >> SAR_A380_TCLK_FREQ_OPT) & SAR_A380_TCLK_FREQ_OPT_MASK);
return armada_38x_tclk_frequencies[tclk_freq_select];
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-38x.c |
static void __init armada_38x_coreclk_init(struct device_node *np) {
mvebu_coreclk_setup(np, &armada_38x_coreclks);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/armada-39x.c |
static void __init armada_39x_get_clk_ratio(void __iomem *sar, int id,
int *mult, int *div) {
switch (id) {
case A390_CPU_TO_NBCLK:
*mult = 1;
*div = 2;
break;
case A390_CPU_TO_HCLK:
*mult = 1;
*div = 4;
break;
case A390_CPU_TO_DCLK:
*mult... | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-corediv.c |
static int clk_corediv_is_enabled(struct clk_hw *hwclk) {
struct clk_corediv *corediv = to_corediv_clk(hwclk);
const struct clk_corediv_soc_desc *soc_desc = corediv->soc_desc;
const struct clk_corediv_desc *desc = corediv->desc;
u32 enable_mask = BIT(desc->fieldbit) << soc_desc->enable_bit_offset;
return !!... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-corediv.c |
static void clk_corediv_disable(struct clk_hw *hwclk) {
struct clk_corediv *corediv = to_corediv_clk(hwclk);
const struct clk_corediv_soc_desc *soc_desc = corediv->soc_desc;
const struct clk_corediv_desc *desc = corediv->desc;
unsigned long flags = 0;
u32 reg;
spin_lock_irqsave(&corediv->lock, flags);
... | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-corediv.c |
static unsigned long clk_corediv_recalc_rate(struct clk_hw *hwclk,
unsigned long parent_rate) {
struct clk_corediv *corediv = to_corediv_clk(hwclk);
const struct clk_corediv_soc_desc *soc_desc = corediv->soc_desc;
const struct clk_corediv_desc *desc = corediv->desc;
... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-corediv.c |
static void __init armada380_corediv_clk_init(struct device_node *node) {
return mvebu_corediv_clk_init(node, &armada380_corediv_soc);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-corediv.c |
static void __init mv98dx3236_corediv_clk_init(struct device_node *node) {
return mvebu_corediv_clk_init(node, &mv98dx3236_corediv_soc);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-cpu.c |
static unsigned long clk_cpu_recalc_rate(struct clk_hw *hwclk,
unsigned long parent_rate) {
struct cpu_clk *cpuclk = to_cpu_clk(hwclk);
u32 reg, div;
reg = readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_VALUE_OFFSET);
div = (reg >> (cpuclk->cpu * 8)) & SYS_CTRL_CLK_DIVI... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/clk-cpu.c | static int clk_cpu_on_set_rate(struct clk_hw *hwclk, unsigned long rate,
unsigned long parent_rate) {
u32 reg;
unsigned long fabric_div, target_div, cur_rate;
struct cpu_clk *cpuclk = to_cpu_clk(hwclk);
if (!cpuclk->pmu_dfs)
return -ENODEV;
cur_rate = clk_hw_get_rate(hwclk... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/common.c |
static struct clk *clk_gating_get_src(struct of_phandle_args *clkspec,
void *data) {
int n;
if (clkspec->args_count < 1)
return ERR_PTR(-EINVAL);
for (n = 0; n < ctrl->num_gates; n++) {
struct clk_gate *gate = to_clk_gate(__clk_get_hw(ctrl->gates[n]));
if (clks... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/cp110-system-controller.c |
static void cp110_gate_disable(struct clk_hw *hw) {
struct cp110_gate_clk *gate = to_cp110_gate_clk(hw);
regmap_update_bits(gate->regmap, CP110_PM_CLOCK_GATING_REG,
BIT(gate->bit_idx), 0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/cp110-system-controller.c |
static int cp110_gate_is_enabled(struct clk_hw *hw) {
struct cp110_gate_clk *gate = to_cp110_gate_clk(hw);
u32 val;
regmap_read(gate->regmap, CP110_PM_CLOCK_GATING_REG, &val);
return val & BIT(gate->bit_idx);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/cp110-system-controller.c |
static struct clk_hw *cp110_register_gate(const char *name,
const char *parent_name,
struct regmap *regmap, u8 bit_idx) {
struct cp110_gate_clk *gate;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
gate = kzalloc(siz... | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/dove-divider.c |
static void dove_load_divider(void __iomem *base, u32 val, u32 mask, u32 load) {
u32 v;
v = readl_relaxed(base + DIV_CTRL1) | DIV_CTRL1_N_RESET_MASK;
writel_relaxed(v, base + DIV_CTRL1);
v = (readl_relaxed(base + DIV_CTRL0) & ~(mask | load)) | val;
writel_relaxed(v, base + DIV_CTRL0);
writel_relaxed(v | ... | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/dove.c |
static u32 __init dove_get_tclk_freq(void __iomem *sar) {
u32 opt = (readl(sar) >> SAR_DOVE_TCLK_FREQ) & SAR_DOVE_TCLK_FREQ_MASK;
return dove_tclk_freqs[opt];
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/kirkwood.c |
static u32 __init kirkwood_get_cpu_freq(void __iomem *sar) {
u32 opt = SAR_KIRKWOOD_CPU_FREQ(readl(sar));
return kirkwood_cpu_freqs[opt];
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/kirkwood.c |
static void __init kirkwood_get_clk_ratio(void __iomem *sar, int id, int *mult,
int *div) {
switch (id) {
case KIRKWOOD_CPU_TO_L2: {
u32 opt = SAR_KIRKWOOD_L2_RATIO(readl(sar));
*mult = kirkwood_cpu_l2_ratios[opt][0];
*div = kirkwood_cpu_l2_ratios[opt][1];
... | [
1,
0
] |
Linux Kernel | drivers/clk/mvebu/kirkwood.c |
static u32 __init mv98dx1135_get_tclk_freq(void __iomem *sar) {
return 166666667;
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/orion.c |
static void __init mv88f5281_clk_init(struct device_node *np) {
return mvebu_coreclk_setup(np, &mv88f5281_coreclks);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/orion.c |
static u32 __init mv88f6183_get_cpu_freq(void __iomem *sar) {
u32 opt =
(readl(sar) >> SAR_MV88F6183_CPU_FREQ) & SAR_MV88F6183_CPU_FREQ_MASK;
if (opt == 9)
return 333333333;
else if (opt == 17)
return 400000000;
else
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/mvebu/orion.c |
static void __init mv88f6183_clk_init(struct device_node *np) {
return mvebu_coreclk_setup(np, &mv88f6183_coreclks);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mxs/clk-div.c |
static unsigned long clk_div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_div *div = to_clk_div(hw);
return div->ops->recalc_rate(&div->divider.hw, parent_rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mxs/clk-frac.c |
static int clk_frac_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_frac *frac = to_clk_frac(hw);
unsigned long flags;
u32 div, val;
u64 tmp;
if (rate > parent_rate)
return -EINVAL;
tmp = rate;
tmp <<= frac->width;
do_div(tmp, p... | [
1,
0
] |
Linux Kernel | drivers/clk/mxs/clk-frac.c |
struct clk *mxs_clk_frac(const char *name, const char *parent_name,
void __iomem *reg, u8 shift, u8 width, u8 busy) {
struct clk_frac *frac;
struct clk *clk;
struct clk_init_data init;
frac = kzalloc(sizeof(*frac), GFP_KERNEL);
if (!frac)
return ERR_PTR(-ENOMEM);
init.name = ... | [
0,
0
] |
Linux Kernel | drivers/clk/mxs/clk-imx23.c | static void __init clk_misc_init(void) {
u32 val;
writel_relaxed(1 << BP_CPU_INTERRUPT_WAIT, CPU + SET);
/* Clear BYPASS for SAIF */
writel_relaxed(1 << BP_CLKSEQ_BYPASS_SAIF, CLKSEQ + CLR);
/* SAIF has to use frac div for functional operation */
val = readl_relaxed(SAIF);
val |= 1 << BP_SAIF_DIV_FRAC_... | [
0,
0
] |
Linux Kernel | drivers/clk/mxs/clk-imx28.c | int mxs_saif_clkmux_select(unsigned int clkmux) {
if (clkmux > 0x3)
return -EINVAL;
writel_relaxed(0x3 << BP_SAIF_CLKMUX, DIGCTRL + CLR);
writel_relaxed(clkmux << BP_SAIF_CLKMUX, DIGCTRL + SET);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/mxs/clk-pll.c |
static void clk_pll_unprepare(struct clk_hw *hw) {
struct clk_pll *pll = to_clk_pll(hw);
writel_relaxed(1 << pll->power, pll->base + CLR);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mxs/clk-ref.c |
static unsigned long clk_ref_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_ref *ref = to_clk_ref(hw);
u64 tmp = parent_rate;
u8 frac = (readl_relaxed(ref->reg) >> (ref->idx * 8)) & 0x3f;
tmp *= 18;
do_div(tmp, frac);
return tmp;
} | [
1,
0
] |
Linux Kernel | drivers/clk/mxs/clk-ref.c |
static long clk_ref_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) {
unsigned long parent_rate = *prate;
u64 tmp = parent_rate;
u8 frac;
tmp = tmp * 18 + rate / 2;
do_div(tmp, rate);
frac = tmp;
if (frac < 18)
frac = 18;
else if (frac > 35)
... | [
1,
0
] |
Linux Kernel | drivers/clk/mxs/clk.c |
int mxs_clk_wait(void __iomem *reg, u8 shift) {
unsigned long timeout = jiffies + msecs_to_jiffies(10);
while (readl_relaxed(reg) & (1 << shift))
if (time_after(jiffies, timeout))
return -ETIMEDOUT;
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/clk/mxs/clk.h |
static inline struct clk *mxs_clk_fixed(const char *name, int rate) {
return clk_register_fixed_rate(NULL, name, NULL, 0, rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-ccu.c |
static struct clk *lpc18xx_ccu_branch_clk_get(struct of_phandle_args *clkspec,
void *data) {
struct lpc18xx_branch_clk_data *clk_data = data;
unsigned int offset = clkspec->args[0];
int i, j;
for (i = 0; i < ARRAY_SIZE(clk_branches); i++) {
if (clk_branches[i]... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-ccu.c |
static void lpc18xx_ccu_gate_disable(struct clk_hw *hw) {
lpc18xx_ccu_gate_endisable(hw, false);
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-ccu.c | static void
lpc18xx_ccu_register_branch_gate_div(struct lpc18xx_clk_branch *branch,
void __iomem *reg_base,
const char *parent) {
const struct clk_ops *div_ops = NULL;
struct clk_divider *div = NULL;
struct clk_hw *div_hw = NULL;
if (bra... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-ccu.c |
static void __init lpc18xx_ccu_init(struct device_node *np) {
struct lpc18xx_branch_clk_data *clk_data;
void __iomem *reg_base;
int i, ret;
reg_base = of_iomap(np, 0);
if (!reg_base) {
pr_warn("%s: failed to map address range\n", __func__);
return;
}
clk_data = kzalloc(sizeof(*clk_data), GFP_KE... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c | static u32 lpc18xx_pll0_mdec2msel(u32 x) {
int i;
switch (x) {
case 0x18003:
return 1;
case 0x10003:
return 2;
default:
for (i = LPC18XX_PLL0_MSEL_MAX + 1; x != 0x4000 && i > 0; i--)
x = ((x ^ x >> 14) & 1) | (x << 1 & 0x7fff);
return i;
}
} | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c |
static long lpc18xx_pll0_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) {
unsigned long m;
if (*prate < rate) {
pr_warn("%s: pll dividers not supported\n", __func__);
return -EINVAL;
}
m = DIV_ROUND_UP_ULL(*prate, rate * 2);
if (m <= 0 &&... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c |
static int lpc18xx_cgu_gate_enable(struct clk_hw *hw) {
return clk_gate_ops.enable(hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c |
static void lpc18xx_fill_parent_names(const char **parent, const u32 *id,
int size) {
int i;
for (i = 0; i < size; i++)
parent[i] = clk_src_names[id[i]];
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c |
static struct clk *lpc18xx_cgu_register_pll(struct lpc18xx_cgu_pll_clk *clk,
void __iomem *base) {
const char *name = clk_src_names[clk->clk_id];
const char *parents[CLK_SRC_MAX];
clk->pll.reg = base;
clk->mux.reg = base + clk->reg_offset + LPC18XX_CGU_PLL_CTRL_OFF... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c | static void __init lpc18xx_cgu_register_source_clks(struct device_node *np,
void __iomem *base) {
const char *parents[CLK_SRC_MAX];
struct clk *clk;
int i;
clk = clk_register_fixed_rate(NULL, clk_src_names[CLK_SRC_IRC], NULL, 0,
... | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-cgu.c |
static void __init lpc18xx_cgu_init(struct device_node *np) {
void __iomem *reg_base;
reg_base = of_iomap(np, 0);
if (!reg_base) {
pr_warn("%s: failed to map address range\n", __func__);
return;
}
lpc18xx_cgu_register_source_clks(np, reg_base);
lpc18xx_cgu_register_base_clks(reg_base);
of_clk_... | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc18xx-creg.c |
static int clk_creg_is_enabled(struct clk_hw *hw) {
struct clk_creg_data *creg = to_clk_creg(hw);
u32 reg;
regmap_read(creg->reg, LPC18XX_CREG_CREG0, ®);
return !!(reg & creg->en_mask);
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static int clk_mask_is_enabled(struct clk_hw *hw) {
struct lpc32xx_clk *clk = to_lpc32xx_clk(hw);
u32 val;
regmap_read(clk_regmap, clk->reg, &val);
return ((val & clk->enable_mask) == clk->enable);
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static int clk_pll_enable(struct clk_hw *hw) {
struct lpc32xx_pll_clk *clk = to_lpc32xx_pll_clk(hw);
u32 val, count;
regmap_update_bits(clk_regmap, clk->reg, clk->enable, clk->enable);
for (count = 0; count < 1000; count++) {
regmap_read(clk_regmap, clk->reg, &val);
if (val & PLL_CTRL_LOCK)
bre... | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static void clk_pll_disable(struct clk_hw *hw) {
struct lpc32xx_pll_clk *clk = to_lpc32xx_pll_clk(hw);
regmap_update_bits(clk_regmap, clk->reg, clk->enable, 0x0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c | static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct lpc32xx_pll_clk *clk = to_lpc32xx_pll_clk(hw);
u32 val;
unsigned long new_rate;
switch (clk->mode) {
case PLL_DIRECT:
val = PLL_CTRL_DIRECT;
val |= (clk->m_div - 1) << 1;... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static int clk_usb_enable(struct clk_hw *hw) {
struct lpc32xx_usb_clk *clk = to_lpc32xx_usb_clk(hw);
u32 val, ctrl_val, count;
pr_debug("%s: 0x%x\n", clk_hw_get_name(hw), clk->enable);
if (clk->ctrl_mask) {
regmap_read(clk_regmap, LPC32XX_CLKPWR_USB_CTRL, &ctrl_val);
regmap_update_bits(clk_regmap, LP... | [
0,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static int clk_usb_is_enabled(struct clk_hw *hw) {
struct lpc32xx_usb_clk *clk = to_lpc32xx_usb_clk(hw);
u32 ctrl_val, val;
if (clk->ctrl_mask) {
regmap_read(clk_regmap, LPC32XX_CLKPWR_USB_CTRL, &ctrl_val);
if ((ctrl_val & clk->ctrl_mask) != clk->ctrl_enable)
return 0;
}
val = lpc32xx_usb_clk... | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static int clk_mux_set_parent(struct clk_hw *hw, u8 index) {
struct lpc32xx_clk_mux *mux = to_lpc32xx_mux(hw);
if (mux->table)
index = mux->table[index];
return regmap_update_bits(clk_regmap, mux->reg, mux->mask << mux->shift,
index << mux->shift);
} | [
1,
0
] |
Linux Kernel | drivers/clk/nxp/clk-lpc32xx.c |
static void __init lpc32xx_usb_clk_init(struct device_node *np) {
unsigned int i;
usb_clk_vbase = of_iomap(np, 0);
if (!usb_clk_vbase) {
pr_err("failed to map address range\n");
return;
}
for (i = 1; i < LPC32XX_USB_CLK_MAX; i++) {
usb_clk[i] = lpc32xx_clk_register(i + LPC32XX_CLK_USB_OFFSET);
... | [
0,
0
] |
Linux Kernel | drivers/clk/pistachio/clk-pll.c |
static inline u64 do_div_round_closest(u64 dividend, u64 divisor) {
dividend += divisor / 2;
return div64_u64(dividend, divisor);
} | [
0,
0
] |
Linux Kernel | drivers/clk/pistachio/clk-pll.c |
static inline struct pistachio_clk_pll *to_pistachio_pll(struct clk_hw *hw) {
return container_of(hw, struct pistachio_clk_pll, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/pistachio/clk-pll.c |
static inline enum pll_mode pll_frac_get_mode(struct clk_hw *hw) {
struct pistachio_clk_pll *pll = to_pistachio_pll(hw);
u32 val;
val = pll_readl(pll, PLL_CTRL3) & PLL_FRAC_CTRL3_DSMPD;
return val ? PLL_MODE_INT : PLL_MODE_FRAC;
} | [
0,
0
] |
Linux Kernel | drivers/clk/pistachio/clk-pll.c |
static long pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct pistachio_clk_pll *pll = to_pistachio_pll(hw);
unsigned int i;
for (i = 0; i < pll->nr_rates; i++) {
if (i > 0 && pll->rates[i].fref == *parent_rate &&
pll->rates[i].fout... | [
0,
0
] |
Linux Kernel | drivers/clk/pistachio/clk-pll.c | static unsigned long pll_gf40lp_frac_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct pistachio_clk_pll *pll = to_pistachio_pll(hw);
u64 val, prediv, fbdiv, frac, postdiv1, postdiv2, rate;
val = pll_readl(pll, PLL_CTRL1);
prediv = (val >> PLL_C... | [
1,
0
] |
Linux Kernel | drivers/clk/pistachio/clk.c |
struct pistachio_clk_provider *
pistachio_clk_alloc_provider(struct device_node *node, unsigned int num_clks) {
struct pistachio_clk_provider *p;
p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p)
return p;
p->clk_data.clks = kcalloc(num_clks, sizeof(struct clk *), GFP_KERNEL);
if (!p->clk_data.clks)
got... | [
1,
0
] |
Linux Kernel | drivers/clk/pistachio/clk.c |
void pistachio_clk_register_mux(struct pistachio_clk_provider *p,
struct pistachio_mux *mux, unsigned int num) {
struct clk *clk;
unsigned int i;
for (i = 0; i < num; i++) {
clk = clk_register_mux(NULL, mux[i].name, mux[i].parents,
mux[i].num_parent... | [
0,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa25x.c |
static unsigned long clk_pxa25x_memory_get_rate(struct clk_hw *hw,
unsigned long parent_rate) {
unsigned long cccr = readl(clk_regs + CCCR);
unsigned int m = M_clk_mult[(cccr >> 5) & 0x03];
return parent_rate / m;
} | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa25x.c |
static unsigned long clk_pxa25x_run_get_rate(struct clk_hw *hw,
unsigned long parent_rate) {
unsigned long cccr = readl(clk_regs + CCCR);
unsigned int n2 = N2_clk_mult[(cccr >> 7) & 0x07];
return (parent_rate / n2) * 2;
} | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa25x.c |
static void __init pxa25x_register_core(void) {
clkdev_pxa_register(CLK_NONE, "cpll", NULL, clk_register_clk_pxa25x_cpll());
clkdev_pxa_register(CLK_NONE, "run", NULL, clk_register_clk_pxa25x_run());
clkdev_pxa_register(CLK_CORE, "core", NULL, clk_register_clk_pxa25x_core());
} | [
0,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa25x.c |
static void __init pxa25x_register_plls(void) {
clk_register_fixed_rate(NULL, "osc_3_6864mhz", NULL, CLK_GET_RATE_NOCACHE,
3686400);
clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL,
clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
... | [
0,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa27x.c |
bool pxa27x_is_ppll_disabled(void) {
unsigned long ccsr = readl(clk_regs + CCSR);
return ccsr & (1 << CCCR_PPDIS_BIT);
}
#define PXA27X_CKEN(dev_id, con_id, parents, mult_hp, div_hp, bit, is_lp, \
flags) \
PXA_CKEN(dev_id, con_id, bit... | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa27x.c |
static unsigned long clk_pxa27x_lcd_base_get_rate(struct clk_hw *hw,
unsigned long parent_rate) {
unsigned int l, osc_forced;
unsigned long ccsr = readl(clk_regs + CCSR);
unsigned long cccr = readl(clk_regs + CCCR);
l = ccsr & CCSR_L_MASK;
osc_forced = ccsr ... | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa27x.c |
static u8 clk_pxa27x_lcd_base_get_parent(struct clk_hw *hw) {
unsigned int osc_forced;
unsigned long ccsr = readl(clk_regs + CCSR);
osc_forced = ccsr & (1 << CCCR_CPDIS_BIT);
if (osc_forced)
return PXA_LCD_13Mhz;
else
return PXA_LCD_RUN;
} | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa27x.c |
static unsigned long clk_pxa27x_run_get_rate(struct clk_hw *hw,
unsigned long parent_rate) {
unsigned long ccsr = readl(clk_regs + CCSR);
unsigned int n2 = (ccsr & CCSR_N2_MASK) >> CCSR_N2_SHIFT;
return (parent_rate / n2) * 2;
} | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa27x.c |
static unsigned long clk_pxa27x_memory_get_rate(struct clk_hw *hw,
unsigned long parent_rate) {
unsigned int a, l, osc_forced;
unsigned long cccr = readl(clk_regs + CCCR);
unsigned long ccsr = readl(clk_regs + CCSR);
osc_forced = ccsr & (1 << CCCR_CPDIS_BIT);
... | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa3xx.c |
static unsigned long clk_pxa3xx_smemc_get_rate(struct clk_hw *hw,
unsigned long parent_rate) {
unsigned long acsr = readl(clk_regs + ACSR);
return (parent_rate / 48) * smcfs_mult[(acsr >> 23) & 0x7] /
pxa3xx_smemc_get_memclkdiv();
} | [
1,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa3xx.c |
static void __init pxa3xx_register_plls(void) {
clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE,
13 * MHz);
clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL,
clk_register_fixed_rate(NULL, "osc_32_768khz", NULL,
... | [
0,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa3xx.c |
int __init pxa3xx_clocks_init(void __iomem *regs, void __iomem *oscc_reg) {
int ret;
clk_regs = regs;
pxa3xx_base_clocks_init(oscc_reg);
pxa3xx_dummy_clocks_init();
ret = clk_pxa_cken_init(pxa3xx_clocks, ARRAY_SIZE(pxa3xx_clocks), regs);
if (ret)
return ret;
if (cpu_is_pxa320())
return clk_pxa_c... | [
0,
0
] |
Linux Kernel | drivers/clk/pxa/clk-pxa3xx.c |
static void __init pxa3xx_dt_clocks_init(struct device_node *np) {
pxa3xx_clocks_init(ioremap(0x41340000, 0x10), ioremap(0x41350000, 4));
clk_pxa_dt_common_init(np);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/apcs-sdx55.c |
static int qcom_apcs_sdx55_clk_remove(struct platform_device *pdev) {
struct device *cpu_dev = get_cpu_device(0);
struct clk_regmap_mux_div *a7cc = platform_get_drvdata(pdev);
clk_notifier_unregister(a7cc->pclk, &a7cc->clk_nb);
dev_pm_domain_detach(cpu_dev, true);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/camcc-sm8450.c |
static int cam_cc_sm8450_probe(struct platform_device *pdev) {
struct regmap *regmap;
regmap = qcom_cc_map(pdev, &cam_cc_sm8450_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
clk_lucid_evo_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config);
clk_lucid_evo_pll_configure(&cam_cc_pll1, regmap, &c... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static void clk_alpha_pll_hwfsm_disable(struct clk_hw *hw) {
int ret;
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
u32 val;
ret = regmap_read(pll->clkr.regmap, PLL_MODE(pll), &val);
if (ret)
return;
if (pll->flags & SUPPORTS_OFFLINE_REQ) {
ret = regmap_update_bits(pll->clkr.regmap, PLL_MODE(p... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int clk_alpha_pll_is_enabled(struct clk_hw *hw) {
return pll_is_enabled(hw, PLL_LOCK_DET);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static const struct pll_vco *alpha_pll_find_vco(const struct clk_alpha_pll *pll,
unsigned long rate) {
const struct pll_vco *v = pll->vco_table;
const struct pll_vco *end = v + pll->num_vco;
for (; v < end; v++)
if (rate >= v->min_freq && rate <= v->max_freq)
... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int clk_alpha_pll_update_latch(struct clk_alpha_pll *pll,
int (*is_enabled)(struct clk_hw *)) {
if (!is_enabled(&pll->clkr.hw) || !(pll->flags & SUPPORTS_DYNAMIC_UPDATE))
return 0;
return __clk_alpha_pll_update_latch(pll);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int __clk_alpha_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate,
int (*is_enabled)(struct clk_hw *)) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
const struct pll_vco *vco;
u32 l, alpha_width = pll_alpha... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int clk_alpha_pll_hwfsm_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate) {
return __clk_alpha_pll_set_rate(hw, rate, prate,
clk_alpha_pll_hwfsm_is_enabled);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static long clk_alpha_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
u32 l, alpha_width = pll_alpha_width(pll);
u64 a;
unsigned long min_freq, max_freq;
rate = alpha_pll_round_rate(rate, *pr... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static unsigned long alpha_huayra_pll_calc_rate(u64 prate, u32 l, u32 a) {
if (a >= BIT(PLL_HUAYRA_ALPHA_WIDTH - 1))
l -= 1;
return (prate * l) + (prate * a >> PLL_HUAYRA_ALPHA_WIDTH);
} | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int alpha_pll_huayra_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
u32 l, a, ctl, cur_alpha = 0;
rate = alpha_huayra_pll_round_rate(rate, prate, &l, &a);
regmap_read(pll->clkr.regmap, PLL_USE... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int clk_trion_pll_is_enabled(struct clk_hw *hw) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
return trion_pll_is_enabled(pll, pll->clkr.regmap);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.