Lines Matching +full:max +full:- +full:clk +full:- +full:rate +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2014 Oleksij Rempel <linux@rempel-privat.de>
10 #include <linux/clk.h>
19 #define DRIVER_NAME "asm9260-timer"
23 * 0x0 - plain read write mode
24 * 0x4 - set mode, OR logic.
25 * 0x8 - clr mode, XOR logic.
26 * 0xc - togle mode.
48 * 1 - Timer Counter and Prescale Counter are enabled for counting
49 * 0 - counters are disabled */
56 /* 00 - count up
57 * 01 - count down
58 * 10 - ?? 2^n/2 */
171 evt->event_handler(evt); in asm9260_timer_interrupt()
179 * ---------------------------------------------------------------------------
181 * ---------------------------------------------------------------------------
186 struct clk *clk; in asm9260_timer_init() local
188 unsigned long rate; in asm9260_timer_init() local
190 priv.base = of_io_request_and_map(np, 0, np->name); in asm9260_timer_init()
196 clk = of_clk_get(np, 0); in asm9260_timer_init()
197 if (IS_ERR(clk)) { in asm9260_timer_init()
198 pr_err("Failed to get clk!\n"); in asm9260_timer_init()
199 return PTR_ERR(clk); in asm9260_timer_init()
202 ret = clk_prepare_enable(clk); in asm9260_timer_init()
204 pr_err("Failed to enable clk!\n"); in asm9260_timer_init()
216 /* set all timers for count-up */ in asm9260_timer_init()
225 rate = clk_get_rate(clk); in asm9260_timer_init()
226 clocksource_mmio_init(priv.base + HW_TC1, DRIVER_NAME, rate, in asm9260_timer_init()
230 * actions for MR are disabled. So, set MR to max value. */ in asm9260_timer_init()
235 priv.ticks_per_jiffy = DIV_ROUND_CLOSEST(rate, HZ); in asm9260_timer_init()
237 clockevents_config_and_register(&event_dev, rate, 0x2c00, 0xfffffffe); in asm9260_timer_init()
241 TIMER_OF_DECLARE(asm9260_timer, "alphascale,asm9260-timer",