Lines Matching +full:clk +full:- +full:out +full:- +full:frequency +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0-only
10 #include <linux/clk.h>
28 static struct clk *twd_clk;
37 static int twd_shutdown(struct clock_event_device *clk) in twd_shutdown() argument
43 static int twd_set_oneshot(struct clock_event_device *clk) in twd_set_oneshot() argument
51 static int twd_set_periodic(struct clock_event_device *clk) in twd_set_periodic() argument
57 writel_relaxed(DIV_ROUND_CLOSEST(twd_timer_rate, HZ), in twd_set_periodic()
94 struct clock_event_device *clk = raw_cpu_ptr(twd_evt); in twd_timer_stop() local
96 twd_shutdown(clk); in twd_timer_stop()
97 disable_percpu_irq(clk->irq); in twd_timer_stop()
101 * Updates clockevent frequency when the cpu frequency changes.
102 * Called on the cpu that is changing frequency with interrupts disabled.
118 * frequency. The timer is local to a cpu, so cross-call to the in twd_rate_change()
123 (void *)&cnd->new_rate, 1); in twd_rate_change()
147 * If this is the first time round, we need to work out how fast in twd_calibrate_rate()
173 twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5); in twd_calibrate_rate()
185 evt->event_handler(evt); in twd_handler()
221 struct clock_event_device *clk = raw_cpu_ptr(twd_evt); in twd_timer_setup() local
230 clockevents_register_device(clk); in twd_timer_setup()
231 enable_percpu_irq(clk->irq, 0); in twd_timer_setup()
244 clk->name = "local_timer"; in twd_timer_setup()
245 clk->features = twd_features; in twd_timer_setup()
246 clk->rating = 350; in twd_timer_setup()
247 clk->set_state_shutdown = twd_shutdown; in twd_timer_setup()
248 clk->set_state_periodic = twd_set_periodic; in twd_timer_setup()
249 clk->set_state_oneshot = twd_set_oneshot; in twd_timer_setup()
250 clk->tick_resume = twd_shutdown; in twd_timer_setup()
251 clk->set_next_event = twd_set_next_event; in twd_timer_setup()
252 clk->irq = twd_ppi; in twd_timer_setup()
253 clk->cpumask = cpumask_of(cpu); in twd_timer_setup()
255 clockevents_config_and_register(clk, twd_timer_rate, in twd_timer_setup()
257 enable_percpu_irq(clk->irq, 0); in twd_timer_setup()
278 err = -ENOMEM; in twd_local_timer_common_register()
293 if (!of_property_read_bool(np, "always-on")) in twd_local_timer_common_register()
322 err = -EINVAL; in twd_local_timer_of_register()
323 goto out; in twd_local_timer_of_register()
328 err = -ENOMEM; in twd_local_timer_of_register()
329 goto out; in twd_local_timer_of_register()
334 out: in twd_local_timer_of_register()
338 TIMER_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
339 TIMER_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
340 TIMER_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);