Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int clk_trion_pll_enable(struct clk_hw *hw) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
struct regmap *regmap = pll->clkr.regmap;
u32 val;
int ret;
ret = regmap_read(regmap, PLL_MODE(pll), &val);
if (ret)
return ret;
if (val & PLL_VOTE_FSM_ENA) {
ret = clk_enable_regmap(hw);
i... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static unsigned long
clk_alpha_pll_postdiv_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
u32 ctl;
regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl);
ctl >>= PLL_POST_DIV_SHIFT;
ctl &= PLL_... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int clk_alpha_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
int div;
div = DIV_ROUND_UP_ULL(parent_rate, rate) - 1;
return regmap_update_bits(pll->clkr.... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static unsigned long
clk_trion_pll_postdiv_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
struct regmap *regmap = pll->clkr.regmap;
u32 i, div = 1, val;
regmap_read(regmap, PLL_USER_CTL(pll), &val)... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static long clk_trion_pll_postdiv_round_rate(struct clk_hw *hw,
unsigned long rate,
unsigned long *prate) {
struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
return divider_round_rate(hw, rate, prate, pll->po... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static long clk_alpha_pll_postdiv_fabia_round_rate(struct clk_hw *hw,
unsigned long rate,
unsigned long *prate) {
struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
return divider_round_rate(hw, ra... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int __alpha_pll_trion_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate, u32 latch_bit,
u32 latch_ack) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
unsigned long rrate;
u32 val, l, alpha_width = pll_alpha_w... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int alpha_pll_lucid_5lpe_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate) {
return __alpha_pll_trion_set_rate(hw, rate, prate, LUCID_5LPE_PLL_LATCH_INPUT,
LUCID_5LPE_ALPHA_PLL_ACK_LATCH);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int __clk_lucid_pll_postdiv_set_rate(struct clk_hw *hw,
unsigned long rate,
unsigned long parent_rate,
unsigned long enable_vote_run) {
struct clk_alpha_pll_postdiv *pll = to_clk_... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int clk_lucid_5lpe_pll_postdiv_set_rate(struct clk_hw *hw,
unsigned long rate,
unsigned long parent_rate) {
return __clk_lucid_pll_postdiv_set_rate(hw, rate, parent_rate,
LUC... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
unsigned long rrate;
u32 test_ctl_val;
u32 l, alpha_width = pll_alpha_width(pll);
u64 a;
int ret;
rrate = alpha_pll_round_rat... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll,
struct regmap *regmap,
const struct alpha_pll_config *config) {
u32 lval = config->l;
lval |= TRION_PLL_CAL_VAL << LUCID_EVO_PLL_CAL_L_VAL_SHIFT;
clk_alpha_pll_write_config(regmap, PLL_L_... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c | static int _alpha_pll_lucid_evo_prepare(struct clk_hw *hw, bool reset) {
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
struct clk_hw *p;
u32 val = 0;
int ret;
regmap_read(pll->clkr.regmap, PLL_MODE(pll), &val);
if (!(val & LUCID_EVO_PCAL_NOT_DONE))
return 0;
p = clk_hw_get_parent(hw);
if (!p)
... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static void alpha_pll_lucid_evo_disable(struct clk_hw *hw) {
_alpha_pll_lucid_evo_disable(hw, false);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-alpha-pll.c |
static int clk_lucid_evo_pll_postdiv_set_rate(struct clk_hw *hw,
unsigned long rate,
unsigned long parent_rate) {
return __clk_lucid_pll_postdiv_set_rate(hw, rate, parent_rate,
LUCID_... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-branch.c |
static bool clk_branch_in_hwcg_mode(const struct clk_branch *br) {
u32 val;
if (!br->hwcg_reg)
return false;
regmap_read(br->clkr.regmap, br->hwcg_reg, &val);
return !!(val & BIT(br->hwcg_bit));
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-branch.c |
static int clk_branch_toggle(struct clk_hw *hw, bool en,
bool(check_halt)(const struct clk_branch *,
bool)) {
struct clk_branch *br = to_clk_branch(hw);
int ret;
if (en) {
ret = clk_enable_regmap(hw);
if (ret)
return ret;
... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-cpu-8996.c |
static inline struct clk_cpu_8996_pmux *
to_clk_cpu_8996_pmux_hw(struct clk_hw *hw) {
return container_of(to_clk_regmap(hw), struct clk_cpu_8996_pmux, clkr);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-cpu-8996.c |
static int clk_cpu_8996_pmux_set_parent(struct clk_hw *hw, u8 index) {
struct clk_regmap *clkr = to_clk_regmap(hw);
struct clk_cpu_8996_pmux *cpuclk = to_clk_cpu_8996_pmux_hw(hw);
u32 val;
val = FIELD_PREP(PMUX_MASK, index);
return regmap_update_bits(clkr->regmap, cpuclk->reg, PMUX_MASK, val);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-cpu-8996.c |
static int clk_cpu_8996_pmux_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_hw *parent;
if (req->rate < (DIV_2_THRESHOLD / 2))
return -EINVAL;
if (req->rate < DIV_2_THRESHOLD)
parent = clk_hw_get_parent_by_index(hw, SMUX_INDEX);
... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-cpu-8996.c |
static int qcom_cpu_clk_msm8996_driver_probe(struct platform_device *pdev) {
struct regmap *regmap;
struct clk_hw_onecell_data *data;
struct device *dev = &pdev->dev;
int ret;
data = devm_kzalloc(dev, struct_size(data, hws, 2), GFP_KERNEL);
if (!data)
return -ENOMEM;
base = devm_platform_ioremap_re... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-hfpll.c | static void __clk_hfpll_enable(struct clk_hw *hw) {
struct clk_hfpll *h = to_clk_hfpll(hw);
struct hfpll_data const *hd = h->d;
struct regmap *regmap = h->clkr.regmap;
u32 val;
__clk_hfpll_init_once(hw);
regmap_update_bits(regmap, hd->mode_reg, PLL_BYPASSNL, PLL_BYPASSNL);
/*
* H/W requires a 5us de... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-hfpll.c | static int clk_hfpll_enable(struct clk_hw *hw) {
unsigned long flags;
struct clk_hfpll *h = to_clk_hfpll(hw);
struct hfpll_data const *hd = h->d;
struct regmap *regmap = h->clkr.regmap;
u32 mode;
spin_lock_irqsave(&h->lock, flags);
regmap_read(regmap, hd->mode_reg, &mode);
if (!(mode & (PLL_BYPASSNL | ... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-hfpll.c |
static int clk_hfpll_init(struct clk_hw *hw) {
struct clk_hfpll *h = to_clk_hfpll(hw);
struct hfpll_data const *hd = h->d;
struct regmap *regmap = h->clkr.regmap;
u32 mode, status;
regmap_read(regmap, hd->mode_reg, &mode);
if (mode != (PLL_BYPASSNL | PLL_RESET_N | PLL_OUTCTRL)) {
__clk_hfpll_init_once... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-krait.c | static int krait_mux_set_parent(struct clk_hw *hw, u8 index) {
struct krait_mux_clk *mux = to_krait_mux_clk(hw);
u32 sel;
sel = clk_mux_index_to_val(mux->parent_map, 0, index);
mux->en_mask = sel;
if (__clk_is_enabled(hw->clk))
__krait_mux_set_sel(mux, sel);
mux->reparent = true;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-pll.c | static int clk_pll_enable(struct clk_hw *hw) {
struct clk_pll *pll = to_clk_pll(hw);
int ret;
u32 mask, val;
mask = PLL_OUTCTRL | PLL_RESET_N | PLL_BYPASSNL;
ret = regmap_read(pll->clkr.regmap, pll->mode_reg, &val);
if (ret)
return ret;
if ((val & mask) == mask || val & PLL_VOTE_FSM_ENA)
return ... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-pll.c | static void clk_pll_disable(struct clk_hw *hw) {
struct clk_pll *pll = to_clk_pll(hw);
u32 mask;
u32 val;
regmap_read(pll->clkr.regmap, pll->mode_reg, &val);
if (val & PLL_VOTE_FSM_ENA)
return;
mask = PLL_OUTCTRL | PLL_RESET_N | PLL_BYPASSNL;
regmap_update_bits(pll->clkr.regmap, pll->mode_reg, mask,... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-pll.c |
static const struct pll_freq_tbl *find_freq(const struct pll_freq_tbl *f,
unsigned long rate) {
if (!f)
return NULL;
for (; f->freq; f++)
if (rate <= f->freq)
return f;
return NULL;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-pll.c |
static int clk_pll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_pll *pll = to_clk_pll(hw);
const struct pll_freq_tbl *f;
f = find_freq(pll->freq_tbl, req->rate);
if (!f)
req->rate = clk_pll_recalc_rate(hw, req->best_parent_rate);
else
... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-pll.c |
static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long p_rate) {
struct clk_pll *pll = to_clk_pll(hw);
const struct pll_freq_tbl *f;
bool enabled;
u32 mode;
u32 enable_mask = PLL_OUTCTRL | PLL_BYPASSNL | PLL_RESET_N;
f = find_freq(pll->freq_tbl, rate);... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static u32 ns_to_src(struct src_sel *s, u32 ns) {
ns >>= s->src_sel_shift;
ns &= SRC_SEL_MASK;
return ns;
} | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static u8 clk_rcg_get_parent(struct clk_hw *hw) {
struct clk_rcg *rcg = to_clk_rcg(hw);
int num_parents = clk_hw_get_num_parents(hw);
u32 ns;
int i, ret;
ret = regmap_read(rcg->clkr.regmap, rcg->ns_reg, &ns);
if (ret)
goto err;
ns = ns_to_src(&rcg->s, ns);
for (i = 0; i < num_parents; i++)
if ... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static u32 mn_to_md(struct mn *mn, u32 m, u32 n, u32 md) {
u32 mask, mask_w;
mask_w = BIT(mn->width) - 1;
mask = (mask_w << mn->m_val_shift) | mask_w;
md &= ~mask;
if (n) {
m <<= mn->m_val_shift;
md |= m;
md |= ~n & mask_w;
}
return md;
} | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c | static unsigned long calc_rate(unsigned long rate, u32 m, u32 n, u32 mode,
u32 pre_div) {
if (pre_div)
rate /= pre_div + 1;
if (mode) {
u64 tmp = rate;
tmp *= m;
do_div(tmp, n);
rate = tmp;
}
return rate;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int _freq_tbl_determine_rate(struct clk_hw *hw, const struct freq_tbl *f,
struct clk_rate_request *req,
const struct parent_map *parent_map) {
unsigned long clk_flags, rate = req->rate;
struct clk_hw *p;
int index;
f = qcom_find_fr... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c | static int __clk_rcg_set_rate(struct clk_rcg *rcg, const struct freq_tbl *f) {
u32 ns, md, ctl;
struct mn *mn = &rcg->mn;
u32 mask = 0;
unsigned int reset_reg;
if (rcg->mn.reset_in_cc)
reset_reg = rcg->clkr.enable_reg;
else
reset_reg = rcg->ns_reg;
if (rcg->mn.width) {
mask = BIT(mn->mnctr_r... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int clk_rcg_bypass_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_rcg *rcg = to_clk_rcg(hw);
return __clk_rcg_set_rate(rcg, rcg->freq_tbl);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int clk_rcg_bypass2_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_hw *p;
p = req->best_parent_hw;
req->best_parent_rate = clk_hw_round_rate(p, req->rate);
req->rate = req->best_parent_rate;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int clk_rcg_bypass2_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_rcg *rcg = to_clk_rcg(hw);
struct freq_tbl f = {0};
u32 ns, src;
int i, ret, num_parents = clk_hw_get_num_parents(hw);
ret = regmap_read(rcg->clkr.regmap, rc... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int clk_rcg_pixel_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
int delta = 100000;
const struct frac_entry *frac = pixel_table;
unsigned long request, src_rate;
for (; frac->num; frac++) {
request = (req->rate * frac->den) / frac->num;
... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int clk_rcg_esc_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_rcg *rcg = to_clk_rcg(hw);
int pre_div_max = BIT(rcg->p.pre_div_width);
int div;
unsigned long src_rate;
if (req->rate == 0)
return -EINVAL;
src_rate = clk_hw_get_... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c | static void clk_rcg_lcc_disable(struct clk_hw *hw) {
struct clk_rcg *rcg = to_clk_rcg(hw);
u32 gfm = BIT(10);
regmap_update_bits(rcg->clkr.regmap, rcg->ns_reg, gfm, 0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg.c |
static int clk_dyn_rcg_set_rate_and_parent(struct clk_hw *hw,
unsigned long rate,
unsigned long parent_rate,
u8 index) {
return __clk_dyn_rcg_set_rate(hw, rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_rcg2_is_enabled(struct clk_hw *hw) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
u32 cmd;
int ret;
ret = regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + CMD_REG, &cmd);
if (ret)
return ret;
return (cmd & CMD_ROOT_OFF) == 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static u8 clk_rcg2_get_parent(struct clk_hw *hw) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
u32 cfg;
int ret;
ret = regmap_read(rcg->clkr.regmap, RCG_CFG_OFFSET(rcg), &cfg);
if (ret) {
pr_debug("%s: Unable to read CFG register for %s\n", __func__,
clk_hw_get_name(hw));
return 0;
}
r... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static unsigned long
__clk_rcg2_recalc_rate(struct clk_hw *hw, unsigned long parent_rate, u32 cfg) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
u32 hid_div, m = 0, n = 0, mode = 0, mask;
if (rcg->mnd_width) {
mask = BIT(rcg->mnd_width) - 1;
regmap_read(rcg->clkr.regmap, RCG_M_OFFSET(rcg), &m);
m &= mas... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_rcg2_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
return _freq_tbl_determine_rate(hw, rcg->freq_tbl, req, CEIL);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
return __clk_rcg2_set_rate(hw, rate, CEIL);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
return __clk_rcg2_set_rate(hw, rate, FLOOR);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c | static int clk_rcg2_get_duty_cycle(struct clk_hw *hw, struct clk_duty *duty) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
u32 notn_m, n, m, d, not2d, mask;
if (!rcg->mnd_width) {
duty->num = 1;
duty->den = 2;
return 0;
}
regmap_read(rcg->clkr.regmap, RCG_D_OFFSET(rcg), ¬2d);
regmap_read(rcg->... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_edp_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
struct freq_tbl f = *rcg->freq_tbl;
const struct frac_entry *frac;
int delta = 100000;
s64 src_rate = parent_rate;
s64 request;
u... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c | static int clk_byte_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate, u8 index) {
return clk_byte_set_rate(hw, rate, parent_rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_byte2_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
unsigned long parent_rate, div;
u32 mask = BIT(rcg->hid_width) - 1;
struct clk_hw *p;
unsigned long rate = req->rate;
if (rate == 0)
return... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c | static int clk_byte2_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate, u8 index) {
return clk_byte2_set_rate(hw, rate, parent_rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
struct freq_tbl f = {0};
const struct frac_entry *frac = frac_table_pixel;
unsigned long request;
int delta = 100000;
u32 mask = BIT(rcg->h... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c | static int clk_gfx3d_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate, u8 index) {
struct clk_rcg2_gfx3d *cgfx = to_clk_rcg2_gfx3d(hw);
struct clk_rcg2 *rcg = &cgfx->rcg;
u32 cfg;
int ret;
cfg = rcg->parent_map[index].cfg << CFG_SRC... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c | static u8 clk_rcg2_shared_get_parent(struct clk_hw *hw) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
if (!clk_hw_is_enabled(hw))
return __clk_rcg2_get_parent(hw, rcg->parked_cfg);
return clk_rcg2_get_parent(hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rcg2.c |
static int clk_rcg2_dp_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
struct freq_tbl f = {0};
u32 mask = BIT(rcg->hid_width) - 1;
u32 hid_div, cfg;
int i, num_parents = clk_hw_get_num_parents(hw);
unsigne... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap-divider.c |
static long div_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) {
struct clk_regmap_div *divider = to_clk_regmap_div(hw);
return divider_round_rate(hw, rate, prate, NULL, divider->width,
CLK_DIVIDER_ROUND_CLOSEST);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap-divider.c |
static int div_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_regmap_div *divider = to_clk_regmap_div(hw);
struct clk_regmap *clkr = ÷r->clkr;
u32 div;
div = divider_get_val(rate, parent_rate, NULL, divider->width,
... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap-divider.c |
static unsigned long div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_regmap_div *divider = to_clk_regmap_div(hw);
struct clk_regmap *clkr = ÷r->clkr;
u32 div;
regmap_read(clkr->regmap, divider->reg, &div);
div >>= divider->shift;
div &=... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap-mux-div.c | int mux_div_set_src_div(struct clk_regmap_mux_div *md, u32 src, u32 div) {
int ret, count;
u32 val, mask;
const char *name = clk_hw_get_name(&md->clkr.hw);
val = (div << md->hid_shift) | (src << md->src_shift);
mask = ((BIT(md->hid_width) - 1) << md->hid_shift) |
((BIT(md->src_width) - 1) << md->src... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap-mux-div.c |
static int mux_div_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate) {
struct clk_regmap_mux_div *md = to_clk_regmap_mux_div(hw);
return __mux_div_set_rate_and_parent(hw, rate, prate, md->src);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap-mux-div.c |
static unsigned long mux_div_recalc_rate(struct clk_hw *hw,
unsigned long prate) {
struct clk_regmap_mux_div *md = to_clk_regmap_mux_div(hw);
u32 div, src;
int i, num_parents = clk_hw_get_num_parents(hw);
const char *name = clk_hw_get_name(hw);
mux_div_get_src_div(md... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap.c | int clk_is_enabled_regmap(struct clk_hw *hw) {
struct clk_regmap *rclk = to_clk_regmap(hw);
unsigned int val;
int ret;
ret = regmap_read(rclk->regmap, rclk->enable_reg, &val);
if (ret != 0)
return ret;
if (rclk->enable_is_inverted)
return (val & rclk->enable_mask) == 0;
else
return (val & rc... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap.c | void clk_disable_regmap(struct clk_hw *hw) {
struct clk_regmap *rclk = to_clk_regmap(hw);
unsigned int val;
if (rclk->enable_is_inverted)
val = rclk->enable_mask;
else
val = 0;
regmap_update_bits(rclk->regmap, rclk->enable_reg, rclk->enable_mask, val);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-regmap.c | int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk) {
if (dev && dev_get_regmap(dev, NULL))
rclk->regmap = dev_get_regmap(dev, NULL);
else if (dev && dev->parent)
rclk->regmap = dev_get_regmap(dev->parent, NULL);
return devm_clk_hw_register(dev, &rclk->hw);
} | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpm.c | static void clk_rpm_unprepare(struct clk_hw *hw) {
struct clk_rpm *r = to_clk_rpm(hw);
struct clk_rpm *peer = r->peer;
unsigned long peer_rate = 0, peer_sleep_rate = 0;
unsigned long active_rate, sleep_rate;
int ret;
mutex_lock(&rpm_clk_lock);
if (!r->rate)
goto out;
if (peer->enabled)
to_act... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpm.c |
static int clk_rpm_fixed_prepare(struct clk_hw *hw) {
struct clk_rpm *r = to_clk_rpm(hw);
u32 value = 1;
int ret;
ret = qcom_rpm_write(r->rpm, QCOM_RPM_ACTIVE_STATE, r->rpm_clk_id, &value, 1);
if (!ret)
r->enabled = true;
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpm.c | static long clk_rpm_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
return rate;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c |
static inline bool has_state_changed(struct clk_rpmh *c, u32 state) {
return (c->last_sent_aggr_state & BIT(state)) != (c->aggr_state & BIT(state));
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c |
static int clk_rpmh_send(struct clk_rpmh *c, enum rpmh_state state,
struct tcs_cmd *cmd, bool wait) {
if (wait)
return rpmh_write(c->dev, state, cmd, 1);
return rpmh_write_async(c->dev, state, cmd, 1);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c | static int clk_rpmh_bcm_send_cmd(struct clk_rpmh *c, bool enable) {
struct tcs_cmd cmd = {0};
u32 cmd_state;
int ret = 0;
mutex_lock(&rpmh_clk_lock);
if (enable) {
cmd_state = 1;
if (c->aggr_state)
cmd_state = c->aggr_state;
} else {
cmd_state = 0;
}
if (c->last_sent_aggr_state != cm... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c |
static int clk_rpmh_bcm_prepare(struct clk_hw *hw) {
struct clk_rpmh *c = to_clk_rpmh(hw);
return clk_rpmh_bcm_send_cmd(c, true);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c |
static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
void *data) {
struct clk_rpmh_desc *rpmh = data;
unsigned int idx = clkspec->args[0];
if (idx >= rpmh->num_clks) {
pr_err("%s: invalid index %u\n", __func__, idx);
return ERR_PTR(-EINVAL);
... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c |
static int __init clk_rpmh_init(void) {
return platform_driver_register(&clk_rpmh_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-rpmh.c |
static void __exit clk_rpmh_exit(void) {
platform_driver_unregister(&clk_rpmh_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-smd-rpm.c | static int clk_smd_rpm_set_rate_active(struct clk_smd_rpm *r,
unsigned long rate) {
struct clk_smd_rpm_req req = {
.key = cpu_to_le32(r->rpm_key),
.nbytes = cpu_to_le32(sizeof(u32)),
.value = cpu_to_le32(DIV_ROUND_UP(rate, 1000)),
};
return qcom_rpm_smd_wr... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-smd-rpm.c | static int clk_smd_rpm_set_rate_sleep(struct clk_smd_rpm *r,
unsigned long rate) {
struct clk_smd_rpm_req req = {
.key = cpu_to_le32(r->rpm_key),
.nbytes = cpu_to_le32(sizeof(u32)),
.value = cpu_to_le32(DIV_ROUND_UP(rate, 1000)),
};
return qcom_rpm_smd_writ... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-smd-rpm.c | static void to_active_sleep(struct clk_smd_rpm *r, unsigned long rate,
unsigned long *active, unsigned long *sleep) {
*active = rate;
if (r->active_only)
*sleep = 0;
else
*sleep = *active;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-smd-rpm.c | static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_smd_rpm *r = to_clk_smd_rpm(hw);
struct clk_smd_rpm *peer = r->peer;
unsigned long active_rate, sleep_rate;
unsigned long this_rate = 0, this_sleep_rate = 0;
unsigned ... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/clk-smd-rpm.c | static long clk_smd_rpm_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
return rate;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-smd-rpm.c |
static void __exit rpm_smd_clk_exit(void) {
platform_driver_unregister(&rpm_smd_clk_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-spmi-pmic-div.c |
static inline struct clkdiv *to_clkdiv(struct clk_hw *hw) {
return container_of(hw, struct clkdiv, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-spmi-pmic-div.c |
static int spmi_pmic_clkdiv_set_enable_state(struct clkdiv *clkdiv,
bool enable) {
unsigned int div_factor;
regmap_read(clkdiv->regmap, clkdiv->base + REG_DIV_CTL1, &div_factor);
div_factor &= DIV_CTL1_DIV_FACTOR_MASK;
return __spmi_pmic_clkdiv_set_enable_state(cl... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/clk-spmi-pmic-div.c |
static unsigned long clk_spmi_pmic_div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clkdiv *clkdiv = to_clkdiv(hw);
unsigned int div_factor;
regmap_read(clkdiv->regmap, clkdiv->base + REG_DIV_CTL1, &div_factor);
div_factor &= DIV_CTL1_DI... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/common.c | const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f,
unsigned long rate) {
if (!f)
return NULL;
if (!f->freq)
return f;
for (; f->freq; f++)
if (rate <= f->freq)
return f;
return f - 1;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/common.c |
const struct freq_tbl *qcom_find_freq_floor(const struct freq_tbl *f,
unsigned long rate) {
const struct freq_tbl *best = NULL;
for (; f->freq; f++) {
if (rate >= f->freq)
best = f;
else
break;
}
return best;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/common.c |
int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map,
u8 cfg) {
int i, num_parents = clk_hw_get_num_parents(hw);
for (i = 0; i < num_parents; i++)
if (cfg == map[i].cfg)
return i;
return -ENOENT;
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/common.c | void qcom_pll_set_fsm_mode(struct regmap *map, u32 reg, u8 bias_count,
u8 lock_count) {
u32 val;
u32 mask;
regmap_update_bits(map, reg, PLL_VOTE_FSM_RESET, 0);
/* Program bias count and lock count */
val = bias_count << PLL_BIAS_COUNT_SHIFT | lock_count << PLL_LOCK_COUNT_SHIFT;
... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/common.c | static int _qcom_cc_register_board_clk(struct device *dev, const char *path,
const char *name, unsigned long rate,
bool add_factor) {
struct device_node *node = NULL;
struct device_node *clocks_node;
struct clk_fixed_factor *factor;
s... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/common.c | static void qcom_cc_drop_protected(struct device *dev, struct qcom_cc *cc) {
struct device_node *np = dev->of_node;
struct property *prop;
const __be32 *p;
u32 i;
of_property_for_each_u32(np, "protected-clocks", prop, p, i) {
if (i >= cc->num_rclks)
continue;
cc->rclks[i] = NULL;
}
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-qcm2290.c | static int disp_cc_qcm2290_probe(struct platform_device *pdev) {
struct regmap *regmap;
int ret;
regmap = qcom_cc_map(pdev, &disp_cc_qcm2290_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
regmap_update_bits(regmap, 0x604c, BIT(... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sc7180.c | static int disp_cc_sc7180_probe(struct platform_device *pdev) {
struct regmap *regmap;
struct alpha_pll_config disp_cc_pll_config = {};
regmap = qcom_cc_map(pdev, &disp_cc_sc7180_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
disp_cc_pll_config.l = 0x47;
disp_cc_pll_config.alpha = 0xe000;
disp_c... | [
1,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sc7280.c |
static void __exit disp_cc_sc7280_exit(void) {
platform_driver_unregister(&disp_cc_sc7280_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sc8280xp.c |
static int __init disp_cc_sc8280xp_init(void) {
return platform_driver_register(&disp_cc_sc8280xp_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sm6350.c |
static int disp_cc_sm6350_probe(struct platform_device *pdev) {
struct regmap *regmap;
regmap = qcom_cc_map(pdev, &disp_cc_sm6350_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
clk_fabia_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
return qcom_cc_really_probe(pdev, &disp_cc_sm6350_d... | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sm6350.c |
static int __init disp_cc_sm6350_init(void) {
return platform_driver_register(&disp_cc_sm6350_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sm6350.c |
static void __exit disp_cc_sm6350_exit(void) {
platform_driver_unregister(&disp_cc_sm6350_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/qcom/dispcc-sm6375.c |
static void __exit disp_cc_sm6375_exit(void) {
platform_driver_unregister(&disp_cc_sm6375_driver);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.