Lines Matching +full:cs +full:- +full:2
1 /* SPDX-License-Identifier: GPL-2.0 */
36 * struct clocksource - hardware abstraction for a free running counter
37 * Provides mostly state-free accessors to the underlying hardware.
49 * @archdata: Optional arch-specific data
60 * 1-99: Unfit for real use
62 * 100-199: Base level usability.
64 * 200-299: Good.
66 * 300-399: Desired.
68 * 400-499: Perfect
69 * The ideal clocksource. A must-use where
102 u64 (*read)(struct clocksource *cs);
123 int (*enable)(struct clocksource *cs);
124 void (*disable)(struct clocksource *cs);
125 void (*suspend)(struct clocksource *cs);
126 void (*resume)(struct clocksource *cs);
127 void (*mark_unstable)(struct clocksource *cs);
128 void (*tick_stable)(struct clocksource *cs);
153 #define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
158 * mult/2^shift = ns/cyc in clocksource_freq2mult()
159 * mult = ns/cyc * 2^shift in clocksource_freq2mult()
160 * mult = from/freq * 2^shift in clocksource_freq2mult()
161 * mult = from * 2^shift / freq in clocksource_freq2mult()
166 tmp += freq/2; /* round for do_div */ in clocksource_freq2mult()
173 * clocksource_khz2mult - calculates mult from khz and shift
186 * clocksource_hz2mult - calculates mult from hz and shift
200 * clocksource_cyc2ns - converts clocksource cycles to nanoseconds
210 * XXX - This could use some mult_lxl_ll() asm optimization
223 extern void clocksource_mark_unstable(struct clocksource *cs);
225 clocksource_start_suspend_timing(struct clocksource *cs, u64 start_cycles);
226 extern u64 clocksource_stop_suspend_timing(struct clocksource *cs, u64 now);
238 __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
240 __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq);
246 static inline int __clocksource_register(struct clocksource *cs) in __clocksource_register() argument
248 return __clocksource_register_scale(cs, 1, 0); in __clocksource_register()
251 static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) in clocksource_register_hz() argument
253 return __clocksource_register_scale(cs, 1, hz); in clocksource_register_hz()
256 static inline int clocksource_register_khz(struct clocksource *cs, u32 khz) in clocksource_register_khz() argument
258 return __clocksource_register_scale(cs, 1000, khz); in clocksource_register_khz()
261 static inline void __clocksource_update_freq_hz(struct clocksource *cs, u32 hz) in __clocksource_update_freq_hz() argument
263 __clocksource_update_freq_scale(cs, 1, hz); in __clocksource_update_freq_hz()
266 static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz) in __clocksource_update_freq_khz() argument
268 __clocksource_update_freq_scale(cs, 1000, khz); in __clocksource_update_freq_khz()
272 extern void clocksource_arch_init(struct clocksource *cs);
274 static inline void clocksource_arch_init(struct clocksource *cs) { } in clocksource_arch_init() argument
311 return (ilog2(num_online_cpus()) / 2) + 1; in clocksource_get_max_watchdog_retry()
314 void clocksource_verify_percpu(struct clocksource *cs);
317 * struct clocksource_base - hardware abstraction for clock on which a clocksource