Home
last modified time | relevance | path

Searched refs:prescale (Results 1 – 25 of 62) sorted by relevance

123

/linux-6.6.21/drivers/iio/adc/
Dqcom-vadc-common.c305 const struct u32_fract *prescale,
309 const struct u32_fract *prescale,
313 const struct u32_fract *prescale,
317 const struct u32_fract *prescale,
321 const struct u32_fract *prescale,
325 const struct u32_fract *prescale,
329 const struct u32_fract *prescale,
409 const struct u32_fract *prescale, in qcom_vadc_scale_volt() argument
417 voltage *= prescale->denominator; in qcom_vadc_scale_volt()
418 result = div64_s64(voltage, prescale->numerator); in qcom_vadc_scale_volt()
[all …]
/linux-6.6.21/drivers/pwm/
Dpwm-rz-mtu3.c81 u8 prescale[RZ_MTU3_MAX_HW_CHANNELS]; member
118 u8 prescale; in rz_mtu3_pwm_calculate_prescale() local
126 prescale = 3; in rz_mtu3_pwm_calculate_prescale()
128 prescale = (fls(prescaled_period_cycles) + 1) / 2; in rz_mtu3_pwm_calculate_prescale()
130 return prescale; in rz_mtu3_pwm_calculate_prescale()
284 u8 prescale, val; in rz_mtu3_pwm_get_state() local
297 prescale = FIELD_GET(RZ_MTU3_TCR_TPCS, val); in rz_mtu3_pwm_get_state()
300 tmp = NSEC_PER_SEC * (u64)pv << (2 * prescale); in rz_mtu3_pwm_get_state()
302 tmp = NSEC_PER_SEC * (u64)dc << (2 * prescale); in rz_mtu3_pwm_get_state()
315 static u16 rz_mtu3_pwm_calculate_pv_or_dc(u64 period_or_duty_cycle, u8 prescale) in rz_mtu3_pwm_calculate_pv_or_dc() argument
[all …]
Dpwm-microchip-core.c135 u8 prescale, u8 period_steps) in mchp_core_pwm_calc_duty() argument
145 tmp = (((u64)prescale) + 1) * NSEC_PER_SEC; in mchp_core_pwm_calc_duty()
186 u16 *prescale, u16 *period_steps) in mchp_core_pwm_calc_period() argument
214 *prescale = MCHPCOREPWM_PRESCALE_MAX; in mchp_core_pwm_calc_period()
258 *prescale = ((u16)tmp) / (MCHPCOREPWM_PERIOD_STEPS_MAX + 1) - 1; in mchp_core_pwm_calc_period()
281 u16 prescale, period_steps; in mchp_core_pwm_apply_locked() local
298 ret = mchp_core_pwm_calc_period(state, clk_rate, &prescale, &period_steps); in mchp_core_pwm_apply_locked()
320 if ((period_steps + 1) * (prescale + 1) < in mchp_core_pwm_apply_locked()
334 prescale = hw_prescale; in mchp_core_pwm_apply_locked()
338 duty_steps = mchp_core_pwm_calc_duty(state, clk_rate, prescale, period_steps); in mchp_core_pwm_apply_locked()
[all …]
Dpwm-imx-tpm.c70 u8 prescale; member
93 u32 rate, prescale, period_count, clock_unit; in pwm_imx_tpm_round_state() local
100 prescale = 0; in pwm_imx_tpm_round_state()
102 prescale = ilog2(clock_unit) + 1 - PWM_IMX_TPM_MOD_WIDTH; in pwm_imx_tpm_round_state()
104 if ((!FIELD_FIT(PWM_IMX_TPM_SC_PS, prescale))) in pwm_imx_tpm_round_state()
106 p->prescale = prescale; in pwm_imx_tpm_round_state()
108 period_count = (clock_unit + ((1 << prescale) >> 1)) >> prescale; in pwm_imx_tpm_round_state()
112 tmp = (u64)period_count << prescale; in pwm_imx_tpm_round_state()
140 u32 rate, val, prescale; in pwm_imx_tpm_get_state() local
149 prescale = FIELD_GET(PWM_IMX_TPM_SC_PS, val); in pwm_imx_tpm_get_state()
[all …]
Dpwm-sprd.c75 u32 val, duty, prescale; in sprd_pwm_get_state() local
105 prescale = val & SPRD_PWM_PRESCALE_MSK; in sprd_pwm_get_state()
106 tmp = (prescale + 1) * NSEC_PER_SEC * SPRD_PWM_MOD_MAX; in sprd_pwm_get_state()
111 tmp = (prescale + 1) * NSEC_PER_SEC * duty; in sprd_pwm_get_state()
126 u32 prescale, duty; in sprd_pwm_config() local
143 prescale = DIV_ROUND_CLOSEST_ULL(tmp, SPRD_PWM_MOD_MAX) - 1; in sprd_pwm_config()
144 if (prescale > SPRD_PWM_PRESCALE_MSK) in sprd_pwm_config()
145 prescale = SPRD_PWM_PRESCALE_MSK; in sprd_pwm_config()
155 sprd_pwm_write(spc, pwm->hwpwm, SPRD_PWM_PRESCALE, prescale); in sprd_pwm_config()
Dpwm-bcm-iproc.c76 u32 value, prescale; in iproc_pwmc_get_state() local
98 prescale = value >> IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_get_state()
99 prescale &= IPROC_PWM_PRESCALE_MAX; in iproc_pwmc_get_state()
101 multi = NSEC_PER_SEC * (prescale + 1); in iproc_pwmc_get_state()
117 unsigned long prescale = IPROC_PWM_PRESCALE_MIN; in iproc_pwmc_apply() local
137 div = NSEC_PER_SEC * (prescale + 1); in iproc_pwmc_apply()
151 if (++prescale > IPROC_PWM_PRESCALE_MAX) in iproc_pwmc_apply()
160 value |= prescale << IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_apply()
Dpwm-pxa.c73 unsigned long period_cycles, prescale, pv, dc; in pxa_pwm_config() local
85 prescale = (period_cycles - 1) / 1024; in pxa_pwm_config()
86 pv = period_cycles / (prescale + 1) - 1; in pxa_pwm_config()
88 if (prescale > 63) in pxa_pwm_config()
96 writel(prescale | PWMCR_SD, pc->mmio_base + offset + PWMCR); in pxa_pwm_config()
Dpwm-vt8500.c74 unsigned long period_cycles, prescale, pv, dc; in vt8500_pwm_config() local
91 prescale = (period_cycles - 1) / 4096; in vt8500_pwm_config()
92 pv = period_cycles / (prescale + 1) - 1; in vt8500_pwm_config()
96 if (prescale > 1023) { in vt8500_pwm_config()
105 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config()
Dpwm-imx27.c220 unsigned long period_cycles, duty_cycles, prescale; in pwm_imx27_apply() local
236 prescale = period_cycles / 0x10000 + 1; in pwm_imx27_apply()
238 period_cycles /= prescale; in pwm_imx27_apply()
242 duty_cycles /= prescale; in pwm_imx27_apply()
276 cr = MX3_PWMCR_PRESCALER_SET(prescale) | in pwm_imx27_apply()
Dpwm-spear.c82 unsigned long prescale = PWMCR_MIN_PRESCALE, pv, dc; in spear_pwm_config() local
98 div *= 1 + prescale; in spear_pwm_config()
113 if (++prescale > PWMCR_MAX_PRESCALE) in spear_pwm_config()
129 prescale << PWMCR_PRESCALE_SHIFT); in spear_pwm_config()
Dpwm-sti.c124 unsigned int *prescale) in sti_pwm_get_prescale() argument
150 *prescale = ps; in sti_pwm_get_prescale()
169 unsigned int ncfg, value, prescale = 0; in sti_pwm_config() local
205 ret = sti_pwm_get_prescale(pc, period_ns, &prescale); in sti_pwm_config()
209 value = prescale & PWM_PRESCALE_LOW_MASK; in sti_pwm_config()
215 value = (prescale & PWM_PRESCALE_HIGH_MASK) >> 4; in sti_pwm_config()
240 prescale, period_ns, duty_ns, value); in sti_pwm_config()
Dpwm-bcm-kona.c106 unsigned long prescale = PRESCALE_MIN, pc, dc; in kona_pwmc_config() local
124 div *= 1 + prescale; in kona_pwmc_config()
137 if (++prescale > PRESCALE_MAX) in kona_pwmc_config()
145 value |= prescale << PRESCALE_SHIFT(chan); in kona_pwmc_config()
/linux-6.6.21/drivers/clocksource/
Dingenic-sysost.c96 unsigned int prescale; in ingenic_ost_percpu_timer_recalc_rate() local
98 prescale = readl(ost_clk->ost->base + info->ostccr_reg); in ingenic_ost_percpu_timer_recalc_rate()
100 prescale = FIELD_GET(OSTCCR_PRESCALE1_MASK, prescale); in ingenic_ost_percpu_timer_recalc_rate()
102 return parent_rate >> (prescale * 2); in ingenic_ost_percpu_timer_recalc_rate()
110 unsigned int prescale; in ingenic_ost_global_timer_recalc_rate() local
112 prescale = readl(ost_clk->ost->base + info->ostccr_reg); in ingenic_ost_global_timer_recalc_rate()
114 prescale = FIELD_GET(OSTCCR_PRESCALE2_MASK, prescale); in ingenic_ost_global_timer_recalc_rate()
116 return parent_rate >> (prescale * 2); in ingenic_ost_global_timer_recalc_rate()
121 u8 prescale; in ingenic_ost_get_prescale() local
123 for (prescale = 0; prescale < 2; prescale++) in ingenic_ost_get_prescale()
[all …]
/linux-6.6.21/drivers/clk/ingenic/
Dtcu.c159 unsigned int prescale; in ingenic_tcu_recalc_rate() local
162 ret = regmap_read(tcu_clk->tcu->map, info->tcsr_reg, &prescale); in ingenic_tcu_recalc_rate()
165 prescale = (prescale & TCU_TCSR_PRESCALE_MASK) >> TCU_TCSR_PRESCALE_LSB; in ingenic_tcu_recalc_rate()
167 return parent_rate >> (prescale * 2); in ingenic_tcu_recalc_rate()
172 u8 prescale; in ingenic_tcu_get_prescale() local
174 for (prescale = 0; prescale < 5; prescale++) in ingenic_tcu_get_prescale()
175 if ((rate >> (prescale * 2)) <= req_rate) in ingenic_tcu_get_prescale()
176 return prescale; in ingenic_tcu_get_prescale()
185 u8 prescale; in ingenic_tcu_determine_rate() local
192 prescale = ingenic_tcu_get_prescale(rate, req->rate); in ingenic_tcu_determine_rate()
[all …]
/linux-6.6.21/drivers/watchdog/
Drealtek_otto_wdt.c107 static int otto_wdt_tick_ms(struct otto_wdt_ctrl *ctrl, int prescale) in otto_wdt_tick_ms() argument
109 return DIV_ROUND_CLOSEST(1 << (25 + prescale), ctrl->clk_rate_khz); in otto_wdt_tick_ms()
133 unsigned int prescale; in otto_wdt_determine_timeouts() local
138 prescale = prescale_next; in otto_wdt_determine_timeouts()
139 if (prescale > OTTO_WDT_PRESCALE_MAX) in otto_wdt_determine_timeouts()
142 tick_ms = otto_wdt_tick_ms(ctrl, prescale); in otto_wdt_determine_timeouts()
156 v |= FIELD_PREP(OTTO_WDT_CTRL_PRESCALE, prescale); in otto_wdt_determine_timeouts()
/linux-6.6.21/arch/powerpc/platforms/52xx/
Dmpc52xx_gpt.c388 u32 prescale; in mpc52xx_gpt_do_start() local
422 prescale = (clocks >> 16) + 1; in mpc52xx_gpt_do_start()
423 do_div(clocks, prescale); in mpc52xx_gpt_do_start()
426 prescale, clocks); in mpc52xx_gpt_do_start()
438 out_be32(&gpt->regs->count, prescale << 16 | clocks); in mpc52xx_gpt_do_start()
492 u64 prescale; in mpc52xx_gpt_timer_period() local
499 prescale = period >> 16; in mpc52xx_gpt_timer_period()
501 if (prescale == 0) in mpc52xx_gpt_timer_period()
502 prescale = 0x10000; in mpc52xx_gpt_timer_period()
503 period = period * prescale * 1000000000ULL; in mpc52xx_gpt_timer_period()
/linux-6.6.21/drivers/i2c/busses/
Di2c-kempld.c226 long prescale; in kempld_i2c_device_init() local
240 prescale = pld->pld_clock / (bus_frequency * 5) - 1000; in kempld_i2c_device_init()
242 prescale = pld->pld_clock / (bus_frequency * 4) - 3000; in kempld_i2c_device_init()
244 if (prescale < 0) in kempld_i2c_device_init()
245 prescale = 0; in kempld_i2c_device_init()
248 prescale_corr = prescale / 1000; in kempld_i2c_device_init()
249 if (prescale % 1000 >= 500) in kempld_i2c_device_init()
Di2c-imx-lpi2c.c203 u8 prescale, filt, sethold, datavd; in lpi2c_imx_config() local
219 for (prescale = 0; prescale <= 7; prescale++) { in lpi2c_imx_config()
220 clk_cycle = clk_rate / ((1 << prescale) * lpi2c_imx->bitrate) in lpi2c_imx_config()
228 if (prescale > 7) in lpi2c_imx_config()
236 temp = prescale | pincfg << 24; in lpi2c_imx_config()
/linux-6.6.21/drivers/gpu/drm/radeon/
Dradeon_i2c.c234 u32 prescale = 0; in radeon_get_i2c_prescale() local
260 prescale = m | (n << 8); in radeon_get_i2c_prescale()
268 prescale = (((sclk * 10)/(4 * 128 * 100) + 1) << 8) + 128; in radeon_get_i2c_prescale()
283 prescale = (127 << 8) + ((sclk * 10) / (4 * 127 * i2c_clock)); in radeon_get_i2c_prescale()
285 prescale = (((sclk * 10)/(4 * 128 * 100) + 1) << 8) + 128; in radeon_get_i2c_prescale()
314 return prescale; in radeon_get_i2c_prescale()
329 u32 prescale; in r100_hw_i2c_xfer() local
337 prescale = radeon_get_i2c_prescale(rdev); in r100_hw_i2c_xfer()
339 reg = ((prescale << RADEON_I2C_PRESCALE_SHIFT) | in r100_hw_i2c_xfer()
582 u32 prescale; in r500_hw_i2c_xfer() local
[all …]
/linux-6.6.21/drivers/media/i2c/
Dsaa717x.c807 int task, int prescale) in set_h_prescale() argument
833 if (vals[i].xpsc == prescale) in set_h_prescale()
987 int prescale, h_scale, v_scale; in saa717x_set_fmt() local
1008 prescale = SAA717X_NTSC_WIDTH / fmt->width; in saa717x_set_fmt()
1009 if (prescale == 0) in saa717x_set_fmt()
1010 prescale = 1; in saa717x_set_fmt()
1011 h_scale = 1024 * SAA717X_NTSC_WIDTH / prescale / fmt->width; in saa717x_set_fmt()
1016 set_h_prescale(sd, 0, prescale); in saa717x_set_fmt()
1017 set_h_prescale(sd, 1, prescale); in saa717x_set_fmt()
/linux-6.6.21/drivers/comedi/drivers/
Ddt3000.c344 unsigned int divider, base, prescale; in dt3k_ns_to_timer() local
349 for (prescale = 0; prescale < 16; prescale++) { in dt3k_ns_to_timer()
350 base = timer_base * (prescale + 1); in dt3k_ns_to_timer()
365 return (prescale << 16) | (divider); in dt3k_ns_to_timer()
369 prescale = 15; in dt3k_ns_to_timer()
370 base = timer_base * (prescale + 1); in dt3k_ns_to_timer()
373 return (prescale << 16) | (divider); in dt3k_ns_to_timer()
/linux-6.6.21/drivers/spi/
Dspi-fsl-lpspi.c88 u8 prescale; member
262 temp |= fsl_lpspi->config.prescale << 27; in fsl_lpspi_set_cmd()
300 u8 prescale; in fsl_lpspi_set_bitrate() local
316 for (prescale = 0; prescale < 8; prescale++) { in fsl_lpspi_set_bitrate()
317 scldiv = perclk_rate / config.speed_hz / (1 << prescale) - 2; in fsl_lpspi_set_bitrate()
319 fsl_lpspi->config.prescale = prescale; in fsl_lpspi_set_bitrate()
331 perclk_rate, config.speed_hz, prescale, scldiv); in fsl_lpspi_set_bitrate()
/linux-6.6.21/drivers/media/pci/cobalt/
Dcobalt-i2c.c309 int prescale; in cobalt_i2c_init() local
315 prescale = ((ALT_CPU_FREQ) / (5 * I2C_FREQUENCY)) - 1; in cobalt_i2c_init()
344 iowrite8(prescale & 0xff, &regs->prerlo); in cobalt_i2c_init()
345 iowrite8((prescale >> 8) & 0xff, &regs->prerhi); in cobalt_i2c_init()
/linux-6.6.21/include/linux/iio/adc/
Dqcom-vadc-common.h138 const struct u32_fract *prescale,
143 int (*scale_fn)(const struct u32_fract *prescale,
/linux-6.6.21/Documentation/devicetree/bindings/hwmon/
Dmax6650.txt13 - maxim,fan-prescale : Pre-scaling value, as per datasheet [1]. Lower values
26 maxim,fan-prescale = <4>;

123