Lines Matching +full:enable +full:- +full:frequency +full:- +full:shift

1 /* SPDX-License-Identifier: GPL-2.0 */
35 * struct clocksource - hardware abstraction for a free running counter
36 * Provides mostly state-free accessors to the underlying hardware.
43 * @shift: Cycle to nanosecond divisor (power of two)
48 * @archdata: Optional arch-specific data
57 * 1-99: Unfit for real use
59 * 100-199: Base level usability.
61 * 200-299: Good.
63 * 300-399: Desired.
65 * 400-499: Perfect
66 * The ideal clocksource. A must-use where
73 * @enable: Optional function to enable the clocksource
100 u32 shift; member
115 int (*enable)(struct clocksource *cs); member
145 #define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
150 * mult/2^shift = ns/cyc in clocksource_freq2mult()
151 * mult = ns/cyc * 2^shift in clocksource_freq2mult()
152 * mult = from/freq * 2^shift in clocksource_freq2mult()
153 * mult = from * 2^shift / freq in clocksource_freq2mult()
154 * mult = (from<<shift) / freq in clocksource_freq2mult()
165 * clocksource_khz2mult - calculates mult from khz and shift
166 * @khz: Clocksource frequency in KHz
167 * @shift_constant: Clocksource shift factor
169 * Helper functions that converts a khz counter frequency to a timsource
170 * multiplier, given the clocksource shift value
178 * clocksource_hz2mult - calculates mult from hz and shift
179 * @hz: Clocksource frequency in Hz
180 * @shift_constant: Clocksource shift factor
183 * frequency to a timsource multiplier, given the
184 * clocksource shift value
192 * clocksource_cyc2ns - converts clocksource cycles to nanoseconds
195 * @shift: cycle to nanosecond divisor (power of two)
197 * Converts clocksource cycles to nanoseconds, using the given @mult and @shift.
202 * XXX - This could use some mult_lxl_ll() asm optimization
204 static inline s64 clocksource_cyc2ns(u64 cycles, u32 mult, u32 shift) in clocksource_cyc2ns() argument
206 return ((u64) cycles * mult) >> shift; in clocksource_cyc2ns()
222 clocks_calc_max_nsecs(u32 mult, u32 shift, u32 maxadj, u64 mask, u64 *max_cycles);
224 clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);