Home
last modified time | relevance | path

Searched refs:prescaler (Results 1 - 25 of 71) sorted by relevance

123

/kernel/linux/linux-6.6/drivers/pwm/
H A Dpwm-sl28cpld.c10 * With the prescaler setting you can select which bit of the counter is used
16 * | prescaler | reset | counter bits | frequency | period length |
25 * - The hardware cannot generate a 100% duty cycle if the prescaler is 0.
26 * - The hardware cannot atomically set the prescaler and the counter value,
28 * - The counter is not reset if you switch the prescaler which leads
55 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler)))
56 #define SL28CPLD_PWM_PERIOD(prescaler) \
57 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler))
64 * max_period_ns = 1 << (7 - prescaler) / SL28CPLD_PWM_CL
100 int prescaler; sl28cpld_pwm_get_state() local
130 unsigned int cycle, prescaler; sl28cpld_pwm_apply() local
[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
191 /* First, test without any prescaler when available */ in sun4i_pwm_calculate()
192 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate()
194 * When not using any prescaler, th in sun4i_pwm_calculate()
240 unsigned int delay_us, prescaler = 0; sun4i_pwm_apply() local
[all...]
H A Dpwm-renesas-tpu.c76 unsigned int prescaler; member
170 * - Set prescaler in tpu_pwm_timer_start()
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
270 * Find the minimal prescaler in [0..3] such that in tpu_pwm_config()
272 * period >> (2 * prescaler) < 0x10000 in tpu_pwm_config()
276 * prescaler = max(ilog2(period) / 2, 7) - 7; in tpu_pwm_config()
283 prescaler = 0; in tpu_pwm_config()
287 prescaler in tpu_pwm_config()
302 period >>= 2 * prescaler; tpu_pwm_config() local
[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()
116 * default prescaler value for all practical clock rate values. in rockchip_pwm_config()
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
[all...]
H 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()
/kernel/linux/linux-5.10/drivers/pwm/
H A Dpwm-sl28cpld.c10 * With the prescaler setting you can select which bit of the counter is used
16 * | prescaler | reset | counter bits | frequency | period length |
25 * - The hardware cannot generate a 100% duty cycle if the prescaler is 0.
26 * - The hardware cannot atomically set the prescaler and the counter value,
28 * - The counter is not reset if you switch the prescaler which leads
54 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler)))
55 #define SL28CPLD_PWM_PERIOD(prescaler) \
56 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler))
63 * max_period_ns = 1 << (7 - prescaler) / SL28CPLD_PWM_CL
96 int prescaler; sl28cpld_pwm_get_state() local
124 unsigned int cycle, prescaler; sl28cpld_pwm_apply() local
[all...]
H A Dpwm-sun4i.c119 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()
174 unsigned int prescaler = 0; in sun4i_pwm_calculate() local
189 /* First, test without any prescaler when available */ in sun4i_pwm_calculate()
190 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate()
192 * When not using any prescaler, th in sun4i_pwm_calculate()
238 unsigned int delay_us, prescaler = 0; sun4i_pwm_apply() local
[all...]
H A Dpwm-renesas-tpu.c76 unsigned int prescaler; member
170 * - Set prescaler in tpu_pwm_timer_start()
176 pwm->prescaler); in tpu_pwm_timer_start()
225 pwm->prescaler = 0; in tpu_pwm_request()
250 unsigned int prescaler; in tpu_pwm_config() local
258 * Pick a prescaler to avoid overflowing the counter. in tpu_pwm_config()
259 * TODO: Pick the highest acceptable prescaler. in tpu_pwm_config()
263 for (prescaler = 0; prescaler < ARRAY_SIZE(prescalers); ++prescaler) { in tpu_pwm_config()
[all...]
H A Dpwm-rockchip.c49 unsigned int prescaler; member
78 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
82 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
109 * default prescaler value for all practical clock rate values. in rockchip_pwm_config()
113 pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
116 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
229 .prescaler = 2,
242 .prescaler = 1,
256 .prescaler = 1,
270 .prescaler
[all...]
H 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()
/kernel/linux/linux-5.10/arch/powerpc/sysdev/
H A Dfsl_gtm.c170 unsigned int prescaler; in gtm_set_ref_timer16() local
177 /* CPM2 doesn't have primary prescaler */ in gtm_set_ref_timer16()
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()
366 /* CPM2 doesn't have primary prescaler */ in gtm_set_shortcuts()
[all...]
/kernel/linux/linux-6.6/arch/powerpc/sysdev/
H A Dfsl_gtm.c170 unsigned int prescaler; in gtm_set_ref_timer16() local
177 /* CPM2 doesn't have primary prescaler */ in gtm_set_ref_timer16()
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()
366 /* CPM2 doesn't have primary prescaler */ in gtm_set_shortcuts()
[all...]
/kernel/linux/linux-5.10/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 Dkempld_wdt.c135 u32 prescaler; in kempld_wdt_set_stage_timeout() local
141 prescaler = kempld_prescaler[PRESCALER_21]; in kempld_wdt_set_stage_timeout()
147 remainder = do_div(stage_timeout64, prescaler); in kempld_wdt_set_stage_timeout()
177 u32 prescaler; in kempld_wdt_get_timeout() local
186 prescaler = kempld_prescaler[STAGE_CFG_GET_PRESCALER(stage_cfg)]; in kempld_wdt_get_timeout()
188 stage_timeout = (stage_timeout & stage->mask) * prescaler; in kempld_wdt_get_timeout()
H A Dcadence_wdt.c34 /* Clock prescaler value and selection */
67 * @prescaler: for saving prescaler value
68 * @ctrl_clksel: counter clock prescaler selection
78 u32 prescaler; member
163 * calculated count = (timeout * clock) / prescaler + 1.
166 * Clears the contents of prescaler and counter reset value. Sets the
167 * prescaler to 4096 and the calculated count and access key
186 count = (wdd->timeout * (clock_f / wdt->prescaler)) / in cdns_wdt_start()
353 wdt->prescaler in cdns_wdt_probe()
[all...]
/kernel/linux/linux-6.6/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 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()
H A Dcadence_wdt.c34 /* Clock prescaler value and selection */
67 * @prescaler: for saving prescaler value
68 * @ctrl_clksel: counter clock prescaler selection
78 u32 prescaler; member
163 * calculated count = (timeout * clock) / prescaler + 1.
166 * Clears the contents of prescaler and counter reset value. Sets the
167 * prescaler to 4096 and the calculated count and access key
186 count = (wdd->timeout * (clock_f / wdt->prescaler)) / in cdns_wdt_start()
338 wdt->prescaler in cdns_wdt_probe()
[all...]
/kernel/linux/linux-5.10/drivers/clocksource/
H A Dtimer-stm32.c200 * stm32_timer_set_prescaler - Compute and set the prescaler register
203 * Depending on the timer width, compute the prescaler to always
205 * considered precise and long enough to not use the prescaler.
209 int prescaler = 1; in stm32_timer_set_prescaler() local
212 prescaler = DIV_ROUND_CLOSEST(timer_of_rate(to), in stm32_timer_set_prescaler()
215 * The prescaler register is an u16, the variable in stm32_timer_set_prescaler()
219 prescaler = prescaler < TIM_PSC_MAX ? prescaler : TIM_PSC_MAX; in stm32_timer_set_prescaler()
222 writel_relaxed(prescaler in stm32_timer_set_prescaler()
[all...]
/kernel/linux/linux-6.6/drivers/clocksource/
H A Dtimer-stm32.c200 * stm32_timer_set_prescaler - Compute and set the prescaler register
203 * Depending on the timer width, compute the prescaler to always
205 * considered precise and long enough to not use the prescaler.
209 int prescaler = 1; in stm32_timer_set_prescaler() local
212 prescaler = DIV_ROUND_CLOSEST(timer_of_rate(to), in stm32_timer_set_prescaler()
215 * The prescaler register is an u16, the variable in stm32_timer_set_prescaler()
219 prescaler = prescaler < TIM_PSC_MAX ? prescaler : TIM_PSC_MAX; in stm32_timer_set_prescaler()
222 writel_relaxed(prescaler in stm32_timer_set_prescaler()
[all...]
/kernel/linux/linux-6.6/drivers/rtc/
H A Drtc-mpfs.c219 unsigned long prescaler; in mpfs_rtc_probe() local
259 /* prescaler hardware adds 1 to reg value */ in mpfs_rtc_probe()
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()
/kernel/linux/linux-5.10/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()
/kernel/linux/linux-6.6/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()
/kernel/linux/linux-5.10/drivers/i2c/busses/
H A Di2c-mpc.c435 * According to the AN2919 all MPC824x have prescaler 1, while MPC83xx in mpc_i2c_get_prescaler_8xxx()
436 * may have prescaler 1, 2, or 3, depending on the power-on in mpc_i2c_get_prescaler_8xxx()
439 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local
453 /* the above 85xx SoCs have prescaler 1 */ in mpc_i2c_get_prescaler_8xxx()
454 prescaler = 1; in mpc_i2c_get_prescaler_8xxx()
457 /* the above 85xx SoCs have prescaler 3 or 2 */ in mpc_i2c_get_prescaler_8xxx()
458 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx()
460 /* all the other 85xx have prescaler 2 */ in mpc_i2c_get_prescaler_8xxx()
461 prescaler = 2; in mpc_i2c_get_prescaler_8xxx()
464 return prescaler; in mpc_i2c_get_prescaler_8xxx()
471 u32 prescaler = mpc_i2c_get_prescaler_8xxx(); mpc_i2c_get_fdr_8xxx() local
[all...]
/kernel/linux/linux-6.6/drivers/i2c/busses/
H A Di2c-mpc.c396 * According to the AN2919 all MPC824x have prescaler 1, while MPC83xx in mpc_i2c_get_prescaler_8xxx()
397 * may have prescaler 1, 2, or 3, depending on the power-on in mpc_i2c_get_prescaler_8xxx()
400 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local
414 /* the above 85xx SoCs have prescaler 1 */ in mpc_i2c_get_prescaler_8xxx()
415 prescaler = 1; in mpc_i2c_get_prescaler_8xxx()
418 /* the above 85xx SoCs have prescaler 3 or 2 */ in mpc_i2c_get_prescaler_8xxx()
419 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx()
421 /* all the other 85xx have prescaler 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(); mpc_i2c_get_fdr_8xxx() local
[all...]

Completed in 20 milliseconds

123