Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
drivers/clk/xilinx/xlnx_vcu.c
static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw) { struct clk_hw *gate = hw; struct clk_hw *divider; struct clk_hw *mux; if (!gate) return; divider = clk_hw_get_parent(gate); clk_hw_unregister_gate(gate); if (!divider) return; mux = clk_hw_get_parent(divider); clk_hw_unregister_m...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynq/pll.c
static long zynq_pll_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) { u32 fbdiv; fbdiv = DIV_ROUND_CLOSEST(rate, *prate); if (fbdiv < PLL_FBDIV_MIN) fbdiv = PLL_FBDIV_MIN; else if (fbdiv > PLL_FBDIV_MAX) fbdiv = PLL_FBDIV_MAX; return *prate * ...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynq/pll.c
static int zynq_pll_enable(struct clk_hw *hw) { unsigned long flags = 0; u32 reg; struct zynq_pll *clk = to_zynq_pll(hw); if (zynq_pll_is_enabled(hw)) return 0; pr_info("PLL: enable\n"); spin_lock_irqsave(clk->lock, flags); reg = readl(clk->pll_ctrl); reg &= ~(PLLCTRL_RESET_MASK | PLLCTRL_PWRDWN...
[ 1, 0 ]
Linux Kernel
drivers/clk/zynqmp/clk-gate-zynqmp.c
struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id, const char *const *parents, u8 num_parents, const struct clock_topology *nodes) { struct zynqmp_clk_gate *gate; struct clk_hw ...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/clk-mux-zynqmp.c
static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index) { struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(hw); const char *clk_name = clk_hw_get_name(hw); u32 clk_id = mux->clk_id; int ret; ret = zynqmp_pm_clock_setparent(clk_id, index); if (ret) pr_debug("%s() set parent failed for clock: %s...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/clkc.c
static inline int zynqmp_is_valid_clock(u32 clk_id) { if (clk_id >= clock_max_idx) return -ENODEV; return clock[clk_id].valid; }
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/clkc.c
static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks) { struct zynqmp_pm_query_data qdata = {0}; u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; qdata.qid = PM_QID_CLOCK_GET_NUM_CLOCKS; ret = zynqmp_pm_query_data(qdata, ret_payload); *nclocks = ret_payload[1]; return ret; }
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/clkc.c
static int zynqmp_pm_clock_get_attributes(u32 clock_id, struct attr_resp *response) { struct zynqmp_pm_query_data qdata = {0}; u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; qdata.qid = PM_QID_CLOCK_GET_ATTRIBUTES; qdata.arg1 = clock_id; ret = zynqmp_pm_query_data(qda...
[ 1, 0 ]
Linux Kernel
drivers/clk/zynqmp/clkc.c
static int __zynqmp_clock_get_parents(struct clock_parent *parents, struct parents_resp *response, u32 *nparent) { int i; struct clock_parent *parent; for (i = 0; i < ARRAY_SIZE(response->parents); i++) { if (response->parents[i] == ...
[ 1, 0 ]
Linux Kernel
drivers/clk/zynqmp/divider.c
static int zynqmp_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct zynqmp_clk_divider *divider = to_zynqmp_clk_divider(hw); const char *clk_name = clk_hw_get_name(hw); u32 clk_id = divider->clk_id; u32 div_type = divider->div_...
[ 1, 0 ]
Linux Kernel
drivers/clk/zynqmp/pll.c
static inline enum pll_mode zynqmp_pll_get_mode(struct clk_hw *hw) { struct zynqmp_pll *clk = to_zynqmp_pll(hw); u32 clk_id = clk->clk_id; const char *clk_name = clk_hw_get_name(hw); u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; ret = zynqmp_pm_get_pll_frac_mode(clk_id, ret_payload); if (ret) { pr_debug...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/pll.c
static int zynqmp_pll_is_enabled(struct clk_hw *hw) { struct zynqmp_pll *clk = to_zynqmp_pll(hw); const char *clk_name = clk_hw_get_name(hw); u32 clk_id = clk->clk_id; unsigned int state; int ret; ret = zynqmp_pm_clock_getstate(clk_id, &state); if (ret) { pr_debug("%s() clock get state failed for %s,...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/pll.c
static int zynqmp_pll_enable(struct clk_hw *hw) { struct zynqmp_pll *clk = to_zynqmp_pll(hw); const char *clk_name = clk_hw_get_name(hw); u32 clk_id = clk->clk_id; int ret; if (zynqmp_pll_is_enabled(hw) && (!clk->set_pll_mode)) return 0; clk->set_pll_mode = false; ret = zynqmp_pm_clock_enable(clk_i...
[ 0, 0 ]
Linux Kernel
drivers/clk/zynqmp/pll.c
struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, const char *const *parents, u8 num_parents, const struct clock_topology *nodes) { struct zynqmp_pll *pll; struct clk_hw *hw; str...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/acpi_pm.c
static inline u32 read_pmtmr(void) { return inl(pmtmr_ioport) & ACPI_PM_MASK; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/acpi_pm.c
static u64 acpi_pm_read_slow(struct clocksource *cs) { return (u64)acpi_pm_read_verified(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arc_timer.c
static int noinline arc_get_timer_clk(struct device_node *node) { struct clk *clk; int ret; clk = of_clk_get(node, 0); if (IS_ERR(clk)) { pr_err("timer missing clk\n"); return PTR_ERR(clk); } ret = clk_prepare_enable(clk); if (ret) { pr_err("Couldn't enable parent clk\n"); return ret; ...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arc_timer.c
static u64 arc_read_gfrc(struct clocksource *cs) { unsigned long flags; u32 l, h; local_irq_save(flags); __mcip_cmd(CMD_GFRC_READ_LO, 0); l = read_aux_reg(ARC_REG_MCIP_READBACK); __mcip_cmd(CMD_GFRC_READ_HI, 0); h = read_aux_reg(ARC_REG_MCIP_READBACK); local_irq_restore(flags); return (((u64)h) <...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arc_timer.c
static int __init arc_cs_setup_gfrc(struct device_node *node) { struct mcip_bcr mp; int ret; READ_BCR(ARC_REG_MCIP_BCR, mp); if (!mp.gfrc) { pr_warn("Global-64-bit-Ctr clocksource not detected\n"); return -ENXIO; } ret = arc_get_timer_clk(node); if (ret) return ret; sched_clock_register(...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arc_timer.c
static int __init arc_cs_setup_timer1(struct device_node *node) { int ret; if (IS_ENABLED(CONFIG_SMP)) return -EINVAL; ret = arc_get_timer_clk(node); if (ret) return ret; write_aux_reg(ARC_REG_TIMER1_LIMIT, ARC_TIMERN_MAX); write_aux_reg(ARC_REG_TIMER1_CNT, 0); write_aux_reg(ARC_REG_TIMER1_CTRL...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static __always_inline u32 arch_timer_reg_read(int access, enum arch_timer_reg reg, struct clock_event_device *clk) { u32 val; if (access == ARCH_TIMER_MEM_PHYS_ACCESS) { struct arch_timer *timer = to_arch_timer(clk)...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static notrace u64 arch_counter_get_cntpct(void) { return __arch_counter_get_cntpct(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static u64 notrace fsl_a008585_read_cntpct_el0(void) { return __fsl_a008585_read_reg(cntpct_el0); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static u64 notrace hisi_161010101_read_cntpct_el0(void) { return __hisi_161010101_read_reg(cntpct_el0); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static u64 notrace hisi_161010101_read_cntvct_el0(void) { return __hisi_161010101_read_reg(cntvct_el0); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static bool arch_timer_check_local_cap_erratum( const struct arch_timer_erratum_workaround *wa, const void *arg) { return this_cpu_has_cap((uintptr_t)wa->id); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static bool arch_timer_check_acpi_oem_erratum( const struct arch_timer_erratum_workaround *wa, const void *arg) { static const struct ate_acpi_oem_info empty_oem_info = {}; const struct ate_acpi_oem_info *info = wa->id; const struct acpi_table_header *table = arg; while (memcmp(info, &empty_oem_info, sizeo...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static bool arch_timer_counter_has_wa(void) { return atomic_read(&timer_unstable_counter_workaround_in_use); } #else #define arch_timer_check_ool_workaround(t, a) \ do { \ } while (0)
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static __always_inline irqreturn_t timer_handler(const int access, struct clock_event_device *evt) { unsigned long ctrl; ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL, evt); if (ctrl & ARCH_TIMER_CTRL_IT_STAT) { ctrl |= ARCH_TIMER_CTRL_IT_MASK; arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL, ...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static irqreturn_t arch_timer_handler_phys(int irq, void *dev_id) { struct clock_event_device *evt = dev_id; return timer_handler(ARCH_TIMER_PHYS_ACCESS, evt); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static __always_inline int arch_timer_shutdown(const int access, struct clock_event_device *clk) { unsigned long ctrl; ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL, clk); ctrl &= ~ARCH_TIMER_CTRL_ENABLE; arch_timer_reg_write(access, ARCH_TIMER_REG_CTRL,...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int arch_timer_shutdown_phys_mem(struct clock_event_device *clk) { return arch_timer_shutdown(ARCH_TIMER_MEM_PHYS_ACCESS, clk); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static __always_inline void set_next_event(const int access, unsigned long evt, struct clock_event_device *clk) { unsigned long ctrl; u64 cnt; ctrl = arch_timer_reg_read(access, ARCH_TIMER_REG_CTRL, clk); ctrl |= ARCH_TIMER_CTRL_ENABLE; ctrl &= ~ARCH_TIMER_CTRL_IT_...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int arch_timer_set_next_event_virt(unsigned long evt, struct clock_event_device *clk) { set_next_event(ARCH_TIMER_VIRT_ACCESS, evt, clk); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static u64 __arch_timer_check_delta(void) { #ifdef CONFIG_ARM64 const struct midr_range broken_cval_midrs[] = { MIDR_ALL_VERSIONS(MIDR_CPU_MODEL(ARM_CPU_IMP_APM, APM_CPU_PART_POTENZA)), {}, }; if (is_midr_in_range_list(read_cpuid_id(), broken_cval_midrs)) { pr_warn_once("Broken CNTx_CVAL_EL1, us...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int arch_timer_starting_cpu(unsigned int cpu) { struct clock_event_device *clk = this_cpu_ptr(arch_timer_evt); u32 flags; __arch_timer_setup(ARCH_TIMER_TYPE_CP15, clk); flags = check_ppi_trigger(arch_timer_ppi[arch_timer_uses_ppi]); enable_percpu_irq(arch_timer_ppi[arch_timer_uses_ppi], flags); i...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int validate_timer_rate(void) { if (!arch_timer_rate) return -EINVAL; WARN_ON(arch_timer_rate < 1000000); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static void __init arch_timer_of_configure_rate(u32 rate, struct device_node *np) { if (arch_timer_rate) return; if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) arch_timer_rate = rate; /* Check the timer frequency. */ if (validate_tim...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
struct arch_timer_kvm_info *arch_timer_get_kvm_info(void) { return &arch_timer_kvm_info; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int arch_timer_cpu_pm_notify(struct notifier_block *self, unsigned long action, void *hcpu) { if (action == CPU_PM_ENTER) { __this_cpu_write(saved_cntkctl, arch_timer_get_cntkctl()); cpumask_clear_cpu(smp_processor_id(), &evtstrm_available); } else if (action == C...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int __init arch_timer_cpu_pm_init(void) { return cpu_pm_register_notifier(&arch_timer_cpu_pm_notifier); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int __init arch_timer_cpu_pm_init(void) { return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int __init arch_timer_of_init(struct device_node *np) { int i, irq, ret; u32 rate; bool has_names; if (arch_timers_present & ARCH_TIMER_TYPE_CP15) { pr_warn("multiple nodes in dt, skipping\n"); return 0; } arch_timers_present |= ARCH_TIMER_TYPE_CP15; has_names = of_property_read_bool(np,...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_arch_timer.c
static int __init arch_timer_mem_acpi_init(int platform_timer_count) { struct arch_timer_mem *timers, *timer; struct arch_timer_mem_frame *frame, *best_frame = NULL; int timer_count, i, ret = 0; timers = kcalloc(platform_timer_count, sizeof(*timers), GFP_KERNEL); if (!timers) return -ENOMEM; ret = acp...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/arm_global_timer.c
static u64 notrace _gt_counter_read(void) { u64 counter; u32 lower; u32 upper, old_upper; upper = readl_relaxed(gt_base + GT_COUNTER1); do { old_upper = upper; lower = readl_relaxed(gt_base + GT_COUNTER0); upper = readl_relaxed(gt_base + GT_COUNTER1); } while (upper != old_upper); counter = ...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/arm_global_timer.c
static int gt_dying_cpu(unsigned int cpu) { struct clock_event_device *clk = this_cpu_ptr(gt_evt); gt_clockevent_shutdown(clk); disable_percpu_irq(clk->irq); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_global_timer.c
static u64 gt_clocksource_read(struct clocksource *cs) { return gt_counter_read(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_global_timer.c
static u32 gt_read_presc(void) { u32 reg; reg = readl(gt_base + GT_CONTROL); reg &= GT_CONTROL_PRESCALER_MASK; return reg >> GT_CONTROL_PRESCALER_SHIFT; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/arm_global_timer.c
static void __init gt_delay_timer_init(void) { gt_delay_timer.freq = gt_target_rate; register_current_timer_delay(&gt_delay_timer); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/bcm2835_timer.c
static int __init bcm2835_timer_init(struct device_node *node) { void __iomem *base; u32 freq; int irq, ret; struct bcm2835_timer *timer; base = of_iomap(node, 0); if (!base) { pr_err("Can't remap registers\n"); return -ENXIO; } ret = of_property_read_u32(node, "clock-frequency", &freq); if...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/bcm_kona_timer.c
static int __init kona_timer_init(struct device_node *node) { u32 freq; struct clk *external_clk; external_clk = of_clk_get_by_name(node, NULL); if (!IS_ERR(external_clk)) { arch_timer_rate = clk_get_rate(external_clk); clk_prepare_enable(external_clk); } else if (!of_property_read_u32(node, "clock-...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/clksrc_st_lpc.c
static int __init st_clksrc_setup_clk(struct device_node *np) { struct clk *clk; clk = of_clk_get(np, 0); if (IS_ERR(clk)) { pr_err("clksrc-st-lpc: Failed to get LPC clock\n"); return PTR_ERR(clk); } if (clk_prepare_enable(clk)) { pr_err("clksrc-st-lpc: Failed to enable LPC clock\n"); retur...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/clksrc_st_lpc.c
static int __init st_clksrc_of_register(struct device_node *np) { int ret; uint32_t mode; ret = of_property_read_u32(np, "st,lpc-mode", &mode); if (ret) { pr_err("clksrc-st-lpc: An LPC mode must be provided\n"); return ret; } if (mode != ST_LPC_MODE_CLKSRC) return 0; ddata.base = of_iomap(n...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/dummy_timer.c
static int dummy_timer_starting_cpu(unsigned int cpu) { struct clock_event_device *evt = per_cpu_ptr(&dummy_timer_evt, cpu); evt->name = "dummy_timer"; evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_DUMMY; evt->rating = 100; evt->cpumask = cpumask_of(cpu); clockev...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/dw_apb_timer.c
static inline u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs) { return readl(timer->base + offs); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/dw_apb_timer.c
static void apbt_enable_int(struct dw_apb_timer *timer) { u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL); apbt_readl(timer, APBTMR_N_EOI); ctrl &= ~APBTMR_CONTROL_INT; apbt_writel(timer, ctrl, APBTMR_N_CONTROL); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/dw_apb_timer.c
static int apbt_set_periodic(struct clock_event_device *evt) { struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt); unsigned long period = DIV_ROUND_UP(dw_ced->timer.freq, HZ); u32 ctrl; pr_debug("%s CPU %d state=periodic\n", __func__, cpumask_first(evt->cpumask)); ctrl = apbt_readl(&dw_ced->t...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/dw_apb_timer.c
void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs) { u32 ctrl = apbt_readl(&dw_cs->timer, APBTMR_N_CONTROL); ctrl &= ~APBTMR_CONTROL_ENABLE; apbt_writel(&dw_cs->timer, ctrl, APBTMR_N_CONTROL); apbt_writel(&dw_cs->timer, ~0, APBTMR_N_LOAD_COUNT); /* enable, mask interrupt */ ctrl &= ~APBTMR_CO...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/dw_apb_timer.c
u64 dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs) { return (u64)~apbt_readl(&dw_cs->timer, APBTMR_N_CURRENT_VALUE); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/em_sti.c
static u64 em_sti_count(struct em_sti_priv *p) { u64 ticks; unsigned long flags; raw_spin_lock_irqsave(&p->lock, flags); ticks = (u64)(em_sti_read(p, STI_COUNT_H) & 0xffff) << 32; ticks |= em_sti_read(p, STI_COUNT_L); raw_spin_unlock_irqrestore(&p->lock, flags); return ticks; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/em_sti.c
static void em_sti_stop(struct em_sti_priv *p, unsigned int user) { unsigned long flags; int used_before, used_after; raw_spin_lock_irqsave(&p->lock, flags); used_before = p->active[USER_CLOCKSOURCE] | p->active[USER_CLOCKEVENT]; p->active[user] = 0; used_after = p->active[USER_CLOCKSOURCE] | p->active[US...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/em_sti.c
static struct em_sti_priv *cs_to_em_sti(struct clocksource *cs) { return container_of(cs, struct em_sti_priv, cs); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/em_sti.c
static int em_sti_probe(struct platform_device *pdev) { struct em_sti_priv *p; int irq, ret; p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); if (p == NULL) return -ENOMEM; p->pdev = pdev; platform_set_drvdata(pdev, p); irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; p->base...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/exynos_mct.c
static u64 exynos4_frc_read(struct clocksource *cs) { return exynos4_read_count_32(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/exynos_mct.c
static cycles_t exynos4_read_current_timer(void) { BUILD_BUG_ON_MSG(sizeof(cycles_t) != sizeof(u32), "cycles_t needs to move to 32-bit for ARM64 usage"); return exynos4_read_count_32(); } #endif
[ 1, 0 ]
Linux Kernel
drivers/clocksource/exynos_mct.c
static void exynos4_mct_comp0_start(bool periodic, unsigned long cycles) { unsigned int tcon; u64 comp_cycle; tcon = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON); if (periodic) { tcon |= MCT_G_TCON_COMP0_AUTO_INC; exynos4_mct_write(cycles, EXYNOS4_MCT_G_COMP0_ADD_INCR); } comp_cycle = exynos4_re...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/exynos_mct.c
static void exynos4_mct_tick_start(unsigned long cycles, struct mct_clock_event_device *mevt) { unsigned long tmp; exynos4_mct_tick_stop(mevt); tmp = (1 << 31) | cycles; /* update interrupt count buffer */ exynos4_mct_write(tmp, mevt->base + MCT_L_ICNTB_OFFSET); /* ena...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/exynos_mct.c
static int set_state_periodic(struct clock_event_device *evt) { struct mct_clock_event_device *mevt; unsigned long cycles_per_jiffy; mevt = container_of(evt, struct mct_clock_event_device, evt); cycles_per_jiffy = (((unsigned long long)NSEC_PER_SEC / HZ * evt->mult) >> evt->shift); exynos4_mct_tick_st...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/hyperv_timer.c
void hv_stimer0_isr(void) { struct clock_event_device *ce; ce = this_cpu_ptr(hv_clock_event); ce->event_handler(ce); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/hyperv_timer.c
static u64 notrace read_hv_clock_tsc_cs(struct clocksource *arg) { return read_hv_clock_tsc(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/hyperv_timer.c
static u64 notrace read_hv_clock_msr_cs(struct clocksource *arg) { return read_hv_clock_msr(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/hyperv_timer.c
static bool __init hv_init_tsc_clocksource(void) { union hv_reference_tsc_msr tsc_msr; if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE)) return false; if (ms_hyperv.features & HV_ACCESS_TSC_INVARIANT) { hyperv_cs_tsc.rating = 250; hyperv_cs_msr.rating = 250; } hv_read_reference_counte...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/hyperv_timer.c
void __init hv_remap_tsc_clocksource(void) { if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE)) return; if (!hv_root_partition) { WARN(1, "%s: attempt to remap TSC page in guest partition\n", __func__); return; } tsc_page = memremap(tsc_pfn << HV_HYP_PAGE_SHIFT, sizeof(tsc_pg), MEM...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/i8253.c
int __init clocksource_i8253_init(void) { return clocksource_register_hz(&i8253_cs, PIT_TICK_RATE); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/i8253.c
void __init clockevent_i8253_init(bool oneshot) { if (oneshot) { i8253_clockevent.features |= CLOCK_EVT_FEAT_ONESHOT; i8253_clockevent.set_state_oneshot = pit_set_oneshot; } i8253_clockevent.cpumask = cpumask_of(smp_processor_id()); clockevents_config_and_register(&i8253_clockevent, PIT_TICK_RATE, 0xF...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-ost.c
static u64 notrace ingenic_ost_read_cnth(void) { return readl(ingenic_ost->regs + OST_REG_CNTH); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-ost.c
static u64 notrace ingenic_ost_clocksource_readh(struct clocksource *cs) { return ingenic_ost_read_cnth(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-ost.c
static int ingenic_ost_suspend(struct device *dev) { struct ingenic_ost *ost = dev_get_drvdata(dev); clk_disable(ost->clk); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-sysost.c
static unsigned long ingenic_ost_percpu_timer_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { struct ingenic_ost_clk *ost_clk = to_ost_clk(hw); const struct ingenic_ost_clk_info *info = ost_clk->info; unsigned int prescale; prescale = readl(ost_clk->ost->base +...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/ingenic-sysost.c
static int ingenic_ost_cevt_set_state_shutdown(struct clock_event_device *evt) { struct ingenic_ost *ost = to_ingenic_ost(evt); writel(OSTECR_OST1ENC, ost->base + OST_REG_OSTECR); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-sysost.c
static int __init ingenic_ost_global_timer_init(struct device_node *np, struct ingenic_ost *ost) { unsigned int channel = OST_CLK_GLOBAL_TIMER; struct clocksource *cs = &ost->cs; unsigned long rate; int err; ost->global_timer_clk = ingenic_ost_get_clock(np, cha...
[ 1, 0 ]
Linux Kernel
drivers/clocksource/ingenic-timer.c
static int ingenic_tcu_cevt_set_state_shutdown(struct clock_event_device *evt) { struct ingenic_tcu_timer *timer = to_ingenic_tcu_timer(evt); struct ingenic_tcu *tcu = to_ingenic_tcu(timer); regmap_write(tcu->map, TCU_REG_TECR, BIT(timer->channel)); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-timer.c
static irqreturn_t ingenic_tcu_cevt_cb(int irq, void *dev_id) { struct ingenic_tcu_timer *timer = dev_id; struct ingenic_tcu *tcu = to_ingenic_tcu(timer); call_single_data_t *csd; regmap_write(tcu->map, TCU_REG_TECR, BIT(timer->channel)); if (timer->cevt.event_handler) { csd = &per_cpu(ingenic_cevt_csd...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-timer.c
static int __init ingenic_tcu_probe(struct platform_device *pdev) { platform_set_drvdata(pdev, ingenic_tcu); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/ingenic-timer.c
static int __maybe_unused ingenic_tcu_suspend(struct device *dev) { struct ingenic_tcu *tcu = dev_get_drvdata(dev); unsigned int cpu; clk_disable(tcu->cs_clk); for (cpu = 0; cpu < num_online_cpus(); cpu++) clk_disable(tcu->timers[cpu].clk); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/jcore-pit.c
static notrace u64 jcore_sched_clock_read(void) { u32 seclo, nsec, seclo0; __iomem void *base = jcore_pit_base; seclo = readl(base + REG_SECLO); do { seclo0 = seclo; nsec = readl(base + REG_NSEC); seclo = readl(base + REG_SECLO); } while (seclo0 != seclo); return seclo * NSEC_PER_SEC + nsec; ...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/jcore-pit.c
static u64 jcore_clocksource_read(struct clocksource *cs) { return jcore_sched_clock_read(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/jcore-pit.c
static int jcore_pit_disable(struct jcore_pit *pit) { writel(0, pit->base + REG_PITEN); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/jcore-pit.c
static int jcore_pit_set_state_shutdown(struct clock_event_device *ced) { struct jcore_pit *pit = container_of(ced, struct jcore_pit, ced); return jcore_pit_disable(pit); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mips-gic-timer.c
static irqreturn_t gic_compare_interrupt(int irq, void *dev_id) { struct clock_event_device *cd = dev_id; write_gic_vl_compare(read_gic_vl_compare()); cd->event_handler(cd); return IRQ_HANDLED; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mips-gic-timer.c
static void gic_clockevent_cpu_init(unsigned int cpu, struct clock_event_device *cd) { cd->name = "MIPS GIC"; cd->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP; cd->rating = 350; cd->irq = gic_timer_irq; cd->cpumask = cpumask_of(cpu); cd->set_next_event = gi...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mips-gic-timer.c
static int gic_starting_cpu(unsigned int cpu) { gic_clockevent_cpu_init(cpu, this_cpu_ptr(&gic_clockevent_device)); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mips-gic-timer.c
static u64 gic_hpt_read(struct clocksource *cs) { return gic_read_count(); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mips-gic-timer.c
static void gic_clocksource_unstable(char *reason) { if (gic_clock_unstable) return; gic_clock_unstable = true; pr_info("GIC timer is unstable due to %s\n", reason); clocksource_mark_unstable(&gic_clocksource); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mmio.c
u64 clocksource_mmio_readw_up(struct clocksource *c) { return (u64)readw_relaxed(to_mmio_clksrc(c)->reg); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mps2-timer.c
static inline struct clockevent_mps2 * to_mps2_clkevt(struct clock_event_device *c) { return container_of(c, struct clockevent_mps2, clkevt); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mps2-timer.c
static irqreturn_t mps2_timer_interrupt(int irq, void *dev_id) { struct clockevent_mps2 *ce = dev_id; u32 status = readl_relaxed(ce->reg + TIMER_INT); if (!status) { pr_warn("spurious interrupt\n"); return IRQ_NONE; } writel_relaxed(1, ce->reg + TIMER_INT); ce->clkevt.event_handler(&ce->clkevt);...
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mxs_timer.c
static inline void timrot_irq_enable(void) { __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base + HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_SET); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mxs_timer.c
static void timrot_irq_acknowledge(void) { __raw_writel(BM_TIMROT_TIMCTRLn_IRQ, mxs_timrot_base + HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR); }
[ 0, 0 ]
Linux Kernel
drivers/clocksource/mxs_timer.c
static void mxs_irq_clear(char *state) { timrot_irq_disable(); /* Set event time into the furthest future */ if (timrot_is_v1()) __raw_writel(0xffff, mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)); else __raw_writel(0xffffffff, mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(1)); /* Clear pending interrupt */ ...
[ 0, 0 ]