Home
last modified time | relevance | path

Searched refs:divisor (Results 1 – 25 of 31) sorted by relevance

12

/linux-4.19.296/lib/
Ddiv64.c71 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
76 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
78 if (divisor > 0) in div_s64_rem()
81 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
82 if (divisor < 0) in div_s64_rem()
102 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
104 u32 high = divisor >> 32; in div64_u64_rem()
109 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem()
113 quot = div_u64(dividend >> n, divisor >> n); in div64_u64_rem()
118 *remainder = dividend - quot * divisor; in div64_u64_rem()
[all …]
Dstring_helpers.c46 static const unsigned int divisor[] = { in string_get_size() local
75 do_div(blk_size, divisor[units]); in string_get_size()
80 do_div(size, divisor[units]); in string_get_size()
89 while (size >= divisor[units]) { in string_get_size()
90 remainder = do_div(size, divisor[units]); in string_get_size()
/linux-4.19.296/include/linux/
Dmath64.h24 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
26 *remainder = dividend % divisor; in div_u64_rem()
27 return dividend / divisor; in div_u64_rem()
38 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
40 *remainder = dividend % divisor; in div_s64_rem()
41 return dividend / divisor; in div_s64_rem()
52 static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
54 *remainder = dividend % divisor; in div64_u64_rem()
55 return dividend / divisor; in div64_u64_rem()
65 static inline u64 div64_u64(u64 dividend, u64 divisor) in div64_u64() argument
[all …]
Dvlynq.h57 enum vlynq_divisor divisor; member
66 enum vlynq_divisor divisor; member
Dkernel.h167 #define DIV_ROUND_CLOSEST(x, divisor)( \ argument
170 typeof(divisor) __d = divisor; \
172 ((typeof(divisor))-1) > 0 || \
182 #define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ argument
184 typeof(divisor) __d = divisor; \
/linux-4.19.296/drivers/cpufreq/
Dsparc-us2e-cpufreq.c87 unsigned long old_divisor, unsigned long divisor) in frob_mem_refresh() argument
92 refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); in frob_mem_refresh()
119 unsigned long old_divisor, unsigned long divisor) in us2e_transition() argument
124 if (old_divisor == 2 && divisor == 1) { in us2e_transition()
127 frob_mem_refresh(0, clock_tick, old_divisor, divisor); in us2e_transition()
128 } else if (old_divisor == 1 && divisor == 2) { in us2e_transition()
129 frob_mem_refresh(1, clock_tick, old_divisor, divisor); in us2e_transition()
132 } else if (old_divisor == 1 && divisor > 2) { in us2e_transition()
136 2, divisor); in us2e_transition()
137 } else if (old_divisor > 2 && divisor == 1) { in us2e_transition()
[all …]
/linux-4.19.296/drivers/clk/
Dclk-vt8500.c144 u32 divisor; in vt8500_dclk_round_rate() local
149 divisor = *prate / rate; in vt8500_dclk_round_rate()
152 if (rate * divisor < *prate) in vt8500_dclk_round_rate()
153 divisor++; in vt8500_dclk_round_rate()
159 if ((cdev->div_mask == 0x3F) && (divisor > 31)) { in vt8500_dclk_round_rate()
160 divisor = 64 * ((divisor / 64) + 1); in vt8500_dclk_round_rate()
163 return *prate / divisor; in vt8500_dclk_round_rate()
170 u32 divisor; in vt8500_dclk_set_rate() local
176 divisor = parent_rate / rate; in vt8500_dclk_set_rate()
178 if (divisor == cdev->div_mask + 1) in vt8500_dclk_set_rate()
[all …]
/linux-4.19.296/drivers/cpuidle/governors/
Dmenu.c202 int i, divisor; in get_typical_interval() local
213 divisor = 0; in get_typical_interval()
218 divisor++; in get_typical_interval()
223 if (divisor == INTERVALS) in get_typical_interval()
226 avg = div_u64(sum, divisor); in get_typical_interval()
237 if (divisor == INTERVALS) in get_typical_interval()
240 do_div(variance, divisor); in get_typical_interval()
255 if ((((u64)avg*avg > variance*36) && (divisor * 4 >= INTERVALS * 3)) in get_typical_interval()
270 if ((divisor * 4) <= INTERVALS * 3) in get_typical_interval()
/linux-4.19.296/drivers/i2c/busses/
Di2c-aspeed.c141 u32 divisor);
692 u32 divisor) in aspeed_i2c_get_clk_reg_val() argument
725 base_clk_divisor = divisor > clk_high_low_max ? in aspeed_i2c_get_clk_reg_val()
726 ilog2((divisor - 1) / clk_high_low_max) + 1 : 0; in aspeed_i2c_get_clk_reg_val()
734 divisor, (1 << base_clk_divisor) * clk_high_low_max); in aspeed_i2c_get_clk_reg_val()
736 tmp = (divisor + (1 << base_clk_divisor) - 1) in aspeed_i2c_get_clk_reg_val()
757 static u32 aspeed_i2c_24xx_get_clk_reg_val(struct device *dev, u32 divisor) in aspeed_i2c_24xx_get_clk_reg_val() argument
763 return aspeed_i2c_get_clk_reg_val(dev, GENMASK(2, 0), divisor); in aspeed_i2c_24xx_get_clk_reg_val()
766 static u32 aspeed_i2c_25xx_get_clk_reg_val(struct device *dev, u32 divisor) in aspeed_i2c_25xx_get_clk_reg_val() argument
772 return aspeed_i2c_get_clk_reg_val(dev, GENMASK(3, 0), divisor); in aspeed_i2c_25xx_get_clk_reg_val()
[all …]
Di2c-altera.c157 u32 divisor = clk_get_rate(idev->i2c_clk) / idev->bus_clk_rate; in altr_i2c_init() local
166 t_high = divisor * 1 / 2; in altr_i2c_init()
167 t_low = divisor * 1 / 2; in altr_i2c_init()
171 t_high = divisor * 1 / 3; in altr_i2c_init()
172 t_low = divisor * 2 / 3; in altr_i2c_init()
177 idev->bus_clk_rate, clk_mhz, divisor); in altr_i2c_init()
Di2c-axxia.c136 u32 divisor = clk_get_rate(idev->i2c_clk) / idev->bus_clk_rate; in axxia_i2c_init() local
145 idev->bus_clk_rate, clk_mhz, divisor); in axxia_i2c_init()
162 t_high = divisor * 1 / 2; in axxia_i2c_init()
163 t_low = divisor * 1 / 2; in axxia_i2c_init()
167 t_high = divisor * 1 / 3; in axxia_i2c_init()
168 t_low = divisor * 2 / 3; in axxia_i2c_init()
/linux-4.19.296/drivers/media/tuners/
Dmax2165.c160 static int fixpt_div32(u32 dividend, u32 divisor, u32 *quotient, u32 *fraction) in fixpt_div32() argument
166 if (0 == divisor) in fixpt_div32()
169 q = dividend / divisor; in fixpt_div32()
170 remainder = dividend - q * divisor; in fixpt_div32()
174 if (remainder >= divisor) { in fixpt_div32()
176 remainder -= divisor; in fixpt_div32()
Dtda18271-fe.c577 s32 divisor, dividend; in tda18271_rf_tracking_filters_init() local
623 divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000; in tda18271_rf_tracking_filters_init()
624 map[i].rf_a1 = (dividend / divisor); in tda18271_rf_tracking_filters_init()
630 divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000; in tda18271_rf_tracking_filters_init()
631 map[i].rf_a2 = (dividend / divisor); in tda18271_rf_tracking_filters_init()
/linux-4.19.296/drivers/iio/gyro/
Dmpu3050-core.c185 freq /= (mpu3050->divisor + 1); in mpu3050_get_freq()
227 ret = regmap_write(mpu3050->map, MPU3050_SMPLRT_DIV, mpu3050->divisor); in mpu3050_start_sampling()
244 u8 divisor; in mpu3050_set_8khz_samplerate() local
248 divisor = mpu3050->divisor; in mpu3050_set_8khz_samplerate()
251 mpu3050->divisor = 0; /* Divide by 1 */ in mpu3050_set_8khz_samplerate()
255 mpu3050->divisor = divisor; in mpu3050_set_8khz_samplerate()
417 mpu3050->divisor = DIV_ROUND_CLOSEST(8000, val) - 1; in mpu3050_write_raw()
422 mpu3050->divisor = DIV_ROUND_CLOSEST(1000, val) - 1; in mpu3050_write_raw()
1162 mpu3050->divisor = 99; in mpu3050_common_probe()
Dmpu3050.h77 u8 divisor; member
/linux-4.19.296/drivers/clk/versatile/
Dicst.c33 u32 divisor = (vco.r + 2) * p->s2div[vco.s]; in icst_hz() local
35 do_div(dividend, divisor); in icst_hz()
/linux-4.19.296/drivers/iio/common/hid-sensors/
Dhid-sensor-attributes.c94 static void simple_div(int dividend, int divisor, int *whole, in simple_div() argument
101 if (divisor == 0) { in simple_div()
105 *whole = dividend/divisor; in simple_div()
106 rem = dividend % divisor; in simple_div()
108 while (rem <= divisor) { in simple_div()
112 *micro_frac = (rem / divisor) * pow_10(6-exp); in simple_div()
/linux-4.19.296/drivers/clk/meson/
Dclk-mpll.c31 unsigned long divisor = (SDM_DEN * n2) + sdm; in rate_from_params() local
36 return DIV_ROUND_UP_ULL((u64)parent_rate * SDM_DEN, divisor); in rate_from_params()
/linux-4.19.296/drivers/clk/mmp/
Dclk-mix.c128 item->divisor = parent_rate / item->rate; in _filter_clk_table()
230 mix_rate = parent_rate / item->divisor; in mmp_clk_mix_determine_rate()
364 div_val = _get_div_val(mix, item->divisor); in mmp_clk_set_parent()
397 && item->divisor == best_divisor) in mmp_clk_set_rate()
403 _get_div_val(mix, item->divisor), in mmp_clk_set_rate()
Dclk.h70 unsigned int divisor; member
/linux-4.19.296/fs/ubifs/
Dbudget.c638 int divisor, factor, f; in ubifs_reported_space() local
655 divisor = UBIFS_MAX_DATA_NODE_SZ; in ubifs_reported_space()
656 divisor += (c->max_idx_node_sz * 3) / (f - 1); in ubifs_reported_space()
658 return div_u64(free, divisor); in ubifs_reported_space()
/linux-4.19.296/drivers/clk/pistachio/
Dclk-pll.c97 static inline u64 do_div_round_closest(u64 dividend, u64 divisor) in do_div_round_closest() argument
99 dividend += divisor / 2; in do_div_round_closest()
100 return div64_u64(dividend, divisor); in do_div_round_closest()
/linux-4.19.296/drivers/media/rc/
Dredrat3.c318 u32 divisor = (RR3_CLK_CONV_FACTOR) / 1000; in redrat3_len_to_us() local
319 u32 result = (u32) (biglen / divisor); in redrat3_len_to_us()
339 u32 divisor; in redrat3_us_to_len() local
342 divisor = (RR3_CLK_CONV_FACTOR / 1000); in redrat3_us_to_len()
343 result = (u32)(microsec * divisor) / 1000; in redrat3_us_to_len()
/linux-4.19.296/include/asm-generic/
Ddiv64.h213 extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
/linux-4.19.296/drivers/iio/adc/
Dvf610_adc.c198 int divisor, i; in vf610_adc_calculate_rates() local
204 divisor = ipg_rate / adck_rate; in vf610_adc_calculate_rates()
205 adc_feature->clk_div = 1 << fls(divisor + 1); in vf610_adc_calculate_rates()

12