Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/clk/imx/clk-gate-93.c |
static void imx93_clk_gate_disable_unused(struct clk_hw *hw) {
struct imx93_clk_gate *gate = to_imx93_clk_gate(hw);
unsigned long flags;
spin_lock_irqsave(gate->lock, flags);
if (!gate->share_count || *gate->share_count == 0)
imx93_clk_gate_do_hardware(hw, false);
spin_unlock_irqrestore(gate->lock, fl... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-gate-exclusive.c |
static int clk_gate_exclusive_enable(struct clk_hw *hw) {
struct clk_gate *gate = to_clk_gate(hw);
struct clk_gate_exclusive *exgate =
container_of(gate, struct clk_gate_exclusive, gate);
u32 val = readl(gate->reg);
if (val & exgate->exclusive_mask)
return -EBUSY;
return clk_gate_ops.enable(hw);
... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-gate2.c |
static int clk_gate2_reg_is_enabled(void __iomem *reg, u8 bit_idx, u8 cgr_val,
u8 cgr_mask) {
u32 val = readl(reg);
if (((val >> bit_idx) & cgr_mask) == cgr_val)
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-gate2.c | struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name,
const char *parent_name,
unsigned long flags, void __iomem *reg,
u8 bit_idx, u8 cgr_val, u8 cgr_mask,
... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx25.c |
static void __init mx25_clocks_init_dt(struct device_node *np) {
void __iomem *ccm;
ccm = of_iomap(np, 0);
__mx25_clocks_init(ccm);
clk_data.clks = clk;
clk_data.clk_num = ARRAY_SIZE(clk);
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx35.c |
static void __init mx35_clocks_init_dt(struct device_node *ccm_node) {
_mx35_clocks_init();
clk_data.clks = clk;
clk_data.clk_num = ARRAY_SIZE(clk);
of_clk_add_provider(ccm_node, of_clk_src_onecell_get, &clk_data);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6q.c |
static inline int clk_on_imx6q(void) {
return of_machine_is_compatible("fsl,imx6q");
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6q.c |
static int ldb_di_sel_by_clock_id(int clock_id) {
switch (clock_id) {
case IMX6QDL_CLK_PLL5_VIDEO_DIV:
if (clk_on_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0)
return -ENOENT;
return 0;
case IMX6QDL_CLK_PLL2_PFD0_352M:
return 1;
case IMX6QDL_CLK_PLL2_PFD2_396M:
return 2;
c... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6q.c | static void of_assigned_ldb_sels(struct device_node *node,
unsigned int *ldb_di0_sel,
unsigned int *ldb_di1_sel) {
struct of_phandle_args clkspec;
int index, rc, num_parents;
int parent, child, sel;
num_parents = of_count_phandle_with_args(node,... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6q.c | static bool pll6_bypassed(struct device_node *node) {
int index, ret, num_clocks;
struct of_phandle_args clkspec;
num_clocks =
of_count_phandle_with_args(node, "assigned-clocks", "#clock-cells");
if (num_clocks < 0)
return false;
for (index = 0; index < num_clocks; index++) {
ret = of_parse_ph... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6q.c | static void disable_anatop_clocks(void __iomem *anatop_base) {
unsigned int reg;
reg = readl_relaxed(anatop_base + CCM_ANALOG_PFD_528);
/* Cannot gate PFD2 if pll2_pfd2_396m is the parent of MMDC clock */
if (clk_get_parent(hws[IMX6QDL_CLK_PERIPH_PRE]->clk) ==
hws[IMX6QDL_CLK_PLL2_PFD2_396M]->clk)
re... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6sl.c | static int imx6sl_get_arm_divider_for_wait(void) {
if (readl_relaxed(ccm_base + CCSR) & BM_CCSR_PLL1_SW_CLK_SEL) {
return ARM_WAIT_DIV_396M;
} else {
if ((readl_relaxed(anatop_base + PLL_ARM) & BM_PLL_ARM_DIV_SELECT) ==
PLL_ARM_DIV_792M)
return ARM_WAIT_DIV_792M;
else
return ARM_WAIT... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6ul.c |
static inline int clk_on_imx6ul(void) {
return of_machine_is_compatible("fsl,imx6ul");
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-imx6ul.c |
static inline int clk_on_imx6ull(void) {
return of_machine_is_compatible("fsl,imx6ull");
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-pfd.c |
static int clk_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_pfd *pfd = to_clk_pfd(hw);
u64 tmp = parent_rate;
u8 frac;
tmp = tmp * 18 + rate / 2;
do_div(tmp, rate);
frac = tmp;
if (frac < 12)
frac = 12;
else if (frac > 35)
... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pfdv2.c |
static unsigned long clk_pfdv2_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_pfdv2 *pfd = to_clk_pfdv2(hw);
u64 tmp = parent_rate;
u8 frac;
frac = (readl_relaxed(pfd->reg) >> pfd->frac_off) & CLK_PFDV2_FRAC_MASK;
if (!frac) {
pr_debug(... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pfdv2.c |
static int clk_pfdv2_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
unsigned long parent_rates[] = {480000000, 528000000, req->best_parent_rate};
unsigned long best_rate = -1UL, rate = req->rate;
unsigned long best_parent_rate = req->best_parent_rate;
u64 ... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pfdv2.c | static int clk_pfdv2_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_pfdv2 *pfd = to_clk_pfdv2(hw);
unsigned long flags;
u64 tmp = parent_rate;
u32 val;
u8 frac;
if (!rate)
return -EINVAL;
if (clk_pfdv2_is_enabled(hw))
clk_pfd... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pll14xx.c |
static inline bool
clk_pll14xx_mp_change(const struct imx_pll14xx_rate_table *rate, u32 pll_div) {
u32 old_mdiv, old_pdiv;
old_mdiv = FIELD_GET(MDIV_MASK, pll_div);
old_pdiv = FIELD_GET(PDIV_MASK, pll_div);
return rate->mdiv != old_mdiv || rate->pdiv != old_pdiv;
} | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv1.c |
static inline bool is_imx1_pllv1(struct clk_pllv1 *pll) {
return pll->type == IMX_PLLV1_IMX1;
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static int clk_pllv3_prepare(struct clk_hw *hw) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
u32 val;
val = readl_relaxed(pll->base);
if (pll->powerup_set)
val |= pll->power_bit;
else
val &= ~pll->power_bit;
writel_relaxed(val, pll->base);
return clk_pllv3_wait_lock(pll);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
u32 val, div;
if (rate == parent_rate * 22)
div = 1;
else if (rate == parent_rate * 20)
div = 0;
else
return -EINVAL;
val =... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static unsigned long clk_pllv3_sys_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
u32 div = readl_relaxed(pll->base) & pll->div_mask;
return parent_rate * div / 2;
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static long clk_pllv3_sys_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) {
unsigned long parent_rate = *prate;
unsigned long min_rate = parent_rate * 54 / 2;
unsigned long max_rate = parent_rate * 108 / 2;
u32 div;
if (rate > max_rate)
rate =... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
unsigned long min_rate = parent_rate * 54 / 2;
unsigned long max_rate = parent_rate * 108 / 2;
u32 val, div;
if (rate < min_rate |... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static unsigned long clk_pllv3_av_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
u32 mfn = readl_relaxed(pll->base + pll->num_offset);
u32 mfd = readl_relaxed(pll->base + pll->denom_offset);
u32 div = readl_rel... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c |
static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
unsigned long min_rate = parent_rate * 27;
unsigned long max_rate = parent_rate * 54;
u32 val, div;
u32 mfn, mfd = 1000000;
u32 max... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv3.c | static int clk_pllv3_vf610_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_pllv3 *pll = to_clk_pllv3(hw);
struct clk_pllv3_vf610_mf mf = clk_pllv3_vf610_rate_to_mf(parent_rate, rate);
u32 val;
val = readl_relaxed(pll->base);
if (mf.m... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-pllv4.c |
static unsigned long clk_pllv4_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_pllv4 *pll = to_clk_pllv4(hw);
u32 mult, mfn, mfd;
u64 temp64;
mult = readl_relaxed(pll->base + pll->cfg_offset);
mult &= BM_PLL_MULT;
mult >>= BP_PLL_MULT;
m... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c |
static inline struct clk_scu *to_clk_scu(struct clk_hw *hw) {
return container_of(hw, struct clk_scu, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c |
static inline int imx_scu_clk_search_cmp(const void *rsrc, const void *rsrc_p) {
return *(u32 *)rsrc - *(u32 *)rsrc_p;
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c | static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_scu *clk = to_clk_scu(hw);
struct arm_smccc_res res;
unsigned long cluster_id;
if (clk->rsrc_id == IMX_SC_R_A35 || clk->rsrc_id == IMX_SC_R_A53)
cluster_id ... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c |
static u8 clk_scu_get_parent(struct clk_hw *hw) {
struct clk_scu *clk = to_clk_scu(hw);
struct imx_sc_msg_get_clock_parent msg;
struct imx_sc_rpc_msg *hdr = &msg.hdr;
int ret;
hdr->ver = IMX_SC_RPC_VERSION;
hdr->svc = IMX_SC_RPC_SVC_PM;
hdr->func = IMX_SC_PM_FUNC_GET_CLOCK_PARENT;
hdr->size = 2;
ms... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c | static int clk_scu_prepare(struct clk_hw *hw) {
struct clk_scu *clk = to_clk_scu(hw);
return sc_pm_clock_enable(ccm_ipc_handle, clk->rsrc_id, clk->clk_type, true,
false);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c | static void clk_scu_unprepare(struct clk_hw *hw) {
struct clk_scu *clk = to_clk_scu(hw);
int ret;
ret = sc_pm_clock_enable(ccm_ipc_handle, clk->rsrc_id, clk->clk_type, false,
false);
if (ret)
pr_warn("%s: clk unprepare failed %d\n", clk_hw_get_name(hw), ret);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c | struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
const char *const *parents, int num_parents,
u32 rsrc_id, u8 clk_type) {
struct clk_init_data init;
struct clk_scu *clk;
struct clk_hw *hw;
int ret;
clk = kzalloc(sizeof(*clk), GFP_KER... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.c |
struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec,
void *data) {
unsigned int rsrc = clkspec->args[0];
unsigned int idx = clkspec->args[1];
struct list_head *scu_clks = data;
struct imx_scu_clk_node *clk;
list_for_each_entry(clk, &scu_clks[rsrc], nod... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-scu.h |
static inline struct clk_hw *
imx_clk_lpcg_scu_dev(struct device *dev, const char *name,
const char *parent_name, unsigned long flags,
void __iomem *reg, u8 bit_idx, bool hw_gate) {
return __imx_clk_lpcg_scu(dev, name, parent_name, flags, reg, bit_idx,
... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
static int clk_sscg_pll2_check_match(struct clk_sscg_pll_setup *setup,
struct clk_sscg_pll_setup *temp_setup) {
int new_diff = temp_setup->fout - temp_setup->fout_request;
int diff = temp_setup->fout_error;
if (abs(diff) > abs(new_diff)) {
temp_setup->fout_error = new_di... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
static int clk_sscg_divq_lookup(struct clk_sscg_pll_setup *setup,
struct clk_sscg_pll_setup *temp_setup) {
int ret = -EINVAL;
for (temp_setup->divq = 0; temp_setup->divq <= PLL_DIVQ_MAX;
temp_setup->divq++) {
temp_setup->vco2 = temp_setup->vco1;
do_div(temp_setup->vc... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
static int clk_sscg_divf2_lookup(struct clk_sscg_pll_setup *setup,
struct clk_sscg_pll_setup *temp_setup) {
int ret = -EINVAL;
for (temp_setup->divf2 = 0; temp_setup->divf2 <= PLL_DIVF2_MAX;
temp_setup->divf2++) {
ret = clk_sscg_divq_lookup(setup, temp_setup);
if (!... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
static int clk_sscg_divr2_lookup(struct clk_sscg_pll_setup *setup,
struct clk_sscg_pll_setup *temp_setup) {
int ret = -EINVAL;
for (temp_setup->divr2 = 0; temp_setup->divr2 <= PLL_DIVR2_MAX;
temp_setup->divr2++) {
temp_setup->ref_div2 = temp_setup->vco1;
do_div(temp... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
static int clk_sscg_divf1_lookup(struct clk_sscg_pll_setup *setup,
struct clk_sscg_pll_setup *temp_setup) {
int ret = -EINVAL;
for (temp_setup->divf1 = 0; temp_setup->divf1 <= PLL_DIVF1_MAX;
temp_setup->divf1++) {
uint64_t vco1 = temp_setup->ref;
do_div(vco1, temp_... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
static int __clk_sscg_pll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req,
uint64_t min, uint64_t max,
uint64_t rate, int bypass) {
struct clk_sscg_pll *pll = to_clk_sscg_pll(hw);... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-sscg-pll.c |
struct clk_hw *imx_clk_hw_sscg_pll(const char *name,
const char *const *parent_names,
u8 num_parents, u8 parent, u8 bypass1,
u8 bypass2, void __iomem *base,
unsigned long flags) {... | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk-vf610.c | static struct clk *__init vf610_get_fixed_clock(struct device_node *ccm_node,
const char *name) {
struct clk *clk = of_clk_get_by_name(ccm_node, name);
if (IS_ERR(clk))
clk = imx_obtain_fixed_clock(name, 0);
return clk;
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk.c |
struct clk_hw *imx_obtain_fixed_clock_hw(const char *name, unsigned long rate) {
struct clk *clk;
clk = imx_obtain_fixed_clock_from_dt(name);
if (IS_ERR(clk))
clk = imx_clk_fixed(name, rate);
return __clk_get_hw(clk);
} | [
0,
0
] |
Linux Kernel | drivers/clk/imx/clk.c | void imx_register_uart_clocks(unsigned int clk_count) {
imx_enabled_uart_clocks = 0;
#ifdef CONFIG_OF
if (imx_keep_uart_clocks) {
int i;
imx_uart_clocks = kcalloc(clk_count, sizeof(struct clk *), GFP_KERNEL);
if (!imx_uart_clocks)
return;
if (!of_stdout)
return;
for (i = 0; i < c... | [
1,
0
] |
Linux Kernel | drivers/clk/imx/clk.h |
static inline struct clk_hw *
__imx_clk_hw_gate(const char *name, const char *parent, void __iomem *reg,
u8 shift, unsigned long flags, unsigned long clk_gate_flags) {
return clk_hw_register_gate(NULL, name, parent, flags | CLK_SET_RATE_PARENT,
reg, shift, clk_gate_fla... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c |
static inline const struct ingenic_cgu_clk_info *
to_clk_info(struct ingenic_clk *clk) {
return &clk->cgu->clock_info[clk->idx];
} | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c | static unsigned long ingenic_pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
struct ingenic_cgu *cgu = ingenic_clk->cgu;
cons... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c | static void ingenic_pll_calc_m_n_od(const struct ingenic_cgu_pll_info *pll_info,
unsigned long rate,
unsigned long parent_rate, unsigned int *pm,
unsigned int *pn, unsigned int *pod) {
unsigned int m, n, od = 1... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c | static int ingenic_pll_set_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long parent_rate) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
struct ingenic_cgu *cgu = ingenic_clk->cgu;
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
const ... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c | static int ingenic_clk_set_parent(struct clk_hw *hw, u8 idx) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
struct ingenic_cgu *cgu = ingenic_clk->cgu;
unsigned long flags;
u8 curr_idx, hw_idx, num_poss;
u32 reg, mask;
if (c... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c |
static unsigned long ingenic_clk_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
struct ingenic_cgu *cgu = ingenic_clk->cgu;
uns... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c |
static unsigned int
ingenic_clk_calc_hw_div(const struct ingenic_cgu_clk_info *clk_info,
unsigned int div) {
unsigned int i, best_i = 0, best = (unsigned int)-1;
for (i = 0; i < (1 << clk_info->div.bits) && clk_info->div.div_table[i];
i++) {
if (clk_info->div.div_table[i] >= div... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c |
static long ingenic_clk_round_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long *parent_rate) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
unsigned int div = 1;
if (clk_info->type ... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c | static int ingenic_clk_set_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long parent_rate) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
struct ingenic_cgu *cgu = ingenic_clk->cgu;
unsign... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c | static int ingenic_clk_enable(struct clk_hw *hw) {
struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
const struct ingenic_cgu_clk_info *clk_info = to_clk_info(ingenic_clk);
struct ingenic_cgu *cgu = ingenic_clk->cgu;
unsigned long flags;
if (clk_info->type & CGU_CLK_GATE) {
spin_lock_irqsave(&cgu->l... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/cgu.c |
struct ingenic_cgu *
ingenic_cgu_new(const struct ingenic_cgu_clk_info *clock_info,
unsigned num_clocks, struct device_node *np) {
struct ingenic_cgu *cgu;
cgu = kzalloc(sizeof(*cgu), GFP_KERNEL);
if (!cgu)
goto err_out;
cgu->base = of_iomap(np, 0);
if (!cgu->base) {
pr_err("%s: fai... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/jz4760-cgu.c |
static void __init jz4760_cgu_init(struct device_node *np) {
struct ingenic_cgu *cgu;
int retval;
cgu = ingenic_cgu_new(jz4760_cgu_clocks, ARRAY_SIZE(jz4760_cgu_clocks), np);
if (!cgu) {
pr_err("%s: failed to initialise CGU\n", __func__);
return;
}
retval = ingenic_cgu_register_clocks(cgu);
if ... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/jz4770-cgu.c |
static void jz4770_uhc_phy_disable(struct clk_hw *hw) {
void __iomem *reg_opcr = cgu->base + CGU_REG_OPCR;
void __iomem *reg_usbpcr1 = cgu->base + CGU_REG_USBPCR1;
writel(readl(reg_usbpcr1) & ~USBPCR1_UHC_POWER, reg_usbpcr1);
writel(readl(reg_opcr) | OPCR_SPENDH, reg_opcr);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/jz4770-cgu.c |
static void __init jz4770_cgu_init(struct device_node *np) {
int retval;
cgu = ingenic_cgu_new(jz4770_cgu_clocks, ARRAY_SIZE(jz4770_cgu_clocks), np);
if (!cgu) {
pr_err("%s: failed to initialise CGU\n", __func__);
return;
}
retval = ingenic_cgu_register_clocks(cgu);
if (retval)
pr_err("%s: fa... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/jz4780-cgu.c |
static long jz4780_otg_phy_round_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long *parent_rate) {
if (req_rate < 15600000)
return 12000000;
if (req_rate < 21600000)
return 19200000;
if (req_rate < 36000000)
return 24000000;
return 48000000;
} | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/tcu.c |
static inline struct ingenic_tcu_clk *to_tcu_clk(struct clk_hw *hw) {
return container_of(hw, struct ingenic_tcu_clk, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/tcu.c |
static void ingenic_tcu_disable_regs(struct clk_hw *hw) {
struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw);
const struct ingenic_tcu_clk_info *info = tcu_clk->info;
struct ingenic_tcu *tcu = tcu_clk->tcu;
regmap_write(tcu->map, TCU_REG_TSSR, BIT(info->gate_bit));
} | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/tcu.c |
static unsigned long ingenic_tcu_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct ingenic_tcu_clk *tcu_clk = to_tcu_clk(hw);
const struct ingenic_tcu_clk_info *info = tcu_clk->info;
unsigned int prescale;
int ret;
ret = regmap_read(tcu_clk->tcu-... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/tcu.c |
static long ingenic_tcu_round_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long *parent_rate) {
unsigned long rate = *parent_rate;
u8 prescale;
if (req_rate > rate)
return rate;
prescale = ingenic_tcu_get_prescale(rate, req_rate);
return rate >> (prescale... | [
1,
0
] |
Linux Kernel | drivers/clk/ingenic/tcu.c | static int __init ingenic_tcu_register_clock(
struct ingenic_tcu *tcu, unsigned int idx, enum tcu_clk_parent parent,
const struct ingenic_tcu_clk_info *info,
struct clk_hw_onecell_data *clocks) {
struct ingenic_tcu_clk *tcu_clk;
int err;
tcu_clk = kzalloc(sizeof(*tcu_clk), GFP_KERNEL);
if (!tcu_clk... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/x1000-cgu.c | static void
x1000_i2spll_set_rate_hook(const struct ingenic_cgu_pll_info *pll_info,
unsigned long rate, unsigned long parent_rate) {
writel(0, cgu->base + CGU_REG_I2SCDR1);
} | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/x1000-cgu.c |
static void __init x1000_cgu_init(struct device_node *np) {
int retval;
cgu = ingenic_cgu_new(x1000_cgu_clocks, ARRAY_SIZE(x1000_cgu_clocks), np);
if (!cgu) {
pr_err("%s: failed to initialise CGU\n", __func__);
return;
}
retval = ingenic_cgu_register_clocks(cgu);
if (retval) {
pr_err("%s: fai... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/x1830-cgu.c |
static int x1830_usb_phy_enable(struct clk_hw *hw) {
void __iomem *reg_opcr = cgu->base + CGU_REG_OPCR;
void __iomem *reg_usbpcr = cgu->base + CGU_REG_USBPCR;
writel((readl(reg_opcr) | OPCR_SPENDN0) & ~OPCR_GATE_USBPHYCLK, reg_opcr);
writel(readl(reg_usbpcr) & ~USBPCR_OTG_DISABLE & ~USBPCR_SIDDQ, reg_usbpcr);... | [
0,
0
] |
Linux Kernel | drivers/clk/ingenic/x1830-cgu.c |
static int x1830_usb_phy_is_enabled(struct clk_hw *hw) {
void __iomem *reg_opcr = cgu->base + CGU_REG_OPCR;
void __iomem *reg_usbpcr = cgu->base + CGU_REG_USBPCR;
return (readl(reg_opcr) & OPCR_SPENDN0) &&
!(readl(reg_usbpcr) & USBPCR_SIDDQ) &&
!(readl(reg_usbpcr) & USBPCR_OTG_DISABLE);
} | [
0,
0
] |
Linux Kernel | drivers/clk/keystone/pll.c |
static struct clk *clk_register_pll(struct device *dev, const char *name,
const char *parent_name,
struct clk_pll_data *pll_data) {
struct clk_init_data init;
struct clk_pll *pll;
struct clk *clk;
pll = kzalloc(sizeof(*pll), GFP_KERNEL);
... | [
0,
0
] |
Linux Kernel | drivers/clk/keystone/pll.c | static void __init of_keystone_pll_clk_init(struct device_node *node) {
_of_pll_clk_init(node, false);
} | [
0,
0
] |
Linux Kernel | drivers/clk/keystone/pll.c | static void __init of_keystone_main_pll_clk_init(struct device_node *node) {
_of_pll_clk_init(node, true);
} | [
0,
0
] |
Linux Kernel | drivers/clk/keystone/pll.c | static void __init of_pll_mux_clk_init(struct device_node *node) {
void __iomem *reg;
u32 shift, mask;
struct clk *clk;
const char *parents[2];
const char *clk_name = node->name;
of_property_read_string(node, "clock-output-names", &clk_name);
reg = of_iomap(node, 0);
if (!reg) {
pr_err("%s: ioremap... | [
0,
0
] |
Linux Kernel | drivers/clk/keystone/sci-clk.c | static unsigned long sci_clk_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct sci_clk *clk = to_sci_clk(hw);
u64 freq;
int ret;
ret = clk->provider->ops->get_freq(clk->provider->sci, clk->dev_id,
clk->clk_id, &freq)... | [
1,
0
] |
Linux Kernel | drivers/clk/keystone/sci-clk.c | static int sci_clk_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct sci_clk *clk = to_sci_clk(hw);
return clk->provider->ops->set_freq(clk->provider->sci, clk->dev_id,
clk->clk_id, rate / 10 * 9, rate,
... | [
1,
0
] |
Linux Kernel | drivers/clk/keystone/sci-clk.c | static int ti_sci_scan_clocks_from_fw(struct sci_clk_provider *provider) {
int ret;
int num_clks = 0;
struct sci_clk **clks = NULL;
struct sci_clk **tmp_clks;
struct sci_clk *sci_clk;
int max_clks = 0;
int clk_id = 0;
int dev_id = 0;
u32 num_parents = 0;
int gap_size = 0;
struct device *dev = prov... | [
1,
0
] |
Linux Kernel | drivers/clk/keystone/syscon-clk.c |
static struct ti_syscon_gate_clk_priv *
to_ti_syscon_gate_clk_priv(struct clk_hw *hw) {
return container_of(hw, struct ti_syscon_gate_clk_priv, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/keystone/syscon-clk.c |
static int ti_syscon_gate_clk_probe(struct platform_device *pdev) {
const struct ti_syscon_gate_clk_data *data, *p;
struct clk_hw_onecell_data *hw_data;
struct device *dev = &pdev->dev;
struct regmap *regmap;
int num_clks, i;
data = device_get_match_data(dev);
if (!data)
return -EINVAL;
regmap = ... | [
0,
0
] |
Linux Kernel | drivers/clk/loongson1/clk.c | struct clk_hw *__init clk_hw_register_pll(struct device *dev, const char *name,
const char *parent_name,
const struct clk_ops *ops,
unsigned long flags) {
int ret;
struct clk_hw *hw;
struc... | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-cpumux.c |
static inline struct mtk_clk_cpumux *to_mtk_clk_cpumux(struct clk_hw *_hw) {
return container_of(_hw, struct mtk_clk_cpumux, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-cpumux.c |
static u8 clk_cpumux_get_parent(struct clk_hw *hw) {
struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw);
unsigned int val;
regmap_read(mux->regmap, mux->reg, &val);
val >>= mux->shift;
val &= mux->mask;
return val;
} | [
1,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-cpumux.c |
static struct clk_hw *mtk_clk_register_cpumux(const struct mtk_composite *mux,
struct regmap *regmap) {
struct mtk_clk_cpumux *cpumux;
int ret;
struct clk_init_data init;
cpumux = kzalloc(sizeof(*cpumux), GFP_KERNEL);
if (!cpumux)
return ERR_PTR(-ENOMEM);
... | [
1,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-cpumux.c |
void mtk_clk_unregister_cpumuxes(const struct mtk_composite *clks, int num,
struct clk_hw_onecell_data *clk_data) {
int i;
for (i = num; i > 0; i--) {
const struct mtk_composite *mux = &clks[i - 1];
if (IS_ERR_OR_NULL(clk_data->hws[mux->id]))
continue;
mtk_clk_... | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-fhctl.c |
static void dump_hw(struct mtk_clk_pll *pll, struct fh_pll_regs *regs,
const struct fh_pll_data *data) {
pr_info("hp_en<%x>,clk_con<%x>,slope0<%x>,slope1<%x>\n",
readl(regs->reg_hp_en), readl(regs->reg_clk_con),
readl(regs->reg_slope0), readl(regs->reg_slope1));
pr_info("cfg... | [
1,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-fhctl.c | static int hopping_hw_flow(struct mtk_clk_pll *pll, struct fh_pll_regs *regs,
const struct fh_pll_data *data,
struct fh_pll_state *state, unsigned int new_dds) {
u32 dds_mask = data->dds_mask;
u32 mon_dds = 0;
u32 con_pcw_tmp;
int ret;
if (state->ssc_rate... | [
1,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-fhctl.c |
static unsigned int __get_postdiv(struct mtk_clk_pll *pll) {
unsigned int regval;
regval = readl(pll->pd_addr) >> pll->data->pd_shift;
regval &= POSTDIV_MASK;
return BIT(regval);
} | [
1,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-fhctl.c |
static void __set_postdiv(struct mtk_clk_pll *pll, unsigned int postdiv) {
unsigned int regval;
regval = readl(pll->pd_addr);
regval &= ~(POSTDIV_MASK << pll->data->pd_shift);
regval |= (ffs(postdiv) - 1) << pll->data->pd_shift;
writel(regval, pll->pd_addr);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-fhctl.c |
static int fhctl_ssc_enable(struct mtk_fh *fh, u32 rate) {
const struct fh_pll_data *data = &fh->pllfh_data->data;
struct fh_pll_state *state = &fh->pllfh_data->state;
struct fh_pll_regs *regs = &fh->regs;
struct mtk_clk_pll *pll = &fh->clk_pll;
spinlock_t *lock = fh->lock;
unsigned long flags = 0;
spin... | [
1,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static inline struct mtk_clk_gate *to_mtk_clk_gate(struct clk_hw *hw) {
return container_of(hw, struct mtk_clk_gate, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static u32 mtk_get_clockgating(struct clk_hw *hw) {
struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
u32 val;
regmap_read(cg->regmap, cg->sta_ofs, &val);
return val & BIT(cg->bit);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static void mtk_cg_set_bit_no_setclr(struct clk_hw *hw) {
struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
regmap_set_bits(cg->regmap, cg->sta_ofs, BIT(cg->bit));
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static void mtk_cg_clr_bit_no_setclr(struct clk_hw *hw) {
struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
regmap_clear_bits(cg->regmap, cg->sta_ofs, BIT(cg->bit));
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static void mtk_cg_disable(struct clk_hw *hw) { mtk_cg_set_bit(hw); } | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static void mtk_cg_disable_inv(struct clk_hw *hw) { mtk_cg_clr_bit(hw); } | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static void mtk_cg_disable_inv_no_setclr(struct clk_hw *hw) {
mtk_cg_clr_bit_no_setclr(hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/mediatek/clk-gate.c |
static struct clk_hw *
mtk_clk_register_gate(const char *name, const char *parent_name,
struct regmap *regmap, int set_ofs, int clr_ofs,
int sta_ofs, u8 bit, const struct clk_ops *ops,
unsigned long flags, struct device *dev) {
struct mtk_clk_gate *cg... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.