Home
last modified time | relevance | path

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

123

/openbmc/linux/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))
100 int prescaler; in sl28cpld_pwm_get_state() local
106 prescaler = FIELD_GET(SL28CPLD_PWM_CTRL_PRESCALER_MASK, reg); in sl28cpld_pwm_get_state()
107 state->period = SL28CPLD_PWM_PERIOD(prescaler); in sl28cpld_pwm_get_state()
130 unsigned int cycle, prescaler; in sl28cpld_pwm_apply() local
143 prescaler = DIV_ROUND_UP_ULL(SL28CPLD_PWM_PERIOD(0), state->period); in sl28cpld_pwm_apply()
144 prescaler = order_base_2(prescaler); in sl28cpld_pwm_apply()
146 if (prescaler > field_max(SL28CPLD_PWM_CTRL_PRESCALER_MASK)) in sl28cpld_pwm_apply()
[all …]
H A Dpwm-sun4i.c117 unsigned int prescaler; in sun4i_pwm_get_state() local
141 prescaler = 1; in sun4i_pwm_get_state()
143 prescaler = prescaler_table[PWM_REG_PRESCAL(val, pwm->hwpwm)]; in sun4i_pwm_get_state()
145 if (prescaler == 0) in sun4i_pwm_get_state()
161 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); in sun4i_pwm_get_state()
164 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); in sun4i_pwm_get_state()
176 unsigned int prescaler = 0; in sun4i_pwm_calculate() local
192 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate()
201 prescaler = 0; in sun4i_pwm_calculate()
204 if (prescaler == 0) { in sun4i_pwm_calculate()
[all …]
H 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()
306 (u64)NSEC_PER_SEC << (2 * prescaler)); in tpu_pwm_config()
[all …]
H 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,
H A Dpwm-imx27.c126 u32 period, prescaler, pwm_clk, val; in pwm_imx27_get_state() local
152 prescaler = MX3_PWMCR_PRESCALER_GET(val); in pwm_imx27_get_state()
158 tmp = NSEC_PER_SEC * (u64)(period + 2) * prescaler; in pwm_imx27_get_state()
170 tmp = NSEC_PER_SEC * (u64)(val) * prescaler; in pwm_imx27_get_state()
/openbmc/u-boot/drivers/pwm/
H A Dsunxi_pwm.c24 u32 prescaler; member
77 for (int prescaler = 0; prescaler <= SUNXI_PWM_CTRL_PRESCALE0_MASK; in sunxi_pwm_set_config() local
78 prescaler++) { in sunxi_pwm_set_config()
81 if (!prescaler_table[prescaler]) in sunxi_pwm_set_config()
83 scaled_freq = lldiv(OSC_24MHZ, prescaler_table[prescaler]); in sunxi_pwm_set_config()
89 best_prescaler = prescaler; in sunxi_pwm_set_config()
100 if (priv->prescaler != best_prescaler) { in sunxi_pwm_set_config()
110 priv->prescaler = best_prescaler; in sunxi_pwm_set_config()
117 __func__, priv->prescaler, in sunxi_pwm_set_config()
H A Dexynos_pwm.c23 unsigned int offset, prescaler; in exynos_pwm_set_config() local
34 prescaler = (channel < 2 ? val : (val >> 8)) & 0xff; in exynos_pwm_set_config()
37 rate = get_pwm_clk() / ((prescaler + 1) * (1 << div)); in exynos_pwm_set_config()
/openbmc/u-boot/arch/arm/cpu/armv7/s5p-common/
H A Dpwm.c120 unsigned int offset, prescaler; in pwm_init() local
129 prescaler = PRESCALER_0; in pwm_init()
131 val |= (prescaler & 0xff); in pwm_init()
133 prescaler = PRESCALER_1; in pwm_init()
135 val |= (prescaler & 0xff) << 8; in pwm_init()
152 ((prescaler + 1) * (1 << div)); in pwm_init()
/openbmc/linux/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()
/openbmc/linux/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()
/openbmc/linux/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()
/openbmc/linux/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,
/openbmc/u-boot/arch/arm/mach-imx/
H A Dtimer.c19 unsigned int prescaler; member
93 &cur_gpt->prescaler); in timer_init()
99 __raw_writel(0, &cur_gpt->prescaler); /* 32Khz */ in timer_init()
/openbmc/u-boot/drivers/watchdog/
H A Dcdns_wdt.c130 u32 count, prescaler, ctrl_clksel, data = 0; in cdns_wdt_start() local
153 prescaler = CDNS_WDT_PRESCALE_512; in cdns_wdt_start()
156 prescaler = CDNS_WDT_PRESCALE_4096; in cdns_wdt_start()
164 count = (timeout * (clk_f / prescaler)) / in cdns_wdt_start()
/openbmc/u-boot/drivers/mmc/
H A Dmxcmmc.c424 int prescaler = 0; in mxcmci_set_clk_rate() local
427 while (prescaler <= 0x800) { in mxcmci_set_clk_rate()
433 if (prescaler) in mxcmci_set_clk_rate()
434 x /= (prescaler * 2); in mxcmci_set_clk_rate()
442 if (prescaler == 0) in mxcmci_set_clk_rate()
443 prescaler = 1; in mxcmci_set_clk_rate()
445 prescaler <<= 1; in mxcmci_set_clk_rate()
448 writel((prescaler << 4) | divider, &host->base->clk_rate); in mxcmci_set_clk_rate()
/openbmc/linux/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()
/openbmc/u-boot/drivers/spi/
H A Dstm32_qspi.c569 u32 prescaler = 255; in stm32_qspi_set_speed() local
576 prescaler = DIV_ROUND_UP(qspi_clk, speed) - 1; in stm32_qspi_set_speed()
577 if (prescaler > 255) in stm32_qspi_set_speed()
578 prescaler = 255; in stm32_qspi_set_speed()
579 else if (prescaler < 0) in stm32_qspi_set_speed()
580 prescaler = 0; in stm32_qspi_set_speed()
583 csht = DIV_ROUND_UP((5 * qspi_clk) / (prescaler + 1), 100000000); in stm32_qspi_set_speed()
591 prescaler << STM32_QSPI_CR_PRESCALER_SHIFT); in stm32_qspi_set_speed()
598 (qspi_clk / (prescaler + 1))); in stm32_qspi_set_speed()
H A Dcf_spi.c193 int prescaler[] = { 2, 3, 5, 7 }; in cfspi_setup_slave() local
204 tmp = (prescaler[3] * scaler[15]); in cfspi_setup_slave()
215 (cfslave->baudrate > (gd->bus_clk / (prescaler[0] * scaler[0])))) { in cfspi_setup_slave()
253 pbrcnt = sizeof(prescaler) / sizeof(int); in cfspi_setup_slave()
258 baud_speed = gd->bus_clk / prescaler[i]; in cfspi_setup_slave()
/openbmc/linux/arch/powerpc/kernel/
H 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()
/openbmc/qemu/hw/timer/
H A Dnrf51_timer.c30 uint32_t freq = TIMER_CLK_FREQ >> s->prescaler; in ns_to_ticks()
37 uint32_t freq = TIMER_CLK_FREQ >> s->prescaler; in ticks_to_ns()
183 r = s->prescaler; in nrf51_timer_read()
286 s->prescaler = value & NRF51_TIMER_REG_PRESCALER_MASK; in nrf51_timer_write()
347 s->prescaler = 0x00; in nrf51_timer_reset()
377 VMSTATE_UINT32(prescaler, NRF51TimerState),
/openbmc/qemu/hw/adc/
H A Dnpcm7xx_adc.c74 uint32_t cycles, uint32_t prescaler) in npcm7xx_adc_start_timer() argument
80 ticks *= prescaler; in npcm7xx_adc_start_timer()
88 uint32_t prescaler = npcm7xx_adc_prescaler(s); in npcm7xx_adc_start_convert() local
91 prescaler); in npcm7xx_adc_start_convert()
/openbmc/linux/drivers/i2c/busses/
H A Di2c-mpc.c400 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local
415 prescaler = 1; in mpc_i2c_get_prescaler_8xxx()
419 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx()
422 prescaler = 2; in mpc_i2c_get_prescaler_8xxx()
425 return prescaler; in mpc_i2c_get_prescaler_8xxx()
432 u32 prescaler = mpc_i2c_get_prescaler_8xxx(); in mpc_i2c_get_fdr_8xxx() local
438 *real_clk = fsl_get_sys_freq() / prescaler / (16 * 3072); in mpc_i2c_get_fdr_8xxx()
442 divider = fsl_get_sys_freq() / clock / prescaler; in mpc_i2c_get_fdr_8xxx()
457 *real_clk = fsl_get_sys_freq() / prescaler / div->divider; in mpc_i2c_get_fdr_8xxx()
/openbmc/linux/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()

123