Lines Matching +full:cs +full:- +full:to +full:- +full:clk
1 // SPDX-License-Identifier: GPL-2.0-only
3 * timer-ti-32k.c - OMAP2 32k Timer Support
7 * Update to use new clocksource/clockevent layers
15 * OMAP Dual-mode timer framework support by Timo Teras
19 * Copyright (C) 2004-2009 Texas Instruments, Inc.
22 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
24 * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com
27 #include <linux/clk.h>
38 * higher resolution in free-running counter modes (e.g. 12 MHz xtal),
39 * but systems won't necessarily want to spend resources that way.
50 struct clocksource cs; member
53 static inline struct ti_32k *to_ti_32k(struct clocksource *cs) in to_ti_32k() argument
55 return container_of(cs, struct ti_32k, cs); in to_ti_32k()
58 static u64 notrace ti_32k_read_cycles(struct clocksource *cs) in ti_32k_read_cycles() argument
60 struct ti_32k *ti = to_ti_32k(cs); in ti_32k_read_cycles()
62 return (u64)readl_relaxed(ti->counter); in ti_32k_read_cycles()
66 .cs = {
77 return ti_32k_read_cycles(&ti_32k_timer.cs); in omap_32k_read_sched_clock()
83 struct clk *clock; in ti_32k_timer_enable_clock()
86 clock = of_clk_get_by_name(np->parent, name); in ti_32k_timer_enable_clock()
89 if (PTR_ERR(clock) == -EINVAL && !strncmp("ick", name, 3)) in ti_32k_timer_enable_clock()
110 if (!of_device_is_compatible(np->parent, "ti,sysc")) in ti_32k_timer_module_init()
118 * No need to tag the module disabled for ti-sysc probe. in ti_32k_timer_module_init()
130 return -ENXIO; in ti_32k_timer_init()
134 ti_32k_timer.cs.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP; in ti_32k_timer_init()
143 * The 'SCHEME' bits(30-31) of the revision register is used to identify in ti_32k_timer_init()
154 ret = clocksource_register_hz(&ti_32k_timer.cs, 32768); in ti_32k_timer_init()
164 TIMER_OF_DECLARE(ti_32k_timer, "ti,omap-counter32k",