Home
last modified time | relevance | path

Searched refs:prescaler (Results 1 – 25 of 48) sorted by relevance

12

/linux-6.15/drivers/pwm/
H A Dpwm-sl28cpld.c55 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler))) argument
56 #define SL28CPLD_PWM_PERIOD(prescaler) \ argument
57 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler))
99 int prescaler; in sl28cpld_pwm_get_state() local
105 prescaler = FIELD_GET(SL28CPLD_PWM_CTRL_PRESCALER_MASK, reg); in sl28cpld_pwm_get_state()
106 state->period = SL28CPLD_PWM_PERIOD(prescaler); in sl28cpld_pwm_get_state()
129 unsigned int cycle, prescaler; in sl28cpld_pwm_apply() local
142 prescaler = DIV_ROUND_UP_ULL(SL28CPLD_PWM_PERIOD(0), state->period); in sl28cpld_pwm_apply()
143 prescaler = order_base_2(prescaler); in sl28cpld_pwm_apply()
145 if (prescaler > field_max(SL28CPLD_PWM_CTRL_PRESCALER_MASK)) in sl28cpld_pwm_apply()
[all …]
H A Dpwm-sun4i.c116 unsigned int prescaler; in sun4i_pwm_get_state() local
140 prescaler = 1; in sun4i_pwm_get_state()
144 if (prescaler == 0) in sun4i_pwm_get_state()
175 unsigned int prescaler = 0; in sun4i_pwm_calculate() local
191 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate()
200 prescaler = 0; in sun4i_pwm_calculate()
203 if (prescaler == 0) { in sun4i_pwm_calculate()
205 for (prescaler = 0; prescaler < PWM_PRESCAL_MASK; prescaler++) { in sun4i_pwm_calculate()
227 *prsclr = prescaler; in sun4i_pwm_calculate()
239 unsigned int delay_us, prescaler = 0; in sun4i_pwm_apply() local
[all …]
H A Dpwm-renesas-tpu.c75 unsigned int prescaler; member
178 tpd->prescaler); in tpu_pwm_timer_start()
225 tpd->prescaler = 0; in tpu_pwm_request()
247 unsigned int prescaler; in tpu_pwm_config() local
281 prescaler = 0; in tpu_pwm_config()
285 prescaler = 1; in tpu_pwm_config()
289 prescaler = 2; in tpu_pwm_config()
293 prescaler = 3; in tpu_pwm_config()
300 period >>= 2 * prescaler; in tpu_pwm_config()
312 if (tpd->prescaler == prescaler && tpd->period == period) in tpu_pwm_config()
[all …]
H A Dpwm-rockchip.c48 unsigned int prescaler; member
81 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
85 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
119 pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
122 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
239 .prescaler = 2,
252 .prescaler = 1,
266 .prescaler = 1,
280 .prescaler = 1,
H A Dpwm-imx27.c108 u32 period, prescaler, pwm_clk, val; in pwm_imx27_get_state() local
134 prescaler = MX3_PWMCR_PRESCALER_GET(val); in pwm_imx27_get_state()
140 tmp = NSEC_PER_SEC * (u64)(period + 2) * prescaler; in pwm_imx27_get_state()
152 tmp = NSEC_PER_SEC * (u64)(val) * prescaler; in pwm_imx27_get_state()
/linux-6.15/drivers/tty/serial/8250/
H A D8250_ni.c68 u8 prescaler; member
156 u8 prescaler) in ni16550_config_prescaler() argument
178 serial_out(up, UART_ICR, prescaler); in ni16550_config_prescaler()
283 unsigned int prescaler = 0; in ni16550_probe() local
352 if (info->prescaler) in ni16550_probe()
353 prescaler = info->prescaler; in ni16550_probe()
354 device_property_read_u32(dev, "clock-prescaler", &prescaler); in ni16550_probe()
356 if (prescaler != 0) { in ni16550_probe()
358 ni16550_config_prescaler(&uart, (u8)prescaler); in ni16550_probe()
429 .prescaler = 0x09,
[all …]
/linux-6.15/drivers/clocksource/
H A Dtimer-stm32.c209 int prescaler = 1; in stm32_timer_set_prescaler() local
212 prescaler = DIV_ROUND_CLOSEST(timer_of_rate(to), in stm32_timer_set_prescaler()
219 prescaler = prescaler < TIM_PSC_MAX ? prescaler : TIM_PSC_MAX; in stm32_timer_set_prescaler()
222 writel_relaxed(prescaler - 1, timer_of_base(to) + TIM_PSC); in stm32_timer_set_prescaler()
227 to->of_clk.rate = DIV_ROUND_CLOSEST(to->of_clk.rate, prescaler); in stm32_timer_set_prescaler()
/linux-6.15/drivers/watchdog/
H A Dmpc8xxx_wdt.c44 int prescaler; member
186 ddata->swtc = min(ddata->wdd.timeout * freq / wdt_type->prescaler, in mpc8xxx_wdt_probe()
197 ddata->wdd.max_hw_heartbeat_ms = (ddata->swtc * wdt_type->prescaler) / in mpc8xxx_wdt_probe()
219 .prescaler = 0x10000,
226 .prescaler = 0x10000,
234 .prescaler = 0x800,
H A Dcadence_wdt.c78 u32 prescaler; member
186 count = (wdd->timeout * (clock_f / wdt->prescaler)) / in cdns_wdt_start()
338 wdt->prescaler = CDNS_WDT_PRESCALE_512; in cdns_wdt_probe()
341 wdt->prescaler = CDNS_WDT_PRESCALE_4096; in cdns_wdt_probe()
H A Dkempld_wdt.c133 u32 prescaler; in kempld_wdt_set_stage_timeout() local
139 prescaler = kempld_prescaler[PRESCALER_21]; in kempld_wdt_set_stage_timeout()
145 remainder = do_div(stage_timeout64, prescaler); in kempld_wdt_set_stage_timeout()
175 u32 prescaler; in kempld_wdt_get_timeout() local
184 prescaler = kempld_prescaler[STAGE_CFG_GET_PRESCALER(stage_cfg)]; in kempld_wdt_get_timeout()
186 stage_timeout = (stage_timeout & stage->mask) * prescaler; in kempld_wdt_get_timeout()
/linux-6.15/arch/powerpc/sysdev/
H A Dfsl_gtm.c170 unsigned int prescaler; in gtm_set_ref_timer16() local
181 prescaler = gtm->clock / frequency; in gtm_set_ref_timer16()
187 if (prescaler > max_prescaler) in gtm_set_ref_timer16()
190 if (prescaler > max_prescaler / 16) { in gtm_set_ref_timer16()
192 prescaler /= 16; in gtm_set_ref_timer16()
195 if (prescaler <= 256) { in gtm_set_ref_timer16()
197 sps = prescaler - 1; in gtm_set_ref_timer16()
200 sps = prescaler / 256 - 1; in gtm_set_ref_timer16()
/linux-6.15/Documentation/misc-devices/
H A Doxsemi-tornado.rst11 frequency by dividing it by the clock prescaler, which can be set to any
19 By default the oversampling rate is set to 16 and the clock prescaler is
27 prescaler is programmed with the CPR/CPR2 register pair [OX200]_ [OX952]_
29 the prescaler the enhanced mode has to be explicitly enabled though, by
31 the prescaler or otherwise it is bypassed as if the value of 1 was used.
34 devices that do not have the extra prescaler's 9th bit in CPR2, so the
45 (tcr), the clock prescaler (cpr) and the divisor (div) produced by the
93 used by encoding the values for, the prescaler, the oversampling rate
109 oversampling rate to 16 and prescaler values below 1 in CPR2/CPR are
113 respectively to 0x1f4, 0x0 and 0x04e2, choosing the prescaler value,
/linux-6.15/Documentation/devicetree/bindings/power/supply/
H A Dlltc,ltc294x.yaml39 lltc,prescaler-exponent:
42 The prescaler exponent as explained in the datasheet.
51 - lltc,prescaler-exponent
64 lltc,prescaler-exponent = <5>; /* 2^(2*5) = 1024 */
/linux-6.15/drivers/rtc/
H A Drtc-mpfs.c219 unsigned long prescaler; in mpfs_rtc_probe() local
260 prescaler = clk_get_rate(devm_clk_get(&pdev->dev, "rtcref")) - 1; in mpfs_rtc_probe()
261 if (prescaler > MAX_PRESCALER_COUNT) { in mpfs_rtc_probe()
262 dev_dbg(&pdev->dev, "invalid prescaler %lu\n", prescaler); in mpfs_rtc_probe()
266 writel(prescaler, rtcdev->base + PRESCALER_REG); in mpfs_rtc_probe()
267 dev_info(&pdev->dev, "prescaler set to: %lu\n", prescaler); in mpfs_rtc_probe()
/linux-6.15/Documentation/devicetree/bindings/pwm/
H A Dti,omap-dmtimer-pwm.yaml29 ti,prescaler:
31 Legacy clock prescaler for timer. The timer counter is prescaled
32 with 2^n where n is the prescaler.
/linux-6.15/arch/powerpc/kernel/
H A Dudbg_16550.c126 unsigned int dll, dlm, divisor, prescaler, speed; in udbg_probe_uart_speed() local
141 prescaler = 4; in udbg_probe_uart_speed()
143 prescaler = 1; in udbg_probe_uart_speed()
149 speed = (clock / prescaler) / (divisor * 16); in udbg_probe_uart_speed()
/linux-6.15/drivers/i2c/busses/
H A Di2c-mpc.c394 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local
409 prescaler = 1; in mpc_i2c_get_prescaler_8xxx()
413 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx()
416 prescaler = 2; in mpc_i2c_get_prescaler_8xxx()
419 return prescaler; in mpc_i2c_get_prescaler_8xxx()
426 u32 prescaler = mpc_i2c_get_prescaler_8xxx(); in mpc_i2c_get_fdr_8xxx() local
432 *real_clk = fsl_get_sys_freq() / prescaler / (16 * 3072); in mpc_i2c_get_fdr_8xxx()
436 divider = fsl_get_sys_freq() / clock / prescaler; in mpc_i2c_get_fdr_8xxx()
451 *real_clk = fsl_get_sys_freq() / prescaler / div->divider; in mpc_i2c_get_fdr_8xxx()
/linux-6.15/drivers/thermal/st/
H A Dstm_thermal.c200 u32 prescaler; in stm_thermal_calibration() local
207 prescaler = 0; in stm_thermal_calibration()
210 while (prescaler <= clk_freq) in stm_thermal_calibration()
211 prescaler++; in stm_thermal_calibration()
220 value |= (prescaler << HSREF_CLK_DIV_POS); in stm_thermal_calibration()
/linux-6.15/Documentation/devicetree/bindings/mfd/
H A Dst,stm32-timers.yaml12 by a programmable prescaler, break input feature, PWM outputs and
15 driven by a programmable prescaler and PWM outputs.
17 programmable prescaler.
/linux-6.15/arch/arm/mach-omap2/
H A Dvc.c474 u32 prescaler; in omap4_calc_volt_ramp() local
483 prescaler = 0; in omap4_calc_volt_ramp()
490 prescaler++; in omap4_calc_volt_ramp()
496 prescaler++; in omap4_calc_volt_ramp()
502 prescaler++; in omap4_calc_volt_ramp()
514 return (prescaler << OMAP4430_RAMP_UP_PRESCAL_SHIFT) | in omap4_calc_volt_ramp()
/linux-6.15/drivers/mmc/host/
H A Dmxcmmc.c789 int prescaler = 0; in mxcmci_set_clk_rate() local
792 while (prescaler <= 0x800) { in mxcmci_set_clk_rate()
798 if (prescaler) in mxcmci_set_clk_rate()
799 x /= (prescaler * 2); in mxcmci_set_clk_rate()
807 if (prescaler == 0) in mxcmci_set_clk_rate()
808 prescaler = 1; in mxcmci_set_clk_rate()
810 prescaler <<= 1; in mxcmci_set_clk_rate()
813 mxcmci_writew(host, (prescaler << 4) | divider, MMC_REG_CLK_RATE); in mxcmci_set_clk_rate()
816 prescaler, divider, clk_in, clk_ios); in mxcmci_set_clk_rate()
/linux-6.15/drivers/usb/serial/
H A Dkeyspan.c49 u8 *prescaler, int portnum);
53 u8 *prescaler, int portnum);
57 u8 *prescaler, int portnum);
61 u8 *prescaler, int portnum);
1975 if (prescaler) { in keyspan_usa19w_calc_baud()
1976 *prescaler = best_prescaler; in keyspan_usa19w_calc_baud()
2080 msg.prescaler = 10; in keyspan_usa26_send_setup()
2350 msg.prescaler = 10; in keyspan_usa49_send_setup()
2481 u8 prescaler; in keyspan_usa90_send_setup() local
2516 &msg.baudHi, &msg.baudLo, &prescaler, 0); in keyspan_usa90_send_setup()
[all …]
/linux-6.15/drivers/iio/frequency/
H A Dadf4350.c145 u32 div_gcd, prescaler, chspc; in adf4350_set_freq() local
153 prescaler = ADF4350_REG1_PRESCALER; in adf4350_set_freq()
156 prescaler = 0; in adf4350_set_freq()
210 1 << st->r4_rf_div_sel, prescaler ? "8/9" : "4/5", in adf4350_set_freq()
218 prescaler; in adf4350_set_freq()
/linux-6.15/drivers/counter/
H A Dstm32-timer-cnt.c245 struct counter_count *count, u64 *prescaler) in stm32_count_prescaler_read() argument
252 *prescaler = psc + 1; in stm32_count_prescaler_read()
258 struct counter_count *count, u64 prescaler) in stm32_count_prescaler_write() argument
263 if (!prescaler || prescaler > MAX_TIM_PSC + 1) in stm32_count_prescaler_write()
266 psc = prescaler - 1; in stm32_count_prescaler_write()
/linux-6.15/drivers/iio/trigger/
H A Dstm32-timer-trigger.c125 int prescaler = 0, ret; in stm32_timer_start() local
140 prescaler++; in stm32_timer_start()
142 do_div(div, (prescaler + 1)); in stm32_timer_start()
146 if (prescaler > MAX_TIM_PSC) { in stm32_timer_start()
164 regmap_write(priv->regmap, TIM_PSC, prescaler); in stm32_timer_start()

12