Lines Matching +full:max +full:- +full:freq
1 // SPDX-License-Identifier: GPL-2.0-only
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()
87 return -EINVAL; in measure_clock()
89 temp = (timestamp2 - timestamp1) * ME_CLK_DIVIDER * 10; in measure_clock()
93 * and avoid promoting r-value to 64-bit before division. in measure_clock()
101 * adf_dev_measure_clock() - measures device clock frequency
105 * @max: Maximal allowed frequency value
107 * If the measurement result will go beyond the min/max thresholds the value
114 * * 0 - measurement succeed
115 * * -ETIMEDOUT - measurement failed
118 u32 *frequency, u32 min, u32 max) in adf_dev_measure_clock() argument
121 u32 freq; in adf_dev_measure_clock() local
123 ret = measure_clock(accel_dev, &freq); in adf_dev_measure_clock()
127 *frequency = clamp(freq, min, max); in adf_dev_measure_clock()
129 if (*frequency != freq) in adf_dev_measure_clock()
132 freq, *frequency); in adf_dev_measure_clock()