Lines Matching +full:max +full:- +full:frequency
1 // SPDX-License-Identifier: GPL-2.0-only
41 static int measure_clock(struct adf_accel_dev *accel_dev, u32 *frequency) in measure_clock() argument
58 delta_us = timespec_to_us(&ts2) - timespec_to_us(&ts1); in measure_clock()
59 } while (delta_us > MEASURE_CLOCK_DELTA_THRESHOLD_US && --tries); in measure_clock()
63 return -ETIMEDOUT; in measure_clock()
74 return -EIO; in measure_clock()
77 delta_us = timespec_to_us(&ts4) - timespec_to_us(&ts3); in measure_clock()
78 } while (delta_us > MEASURE_CLOCK_DELTA_THRESHOLD_US && --tries); in measure_clock()
82 return -ETIMEDOUT; in measure_clock()
85 delta_us = timespec_to_us(&ts3) - timespec_to_us(&ts1); in measure_clock()
86 temp = (timestamp2 - timestamp1) * ME_CLK_DIVIDER * 10; in measure_clock()
90 * and avoid promoting r-value to 64-bit before division. in measure_clock()
92 *frequency = temp * (HZ_PER_MHZ / 10); in measure_clock()
98 * adf_dev_measure_clock() - measures device clock frequency
100 * @frequency: Pointer to variable where result will be stored
101 * @min: Minimal allowed frequency value
102 * @max: Maximal allowed frequency value
104 * If the measurement result will go beyond the min/max thresholds the value
111 * * 0 - measurement succeed
112 * * -ETIMEDOUT - measurement failed
115 u32 *frequency, u32 min, u32 max) in adf_dev_measure_clock() argument
124 *frequency = clamp(freq, min, max); in adf_dev_measure_clock()
126 if (*frequency != freq) in adf_dev_measure_clock()
129 freq, *frequency); in adf_dev_measure_clock()