Home
last modified time | relevance | path

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

12345

/drivers/cpufreq/
Dsparc-us2e-cpufreq.c88 unsigned long old_divisor, unsigned long divisor) in frob_mem_refresh() argument
93 refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); in frob_mem_refresh()
120 unsigned long old_divisor, unsigned long divisor) in us2e_transition() argument
125 if (old_divisor == 2 && divisor == 1) { in us2e_transition()
128 frob_mem_refresh(0, clock_tick, old_divisor, divisor); in us2e_transition()
129 } else if (old_divisor == 1 && divisor == 2) { in us2e_transition()
130 frob_mem_refresh(1, clock_tick, old_divisor, divisor); in us2e_transition()
133 } else if (old_divisor == 1 && divisor > 2) { in us2e_transition()
137 2, divisor); in us2e_transition()
138 } else if (old_divisor > 2 && divisor == 1) { in us2e_transition()
[all …]
/drivers/iio/common/hid-sensors/
Dhid-sensor-attributes.c76 static void simple_div(int dividend, int divisor, int *whole, in simple_div() argument
83 if (divisor == 0) { in simple_div()
87 *whole = dividend/divisor; in simple_div()
88 rem = dividend % divisor; in simple_div()
90 while (rem <= divisor) { in simple_div()
94 *micro_frac = (rem / divisor) * int_pow(10, 6 - exp); in simple_div()
100 int divisor = int_pow(10, exp); in split_micro_fraction() local
102 *val1 = no / divisor; in split_micro_fraction()
103 *val2 = no % divisor * int_pow(10, 6 - exp); in split_micro_fraction()
138 int divisor; in convert_to_vtf_format() local
[all …]
/drivers/acpi/acpica/
Dutmath.c257 u32 divisor, u64 *out_quotient, u32 *out_remainder) in acpi_ut_short_divide() argument
267 if (divisor == 0) { in acpi_ut_short_divide()
278 ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor, in acpi_ut_short_divide()
281 ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor, in acpi_ut_short_divide()
316 union uint64_overlay divisor; in acpi_ut_divide() local
334 divisor.full = in_divisor; in acpi_ut_divide()
336 if (divisor.part.hi == 0) { in acpi_ut_divide()
347 ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo, in acpi_ut_divide()
350 ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo, in acpi_ut_divide()
361 normalized_divisor = divisor; in acpi_ut_divide()
[all …]
/drivers/clk/
Dclk-vt8500.c135 u32 divisor; in vt8500_dclk_round_rate() local
140 divisor = *prate / rate; in vt8500_dclk_round_rate()
143 if (rate * divisor < *prate) in vt8500_dclk_round_rate()
144 divisor++; in vt8500_dclk_round_rate()
150 if ((cdev->div_mask == 0x3F) && (divisor > 31)) { in vt8500_dclk_round_rate()
151 divisor = 64 * ((divisor / 64) + 1); in vt8500_dclk_round_rate()
154 return *prate / divisor; in vt8500_dclk_round_rate()
161 u32 divisor; in vt8500_dclk_set_rate() local
167 divisor = parent_rate / rate; in vt8500_dclk_set_rate()
169 if (divisor == cdev->div_mask + 1) in vt8500_dclk_set_rate()
[all …]
/drivers/cpuidle/governors/
Dmenu.c172 int i, divisor; in get_typical_interval() local
184 divisor = 0; in get_typical_interval()
189 divisor++; in get_typical_interval()
205 if (divisor == INTERVALS) in get_typical_interval()
208 avg = div_u64(sum, divisor); in get_typical_interval()
219 if (divisor == INTERVALS) in get_typical_interval()
222 do_div(variance, divisor); in get_typical_interval()
237 if ((((u64)avg*avg > variance*36) && (divisor * 4 >= INTERVALS * 3)) in get_typical_interval()
252 if ((divisor * 4) <= INTERVALS * 3) in get_typical_interval()
/drivers/staging/comedi/drivers/
Dcomedi_8254.c341 i8254->divisor = i8254->next_div & 0xffff; in comedi_8254_update_divisors()
441 unsigned int divisor; in comedi_8254_ns_to_timer() local
446 divisor = DIV_ROUND_CLOSEST(*nanosec, i8254->osc_base); in comedi_8254_ns_to_timer()
449 divisor = DIV_ROUND_UP(*nanosec, i8254->osc_base); in comedi_8254_ns_to_timer()
452 divisor = *nanosec / i8254->osc_base; in comedi_8254_ns_to_timer()
455 if (divisor < 2) in comedi_8254_ns_to_timer()
456 divisor = 2; in comedi_8254_ns_to_timer()
457 if (divisor > I8254_MAX_COUNT) in comedi_8254_ns_to_timer()
458 divisor = I8254_MAX_COUNT; in comedi_8254_ns_to_timer()
460 *nanosec = divisor * i8254->osc_base; in comedi_8254_ns_to_timer()
[all …]
Daddi_apci_3120.c276 unsigned int divisor; in apci3120_ns_to_timer() local
280 divisor = DIV_ROUND_UP(ns, timer_base); in apci3120_ns_to_timer()
283 divisor = ns / timer_base; in apci3120_ns_to_timer()
287 divisor = DIV_ROUND_CLOSEST(ns, timer_base); in apci3120_ns_to_timer()
293 if (divisor > 0x00ffffff) in apci3120_ns_to_timer()
294 divisor = 0x00ffffff; in apci3120_ns_to_timer()
297 if (divisor > 0xffff) in apci3120_ns_to_timer()
298 divisor = 0xffff; in apci3120_ns_to_timer()
301 if (divisor < 2) in apci3120_ns_to_timer()
302 divisor = 2; in apci3120_ns_to_timer()
[all …]
Dadv_pci1760.c179 unsigned int divisor; in pci1760_pwm_ns_to_div() local
183 divisor = DIV_ROUND_CLOSEST(ns, PCI1760_PWM_TIMEBASE); in pci1760_pwm_ns_to_div()
186 divisor = DIV_ROUND_UP(ns, PCI1760_PWM_TIMEBASE); in pci1760_pwm_ns_to_div()
189 divisor = ns / PCI1760_PWM_TIMEBASE; in pci1760_pwm_ns_to_div()
195 if (divisor < 1) in pci1760_pwm_ns_to_div()
196 divisor = 1; in pci1760_pwm_ns_to_div()
197 if (divisor > 0xffff) in pci1760_pwm_ns_to_div()
198 divisor = 0xffff; in pci1760_pwm_ns_to_div()
200 return divisor; in pci1760_pwm_ns_to_div()
/drivers/usb/serial/
Doti6858.c76 __le16 divisor; /* baud rate = 96000000 / (16 * divisor), LE */ member
114 (((a)->divisor == (priv)->pending_setup.divisor) \
181 __le16 divisor; member
228 new_setup->divisor = priv->pending_setup.divisor; in setup_line()
406 __le16 divisor; in oti6858_set_termios() local
412 divisor = priv->pending_setup.divisor; in oti6858_set_termios()
441 divisor = 0; in oti6858_set_termios()
449 divisor = cpu_to_le16(new_divisor); in oti6858_set_termios()
491 if (divisor != priv->pending_setup.divisor in oti6858_set_termios()
494 priv->pending_setup.divisor = divisor; in oti6858_set_termios()
[all …]
/drivers/gpu/drm/amd/display/dc/basics/
Dconversion.c40 int32_t divisor = 1 << fractional_bits; in fixed_point_to_int_frac() local
48 if (d <= (uint16_t)(1 << integer_bits) - (1 / (uint16_t)divisor)) in fixed_point_to_int_frac()
52 divisor)); in fixed_point_to_int_frac()
60 divisor)))); in fixed_point_to_int_frac()
/drivers/watchdog/
Dzx2967_wdt.c84 unsigned int divisor = ZX2967_WDT_DIV_DEFAULT; in zx2967_wdt_set_timeout() local
88 if (count > divisor * ZX2967_WDT_MAX_COUNT) in zx2967_wdt_set_timeout()
89 divisor = DIV_ROUND_UP(count, ZX2967_WDT_MAX_COUNT); in zx2967_wdt_set_timeout()
90 count = DIV_ROUND_UP(count, divisor); in zx2967_wdt_set_timeout()
92 ZX2967_WDT_CFG_DIV(divisor) & ZX2967_WDT_VAL_MASK); in zx2967_wdt_set_timeout()
96 wdd->timeout = (count * divisor) / ZX2967_WDT_CLK_FREQ; in zx2967_wdt_set_timeout()
Docteon-wdt-main.c69 static int divisor; variable
449 timeout_cnt = ((octeon_get_io_clock_rate() / divisor) * timeout_sec) >> 8; in octeon_wdt_calc_parameters()
531 divisor = 0x200; in octeon_wdt_init()
533 divisor = 0x400; in octeon_wdt_init()
535 divisor = 0x100; in octeon_wdt_init()
548 timeout_cnt = ((octeon_get_io_clock_rate() / divisor) * max_timeout_sec) >> 8; in octeon_wdt_init()
Ds3c2410_wdt.c305 unsigned int divisor = 1; in s3c2410wdt_set_heartbeat() local
323 divisor = DIV_ROUND_UP(count, 0xffff); in s3c2410wdt_set_heartbeat()
325 if (divisor > 0x100) { in s3c2410wdt_set_heartbeat()
332 timeout, divisor, count, DIV_ROUND_UP(count, divisor)); in s3c2410wdt_set_heartbeat()
334 count = DIV_ROUND_UP(count, divisor); in s3c2410wdt_set_heartbeat()
340 wtcon |= S3C2410_WTCON_PRESCALE(divisor-1); in s3c2410wdt_set_heartbeat()
345 wdd->timeout = (count * divisor) / freq; in s3c2410wdt_set_heartbeat()
/drivers/staging/sm750fb/
Dddk750_chip.c87 unsigned int reg, divisor; in set_memory_clock() local
105 divisor = DIV_ROUND_CLOSEST(get_mxclk_freq(), frequency); in set_memory_clock()
109 switch (divisor) { in set_memory_clock()
139 unsigned int reg, divisor; in set_master_clock() local
157 divisor = DIV_ROUND_CLOSEST(get_mxclk_freq(), frequency); in set_master_clock()
161 switch (divisor) { in set_master_clock()
/drivers/mfd/
Dmcp-sa11x0.c45 mcp_sa11x0_set_telecom_divisor(struct mcp *mcp, unsigned int divisor) in mcp_sa11x0_set_telecom_divisor() argument
49 divisor /= 32; in mcp_sa11x0_set_telecom_divisor()
52 m->mccr0 |= divisor << 8; in mcp_sa11x0_set_telecom_divisor()
57 mcp_sa11x0_set_audio_divisor(struct mcp *mcp, unsigned int divisor) in mcp_sa11x0_set_audio_divisor() argument
61 divisor /= 32; in mcp_sa11x0_set_audio_divisor()
64 m->mccr0 |= divisor; in mcp_sa11x0_set_audio_divisor()
/drivers/soc/fsl/qe/
Dqe.c211 u32 divisor, tempval; in qe_setbrg() local
217 divisor = qe_get_brg_clk() / (rate * multiplier); in qe_setbrg()
219 if (divisor > QE_BRGC_DIVISOR_MAX + 1) { in qe_setbrg()
221 divisor /= 16; in qe_setbrg()
228 if (!div16 && (divisor & 1) && (divisor > 3)) in qe_setbrg()
229 divisor++; in qe_setbrg()
231 tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) | in qe_setbrg()
/drivers/net/wireless/ath/ath9k/
Dcommon-beacon.c24 unsigned int offset, divisor; in ath9k_get_next_tbtt() local
27 divisor = TU_TO_USEC(interval); in ath9k_get_next_tbtt()
28 div_u64_rem(tsf, divisor, &offset); in ath9k_get_next_tbtt()
30 return (u32) tsf + divisor - offset; in ath9k_get_next_tbtt()
/drivers/i2c/busses/
Di2c-aspeed.c152 u32 divisor);
817 u32 divisor) in aspeed_i2c_get_clk_reg_val() argument
850 base_clk_divisor = divisor > clk_high_low_max ? in aspeed_i2c_get_clk_reg_val()
851 ilog2((divisor - 1) / clk_high_low_max) + 1 : 0; in aspeed_i2c_get_clk_reg_val()
859 divisor, (1 << base_clk_divisor) * clk_high_low_max); in aspeed_i2c_get_clk_reg_val()
861 tmp = (divisor + (1 << base_clk_divisor) - 1) in aspeed_i2c_get_clk_reg_val()
882 static u32 aspeed_i2c_24xx_get_clk_reg_val(struct device *dev, u32 divisor) in aspeed_i2c_24xx_get_clk_reg_val() argument
888 return aspeed_i2c_get_clk_reg_val(dev, GENMASK(2, 0), divisor); in aspeed_i2c_24xx_get_clk_reg_val()
891 static u32 aspeed_i2c_25xx_get_clk_reg_val(struct device *dev, u32 divisor) in aspeed_i2c_25xx_get_clk_reg_val() argument
897 return aspeed_i2c_get_clk_reg_val(dev, GENMASK(3, 0), divisor); in aspeed_i2c_25xx_get_clk_reg_val()
[all …]
/drivers/input/serio/
Dambakmi.c31 unsigned int divisor; member
67 unsigned int divisor; in amba_kmi_open() local
74 divisor = clk_get_rate(kmi->clk) / 8000000 - 1; in amba_kmi_open()
75 writeb(divisor, KMICLKDIV); in amba_kmi_open()
/drivers/mmc/host/
Dtmio_mmc.c53 unsigned int divisor; in tmio_mmc_set_clock() local
62 divisor = host->pdata->hclk / new_clock; in tmio_mmc_set_clock()
65 clk_sel = (divisor <= 1); in tmio_mmc_set_clock()
66 clk = clk_sel ? 0 : (roundup_pow_of_two(divisor) >> 2); in tmio_mmc_set_clock()
/drivers/vlynq/
Dvlynq.c318 vdev->divisor = ids->divisor; in vlynq_device_match()
404 dev->divisor = i; in __vlynq_try_remote()
441 dev->divisor = i; in __vlynq_try_local()
474 dev->divisor = vlynq_div_external; in __vlynq_try_external()
490 switch (dev->divisor) { in __vlynq_enable_device()
519 VLYNQ_CTRL_CLOCK_DIV(dev->divisor - in __vlynq_enable_device()
526 dev->divisor - vlynq_ldiv1 + 1); in __vlynq_enable_device()
540 VLYNQ_CTRL_CLOCK_DIV(dev->divisor - in __vlynq_enable_device()
546 dev->divisor - vlynq_rdiv1 + 1); in __vlynq_enable_device()
726 dev->divisor = vlynq_div_auto; in vlynq_probe()
/drivers/power/reset/
Dqnap-poweroff.c56 const unsigned divisor = ((tclk + (8 * cfg->baud)) / (16 * cfg->baud)); in qnap_power_off() local
62 writel(divisor & 0xff, UART1_REG(DLL)); in qnap_power_off()
63 writel((divisor >> 8) & 0xff, UART1_REG(DLM)); in qnap_power_off()
/drivers/media/tuners/
Dmax2165.c150 static int fixpt_div32(u32 dividend, u32 divisor, u32 *quotient, u32 *fraction) in fixpt_div32() argument
156 if (0 == divisor) in fixpt_div32()
159 q = dividend / divisor; in fixpt_div32()
160 remainder = dividend - q * divisor; in fixpt_div32()
164 if (remainder >= divisor) { in fixpt_div32()
166 remainder -= divisor; in fixpt_div32()
/drivers/tty/serial/
Dmpc52xx_uart.c123 u16 prescaler, unsigned int divisor) in mpc52xx_set_divisor() argument
127 out_8(&psc->ctur, divisor >> 8); in mpc52xx_set_divisor()
128 out_8(&psc->ctlr, divisor & 0xff); in mpc52xx_set_divisor()
291 unsigned int divisor; in mpc5200_psc_set_baudrate() local
297 divisor = (port->uartclk + 16 * baud) / (32 * baud); in mpc5200_psc_set_baudrate()
300 mpc52xx_set_divisor(PSC(port), 0xdd00, divisor); in mpc5200_psc_set_baudrate()
309 unsigned int divisor; in mpc5200b_psc_set_baudrate() local
317 divisor = (port->uartclk + 2 * baud) / (4 * baud); in mpc5200b_psc_set_baudrate()
321 if (divisor > 0xffff || baud <= 115200) { in mpc5200b_psc_set_baudrate()
322 divisor = (divisor + 4) / 8; in mpc5200b_psc_set_baudrate()
[all …]
/drivers/tty/serial/8250/
D8250_early.c137 unsigned int divisor; in init_port() local
148 divisor = DIV_ROUND_CLOSEST(port->uartclk, 16 * device->baud); in init_port()
151 serial8250_early_out(port, UART_DLL, divisor & 0xff); in init_port()
152 serial8250_early_out(port, UART_DLM, (divisor >> 8) & 0xff); in init_port()

12345