Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/clk/actions/owl-pll.c | static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct owl_pll *pll = hw_to_owl_pll(hw);
struct owl_pll_hw *pll_hw = &pll->pll_hw;
const struct clk_pll_table *clkt;
u32 mul;
if (pll_hw->table) {
clkt = _get_pll_table(pll_h... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-pll.c | static unsigned long owl_pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct owl_pll *pll = hw_to_owl_pll(hw);
struct owl_pll_hw *pll_hw = &pll->pll_hw;
const struct owl_clk_common *common = &pll->common;
u32 val;
if (pll_hw->table) {
regmap_rea... | [
1,
0
] |
Linux Kernel | drivers/clk/actions/owl-pll.c |
static void owl_pll_set(const struct owl_clk_common *common,
const struct owl_pll_hw *pll_hw, bool enable) {
u32 reg;
regmap_read(common->regmap, pll_hw->reg, ®);
if (enable)
reg |= BIT(pll_hw->bit_idx);
else
reg &= ~BIT(pll_hw->bit_idx);
regmap_write(common->regmap, pll... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-pll.c | static int owl_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct owl_pll *pll = hw_to_owl_pll(hw);
struct owl_pll_hw *pll_hw = &pll->pll_hw;
const struct owl_clk_common *common = &pll->common;
const struct clk_pll_table *clkt;
u32 val, reg;
... | [
1,
0
] |
Linux Kernel | drivers/clk/actions/owl-s500.c |
static int __init s500_clk_init(void) {
return platform_driver_register(&s500_clk_driver);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-s700.c | static int s700_clk_probe(struct platform_device *pdev) {
struct owl_clk_desc *desc;
struct owl_reset *reset;
int ret;
desc = &s700_clk_desc;
owl_clk_regmap_init(pdev, desc);
/*
* FIXME: Reset controller registration should be moved to
* common code, once all SoCs of Owl family supports it.
*/
... | [
1,
1
] |
Linux Kernel | drivers/clk/actions/owl-s900.c | static int s900_clk_probe(struct platform_device *pdev) {
struct owl_clk_desc *desc;
struct owl_reset *reset;
int ret;
desc = &s900_clk_desc;
owl_clk_regmap_init(pdev, desc);
/*
* FIXME: Reset controller registration should be moved to
* common code, once all SoCs of Owl family supports it.
*/
... | [
1,
1
] |
Linux Kernel | drivers/clk/analogbits/wrpll-cln28hpc.c | static int __wrpll_update_parent_rate(struct wrpll_cfg *c,
unsigned long parent_rate) {
u8 max_r_for_parent;
if (parent_rate > MAX_INPUT_FREQ || parent_rate < MIN_POST_DIVR_FREQ)
return -ERANGE;
c->parent_rate = parent_rate;
max_r_for_parent = div_u64(parent_rate, MIN... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/at91sam9260.c |
static void __init at91sam9260_pmc_setup(struct device_node *np) {
at91sam926x_pmc_setup(np, &at91sam9260_data);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/at91sam9260.c |
static void __init at91sam9263_pmc_setup(struct device_node *np) {
at91sam926x_pmc_setup(np, &at91sam9263_data);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/at91sam9x5.c |
static void __init at91sam9g25_pmc_setup(struct device_node *np) {
at91sam9x5_pmc_setup(np, at91sam9g25_periphck, false);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/at91sam9x5.c |
static void __init at91sam9x25_pmc_setup(struct device_node *np) {
at91sam9x5_pmc_setup(np, at91sam9x25_periphck, false);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c |
static int clk_audio_pll_pad_enable(struct clk_hw *hw) {
struct clk_audio_pad *apad_ck = to_clk_audio_pad(hw);
regmap_update_bits(apad_ck->regmap, AT91_PMC_AUDIO_PLL1,
AT91_PMC_AUDIO_PLL_QDPAD_MASK,
AUDIO_PLL_QDPAD(apad_ck->qdaudio, apad_ck->div));
regmap_update_bits(ap... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c | static void clk_audio_pll_frac_disable(struct clk_hw *hw) {
struct clk_audio_frac *frac = to_clk_audio_frac(hw);
regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0,
AT91_PMC_AUDIO_PLL_PLLEN, 0);
regmap_update_bits(frac->regmap, AT91_PMC_AUDIO_PLL0,
AT91_PMC_AUDIO_PLL_... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c |
static void clk_audio_pll_pad_disable(struct clk_hw *hw) {
struct clk_audio_pad *apad_ck = to_clk_audio_pad(hw);
regmap_update_bits(apad_ck->regmap, AT91_PMC_AUDIO_PLL0,
AT91_PMC_AUDIO_PLL_PADEN, 0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c |
static void clk_audio_pll_pmc_disable(struct clk_hw *hw) {
struct clk_audio_pmc *apmc_ck = to_clk_audio_pmc(hw);
regmap_update_bits(apmc_ck->regmap, AT91_PMC_AUDIO_PLL0,
AT91_PMC_AUDIO_PLL_PMCEN, 0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c |
static unsigned long clk_audio_pll_pmc_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_audio_pmc *apmc_ck = to_clk_audio_pmc(hw);
unsigned long apmc_rate = 0;
apmc_rate = parent_rate / (apmc_ck->qdpmc + 1);
pr_debug("A PLL/PMC: %s, apm... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c | static int clk_audio_pll_frac_compute_frac(unsigned long rate,
unsigned long parent_rate,
unsigned long *nd,
unsigned long *fracr) {
unsigned long long tmp, rem;
if (!rate)
return -E... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-audio-pll.c | static long clk_audio_pll_pmc_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct clk_hw *pclk = clk_hw_get_parent(hw);
long best_rate = -EINVAL;
unsigned long best_parent_rate = 0;
u32 tmp_qd = 0, div;
long tmp_rate;
int tmp_diff;
... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-generated.c |
static int clk_generated_enable(struct clk_hw *hw) {
struct clk_generated *gck = to_clk_generated(hw);
pr_debug("GCLK: %s, gckdiv = %d, parent id = %d\n", __func__, gck->gckdiv,
gck->parent_id);
clk_generated_set(gck, 1);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-generated.c |
static void clk_generated_disable(struct clk_hw *hw) {
struct clk_generated *gck = to_clk_generated(hw);
unsigned long flags;
spin_lock_irqsave(gck->lock, flags);
regmap_write(gck->regmap, gck->layout->offset,
(gck->id & gck->layout->pid_mask));
regmap_update_bits(gck->regmap, gck->layout->of... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-generated.c |
static void clk_generated_restore_context(struct clk_hw *hw) {
struct clk_generated *gck = to_clk_generated(hw);
if (gck->pms.status)
clk_generated_set(gck, gck->pms.status);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-h32mx.c |
static long clk_sama5d4_h32mx_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
unsigned long div;
if (rate > *parent_rate)
return *parent_rate;
div = *parent_rate / 2;
if (rate < div)
return div;
if (rate - div < *parent_rate -... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-h32mx.c |
struct clk_hw *__init at91_clk_register_h32mx(struct regmap *regmap,
const char *name,
const char *parent_name) {
struct clk_sama5d4_h32mx *h32mxclk;
struct clk_init_data init;
int ret;
h32mxclk = kzalloc(sizeof(*h32mx... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-i2s-mux.c |
static u8 clk_i2s_mux_get_parent(struct clk_hw *hw) {
struct clk_i2s_mux *mux = to_clk_i2s_mux(hw);
u32 val;
regmap_read(mux->regmap, AT91_SFR_I2SCLKSEL, &val);
return (val & BIT(mux->bus_id)) >> mux->bus_id;
} | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-i2s-mux.c |
struct clk_hw *__init at91_clk_i2s_mux_register(struct regmap *regmap,
const char *name,
const char *const *parent_names,
unsigned int num_parents,
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
static inline bool clk_main_osc_ready(struct regmap *regmap) {
unsigned int status;
regmap_read(regmap, AT91_PMC_SR, &status);
return status & AT91_PMC_MOSCS;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
static int clk_main_osc_prepare(struct clk_hw *hw) {
struct clk_main_osc *osc = to_clk_main_osc(hw);
struct regmap *regmap = osc->regmap;
u32 tmp;
regmap_read(regmap, AT91_CKGR_MOR, &tmp);
tmp &= ~MOR_KEY_MASK;
if (tmp & AT91_PMC_OSCBYPASS)
return 0;
if (!(tmp & AT91_PMC_MOSCEN)) {
tmp |= AT91... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
static void clk_main_rc_osc_unprepare(struct clk_hw *hw) {
struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw);
struct regmap *regmap = osc->regmap;
unsigned int mor;
regmap_read(regmap, AT91_CKGR_MOR, &mor);
if (!(mor & AT91_PMC_MOSCRCEN))
return;
regmap_update_bits(regmap, AT91_CKGR_MOR, MOR_KEY_... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
static int clk_rm9200_main_is_prepared(struct clk_hw *hw) {
struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw);
unsigned int status;
regmap_read(clkmain->regmap, AT91_CKGR_MCFR, &status);
return !!(status & AT91_PMC_MAINRDY);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
struct clk_hw *__init at91_clk_register_rm9200_main(struct regmap *regmap,
const char *name,
const char *parent_name) {
struct clk_rm9200_main *clkmain;
struct clk_init_data init;
struct clk_hw *hw;
int ret;... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
static int clk_sam9x5_main_is_prepared(struct clk_hw *hw) {
struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
return clk_sam9x5_main_ready(clkmain->regmap);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-main.c |
static void clk_sam9x5_main_restore_context(struct clk_hw *hw) {
struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
int ret;
ret = clk_sam9x5_main_set_parent(hw, clkmain->pms.parent);
if (ret)
return;
if (clkmain->pms.status)
clk_sam9x5_main_prepare(hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c | static int clk_master_div_set(struct clk_master *master,
unsigned long parent_rate, int div) {
const struct clk_master_characteristics *characteristics =
master->characteristics;
unsigned long rate = parent_rate;
unsigned int max_div = 0, div_index = 0, max_div_index = 0;
uns... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c |
static void clk_sama7g5_master_best_diff(struct clk_rate_request *req,
struct clk_hw *parent,
unsigned long parent_rate,
long *best_rate, long *best_diff,
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c |
static u8 clk_master_pres_get_parent(struct clk_hw *hw) {
struct clk_master *master = to_clk_master(hw);
unsigned long flags;
unsigned int mckr;
spin_lock_irqsave(master->lock, flags);
regmap_read(master->regmap, master->layout->offset, &mckr);
spin_unlock_irqrestore(master->lock, flags);
mckr &= maste... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c | static void clk_sama7g5_master_set(struct clk_master *master,
unsigned int status) {
unsigned long flags;
unsigned int val, cparent;
unsigned int enable = status ? AT91_PMC_MCR_V2_EN : 0;
unsigned int parent = master->parent << PMC_MCR_CSS_SHIFT;
unsigned int div = master->d... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c |
static int clk_sama7g5_master_enable(struct clk_hw *hw) {
struct clk_master *master = to_clk_master(hw);
clk_sama7g5_master_set(master, 1);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c |
static int clk_sama7g5_master_is_enabled(struct clk_hw *hw) {
struct clk_master *master = to_clk_master(hw);
unsigned long flags;
unsigned int val;
spin_lock_irqsave(master->lock, flags);
regmap_write(master->regmap, AT91_PMC_MCR_V2, master->id);
regmap_read(master->regmap, AT91_PMC_MCR_V2, &val);
spi... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-master.c |
static void clk_sama7g5_master_restore_context(struct clk_hw *hw) {
struct clk_master *master = to_clk_master(hw);
if (master->pms.status)
clk_sama7g5_master_set(master, master->pms.status);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-peripheral.c |
static int clk_peripheral_enable(struct clk_hw *hw) {
struct clk_peripheral *periph = to_clk_peripheral(hw);
int offset = AT91_PMC_PCER;
u32 id = periph->id;
if (id < PERIPHERAL_ID_MIN)
return 0;
if (id > PERIPHERAL_ID_MAX)
offset = AT91_PMC_PCER1;
regmap_write(periph->regmap, offset, PERIPHERAL_M... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-peripheral.c |
static void clk_peripheral_disable(struct clk_hw *hw) {
struct clk_peripheral *periph = to_clk_peripheral(hw);
int offset = AT91_PMC_PCDR;
u32 id = periph->id;
if (id < PERIPHERAL_ID_MIN)
return;
if (id > PERIPHERAL_ID_MAX)
offset = AT91_PMC_PCDR1;
regmap_write(periph->regmap, offset, PERIPHERAL_M... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-peripheral.c |
static int clk_sam9x5_peripheral_set(struct clk_sam9x5_peripheral *periph,
unsigned int status) {
unsigned long flags;
unsigned int enable = status ? AT91_PMC_PCR_EN : 0;
if (periph->id < PERIPHERAL_ID_MIN)
return 0;
spin_lock_irqsave(periph->lock, flags);
regmap_wr... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-peripheral.c |
static int clk_sam9x5_peripheral_is_enabled(struct clk_hw *hw) {
struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw);
unsigned long flags;
unsigned int status;
if (periph->id < PERIPHERAL_ID_MIN)
return 1;
spin_lock_irqsave(periph->lock, flags);
regmap_write(periph->regmap, periph->la... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-peripheral.c |
static void clk_sam9x5_peripheral_restore_context(struct clk_hw *hw) {
struct clk_sam9x5_peripheral *periph = to_clk_sam9x5_peripheral(hw);
if (periph->pms.status)
clk_sam9x5_peripheral_set(periph, periph->pms.status);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-pll.c |
static int clk_pll_is_prepared(struct clk_hw *hw) {
struct clk_pll *pll = to_clk_pll(hw);
return clk_pll_ready(pll->regmap, pll->id);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-pll.c |
static void clk_pll_unprepare(struct clk_hw *hw) {
struct clk_pll *pll = to_clk_pll(hw);
unsigned int mask = pll->layout->pllr_mask;
regmap_update_bits(pll->regmap, PLL_REG(pll->id), mask, ~mask);
} | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-pll.c |
static void clk_pll_restore_context(struct clk_hw *hw) {
struct clk_pll *pll = to_clk_pll(hw);
unsigned long calc_rate;
unsigned int pllr, pllr_out, pllr_count;
u8 out = 0;
if (pll->characteristics->out)
out = pll->characteristics->out[pll->range];
regmap_read(pll->regmap, PLL_REG(pll->id), &pllr);
... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-plldiv.c |
static unsigned long clk_plldiv_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct clk_plldiv *plldiv = to_clk_plldiv(hw);
unsigned int mckr;
regmap_read(plldiv->regmap, AT91_PMC_MCKR, &mckr);
if (mckr & AT91_PMC_PLLADIV2)
return parent_rate / 2... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-plldiv.c |
struct clk_hw *__init at91_clk_register_plldiv(struct regmap *regmap,
const char *name,
const char *parent_name) {
struct clk_plldiv *plldiv;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
plldiv = kzalloc(... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-programmable.c |
static int clk_programmable_set_parent(struct clk_hw *hw, u8 index) {
struct clk_programmable *prog = to_clk_programmable(hw);
const struct clk_programmable_layout *layout = prog->layout;
unsigned int mask = layout->css_mask;
unsigned int pckr = index;
if (layout->have_slck_mck)
mask |= AT91_PMC_CSSMCK_... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-programmable.c |
static int clk_programmable_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct clk_programmable *prog = to_clk_programmable(hw);
const struct clk_programmable_layout *layout = prog->layout;
unsigned long div = parent_rate / rate;
int shift =... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-programmable.c |
static int clk_programmable_save_context(struct clk_hw *hw) {
struct clk_programmable *prog = to_clk_programmable(hw);
struct clk_hw *parent_hw = clk_hw_get_parent(hw);
prog->pms.parent = clk_programmable_get_parent(hw);
prog->pms.parent_rate = clk_hw_get_rate(parent_hw);
prog->pms.rate = clk_programmable_r... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c |
static bool sam9x60_frac_pll_ready(struct regmap *regmap, u8 id) {
return sam9x60_pll_ready(regmap, id);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c |
static int sam9x60_frac_pll_is_prepared(struct clk_hw *hw) {
struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
return sam9x60_pll_ready(core->regmap, core->id);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c | static long sam9x60_frac_pll_compute_mul_frac(struct sam9x60_pll_core *core,
unsigned long rate,
unsigned long parent_rate,
bool update) {
struct sam9x60_frac *frac = to_sam9x60_fr... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c |
static int sam9x60_div_pll_prepare(struct clk_hw *hw) {
struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
return sam9x60_div_pll_set(core);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c |
static long sam9x60_div_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct sam9x60_pll_core *core = to_sam9x60_pll_core(hw);
return sam9x60_div_pll_compute_div(core, parent_rate, rate);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c | static int sam9x60_div_pll_notifier_fn(struct notifier_block *notifier,
unsigned long code, void *data) {
struct sam9x60_div *div = notifier_div;
struct sam9x60_pll_core core = div->core;
struct regmap *regmap = core.regmap;
unsigned long irqflags;
u32 val, cdiv;
int r... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-sam9x60-pll.c | struct clk_hw *__init sam9x60_clk_register_div_pll(
struct regmap *regmap, spinlock_t *lock, const char *name,
const char *parent_name, u8 id,
const struct clk_pll_characteristics *characteristics,
const struct clk_pll_layout *layout, u32 flags, u32 safe_div) {
struct sam9x60_div *div;
struct clk_hw... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-slow.c |
struct clk_hw *__init at91_clk_register_sam9260_slow(struct regmap *regmap,
const char *name,
const char **parent_names,
int num_parents) {
struct clk_sam9260... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-smd.c |
static long at91sam9x5_clk_smd_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
unsigned long div;
unsigned long bestrate;
unsigned long tmp;
if (rate >= *parent_rate)
return *parent_rate;
div = *parent_rate / rate;
if (div > SM... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-smd.c |
static u8 at91sam9x5_clk_smd_get_parent(struct clk_hw *hw) {
struct at91sam9x5_clk_smd *smd = to_at91sam9x5_clk_smd(hw);
unsigned int smdr;
regmap_read(smd->regmap, AT91_PMC_SMD, &smdr);
return smdr & AT91_PMC_SMDS;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-system.c |
static void clk_system_restore_context(struct clk_hw *hw) {
struct clk_system *sys = to_clk_system(hw);
if (sys->pms.status)
clk_system_prepare(&sys->hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
static int at91sam9x5_clk_usb_set_parent(struct clk_hw *hw, u8 index) {
struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw);
if (index >= usb->num_parents)
return -EINVAL;
regmap_update_bits(usb->regmap, AT91_PMC_USB, usb->usbs_mask, index);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
static int at91sam9x5_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw);
unsigned long div;
if (!rate)
return -EINVAL;
div = DIV_ROUND_CLOSEST(parent_rate, rate);
if (div... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
static void at91sam9n12_clk_usb_disable(struct clk_hw *hw) {
struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw);
regmap_update_bits(usb->regmap, AT91_PMC_USB, AT91_PMC_USBS, 0);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
static int at91sam9n12_clk_usb_is_enabled(struct clk_hw *hw) {
struct at91sam9x5_clk_usb *usb = to_at91sam9x5_clk_usb(hw);
unsigned int usbr;
regmap_read(usb->regmap, AT91_PMC_USB, &usbr);
return usbr & AT91_PMC_USBS;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
static struct clk_hw *__init _at91sam9x5_clk_register_usb(
struct regmap *regmap, const char *name, const char **parent_names,
u8 num_parents, u32 usbs_mask) {
struct at91sam9x5_clk_usb *usb;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
usb = kzalloc(sizeof(*usb), GFP_KERNEL);
if (!usb)
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
struct clk_hw *__init sam9x60_clk_register_usb(struct regmap *regmap,
const char *name,
const char **parent_names,
u8 num_parents) {
return _at91sam9x5_clk_register_usb(regmap,... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
struct clk_hw *__init at91sam9n12_clk_register_usb(struct regmap *regmap,
const char *name,
const char *parent_name) {
struct at91sam9x5_clk_usb *usb;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
static int at91rm9200_clk_usb_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
int i;
struct at91rm9200_clk_usb *usb = to_at91rm9200_clk_usb(hw);
unsigned long div;
if (!rate)
return -EINVAL;
div = DIV_ROUND_CLOSEST(parent_rate, rate);
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-usb.c |
struct clk_hw *__init at91rm9200_clk_register_usb(struct regmap *regmap,
const char *name,
const char *parent_name,
const u32 *divisors) {
struct at91rm9200_clk_usb *u... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/clk-utmi.c |
static struct clk_hw *__init at91_clk_register_utmi_internal(
struct regmap *regmap_pmc, struct regmap *regmap_sfr, const char *name,
const char *parent_name, const struct clk_ops *ops, unsigned long flags) {
struct clk_utmi *utmi;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
utmi = kzallo... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/clk-utmi.c |
struct clk_hw *__init at91_clk_sama7g5_register_utmi(struct regmap *regmap_pmc,
const char *name,
const char *parent_name) {
return at91_clk_register_utmi_internal(regmap_pmc, NULL, name, parent_name,
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c | static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np) {
struct clk_hw *hw;
const char *name = np->name;
const char *parent_name;
struct regmap *regmap;
struct device_node *parent_np;
parent_np = of_get_parent(np);
regmap = syscon_node_to_regmap(parent_np);
of_node_put(parent_np... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np) {
struct clk_hw *hw;
const char *name = np->name;
const char *parent_name;
struct regmap *regmap;
struct device_node *parent_np;
parent_np = of_get_parent(np);
regmap = syscon_node_to_regmap(parent_np);
of_node_put(parent_np... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np) {
struct regmap *regmap_sfr;
u8 bus_id;
const char *parent_names[2];
struct device_node *i2s_mux_np;
struct clk_hw *hw;
int ret;
regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
if (IS_ERR(regmap_sfr))
ret... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_at91rm9200_clk_main_setup(struct device_node *np) {
struct clk_hw *hw;
const char *parent_name;
const char *name = np->name;
struct regmap *regmap;
struct device_node *parent_np;
parent_name = of_clk_get_parent_name(np, 0);
of_property_read_string(np, "clock-output-names", &name);
... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_at91_clk_prog_setup(
struct device_node *np, const struct clk_programmable_layout *layout,
u32 *mux_table) {
int num;
u32 id;
struct clk_hw *hw;
unsigned int num_parents;
const char *parent_names[PROG_SOURCE_MAX];
const char *name;
struct device_node *progclknp, *parent_np;
... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_at91sam9g45_clk_prog_setup(struct device_node *np) {
of_at91_clk_prog_setup(np, &at91sam9g45_programmable_layout, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_at91sam9x5_clk_prog_setup(struct device_node *np) {
of_at91_clk_prog_setup(np, &at91sam9x5_programmable_layout, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) {
struct clk_hw *hw;
const char *parent_names[2];
unsigned int num_parents;
const char *name = np->name;
struct regmap *regmap;
struct device_node *parent_np;
num_parents = of_clk_get_parent_count(np);
if (num_parents != 2)
r... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/dt-compat.c |
static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) {
int num;
u32 id;
struct clk_hw *hw;
const char *name;
struct device_node *sysclknp, *parent_np;
const char *parent_name;
struct regmap *regmap;
num = of_get_child_count(np);
if (num > (SYSTEM_MAX_ID + 1))
return;
parent_... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/pmc.c |
static int at91_pmc_suspend(void) {
unsigned int backup;
if (!at91_pmc_backup_suspend)
return 0;
backup = readl_relaxed(at91_pmc_backup_suspend);
if (!backup)
return 0;
return clk_save_context();
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/pmc.c |
static int __init pmc_register_ops(void) {
struct device_node *np;
np = of_find_matching_node(NULL, pmc_dt_ids);
if (!np)
return -ENODEV;
if (!of_device_is_available(np)) {
of_node_put(np);
return -ENODEV;
}
of_node_put(np);
np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-securam")... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/sckc.c |
static unsigned long clk_slow_rc_osc_recalc_accuracy(struct clk_hw *hw,
unsigned long parent_acc) {
struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
return osc->accuracy;
} | [
0,
0
] |
Linux Kernel | drivers/clk/at91/sckc.c |
static int clk_slow_rc_osc_prepare(struct clk_hw *hw) {
struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
void __iomem *sckcr = osc->sckcr;
writel(readl(sckcr) | osc->bits->cr_rcen, sckcr);
if (system_state < SYSTEM_RUNNING)
udelay(osc->startup_usec);
else
usleep_range(osc->startup_usec, osc->s... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/sckc.c |
static struct clk_hw *__init at91_clk_register_slow_rc_osc(
void __iomem *sckcr, const char *name, unsigned long frequency,
unsigned long accuracy, unsigned long startup,
const struct clk_slow_bits *bits) {
struct clk_slow_rc_osc *osc;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
if (!... | [
0,
0
] |
Linux Kernel | drivers/clk/at91/sckc.c |
static int clk_sam9x5_slow_set_parent(struct clk_hw *hw, u8 index) {
struct clk_sam9x5_slow *slowck = to_clk_sam9x5_slow(hw);
void __iomem *sckcr = slowck->sckcr;
u32 tmp;
if (index > 1)
return -EINVAL;
tmp = readl(sckcr);
if ((!index && !(tmp & slowck->bits->cr_oscsel)) ||
(index && (tmp & sl... | [
1,
0
] |
Linux Kernel | drivers/clk/at91/sckc.c |
static struct clk_hw *__init at91_clk_register_sam9x5_slow(
void __iomem *sckcr, const char *name, const char **parent_names,
int num_parents, const struct clk_slow_bits *bits) {
struct clk_sam9x5_slow *slowck;
struct clk_hw *hw;
struct clk_init_data init;
int ret;
if (!sckcr || !name || !parent_nam... | [
0,
0
] |
Linux Kernel | drivers/clk/axs10x/i2s_pll_clock.c |
static inline struct i2s_pll_clk *to_i2s_pll_clk(struct clk_hw *hw) {
return container_of(hw, struct i2s_pll_clk, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/axs10x/pll_clock.c |
static inline u32 axs10x_pll_read(struct axs10x_pll_clk *clk, u32 reg) {
return ioread32(clk->base + reg);
} | [
0,
0
] |
Linux Kernel | drivers/clk/axs10x/pll_clock.c |
static inline u32 axs10x_div_get_value(u32 reg) {
if (PLL_REG_GET_BYPASS(reg))
return 1;
return PLL_REG_GET_HIGH(reg) + PLL_REG_GET_LOW(reg);
} | [
0,
0
] |
Linux Kernel | drivers/clk/baikal-t1/ccu-div.c |
static inline unsigned long ccu_div_lock_delay_ns(unsigned long ref_clk,
unsigned long div) {
u64 ns = 4ULL * (div ?: 1) * NSEC_PER_SEC;
do_div(ns, ref_clk);
return ns;
} | [
0,
0
] |
Linux Kernel | drivers/clk/baikal-t1/ccu-div.c | static int ccu_div_var_update_clkdiv(struct ccu_div *div,
unsigned long parent_rate,
unsigned long divider) {
unsigned long nd;
u32 val = 0;
u32 lock;
int count;
nd = ccu_div_lock_delay_ns(parent_rate, divider);
if (div->features & ... | [
0,
0
] |
Linux Kernel | drivers/clk/baikal-t1/ccu-div.c |
static int ccu_div_var_enable(struct clk_hw *hw) {
struct clk_hw *parent_hw = clk_hw_get_parent(hw);
struct ccu_div *div = to_ccu_div(hw);
unsigned long flags;
u32 val = 0;
int ret;
if (!parent_hw) {
pr_err("Can't enable '%s' with no parent", clk_hw_get_name(hw));
return -EINVAL;
}
regmap_rea... | [
0,
0
] |
Linux Kernel | drivers/clk/baikal-t1/ccu-div.c |
static int ccu_div_gate_is_enabled(struct clk_hw *hw) {
struct ccu_div *div = to_ccu_div(hw);
u32 val = 0;
regmap_read(div->sys_regs, div->reg_ctl, &val);
return !!(val & CCU_DIV_CTL_EN);
} | [
0,
0
] |
Linux Kernel | drivers/clk/baikal-t1/ccu-div.c |
static long ccu_div_fixed_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct ccu_div *div = to_ccu_div(hw);
return ccu_div_calc_freq(*parent_rate, div->divider);
} | [
0,
0
] |
Linux Kernel | drivers/clk/baikal-t1/ccu-div.c |
static int ccu_div_dbgfs_bit_set(void *priv, u64 val) {
const struct ccu_div_dbgfs_bit *bit = priv;
struct ccu_div *div = bit->div;
unsigned long flags;
spin_lock_irqsave(&div->lock, flags);
regmap_update_bits(div->sys_regs, div->reg_ctl, bit->mask,
val ? bit->mask : 0);
spin_unlock_i... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.