Home
last modified time | relevance | path

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

12

/linux-6.3-rc2/drivers/pwm/
A Dpwm-sl28cpld.c54 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler))) argument
55 #define SL28CPLD_PWM_PERIOD(prescaler) \ argument
56 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler))
96 int prescaler; in sl28cpld_pwm_get_state() local
102 prescaler = FIELD_GET(SL28CPLD_PWM_CTRL_PRESCALER_MASK, reg); in sl28cpld_pwm_get_state()
103 state->period = SL28CPLD_PWM_PERIOD(prescaler); in sl28cpld_pwm_get_state()
126 unsigned int cycle, prescaler; in sl28cpld_pwm_apply() local
139 prescaler = DIV_ROUND_UP_ULL(SL28CPLD_PWM_PERIOD(0), state->period); in sl28cpld_pwm_apply()
140 prescaler = order_base_2(prescaler); in sl28cpld_pwm_apply()
142 if (prescaler > field_max(SL28CPLD_PWM_CTRL_PRESCALER_MASK)) in sl28cpld_pwm_apply()
[all …]
A Dpwm-sun4i.c118 unsigned int prescaler; in sun4i_pwm_get_state() local
142 prescaler = 1; in sun4i_pwm_get_state()
146 if (prescaler == 0) in sun4i_pwm_get_state()
177 unsigned int prescaler = 0; in sun4i_pwm_calculate() local
193 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate()
202 prescaler = 0; in sun4i_pwm_calculate()
205 if (prescaler == 0) { in sun4i_pwm_calculate()
207 for (prescaler = 0; prescaler < PWM_PRESCAL_MASK; prescaler++) { in sun4i_pwm_calculate()
229 *prsclr = prescaler; in sun4i_pwm_calculate()
241 unsigned int delay_us, prescaler = 0; in sun4i_pwm_apply() local
[all …]
A Dpwm-renesas-tpu.c76 unsigned int prescaler; member
176 tpd->prescaler); in tpu_pwm_timer_start()
225 tpd->prescaler = 0; in tpu_pwm_request()
249 unsigned int prescaler; in tpu_pwm_config() local
283 prescaler = 0; in tpu_pwm_config()
287 prescaler = 1; in tpu_pwm_config()
291 prescaler = 2; in tpu_pwm_config()
295 prescaler = 3; in tpu_pwm_config()
302 period >>= 2 * prescaler; in tpu_pwm_config()
314 if (tpd->prescaler == prescaler && tpd->period == period) in tpu_pwm_config()
[all …]
A Dpwm-rockchip.c49 unsigned int prescaler; member
82 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
86 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
120 pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
123 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
241 .prescaler = 2,
254 .prescaler = 1,
268 .prescaler = 1,
282 .prescaler = 1,
A Dpwm-imx27.c125 u32 period, prescaler, pwm_clk, val; in pwm_imx27_get_state() local
151 prescaler = MX3_PWMCR_PRESCALER_GET(val); in pwm_imx27_get_state()
157 tmp = NSEC_PER_SEC * (u64)(period + 2) * prescaler; in pwm_imx27_get_state()
169 tmp = NSEC_PER_SEC * (u64)(val) * prescaler; in pwm_imx27_get_state()
A Dpwm-stm32.c326 unsigned int prescaler = 0; in stm32_pwm_config() local
336 prescaler++; in stm32_pwm_config()
338 do_div(div, prescaler + 1); in stm32_pwm_config()
343 if (prescaler > MAX_TIM_PSC) in stm32_pwm_config()
356 if ((psc != prescaler) || (arr != prd - 1)) in stm32_pwm_config()
360 regmap_write(priv->regmap, TIM_PSC, prescaler); in stm32_pwm_config()
/linux-6.3-rc2/drivers/clocksource/
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.3-rc2/drivers/watchdog/
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,
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()
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.3-rc2/arch/powerpc/sysdev/
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.3-rc2/Documentation/misc-devices/
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.3-rc2/Documentation/devicetree/bindings/power/supply/
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.3-rc2/drivers/rtc/
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.3-rc2/arch/powerpc/kernel/
A Dudbg_16550.c127 unsigned int dll, dlm, divisor, prescaler, speed; in udbg_probe_uart_speed() local
142 prescaler = 4; in udbg_probe_uart_speed()
144 prescaler = 1; in udbg_probe_uart_speed()
150 speed = (clock / prescaler) / (divisor * 16); in udbg_probe_uart_speed()
/linux-6.3-rc2/drivers/i2c/busses/
A Di2c-mpc.c399 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local
414 prescaler = 1; in mpc_i2c_get_prescaler_8xxx()
418 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx()
421 prescaler = 2; in mpc_i2c_get_prescaler_8xxx()
424 return prescaler; in mpc_i2c_get_prescaler_8xxx()
431 u32 prescaler = mpc_i2c_get_prescaler_8xxx(); in mpc_i2c_get_fdr_8xxx() local
437 *real_clk = fsl_get_sys_freq() / prescaler / (16 * 3072); in mpc_i2c_get_fdr_8xxx()
441 divider = fsl_get_sys_freq() / clock / prescaler; in mpc_i2c_get_fdr_8xxx()
456 *real_clk = fsl_get_sys_freq() / prescaler / div->divider; in mpc_i2c_get_fdr_8xxx()
/linux-6.3-rc2/drivers/thermal/st/
A Dstm_thermal.c202 u32 prescaler; in stm_thermal_calibration() local
209 prescaler = 0; in stm_thermal_calibration()
212 while (prescaler <= clk_freq) in stm_thermal_calibration()
213 prescaler++; in stm_thermal_calibration()
222 value |= (prescaler << HSREF_CLK_DIV_POS); in stm_thermal_calibration()
/linux-6.3-rc2/Documentation/devicetree/bindings/mfd/
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.3-rc2/arch/arm/mach-omap2/
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.3-rc2/drivers/iio/frequency/
A Dadf4350.c140 u32 div_gcd, prescaler, chspc; in adf4350_set_freq() local
148 prescaler = ADF4350_REG1_PRESCALER; in adf4350_set_freq()
151 prescaler = 0; in adf4350_set_freq()
205 1 << st->r4_rf_div_sel, prescaler ? "8/9" : "4/5", in adf4350_set_freq()
213 prescaler; in adf4350_set_freq()
/linux-6.3-rc2/drivers/mmc/host/
A Dmxcmmc.c777 int prescaler = 0; in mxcmci_set_clk_rate() local
780 while (prescaler <= 0x800) { in mxcmci_set_clk_rate()
786 if (prescaler) in mxcmci_set_clk_rate()
787 x /= (prescaler * 2); in mxcmci_set_clk_rate()
795 if (prescaler == 0) in mxcmci_set_clk_rate()
796 prescaler = 1; in mxcmci_set_clk_rate()
798 prescaler <<= 1; in mxcmci_set_clk_rate()
801 mxcmci_writew(host, (prescaler << 4) | divider, MMC_REG_CLK_RATE); in mxcmci_set_clk_rate()
804 prescaler, divider, clk_in, clk_ios); in mxcmci_set_clk_rate()
/linux-6.3-rc2/drivers/usb/serial/
A Dkeyspan.c49 u8 *prescaler, int portnum);
53 u8 *prescaler, int portnum);
57 u8 *prescaler, int portnum);
61 u8 *prescaler, int portnum);
1973 if (prescaler) { in keyspan_usa19w_calc_baud()
1974 *prescaler = best_prescaler; in keyspan_usa19w_calc_baud()
2078 msg.prescaler = 10; in keyspan_usa26_send_setup()
2348 msg.prescaler = 10; in keyspan_usa49_send_setup()
2479 u8 prescaler; in keyspan_usa90_send_setup() local
2514 &msg.baudHi, &msg.baudLo, &prescaler, 0); in keyspan_usa90_send_setup()
[all …]
A Dkeyspan_usa26msg.h155 prescaler; // BOTH: specified as N/8; values 8-ff are valid member
A Dkeyspan_usa67msg.h153 prescaler; // specified as N/8; values 8-ff are valid member
/linux-6.3-rc2/drivers/iio/trigger/
A Dstm32-timer-trigger.c122 int prescaler = 0; in stm32_timer_start() local
137 prescaler++; in stm32_timer_start()
139 do_div(div, (prescaler + 1)); in stm32_timer_start()
143 if (prescaler > MAX_TIM_PSC) { in stm32_timer_start()
159 regmap_write(priv->regmap, TIM_PSC, prescaler); in stm32_timer_start()

Completed in 41 milliseconds

12